From ac0cb61927421f8e95b7e17c9742ce8d0d7aefbf Mon Sep 17 00:00:00 2001 From: castano Date: Thu, 17 Jan 2008 20:40:40 +0000 Subject: [PATCH] Eliminate W4 warning. Add assert. --- src/nvtt/FastCompressDXT.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/nvtt/FastCompressDXT.cpp b/src/nvtt/FastCompressDXT.cpp index f5ae267..92b5b8f 100644 --- a/src/nvtt/FastCompressDXT.cpp +++ b/src/nvtt/FastCompressDXT.cpp @@ -1098,7 +1098,7 @@ static uint computeAlphaIndices(const ColorBlock & rgba, AlphaBlockDXT5 * block) uint8 alpha = rgba.color(i).a; uint besterror = 256*256; - uint best; + uint best = 8; for(uint p = 0; p < 8; p++) { int d = alphas[p] - alpha; @@ -1110,6 +1110,7 @@ static uint computeAlphaIndices(const ColorBlock & rgba, AlphaBlockDXT5 * block) best = p; } } + nvDebugCheck(best < 8); totalError += besterror; block->setIndex(i, best);