diff mm7_2.cpp @ 1130:d98415be04ca

banker's rounding template
author Grumpy7
date Fri, 31 May 2013 23:38:43 +0200
parents 9362028fccd1
children 71ba92960bc5 f947bedb2859
line wrap: on
line diff
--- a/mm7_2.cpp	Fri May 31 06:36:34 2013 +0200
+++ b/mm7_2.cpp	Fri May 31 23:38:43 2013 +0200
@@ -2237,6 +2237,7 @@
   unsigned int a6r; // [sp+A0h] [bp+18h]@218
   int dstdiffmult;
 
+  using namespace rounding;
 
   int probablyBitDepth = this->field_20.field_C;
   switch(probablyBitDepth)
@@ -2276,13 +2277,13 @@
     while ( 1 )
     {
       a6s = (double)v14 / (double)dstWidth * (double)srcWidth;
-      v151 = floorf(a6s + 0.5f);//a6s + 6.7553994e15;
+      v151 = bankersRounding(a6s);//a6s + 6.7553994e15;
       a6t = (double)(v14 + 1) / (double)dstWidth * (double)srcWidth;
-      v142 = floorf(a6t + 0.5f);//a6t + 6.7553994e15;
+      v142 = bankersRounding(a6t);//a6t + 6.7553994e15;
       v17 = (double)v231 / (double)dstHeight * (double)srcHeight;
-      v133 = floorf(v17 + 0.5f);//v17 + 6.7553994e15;
+      v133 = bankersRounding(v17);//v17 + 6.7553994e15;
       v18 = (double)(v231 + 1) / (double)dstHeight * (double)srcHeight;
-      v124 = floorf(v18 + 0.5f);//v18 + 6.7553994e15;
+      v124 = bankersRounding(v18);//v18 + 6.7553994e15;
       v19 = (LODWORD(v124) - LODWORD(v133)) * (LODWORD(v142) - LODWORD(v151));
       v252 = 0;
       a6b = 0;