From 44e6560111715cf6e3b88e736d438379bed3aace Mon Sep 17 00:00:00 2001 From: castano Date: Wed, 10 Oct 2007 17:06:42 +0000 Subject: [PATCH] Fix vc8 warnings. --- src/nvimage/PixelFormat.h | 3 +-- src/nvimage/nvtt/CompressRGB.cpp | 2 +- src/nvimage/nvtt/QuickCompressDXT.cpp | 4 ++-- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/nvimage/PixelFormat.h b/src/nvimage/PixelFormat.h index 801adc2..2101ace 100644 --- a/src/nvimage/PixelFormat.h +++ b/src/nvimage/PixelFormat.h @@ -25,10 +25,9 @@ #define NV_IMAGE_PIXELFORMAT_H -#include +#include -// @@ Move this code to format conversion!! namespace nv { namespace PixelFormat diff --git a/src/nvimage/nvtt/CompressRGB.cpp b/src/nvimage/nvtt/CompressRGB.cpp index 0435e50..78e37b6 100644 --- a/src/nvimage/nvtt/CompressRGB.cpp +++ b/src/nvimage/nvtt/CompressRGB.cpp @@ -116,7 +116,7 @@ void nv::compressRGB(const Image * image, const OutputOptions & outputOptions, c c |= PixelFormat::convert(src[x].a, 8, asize) << ashift; // Output one byte at a time. @@ Not tested... Does this work on LE and BE? - for (int i = 0; i < byteCount; i++) + for (uint i = 0; i < byteCount; i++) { *(dst + x * byteCount) = (c >> (i * 8)) & 0xFF; } diff --git a/src/nvimage/nvtt/QuickCompressDXT.cpp b/src/nvimage/nvtt/QuickCompressDXT.cpp index 6e4e5b2..e6203d3 100644 --- a/src/nvimage/nvtt/QuickCompressDXT.cpp +++ b/src/nvimage/nvtt/QuickCompressDXT.cpp @@ -66,7 +66,7 @@ inline static void findMinMaxColorsBox(const Vector3 * block, uint num, Vector3 *maxColor = Vector3(0, 0, 0); *minColor = Vector3(255, 255, 255); - for (int i = 0; i < num; i++) + for (uint i = 0; i < num; i++) { *maxColor = max(*maxColor, block[i]); *minColor = min(*minColor, block[i]); @@ -79,7 +79,7 @@ inline static void selectDiagonal(const Vector3 * block, uint num, Vector3 * __r Vector3 center = (*maxColor + *minColor) * 0.5; Vector2 covariance = Vector2(zero); - for (int i = 0; i < num; i++) + for (uint i = 0; i < num; i++) { Vector3 t = block[i] - center; covariance += t.xy() * t.z();