diff mm7_1.cpp @ 1226:33b30398e286

m
author Ritor1
date Fri, 07 Jun 2013 22:24:11 +0600
parents 42b41aaecd87
children 312e895a6439
line wrap: on
line diff
--- a/mm7_1.cpp	Wed Jun 05 21:00:45 2013 +0600
+++ b/mm7_1.cpp	Fri Jun 07 22:24:11 2013 +0600
@@ -2229,7 +2229,7 @@
 }
 
 //----- (00424829) --------------------------------------------------------
-bool sub_424829(int pNumVertices, BspRenderer_stru2 *a2, BspRenderer_stru2 *a3, int uFaceID)
+bool isVisibleRoom(int pNumVertices, BspRenderer_stru2 *a2, BspRenderer_stru2 *a3, int uFaceID)
 {
   //int v4; // edi@1
   //BspRenderer_stru2 *v5; // ebx@1
@@ -2308,9 +2308,11 @@
   //return true;
   if ( !pNumVertices )
     return false;
+
   v7 = stru_50B700._screen_space_y[0];
   v65 = 0;
   v8 = stru_50B700._screen_space_y[0];
+
   if ( !stru_50B700.field_0 )
   {
     v63 = 1;
@@ -2321,8 +2323,10 @@
     v63 = -1;
     v64 = 1;
   }
+
   if ( pNumVertices <= 1 )
     return false;
+
   for ( v6 = 1; v6 < pNumVertices; ++v6 )
   {
     if ( stru_50B700._screen_space_y[v6] >= v7 )
@@ -2336,12 +2340,15 @@
       v7 = stru_50B700._screen_space_y[v6];
     }
   }
+
   if ( v8 == v7 )
     return false;
+
   v10 = v65;
   a2->_viewport_space_y = v7;
   a2->_viewport_space_w = v8;
   v55 = v65;
+
   if ( pNumVertices > 0 )
   {
     //v11 = v65;
@@ -2366,6 +2373,7 @@
         break;
     }
   }
+
   v13 = v55 + v64;
   if ( v13 < pNumVertices )
   {
@@ -2376,12 +2384,14 @@
   {
     v13 -= pNumVertices;
   }
+
   if ( stru_50B700._screen_space_y[v13] != stru_50B700._screen_space_y[v55] )
   {
     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]);
   }
+
   v15 = v65;
   v61 = v65;
   if ( pNumVertices > 0 )
@@ -2408,6 +2418,7 @@
         break;
     }
   }
+
   v18 = v63 + v61;
   if ( v18 < pNumVertices )
   {
@@ -2419,6 +2430,7 @@
     v18 -= pNumVertices;
   }
   v19 = v18;
+
   v20 = v61;
   if ( stru_50B700._screen_space_y[v19] != stru_50B700._screen_space_y[v61] )
   {
@@ -2426,6 +2438,7 @@
     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]);
   }
+
   v22 = v7;
   if ( v7 <= v8 )
   {
@@ -2498,25 +2511,28 @@
       //++v23;
     }
   }
+
   if ( v8 < a3->_viewport_space_y )
     return false;
   if ( v7 > 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 )
   {
     //a3a = (char *)a2 - (char *)a3;
     //v42 = &a3->array_3D8[v7];
     //v57 = *(__int16 *)((char *)v42 + a3a);
-    for ( v71 = v7; v71 <= v8; ++v71 )
+    for ( v7; v7 <= v8; ++v7 )
     {
-      if ( a2->array_18[v71] >= a3->array_18[v71] && a2->array_18[v71] <= a3->array_3D8[v71] )
+      if ( a2->array_18[v7] >= a3->array_18[v7] && a2->array_18[v7] <= a3->array_3D8[v7] )
         break;
       //++v57;
-      ++v7;
+      //++v7;
       //++v42;
     }
   }
@@ -2525,12 +2541,12 @@
   //a3a = (char *)a2 - (char *)a3;
   //v43 = &a3->array_3D8[v8];
   //v58 = *(__int16 *)((char *)v43 + a3a);
-  for ( v72 = v8; v72 >= v7; --v72 )
+  for ( v8; v8 >= v7; --v8 )
   {
-    if ( a2->array_3D8[v72] >= a3->array_18[v72] && a2->array_18[v72] <= a3->array_3D8[v72] )
+    if ( a2->array_3D8[v8] >= a3->array_18[v8] && a2->array_18[v8] <= a3->array_3D8[v8] )
       break;
     //--v58;
-    --v8;
+    //--v8;
     //--v43;
     //v8 = v8;
   }