changeset 1189:cb365b58a641

Слияние
author Ritor1
date Fri, 07 Jun 2013 11:31:20 +0600
parents 9541e9d1e5fa (diff) 569216b4f54d (current diff)
children d6f9482a09af
files
diffstat 4 files changed, 61 insertions(+), 79 deletions(-) [+]
line wrap: on
line diff
--- a/Indoor.cpp	Fri Jun 07 08:51:31 2013 +0400
+++ b/Indoor.cpp	Fri Jun 07 11:31:20 2013 +0600
@@ -302,11 +302,11 @@
     pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z);
     for (uint i = 0; i < pBspRenderer->num_faces; ++i)
     {
-      v2 = pBspRenderer->faces[i].uNodeID;
-      //if (pBspRenderer->nodes[v2].viewing_portal_id == -1)
+      //v2 = pBspRenderer->faces[i].uNodeID;
+      if (pBspRenderer->nodes[pBspRenderer->faces[i].uNodeID].viewing_portal_id == -1)
         IndoorLocation::ExecDraw_d3d(pBspRenderer->faces[i].uFaceID, nullptr, 4, nullptr);
-      //else
-        //IndoorLocation::ExecDraw_d3d(pBspRenderer->faces[i].uFaceID, pBspRenderer->nodes[v2].std__vector_0007AC, 4, pBspRenderer->nodes[v2].pPortalBounding);
+      else
+        IndoorLocation::ExecDraw_d3d(pBspRenderer->faces[i].uFaceID, pBspRenderer->nodes[pBspRenderer->faces[i].uNodeID].std__vector_0007AC, 4, pBspRenderer->nodes[pBspRenderer->faces[i].uNodeID].pPortalBounding);
     }
   }
   else for (uint j = 0; j < pBspRenderer->num_faces; ++j )
@@ -521,7 +521,7 @@
     }
 
     if (!pVertices ||
-        (pGame->pStru9Instance->_498377(pPortalBounding, 4u, pVertices, static_vertices_F7C228, &uNumVerticesa), uNumVerticesa) )
+        (pGame->pStru9Instance->_498377(pPortalBounding, 4, pVertices, static_vertices_F7C228, &uNumVerticesa), uNumVerticesa) )
     {
       if (pGame->pIndoorCameraD3D->CalcPortalShape(static_vertices_F7C228, &uNumVerticesa,
                      static_vertices_F7B628, pGame->pIndoorCameraD3D->std__vector_000034_prolly_frustrum, 4, false, 0) != 1 || uNumVerticesa )
--- a/mm7_1.cpp	Fri Jun 07 08:51:31 2013 +0400
+++ b/mm7_1.cpp	Fri Jun 07 11:31:20 2013 +0600
@@ -2306,7 +2306,7 @@
 
   //try graphic engine with function returning 1 always, and without
   //return true;
-  if ( !pNumVertices )
+  if ( pNumVertices <= 1 )
     return false;
   v7 = stru_50B700._screen_space_y[0];
   v65 = 0;
@@ -2321,8 +2321,7 @@
     v63 = -1;
     v64 = 1;
   }
-  if ( pNumVertices <= 1 )
-    return false;
+
   for ( v6 = 1; v6 < pNumVertices; ++v6 )
   {
     if ( stru_50B700._screen_space_y[v6] >= v7 )
@@ -2338,33 +2337,29 @@
   }
   if ( v8 == v7 )
     return false;
+
   v10 = v65;
   a2->_viewport_space_y = v7;
   a2->_viewport_space_w = v8;
   v55 = v65;
-  if ( pNumVertices > 0 )
+
+  for ( v68 = 0; v68 < pNumVertices; ++v68 )
   {
-    //v11 = v65;
-    for ( v68 = 0; v68 < pNumVertices; ++v68 )
+    v10 += v64;
+    if ( v10 < pNumVertices )
     {
-      v10 += v64;
-      if ( v10 < pNumVertices )
-      {
-        if ( v10 < 0 )
-          v10 += pNumVertices;
-      }
-      else
-      {
-        v10 -= pNumVertices;
-      }
-      if ( stru_50B700._screen_space_y[v10] <= stru_50B700._screen_space_y[v65] )
-      {
-        v55 = v10;
-        v65 = v10;
-      }
-      if ( stru_50B700._screen_space_y[v10] == v8 )
-        break;
+      if ( v10 < 0 )
+        v10 += pNumVertices;
     }
+    else
+      v10 -= pNumVertices;
+    if ( stru_50B700._screen_space_y[v10] <= stru_50B700._screen_space_y[v65] )
+    {
+      v55 = v10;
+      v65 = v10;
+    }
+    if ( stru_50B700._screen_space_y[v10] == v8 )
+      break;
   }
   v13 = v55 + v64;
   if ( v13 < pNumVertices )
@@ -2373,9 +2368,7 @@
       v13 += pNumVertices;
   }
   else
-  {
     v13 -= pNumVertices;
-  }
   if ( stru_50B700._screen_space_y[v13] != stru_50B700._screen_space_y[v55] )
   {
     v62 = stru_50B700._screen_space_x[v55] << 16;
@@ -2384,29 +2377,24 @@
   }
   v15 = v65;
   v61 = v65;
