From 3734d643a65f452e74d7f97ace7b0a2c47d3022c Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Mon, 2 Dec 2013 12:52:44 -0500 Subject: [PATCH] Fix some compiler warnings on MSVC --- BPTCEncoder/src/BC7Compressor.cpp | 2 +- IO/third_party/tga/targa.c | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/BPTCEncoder/src/BC7Compressor.cpp b/BPTCEncoder/src/BC7Compressor.cpp index 9219118..1332cc4 100755 --- a/BPTCEncoder/src/BC7Compressor.cpp +++ b/BPTCEncoder/src/BC7Compressor.cpp @@ -1016,7 +1016,7 @@ double BC7CompressionMode::CompressCluster( a2 = std::min(255.0f, std::max(0.0f, a2)); // Quantize - const int8 maskSeed = 0x80; + const int8 maskSeed = -0x7F; const uint8 a1b = ::QuantizeChannel( uint8(a1), (maskSeed >> (GetAlphaChannelPrecision() - 1))); const uint8 a2b = ::QuantizeChannel( diff --git a/IO/third_party/tga/targa.c b/IO/third_party/tga/targa.c index a4c66c9..04f0a7c 100755 --- a/IO/third_party/tga/targa.c +++ b/IO/third_party/tga/targa.c @@ -33,6 +33,11 @@ // preprocessor directives +#ifdef _MSC_VER +# define WIN32_LEAN_AND_MEAN +# define _CRT_SECURE_NO_WARNINGS +#endif + #include #include #include