From fabf6830ee2a4f51da9aa8a6aa1d64be9fc08bdb Mon Sep 17 00:00:00 2001 From: Pavel Krajcevski Date: Fri, 28 Mar 2014 11:40:38 -0400 Subject: [PATCH] Fix bug so that we at least generate *some* endpoints --- BPTCEncoder/src/RGBAEndpoints.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/BPTCEncoder/src/RGBAEndpoints.cpp b/BPTCEncoder/src/RGBAEndpoints.cpp index 1cbb722..5a11ea0 100755 --- a/BPTCEncoder/src/RGBAEndpoints.cpp +++ b/BPTCEncoder/src/RGBAEndpoints.cpp @@ -306,7 +306,8 @@ double RGBACluster::QuantizedError( float minError = FLT_MAX; uint8 bestBucket = 0; - for(int32 j = j1; j <= j2; j++) { + int32 j = j1; + do { uint32 interp0 = (*interpVals)[j][0]; uint32 interp1 = (*interpVals)[j][1]; @@ -331,7 +332,7 @@ double RGBACluster::QuantizedError( else if(error > minError) { break; } - } + } while(++j <= j2); totalError += minError;