diff Indoor.cpp @ 717:d5473972234d

m
author Ritor1
date Mon, 18 Mar 2013 01:50:50 +0600
parents 0f25d026acfa
children a5ee769b02c6
line wrap: on
line diff
--- a/Indoor.cpp	Sat Mar 16 17:42:59 2013 +0600
+++ b/Indoor.cpp	Mon Mar 18 01:50:50 2013 +0600
@@ -3160,10 +3160,10 @@
   //Vec3_short_ *v34; // edx@27
   int v35; // edx@32
   int v37; // edi@38
-  int v38; // ebx@40
+  int pSectorID; // ebx@40
   int v39; // eax@41
-  BLVFace *v40; // esi@42
-  PolygonType v41; // dl@42
+  BLVFace *pFace; // esi@42
+  PolygonType pPolygonType; // dl@42
   int v42; // edx@43
   int v43[50]; // [sp+Ch] [bp-108h]@1
   //int v44; // [sp+D4h] [bp-40h]@9
@@ -3236,10 +3236,10 @@
                //pVertexIDs = pFace->pVertexIDs;
                       //v19 = this->pVertices;
                //v20 = pVertices[pFace->pVertexIDs[0]].y;
-                      v54 = 0;
-                      //v57 = 0;
-                      //v5 = v16->uNumVertices == 0;
-                      v59 = pVertices[pFace->pVertexIDs[0]].y >= sY;
+               v54 = 0;
+               //v57 = 0;
+               //v5 = v16->uNumVertices == 0;
+               v59 = pVertices[pFace->pVertexIDs[0]].y >= sY;
 
                         //v21 = pFace->pVertexIDs + 1;
                for (uint k = 1; k < pFace->uNumVertices; ++k)
@@ -3297,24 +3297,24 @@
                           ++v54;
                       }
                     }
-                   }
-                 }
-
-                 v59 = v50;
-               }
-
-               if (pFace->uNumVertices)
-               {
-                 if (v54 == 1)
-                 {
-                   v35 = v55++;
-                   v43[v35] = uFaceID;
-                 }
-               }
-             }
+                  }
+                }
+
+                v59 = v50;
+              }
+
+              if (pFace->uNumVertices)
+              {
+                if (v54 == 1)
+                {
+                  v35 = v55++;
+                  v43[v35] = uFaceID;
+                }
+              }
             }
-            v4 = v43[0];
           }
+          v4 = v43[0];
+        }
   }
 
   if ( v55 == 1 )
@@ -3322,45 +3322,46 @@
   v37 = 0;
   if ( !v55 )
     return 0;
-  v38 = 0;
+  pSectorID = 0;
   v53 = 0xFFFFFFu;
   if ( v55 > 0 )
   {
     v39 = sY;
     while ( 1 )
     {
-      v40 = &this->pFaces[v43[v37]];
-      v41 = v40->uPolygonType;
-      if ( v41 == 3 )
-        break;
-      if ( v41 == 4 )
+      pFace = &this->pFaces[v43[v37]];
+      //pPolygonType = pFace->uPolygonType;
+      if ( pFace->uPolygonType == POLYGON_Floor )
       {
-        v51 = v40->zCalc1;
-        v57 = (unsigned __int64)(v51 * (signed __int64)(sX << 16)) >> 16;
-        v56 = sY << 16;
-        v51 = v40->zCalc2;
-        v56 = (unsigned __int64)(v51 * (signed __int64)(sY << 16)) >> 16;
-        v42 = (v56 + v40->zCalc3 + v57 + 32768) >> 16;
+        v42 = this->pVertices[*pFace->pVertexIDs].z;
+        v39 = sZ - v42;
+        //goto LABEL_47;
+      }
+      if ( pFace->uPolygonType == POLYGON_InBetweenFloorAndWall )
+      {
+        //v51 = pFace->zCalc1;
+        v57 = (unsigned __int64)(pFace->zCalc1 * (signed __int64)(sX << 16)) >> 16;
+        //v56 = sY << 16;
+        //v51 = pFace->zCalc2;
+        v56 = (unsigned __int64)(pFace->zCalc2 * (signed __int64)(sY << 16)) >> 16;
+        v42 = (v56 + pFace->zCalc3 + v57 + 32768) >> 16;
         v39 = sZ - v42;
       }
-LABEL_47:
+//LABEL_47:
       if ( v39 >= 0 )
       {
         if ( v39 < v53 )
         {
-          v38 = v40->uSectorID;
+          pSectorID = pFace->uSectorID;
           v53 = v39;
         }
       }
       ++v37;
       if ( v37 >= v55 )
-        return v38;
+        return pSectorID;
     }
-    v42 = this->pVertices[*v40->pVertexIDs].z;
-    v39 = sZ - v42;
-    goto LABEL_47;
   }
-  return v38;
+  //return pSectorID;
 }
 // 49AC17: using guessed type int var_108[50];