-  if ( pNumVertices > 0 )
+
+  for ( v69 = 0; v69 < pNumVertices; ++v69 )
   {
-    //v16 = v65;
-    for ( v69 = 0; v69 < pNumVertices; ++v69 )
+    v15 += v63;
+    if ( v15 < pNumVertices )
     {
-      v15 += v63;
-      if ( v15 < pNumVertices )
-      {
-        if ( v15 < 0 )
-          v15 += pNumVertices;
-      }
-      else
-      {
-        v15 -= pNumVertices;
-      }
-      if ( stru_50B700._screen_space_y[v15] <= stru_50B700._screen_space_y[v65] )
-      {
-        v61 = v15;
-        v65 = v15;
-      }
-      if ( stru_50B700._screen_space_y[v15] == v8 )
-        break;
+      if ( v15 < 0 )
+        v15 += pNumVertices;
     }
+    else
+      v15 -= pNumVertices;
+    if ( stru_50B700._screen_space_y[v15] <= stru_50B700._screen_space_y[v65] )
+    {
+      v61 = v15;
+      v65 = v15;
+    }
+    if ( stru_50B700._screen_space_y[v15] == v8 )
+      break;
   }
   v18 = v63 + v61;
   if ( v18 < pNumVertices )
@@ -2415,9 +2403,7 @@
       v18 += pNumVertices;
   }
   else
-  {
     v18 -= pNumVertices;
-  }
   v19 = v18;
   v20 = v61;
   if ( stru_50B700._screen_space_y[v19] != stru_50B700._screen_space_y[v61] )
@@ -2443,9 +2429,7 @@
             v13 += pNumVertices;
         }
         else
-        {
           v13 -= pNumVertices;
-        }
         v26 = v13;
         //v27 = stru_50B700._screen_space_y[v26] - stru_50B700._screen_space_y[v24];
         if ( stru_50B700._screen_space_y[v26] - stru_50B700._screen_space_y[v24] > 0 )
@@ -2464,9 +2448,7 @@
             v18 += pNumVertices;
         }
         else
-        {
           v18 -= pNumVertices;
-        }
         v31 = v18;
         //v32 = stru_50B700._screen_space_y[v31] - stru_50B700._screen_space_y[v29];
         if ( stru_50B700._screen_space_y[v31] - stru_50B700._screen_space_y[v29] > 0 )
--- a/stru9.cpp	Fri Jun 07 08:51:31 2013 +0400
+++ b/stru9.cpp	Fri Jun 07 11:31:20 2013 +0600
@@ -6,7 +6,7 @@
 
 
 //----- (00498377) --------------------------------------------------------
-bool stru9::_498377(struct RenderVertexSoft *pPortalBounding, unsigned int uNumVertices, struct IndoorCameraD3D_Vec4 *a3, struct RenderVertexSoft *pVertices, unsigned int *pOutNumVertices)
+bool stru9::_498377(struct RenderVertexSoft *pPortalBounding, unsigned int uNumVertices, struct IndoorCameraD3D_Vec4 *pVertices, struct RenderVertexSoft *pVertices2, unsigned int *pOutNumVertices)
 {
   int result; // eax@7
   //unsigned int *v7; // ebx@7
@@ -19,7 +19,7 @@
   //VertexBuffer *v14; // edx@26
   //char *v15; // eax@26
   //unsigned int i; // ecx@26
-  int v17; // [sp+0h] [bp-28h]@9
+  //int v17; // [sp+0h] [bp-28h]@9
   //char *v18; // [sp+10h] [bp-18h]@8
   RenderVertexSoft *v19; // [sp+14h] [bp-14h]@0
   //RenderVertexSoft *v20; // [sp+18h] [bp-10h]@0
@@ -59,7 +59,7 @@
     //VertexBuffer::VertexBuffer(&static_AE33A0);
   }*/
 
-  result = 0;
+  result = false;
   //v7 = pOutNumVertices;
   v21 = 0;
   if ( (signed int)uNumVertices <= 0 )
@@ -71,11 +71,11 @@
   //v8 = (char *)&a3->y;
   //v18 = (char *)&a3->y;
   //do
