diff mm7_2.cpp @ 2314:8e9be4fa33a8

for Bloodsplat
author Ritor1
date Tue, 18 Mar 2014 23:50:35 +0600
parents ca13c630ee2b
children 9551756f46c4
line wrap: on
line diff
--- a/mm7_2.cpp	Tue Mar 18 17:34:33 2014 +0600
+++ b/mm7_2.cpp	Tue Mar 18 23:50:35 2014 +0600
@@ -881,7 +881,7 @@
   int v160; // [sp+3Ch] [bp-4Ch]@13
   unsigned __int16 *v175; // [sp+4Ch] [bp-3Ch]@13
   unsigned __int16 *v193; // [sp+5Ch] [bp-2Ch]@7
-  signed int v231; // [sp+78h] [bp-10h]@7
+  //signed int v231; // [sp+78h] [bp-10h]@7
   __int64 v240; // [sp+7Ch] [bp-Ch]@12
   unsigned int v251; // [sp+80h] [bp-8h]@218
   unsigned int v252; // [sp+84h] [bp-4h]@218
@@ -922,18 +922,20 @@
     return result;
   
   //do
-  for ( v231 = 0; v231 < dstHeight; v231++ )
+  for ( int height = 0; height < dstHeight; height++ )
   {
-    for (int counter = 0; counter < dstWidth; counter++)
+    for (int width = 0; width < dstWidth; width++)
     {
-      a6s = (double)counter / (double)dstWidth * (double)srcWidth;
+      a6s = (double)width / (double)dstWidth * (double)srcWidth;
       widthRatio = bankersRounding(a6s);
-      a6t = (double)(counter + 1) / (double)dstWidth * (double)srcWidth;
+      a6t = (double)(width + 1) / (double)dstWidth * (double)srcWidth;
       widthRatioPlusOne = bankersRounding(a6t);
-      v17 = (double)v231 / (double)dstHeight * (double)srcHeight;
+
+      v17 = (double)height / (double)dstHeight * (double)srcHeight;
       heightRatio = bankersRounding(v17);
-      v18 = (double)(v231 + 1) / (double)dstHeight * (double)srcHeight;
+      v18 = (double)(height + 1) / (double)dstHeight * (double)srcHeight;
       heightRatioPlusOne = bankersRounding(v18);
+
       v251 = 0;
       v19 = (heightRatioPlusOne - heightRatio) * (widthRatioPlusOne - widthRatio);
       v252 = 0;
@@ -943,15 +945,15 @@
       v175 = (unsigned short*)((char *)pSrc + field_0_bits * (widthRatio + srcPitch * heightRatio));
       for (int heightDiff = 0; heightDiff < heightRatioPlusOne - heightRatio; heightDiff++)
       {
-        int ratioDiff = widthRatioPlusOne - widthRatio;
-        for(int i = 0; i < ratioDiff; i++)
+        //int ratioDiff = widthRatioPlusOne - widthRatio;
+        for(int ratioDiff = 0; ratioDiff < widthRatioPlusOne - widthRatio; ratioDiff++)
         {
           if(field0value == 32)
-            v21 = _450FB1(((int*)v175)[i]);
+            v21 = _450FB1(((int*)v175)[ratioDiff]);
           else if(field0value == 16)
-            v21 = _450FB1(((_WORD*)v175)[i]);
+            v21 = _450FB1(((_WORD*)v175)[ratioDiff]);
           else if (field0value == 8)
-            v21 = _450FB1(((unsigned __int8*)v175)[i]);
+            v21 = _450FB1(((unsigned __int8*)v175)[ratioDiff]);
           v240 += ((unsigned int)v21 >> 24);
           a6b += BYTE2(v21);
           v252 += BYTE1(v21);
@@ -960,10 +962,11 @@
         if (field0value == 32)
           v175 += 2 * srcPitch;
         else if (field0value == 16)
-          v175 += srcPitch;   
+          v175 += srcPitch;
         else if (field0value == 8)
           v175 = (unsigned short*)((char *)v175 + 2 * srcPitch);
       }
+
       v22 = (unsigned int)v240 / ((heightRatioPlusOne - heightRatio) * (widthRatioPlusOne - widthRatio));
       if ( v19 )
       {
@@ -979,7 +982,7 @@
     }
     v193 = (unsigned __int16 *)((char *)v193 + field_20_bits * (dstPitch - dstWidth));
     //++v231;
-    result = v231;
+    result = height;
   }
   //while(v231 < dstHeight);
   return result;