diff --git a/DirectXTex/DirectXTexConvert.cpp b/DirectXTex/DirectXTexConvert.cpp index 16c2fbe..b42e97b 100644 --- a/DirectXTex/DirectXTexConvert.cpp +++ b/DirectXTex/DirectXTexConvert.cpp @@ -1889,7 +1889,7 @@ bool DirectX::_StoreScanline( if (sPtr >= ePtr) break; float v = XMVectorGetX(*sPtr++); v = std::max(std::min(v, 1.f), -1.f); - *(dPtr++) = static_cast(v * 32767.f); + *(dPtr++) = static_cast(lroundf(v * 32767.f)); } return true; } @@ -1949,7 +1949,7 @@ bool DirectX::_StoreScanline( if (sPtr >= ePtr) break; float v = XMVectorGetX(*sPtr++); v = std::max(std::min(v, 1.f), -1.f); - *(dPtr++) = static_cast(v * 127.f); + *(dPtr++) = static_cast(lroundf(v * 127.f)); } return true; }