changeset 1237:8ee5f1554b64

Слияние
author Ritor1
date Sun, 09 Jun 2013 21:48:48 +0600
parents d7ba42663d59 (diff) b237a61e61d3 (current diff)
children 77ea5c5f2c0b
files mm7_4.cpp
diffstat 3 files changed, 68 insertions(+), 84 deletions(-) [+]
line wrap: on
line diff
--- a/Indoor.cpp	Sun Jun 09 17:35:10 2013 +0200
+++ b/Indoor.cpp	Sun Jun 09 21:48:48 2013 +0600
@@ -1312,8 +1312,6 @@
     return;
   }
 
-
-
     if (p->uFaceID == uFaceID)
       return;
     if (!node_id &&
@@ -1337,10 +1335,8 @@
         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);
+        nodes[num_nodes].field_C._43F9E1(pBLVRenderParams->uViewportX, pBLVRenderParams->uViewportY,
+                                         pBLVRenderParams->uViewportZ, pBLVRenderParams->uViewportW);
         AddBspNodeToRenderList(++num_nodes - 1);
         return;
       }
@@ -1381,7 +1377,7 @@
 	  //savegame: qw , 0Bh and 0x1D4h
 	  //problem here when standing near/on portal, condition is false because of face_min_screenspace_x > p->uViewportZ
       if (face_max_screenspace_x >= p->uViewportX &&
-//          face_min_screenspace_x <= p->uViewportZ &&
+          face_min_screenspace_x <= p->uViewportZ &&
           face_max_screenspace_y >= p->uViewportY &&
           face_min_screenspace_y <= p->uViewportW &&
           sub_424829(num_vertices, &nodes[num_nodes].field_C, &p->field_C, uFaceID))
--- a/Viewport.cpp	Sun Jun 09 17:35:10 2013 +0200
+++ b/Viewport.cpp	Sun Jun 09 21:48:48 2013 +0600
@@ -180,61 +180,59 @@
 
 //----- (00443365) --------------------------------------------------------
 void ViewingParams::_443365()
-    {
-  
-    Vec3_short_ *v3; // eax@4
-    Vec3_short_ *v6; // eax@12
-    int minimum_y; // [sp+10h] [bp-10h]@2
-    int maximum_y; // [sp+14h] [bp-Ch]@2
-    int minimum_x; // [sp+18h] [bp-8h]@2
-     int maximum_x; // [sp+1Ch] [bp-4h]@2
+{
+  Vec3_short_ *v3; // eax@4
+  Vec3_short_ *v6; // eax@12
+  int minimum_y; // [sp+10h] [bp-10h]@2
+  int maximum_y; // [sp+14h] [bp-Ch]@2
+  int minimum_x; // [sp+18h] [bp-8h]@2
+  int maximum_x; // [sp+1Ch] [bp-4h]@2
 
- 
-    InitGrayPalette();
-    if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
-        {
-        minimum_x = 0x40000000;
-        minimum_y = 0x40000000;
+  InitGrayPalette();
+  if ( uCurrentlyLoadedLevelType == LEVEL_Indoor )
+  {
+    minimum_x = 0x40000000;
+    minimum_y = 0x40000000;
 
-        maximum_x = -0x40000000;
-        maximum_y = -0x40000000;
-        for (int i=0; i<pIndoor->pMapOutlines->uNumOutlines; ++i)
-            {
-            v3 = &pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uFace1ID];
+    maximum_x = -0x40000000;
+    maximum_y = -0x40000000;
+    for (int i=0; i<pIndoor->pMapOutlines->uNumOutlines; ++i)
+    {
+      v3 = &pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uFace1ID];
 
-            if ( v3->x < minimum_x )
-                minimum_x = v3->x;
-            if ( v3->x > maximum_x )
-                maximum_x = v3->x;
-            if ( v3->y < minimum_y )
-                minimum_y = v3->x;
-            if ( v3->y > maximum_y )
-                maximum_y = v3->x;
+      if ( v3->x < minimum_x )
+        minimum_x = v3->x;
+      if ( v3->x > maximum_x )
+        maximum_x = v3->x;
+      if ( v3->y < minimum_y )
+        minimum_y = v3->x;
+      if ( v3->y > maximum_y )
+        maximum_y = v3->x;
 
-            v6 = &pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uFace2ID];
+      v6 = &pIndoor->pVertices[pIndoor->pMapOutlines->pOutlines[i].uFace2ID];
+
+      if ( v6->x < minimum_x )
+        minimum_x = v3->x;
+      if ( v6->x > maximum_x )
+        maximum_x = v3->x;
 
-            if ( v6->x < minimum_x )
-                minimum_x = v3->x;
-            if ( v6->x > maximum_x )
-                maximum_x = v3->x;
- 
-            if ( v6->y < minimum_y )
-                minimum_y = v3->y;
-            if ( v6->y > maximum_y )
-                maximum_y = v3->y;
-            }
+      if ( v6->y < minimum_y )
+        minimum_y = v3->y;
+      if ( v6->y > maximum_y )
+        maximum_y = v3->y;
+    }
 
-        uMinimapZoom = 1024;
-        indoor_center_x = (signed int)(minimum_x + maximum_x) / 2;
-        field_28 = 10;
-        indoor_center_y = (signed int)(minimum_y + maximum_y) / 2;
-        }
-    else
-        {
-        indoor_center_x = 0;
-        indoor_center_y = 0;
-        uMinimapZoom = _576E2C_current_minimap_zoom;
-        field_28 = dword_576E28;
-        }
-    field_2C = 384;
-    }
\ No newline at end of file
+    uMinimapZoom = 1024;
+    indoor_center_x = (signed int)(minimum_x + maximum_x) / 2;
+    field_28 = 10;
+    indoor_center_y = (signed int)(minimum_y + maximum_y) / 2;
+  }
+  else
+  {
+    indoor_center_x = 0;
+    indoor_center_y = 0;
+    uMinimapZoom = _576E2C_current_minimap_zoom;
+    field_28 = dword_576E28;
+  }
+  field_2C = 384;
+}
\ No newline at end of file
--- a/mm7_3.cpp	Sun Jun 09 17:35:10 2013 +0200
+++ b/mm7_3.cpp	Sun Jun 09 21:48:48 2013 +0600
@@ -11018,10 +11018,8 @@
     pBspRenderer->nodes[0].uViewportZ = pBLVRenderParams->uViewportZ;
     pBspRenderer->nodes[0].uViewportY = pBLVRenderParams->uViewportY;
     pBspRenderer->nodes[0].uViewportX = pBLVRenderParams->uViewportX;
