changeset 2388:41025c0eb414

sub_407A1C - changing some variables to signed
author zipi
date Mon, 30 Jun 2014 10:22:31 +0100
parents 5f395dd759fb
children 6a7309a847ea
files Indoor.cpp
diffstat 1 files changed, 14 insertions(+), 38 deletions(-) [+]
line wrap: on
line diff
--- a/Indoor.cpp	Mon Jun 23 23:45:57 2014 +0600
+++ b/Indoor.cpp	Mon Jun 30 10:22:31 2014 +0100
@@ -4152,7 +4152,7 @@
   int v18; // ST38_4@25
   int v19; // eax@25
   char v20; // zf@25
-  int v21; // ebx@25
+  signed int v21; // ebx@25
   signed int v23; // edi@26
   int v24; // ST34_4@30
   Vec3_int_ v27; // ST08_12@37
@@ -4161,7 +4161,7 @@
   int v33; // eax@37
   int v35; // eax@39
   ODMFace *odm_face; // esi@54
-  int v40; // ebx@60
+  signed int v40; // ebx@60
   signed int v42; // edi@61
   Vec3_int_ v45; // ST08_12@73
   signed int v49; // ecx@73
@@ -4174,7 +4174,7 @@
   int v63; // ST34_4@98
   int v64; // ST30_4@98
   int v65; // eax@98
-  int v66; // ebx@98
+  signed int v66; // ebx@98
   signed int v68; // edi@99
   int v69; // ST2C_4@103
   Vec3_int_ v72; // ST08_12@111
@@ -4184,15 +4184,9 @@
   int v80; // ecx@113
   int v81; // eax@113
   int v87; // ecx@128
-  int v91; // ebx@136
+  signed int v91; // ebx@136
   signed int v93; // edi@137
   Vec3_int_ v97; // [sp-18h] [bp-94h]@1
-  int v98; // [sp-Ch] [bp-88h]@88
-  int v99; // [sp-Ch] [bp-88h]@126
-  int v100; // [sp-8h] [bp-84h]@88
-  int v101; // [sp-8h] [bp-84h]@126
-  int v102; // [sp-4h] [bp-80h]@88
-  int v103; // [sp-4h] [bp-80h]@126
   int v107; // [sp+10h] [bp-6Ch]@98
   int v108; // [sp+10h] [bp-6Ch]@104
   int v109; // [sp+18h] [bp-64h]@25
@@ -4296,17 +4290,12 @@
     {
       if ( a5b )
       {
-        v102 = sZ;
-        v100 = sY;
-        v98 = sX;
+		v59 = pIndoor->GetSector(sX, sY, sZ);
       }
       else
       {
-        v102 = outz;
-        v100 = outy;
-        v98 = outx;
+		v59 = pIndoor->GetSector(outx, outy, outz);
       }
-      v59 = pIndoor->GetSector(v98, v100, v102);
       //v60 = pIndoor->pSectors;
       //v61 = 116 * v59;
       //i = 116 * v59;
@@ -4318,14 +4307,14 @@
         v63 = fixpoint_mul(v143, face->pFacePlane_old.vNormal.x);
         v64 = fixpoint_mul(v53, face->pFacePlane_old.vNormal.z);
         v65 = fixpoint_mul(v52, face->pFacePlane_old.vNormal.y);
-        v20 = v63 + v64 + v65;
+        v20 = v63 + v64 + v65 == 0;
         v66 = v63 + v64 + v65;
         v107 = v63 + v64 + v65;
         if ( face->Portal()
           || v119 > face->pBounding.x2 || v123 < face->pBounding.x1
           || v127 > face->pBounding.y2 || v131 < face->pBounding.y1
           || v135 > face->pBounding.z2 || v139 < face->pBounding.z1
-          || !v20 )
+          || v20 )
           continue;
         v68 = -(face->pFacePlane_old.dist + sX * face->pFacePlane_old.vNormal.x
                                           + sY * face->pFacePlane_old.vNormal.y
@@ -4401,39 +4390,26 @@
         return !v114 || !v113;
       if ( a5c )
       {
-        v103 = sZ;
-        v101 = sY;
-        v99 = sX;
+		v87 = pIndoor->GetSector(sX, sY, sZ);
       }
       else
       {
-        v103 = outz;
-        v101 = outy;
-        v99 = outx;
+		v87 = pIndoor->GetSector(outx, outy, outz);
       }
-      v87 = pIndoor->GetSector(v99, v101, v103);
-      //v88 = pIndoor->pSectors;
-      //v89 = 116 * v87;
-      
-      //v112 = v89;
-      //if ( *(__int16 *)((char *)&pIndoor->pSectors->uNumWalls + v89)
-         //+ 2 * *(__int16 *)((char *)&pIndoor->pSectors->uNumFloors + v89) > 0 )
-   //{
-    //while ( 1 )
     for ( v162 = 0; v162 < pIndoor->pSectors[v87].uNumFaces; v162++)
     {
       face = &pIndoor->pFaces[pIndoor->pSectors[v87].pFaceIDs[v162]];
       yb = fixpoint_mul(v144, face->pFacePlane_old.vNormal.x);
       v_4b = fixpoint_mul(v80, face->pFacePlane_old.vNormal.y);
       vf = fixpoint_mul(v81, face->pFacePlane_old.vNormal.z);
-      v20 = yb + vf + v_4b;
+      v20 = yb + vf + v_4b == 0;
       v91 = yb + vf + v_4b;
       vc = yb + vf + v_4b;
       if ( face->Portal()
         || v120 > face->pBounding.x2 || v124 < face->pBounding.x1
         || v128 > face->pBounding.y2 || v132 < face->pBounding.y1
         || v136 > face->pBounding.z2 || v140 < face->pBounding.z1
-        || !v20 )
+        || v20 )
         continue;
       //v92 = sZ * face->pFacePlane_old.vNormal.z;
       v93 = -(face->pFacePlane_old.dist + sX * face->pFacePlane_old.vNormal.x
@@ -4513,13 +4489,13 @@
           v17 = fixpoint_mul(v125, odm_face->pFacePlane.vNormal.x);
           v18 = fixpoint_mul(v121, odm_face->pFacePlane.vNormal.y);
           v19 = fixpoint_mul(v12, odm_face->pFacePlane.vNormal.z);
-          v20 = v17 + v18 + v19;
+          v20 = v17 + v18 + v19 == 0;
           v21 = v17 + v18 + v19;
           v109 = v17 + v18 + v19;
           if ( v149 > odm_face->pBoundingBox.x2 || v145 < odm_face->pBoundingBox.x1
             || v141 > odm_face->pBoundingBox.y2 || v137 < odm_face->pBoundingBox.y1
             || v133 > odm_face->pBoundingBox.z2 || v129 < odm_face->pBoundingBox.z1
-            || !v20 )
+            || v20 )
             continue;
           v23 = -(odm_face->pFacePlane.dist + sX * odm_face->pFacePlane.vNormal.x
                                             + sY * odm_face->pFacePlane.vNormal.y