From 7359f9e7581f64f29c592663f114b2c5a888ef4b Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Tue, 19 Nov 2013 14:54:59 -0500 Subject: [PATCH] Some compilers treat hex literals as unsigned, which causes problems --- BPTCEncoder/src/BC7Compressor.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/BPTCEncoder/src/BC7Compressor.cpp b/BPTCEncoder/src/BC7Compressor.cpp index 9586f98..9219118 100755 --- a/BPTCEncoder/src/BC7Compressor.cpp +++ b/BPTCEncoder/src/BC7Compressor.cpp @@ -1016,10 +1016,11 @@ double BC7CompressionMode::CompressCluster( a2 = std::min(255.0f, std::max(0.0f, a2)); // Quantize + const int8 maskSeed = 0x80; const uint8 a1b = ::QuantizeChannel( - uint8(a1), (0x80 >> (GetAlphaChannelPrecision() - 1))); + uint8(a1), (maskSeed >> (GetAlphaChannelPrecision() - 1))); const uint8 a2b = ::QuantizeChannel( - uint8(a2), (0x80 >> (GetAlphaChannelPrecision() - 1))); + uint8(a2), (maskSeed >> (GetAlphaChannelPrecision() - 1))); // Compute error alphaError = 0.0;