-    pBspRenderer->nodes[0].field_C._43F9E1(pBLVRenderParams->uViewportX,
-                                           pBLVRenderParams->uViewportY,
-                                           pBLVRenderParams->uViewportZ,
-                                           pBLVRenderParams->uViewportW);
+    pBspRenderer->nodes[0].field_C._43F9E1(pBLVRenderParams->uViewportX, pBLVRenderParams->uViewportY,
+                                           pBLVRenderParams->uViewportZ, pBLVRenderParams->uViewportW);
     pBspRenderer->nodes[0].uFaceID = -1;
     pBspRenderer->nodes[0].viewing_portal_id = -1;
     pBspRenderer->num_nodes = 1;
@@ -11386,30 +11384,22 @@
 //----- (00440639) --------------------------------------------------------
 void AddBspNodeToRenderList(unsigned int node_id)
 {
-  //int v1; // ebx@1
-  signed int v2; // edi@1
-  BLVSector *v3; // esi@1
-
-  //v1 = sector_id;
-  v2 = 0;
-  v3 = &pIndoor->pSectors[pBspRenderer->nodes[node_id].uSectorID];
+  BLVSector *pSector; // esi@1
+
+  pSector = &pIndoor->pSectors[pBspRenderer->nodes[node_id].uSectorID];
   if ( pRenderer->pRenderD3D )
   {
-    for (uint i = 0; i < v3->uNumNonBSPFaces; ++i)
+    for (uint i = 0; i < pSector->uNumNonBSPFaces; ++i)
       //Log::Warning(L"Non-BSP face: %X", v3->pFaceIDs[v2]);
-      pBspRenderer->AddFaceToRenderList_d3d(node_id, v3->pFaceIDs[i]);
-  }
-  else
-  {
-    if ( v3->uNumNonBSPFaces > 0 )
-    {
-      do
-        pBspRenderer->AddFaceToRenderList_sw(node_id, v3->pFaceIDs[v2++]);
-      while ( v2 < v3->uNumNonBSPFaces );
-    }
-  }
-  if ( v3->field_0 & 0x10 )
-    sub_4406BC(node_id, v3->uFirstBSPNode);
+      pBspRenderer->AddFaceToRenderList_d3d(node_id, pSector->pFaceIDs[i]);
+  }
+  else
+  {
+    for (uint i = 0; i < pSector->uNumNonBSPFaces; ++i)
+      pBspRenderer->AddFaceToRenderList_sw(node_id, pSector->pFaceIDs[i]);
+  }
+  if ( pSector->field_0 & 0x10 )
+    sub_4406BC(node_id, pSector->uFirstBSPNode);
 }
 
 //----- (004406BC) --------------------------------------------------------