diff Indoor.cpp @ 830:08d90b633131

some BLV floor collisions
author Nomad
date Wed, 27 Mar 2013 11:59:37 +0200
parents e95389c8680a
children 9c3f28b31b4a
line wrap: on
line diff
--- a/Indoor.cpp	Wed Mar 27 00:28:45 2013 +0200
+++ b/Indoor.cpp	Wed Mar 27 11:59:37 2013 +0200
@@ -1291,6 +1291,7 @@
   //v39 = &pIndoor->pFaces[uFaceID];
 
   auto pFace = &pIndoor->pFaces[uFaceID];
+  auto p = &nodes[node_id];
 
   if (!pFace->Portal())
   {
@@ -1302,9 +1303,8 @@
     return;
   }
 
-    auto p = &nodes[node_id];
-    //v6 = (int)((char *)this + 2252 * a2);
-    //a0 = v6;
+
+
     if (p->uFaceID == uFaceID)
       return;
     if (!node_id &&
@@ -1316,8 +1316,8 @@
         pBLVRenderParams->vPartyPos.z <= pFace->pBounding.z2 + 16 )
     {
       if ( abs(pFace->pFacePlane_old.dist + pBLVRenderParams->vPartyPos.x * pFace->pFacePlane_old.vNormal.x
-                                       + pBLVRenderParams->vPartyPos.y * pFace->pFacePlane_old.vNormal.y
-                                       + pBLVRenderParams->vPartyPos.z * pFace->pFacePlane_old.vNormal.z) <= 589824 ) // we sure are standing at the portal plane
+                                          + pBLVRenderParams->vPartyPos.y * pFace->pFacePlane_old.vNormal.y
+                                          + pBLVRenderParams->vPartyPos.z * pFace->pFacePlane_old.vNormal.z) <= 589824 ) // we sure are standing at the portal plane
       {
         v7 = pFace->uSectorID;
         if ( nodes[0].uSectorID == v7 )  // draw back sector
@@ -1328,11 +1328,11 @@
         nodes[num_nodes].uViewportZ = pBLVRenderParams->uViewportZ;
         nodes[num_nodes].uViewportY = pBLVRenderParams->uViewportY;
         nodes[num_nodes].uViewportW = pBLVRenderParams->uViewportW;
-        nodes[num_nodes++].field_C._43F9E1(pBLVRenderParams->uViewportX,
-                                           pBLVRenderParams->uViewportY,
-                                           pBLVRenderParams->uViewportZ,
-                                           pBLVRenderParams->uViewportW);
-        AddBspNodeToRenderList(num_nodes - 1);
+        nodes[num_nodes].field_C._43F9E1(pBLVRenderParams->uViewportX,
+                                         pBLVRenderParams->uViewportY,
+                                         pBLVRenderParams->uViewportZ,
+                                         pBLVRenderParams->uViewportW);
+        AddBspNodeToRenderList(++num_nodes - 1);
         return;
       }
       //v5 = v39;
@@ -1368,40 +1368,7 @@
       if (face_max_screenspace_y < _50B9D8_screen_space_y[i])
         face_max_screenspace_y = _50B9D8_screen_space_y[i];
     }
-      //v10 = sub_423B5D(uFaceID);
-      //v34 = v10;
-      //if ( v10 )
-      //{
-       /* v11 = _50BAC8_screen_space_x[0];
-        v12 = _50B9D8_screen_space_y[0];
-        a2 = _50BAC8_screen_space_x[0];
-        v13 = 1;
-        v37 = _50B9D8_screen_space_y[0];
-        if ( v10 > 1 )
-        {
-          do
-          {
-            v14 = _50BAC8_screen_space_x[v13];
-            if ( v14 < a2 )
-              a2 = _50BAC8_screen_space_x[v13];
-            if ( v14 > v11 )
-              v11 = v14;
-            v15 = _50B9D8_screen_space_y[v13];
-            if ( v15 < v37 )
-              v37 = _50B9D8_screen_space_y[v13];
-            if ( v15 > v12 )
-              v12 = _50B9D8_screen_space_y[v13];
-            v10 = v34;
-            ++v13;
-          }
-          while ( v13 < v34 );
-        }
-        //v16 = a0;
-        if (v11 >= p->uViewportX &&
-            a2 <= p->uViewportZ &&
-            v12 >= p->uViewportY &&
-            v37 <= p->uViewportW &&
-            sub_424829(v10, &nodes[num_nodes].field_C, &p->field_C, uFaceID))*/
+
       if (face_max_screenspace_x >= p->uViewportX &&
           face_min_screenspace_x <= p->uViewportZ &&
           face_max_screenspace_y >= p->uViewportY &&