diff mm7_1.cpp @ 1195:1f92c110a4f2

indoor sub_424829
author zipi
date Fri, 07 Jun 2013 23:46:57 +0100
parents 02e2a5c1ebc0
children 8c02e6f74b29 eb419a6d48fe
line wrap: on
line diff
--- a/mm7_1.cpp	Sat Jun 08 01:19:15 2013 +0400
+++ b/mm7_1.cpp	Fri Jun 07 23:46:57 2013 +0100
@@ -2234,8 +2234,8 @@
   //int v4; // edi@1
   //BspRenderer_stru2 *v5; // ebx@1
   int v6; // eax@3
-  int v7; // esi@5
-  int v8; // edx@5
+  int min_y; // esi@5
+  int max_y; // edx@5
   //int v9; // ecx@6
   int v10; // eax@12
   //int v11; // edi@13
@@ -2308,9 +2308,9 @@
   //return true;
   if ( pNumVertices <= 1 )
     return false;
-  v7 = stru_50B700._screen_space_y[0];
+  min_y = stru_50B700._screen_space_y[0];
   v65 = 0;
-  v8 = stru_50B700._screen_space_y[0];
+  max_y = stru_50B700._screen_space_y[0];
   if ( !stru_50B700.field_0 )
   {
     v63 = 1;
@@ -2324,23 +2324,23 @@
 
   for ( v6 = 1; v6 < pNumVertices; ++v6 )
   {
-    if ( stru_50B700._screen_space_y[v6] >= v7 )
+    if ( stru_50B700._screen_space_y[v6] >= min_y )
     {
-      if ( stru_50B700._screen_space_y[v6] > v8 )
-        v8 = stru_50B700._screen_space_y[v6];
+      if ( stru_50B700._screen_space_y[v6] > max_y )
+        max_y = stru_50B700._screen_space_y[v6];
     }
-    else
+    if ( stru_50B700._screen_space_y[v6] < min_y )
     {
       v65 = v6;
-      v7 = stru_50B700._screen_space_y[v6];
+      min_y = stru_50B700._screen_space_y[v6];
     }
   }
-  if ( v8 == v7 )
+  if ( max_y == min_y )
     return false;
 
   v10 = v65;
-  a2->_viewport_space_y = v7;
-  a2->_viewport_space_w = v8;
+  a2->_viewport_space_y = min_y;
+  a2->_viewport_space_w = max_y;
   v55 = v65;
 
   for ( v68 = 0; v68 < pNumVertices; ++v68 )
@@ -2358,7 +2358,7 @@
       v55 = v10;
       v65 = v10;
     }
-    if ( stru_50B700._screen_space_y[v10] == v8 )
+    if ( stru_50B700._screen_space_y[v10] == max_y )
       break;
   }
   v13 = v55 + v64;
@@ -2373,7 +2373,7 @@
   {
     v62 = stru_50B700._screen_space_x[v55] << 16;
     v54 = ((stru_50B700._screen_space_x[v13] - stru_50B700._screen_space_x[v55]) << 16) / (stru_50B700._screen_space_y[v13] - stru_50B700._screen_space_y[v55]);
-    a2->array_18[v7] = LOWORD(stru_50B700._screen_space_x[v55]);
+    a2->array_18[min_y] = LOWORD(stru_50B700._screen_space_x[v55]);
   }
   v15 = v65;
   v61 = v65;
@@ -2393,7 +2393,7 @@
       v61 = v15;
       v65 = v15;
     }
-    if ( stru_50B700._screen_space_y[v15] == v8 )
+    if ( stru_50B700._screen_space_y[v15] == max_y )
       break;
   }
   v18 = v63 + v61;
@@ -2410,17 +2410,17 @@
   {
     v61 = stru_50B700._screen_space_x[v20] << 16;
     v53 = ((stru_50B700._screen_space_x[v19] - stru_50B700._screen_space_x[v20]) << 16) / stru_50B700._screen_space_y[v19] - stru_50B700._screen_space_y[v20];
-    a2->array_3D8[v8] = LOWORD(stru_50B700._screen_space_x[v20]);
+    a2->array_3D8[max_y] = LOWORD(stru_50B700._screen_space_x[v20]);
   }