-  for (v17 = 0; v17 < uNumVertices; v17++ )
+  for (uint j = 0; j < uNumVertices; j++ )
   {
     //v17 = result + 1;
-    result = v17;
-    v9 = &pPortalBounding[(result + 1) % (signed int)uNumVertices];
+    result = j;
+    v9 = &pPortalBounding[(j + 1) % (signed int)uNumVertices];
     if ( pPortalBounding->vWorldPosition.x != v9->vWorldPosition.x
       || pPortalBounding->vWorldPosition.y != v9->vWorldPosition.y
       || pPortalBounding->vWorldPosition.z != v9->vWorldPosition.z )
@@ -86,9 +86,9 @@
       //result = 0;
       static_AE33A0.uNumVertices = 0;
       //a3a = 0;
-      static_AE3FA4.x = a3->x;
-      static_AE3FA4.y = a3->y;
-      static_AE3FA4.z = a3->z;
+      static_AE3FA4.x = pVertices->x;
+      static_AE3FA4.y = pVertices->y;
+      static_AE3FA4.z = pVertices->z;
       if ( (signed int)*pOutNumVertices <= 0 )
       {
         *pOutNumVertices = 0;
@@ -100,17 +100,17 @@
         //v12 = &pVertices[result];
         if ( result )
         {
-          if ( _4989E1(&pVertices[i], &pVertices[i], pPortalBounding, &static_AE3FA4) 
-            && _498774(&pVertices[i], &pVertices[i], pPortalBounding, &static_AE3FA4, &static_AE3FB4) )
+          if ( _4989E1(&pVertices2[i], &pVertices2[i], pPortalBounding, &static_AE3FA4) 
+            && _498774(&pVertices2[i], &pVertices2[i], pPortalBounding, &static_AE3FA4, &static_AE3FB4) )
             AddVertex(&static_AE33A0, &static_AE3FB4);
         }
         else
         {
-          v19 = &pVertices[i];
+          v19 = &pVertices2[i];
         }
         //v20 = v12;
-        if ( AreVectorsCollinear(&pVertices[i], pPortalBounding, &static_AE3FA4) )//
-          AddVertex(&static_AE33A0, &pVertices[i]);
+        if ( AreVectorsCollinear(&pVertices2[i], pPortalBounding, &static_AE3FA4) )//
+          AddVertex(&static_AE33A0, &pVertices2[i]);
         //pOutNumVertices = pOutNumVertices;
         //a3a++;
       }
@@ -120,17 +120,17 @@
           *pOutNumVertices = 0;
           return true;
         }
-      if ( _4989E1(&pVertices[result], v19, pPortalBounding, &static_AE3FA4)
-        && _498774(&pVertices[result], v19, pPortalBounding, &static_AE3FA4, &static_AE3FB4) )
+      if ( _4989E1(&pVertices2[result], v19, pPortalBounding, &static_AE3FA4)
+        && _498774(&pVertices2[result], v19, pPortalBounding, &static_AE3FA4, &static_AE3FB4) )
         AddVertex(&static_AE33A0, &static_AE3FB4);
 
       for (uint i = 0; i < static_AE33A0.uNumVertices; ++i)
       {
-        pVertices[i].vWorldPosition.x = static_AE33A0.pVertices[i].vWorldPosition.x;
-        pVertices[i].vWorldPosition.y = static_AE33A0.pVertices[i].vWorldPosition.y;
-        pVertices[i].vWorldPosition.z = static_AE33A0.pVertices[i].vWorldPosition.z;
-        pVertices[i].u = static_AE33A0.pVertices[i].u;
-        pVertices[i].v = static_AE33A0.pVertices[i].v;
+        pVertices2[i].vWorldPosition.x = static_AE33A0.pVertices[i].vWorldPosition.x;
+        pVertices2[i].vWorldPosition.y = static_AE33A0.pVertices[i].vWorldPosition.y;
+        pVertices2[i].vWorldPosition.z = static_AE33A0.pVertices[i].vWorldPosition.z;
+        pVertices2[i].u = static_AE33A0.pVertices[i].u;
+        pVertices2[i].v = static_AE33A0.pVertices[i].v;
       }
 
       //v13 = static_AE33A0.uNumVertices;
@@ -163,7 +163,7 @@
     }
     //result = v17;
     ++pPortalBounding;
-    a3++;
+    pVertices++;
     //v18 = (char *)&a3->y;
   }
   //while ( v17 < (signed int)uNumVertices );
--- a/stru9.h	Fri Jun 07 08:51:31 2013 +0400
+++ b/stru9.h	Fri Jun 07 11:31:20 2013 +0600
@@ -51,7 +51,7 @@
   {}
 
   bool _4980B9(struct RenderVertexSoft *a1, unsigned int uNumVertices, float a3, float a4, float a5, struct RenderVertexSoft *pOutVertices, unsigned int *pOutNumVertices);
-  bool _498377(struct RenderVertexSoft *pPortalBounding, unsigned int uNumVertices, struct IndoorCameraD3D_Vec4 *a3, struct RenderVertexSoft *pVertices, unsigned int *pOutNumVertices);
+  bool _498377(struct RenderVertexSoft *pPortalBounding, unsigned int uNumVertices, struct IndoorCameraD3D_Vec4 *pVertices, struct RenderVertexSoft *pVertices2, unsigned int *pOutNumVertices);
   bool CalcPortalShape(struct RenderVertexSoft *a1, signed int a2, struct RenderVertexSoft *a3, unsigned int *pOutNumVertices, struct Vec3_float_ *a5, float a6, char *a7, int unused);
   void AddVertex(struct VertexBuffer *pVertexBuffer, struct RenderVertexSoft *pVertex);
   bool _498774(struct RenderVertexSoft *a1, struct RenderVertexSoft *a2, struct RenderVertexSoft *a3, struct stru312 *a4, struct RenderVertexSoft *a5);