-  v22 = v7;
-  if ( v7 <= v8 )
+  v22 = min_y;
+  if ( min_y <= max_y )
   {
     //v56 = &a2->array_3D8[v7];
     //v23 = &a2->array_18[v7];
-    for ( v70 = v7; v70 <= v8; ++v70 )
+    for ( v70 = min_y; v70 <= max_y; ++v70 )
     {
       v24 = v13;
-      if ( v22 >= stru_50B700._screen_space_y[v13] && v22 != v8 )
+      if ( v22 >= stru_50B700._screen_space_y[v13] && v22 != max_y )
       {
         v13 = v64 + v13;
         if ( v13 < pNumVertices )
@@ -2439,7 +2439,7 @@
         }
       }
       v29 = v18;
-      if ( v70 >= stru_50B700._screen_space_y[v18] && v70 != v8 )
+      if ( v70 >= stru_50B700._screen_space_y[v18] && v70 != max_y )
       {
         v18 += v63;
         if ( v18 < pNumVertices )
@@ -2480,49 +2480,49 @@
       //++v23;
     }
   }
-  if ( v8 < a3->_viewport_space_y )
+  if ( max_y < a3->_viewport_space_y )
     return false;
-  if ( v7 > a3->_viewport_space_w )
+  if ( min_y > a3->_viewport_space_w )
     return false;
-  if ( v7 < a3->_viewport_space_y )
-    v7 = a3->_viewport_space_y;
-  if ( v8 > a3->_viewport_space_w )
-    v8 = a3->_viewport_space_w;
-  if ( v7 <= v8 )
+  if ( min_y < a3->_viewport_space_y )
+    min_y = a3->_viewport_space_y;
+  if ( max_y > a3->_viewport_space_w )
+    max_y = a3->_viewport_space_w;
+  if ( min_y <= max_y )
   {
     //a3a = (char *)a2 - (char *)a3;
     //v42 = &a3->array_3D8[v7];
     //v57 = *(__int16 *)((char *)v42 + a3a);
-    for ( v71 = v7; v71 <= v8; ++v71 )
+    for ( v71 = min_y; v71 <= max_y; ++v71 )
     {
       if ( a2->array_18[v71] >= a3->array_18[v71] && a2->array_18[v71] <= a3->array_3D8[v71] )
         break;
       //++v57;
-      ++v7;
+      ++min_y;
       //++v42;
     }
   }
-  if ( v8 < v7 )
+  if ( max_y < min_y )
     return false;
   //a3a = (char *)a2 - (char *)a3;
   //v43 = &a3->array_3D8[v8];
   //v58 = *(__int16 *)((char *)v43 + a3a);
-  for ( v72 = v8; v72 >= v7; --v72 )
+  for ( v72 = max_y; v72 >= min_y; --v72 )
   {
     if ( a2->array_3D8[v72] >= a3->array_18[v72] && a2->array_18[v72] <= a3->array_3D8[v72] )
       break;
     //--v58;
-    --v8;
+    --max_y;
     //--v43;
     //v8 = v8;
   }
-  if ( v7 >= v8 )
+  if ( min_y >= max_y )
     return false;
   //a3b = (char *)a3 - (char *)a2;
-  v59 = v7;
+  v59 = min_y;
   //v45 = &a2->array_18[v7];
   
-  for ( v46 = v8 - v7 + 1; v46; --v46 )
+  for ( v46 = max_y - min_y + 1; v46; --v46 )
   {
     //v47 = *(__int16 *)((char *)v45 + a3b);
     if ( a2->array_18[v59] < a3->array_18[v59] )
@@ -2532,18 +2532,18 @@
     ++v59;
     //++v45;
   }
-  a2->_viewport_space_y = v7;
-  a2->_viewport_space_w = v8;
-  a2->field_8 = a2->array_18[v7];
+  a2->_viewport_space_y = min_y;
+  a2->_viewport_space_w = max_y;
+  a2->field_8 = a2->array_18[min_y];
   //v48 = a2->array_3D8[v7];
-  a2->field_10 = v7;
-  a2->field_14 = v7;
-  a2->field_C = a2->array_3D8[v7];
-  v49 = v7 + 1;
-  if ( v49 <= v8 )
+  a2->field_10 = min_y;
+  a2->field_14 = min_y;
+  a2->field_C = a2->array_3D8[min_y];
+  v49 = min_y + 1;
+  if ( v49 <= max_y )
   {
     //v50 = &a2->array_3D8[v49];
-    for ( v49; v49 <= v8; ++v49 )
+    for ( v49; v49 <= max_y; ++v49 )
     {
       //v51 = a2->array_18[v49];
       if ( a2->array_18[v49] < a2->field_8 )