changeset 1081:6ea7c693a1cf

Merge
author Gloval
date Sat, 25 May 2013 23:51:56 +0400
parents 9456f2ed5ff9 (current diff) 81a30c2e3e0a (diff)
children 7033eb155558
files
diffstat 6 files changed, 244 insertions(+), 197 deletions(-) [+]
line wrap: on
line diff
--- a/DecalBuilder.cpp	Sat May 25 23:50:56 2013 +0400
+++ b/DecalBuilder.cpp	Sat May 25 23:51:56 2013 +0400
@@ -449,6 +449,7 @@
 {
   double v7; // st7@12
 
+  uNumDecals = 0;  
   if (!pBloodsplatContainer->std__vector_pBloodsplats_size)
     return true;
   
@@ -458,7 +459,6 @@
     return true;
   if (pFace->Fluid())
     return true;
-
   for (uint i = 0; i < pBloodsplatContainer->std__vector_pBloodsplats_size; ++i)
   {
     auto pBloodsplat = pBloodsplatContainer->std__vector_pBloodsplats + i;
--- a/Indoor.cpp	Sat May 25 23:50:56 2013 +0400
+++ b/Indoor.cpp	Sat May 25 23:51:56 2013 +0400
@@ -5,6 +5,7 @@
 #include "ParticleEngine.h"
 #include "stru9.h"
 #include "stru10.h"
+#include "stru367.h"
 
 #include "BSPModel.h"
 #include "Outdoor.h"
@@ -1356,21 +1357,21 @@
     if (num_vertices < 2)
       return;
 
-    auto face_min_screenspace_x = _50BAC8_screen_space_x[0],
-         face_max_screenspace_x = _50BAC8_screen_space_x[0];
-    auto face_min_screenspace_y = _50B9D8_screen_space_y[0],
-         face_max_screenspace_y = _50B9D8_screen_space_y[0];
+    auto face_min_screenspace_x = stru_50B700._screen_space_x[0],
+         face_max_screenspace_x = stru_50B700._screen_space_x[0];
+    auto face_min_screenspace_y = stru_50B700._screen_space_y[0],
+         face_max_screenspace_y = stru_50B700._screen_space_y[0];
     for (uint i = 1; i < num_vertices; ++i)
     {
-      if (face_min_screenspace_x > _50BAC8_screen_space_x[i])
-        face_min_screenspace_x = _50BAC8_screen_space_x[i];
-      if (face_max_screenspace_x < _50BAC8_screen_space_x[i])
-        face_max_screenspace_x = _50BAC8_screen_space_x[i];
-
-      if (face_min_screenspace_y > _50B9D8_screen_space_y[i])
-        face_min_screenspace_y = _50B9D8_screen_space_y[i];
-      if (face_max_screenspace_y < _50B9D8_screen_space_y[i])
-        face_max_screenspace_y = _50B9D8_screen_space_y[i];
+      if (face_min_screenspace_x > stru_50B700._screen_space_x[i])
+        face_min_screenspace_x = stru_50B700._screen_space_x[i];
+      if (face_max_screenspace_x < stru_50B700._screen_space_x[i])
+        face_max_screenspace_x = stru_50B700._screen_space_x[i];
+
+      if (face_min_screenspace_y > stru_50B700._screen_space_y[i])
+        face_min_screenspace_y = stru_50B700._screen_space_y[i];
+      if (face_max_screenspace_y < stru_50B700._screen_space_y[i])
+        face_max_screenspace_y = stru_50B700._screen_space_y[i];
     }
 
       if (face_max_screenspace_x >= p->uViewportX &&
@@ -1511,25 +1512,25 @@
       v19 = v10;
       if ( v10 )
       {
-        v11 = _50BAC8_screen_space_x[0];
-        v12 = _50B9D8_screen_space_y[0];
-        v23 = _50BAC8_screen_space_x[0];
+        v11 = stru_50B700._screen_space_x[0];
+        v12 = stru_50B700._screen_space_y[0];
+        v23 = stru_50B700._screen_space_x[0];
         v13 = 1;
-        v22 = _50B9D8_screen_space_y[0];
+        v22 = stru_50B700._screen_space_y[0];
         if ( v10 > 1 )
         {
           do
           {
-            v14 = _50BAC8_screen_space_x[v13];
+            v14 = stru_50B700._screen_space_x[v13];
             if ( v14 < v23 )
-              v23 = _50BAC8_screen_space_x[v13];
+              v23 = stru_50B700._screen_space_x[v13];
             if ( v14 > v11 )
-              v11 = _50BAC8_screen_space_x[v13];
-            v15 = _50B9D8_screen_space_y[v13];
+              v11 = stru_50B700._screen_space_x[v13];
+            v15 = stru_50B700._screen_space_y[v13];
             if ( v15 < v22 )
-              v22 = _50B9D8_screen_space_y[v13];
+              v22 = stru_50B700._screen_space_y[v13];
             if ( v15 > v12 )
-              v12 = _50B9D8_screen_space_y[v13];
+              v12 = stru_50B700._screen_space_y[v13];
             v10 = v19;
             ++v13;
           }
--- a/mm7_1.cpp	Sat May 25 23:50:56 2013 +0400
+++ b/mm7_1.cpp	Sat May 25 23:51:56 2013 +0400
@@ -35,6 +35,7 @@
 #include "texts.h"
 #include "UIHouses.h"
 #include "mm7_data.h"
+#include "stru367.h"
 
 int __stdcall aWinProc(HWND hWnd, UINT Msg, WPARAM wParam, unsigned int lParam);
 int __stdcall InsertMM7CDDialogFunc(HWND hDlg, int a2, __int16 a3, int a4);
@@ -1582,11 +1583,11 @@
      + v1->pFacePlane_old.vNormal.y * (v2->y - pBLVRenderParams->vPartyPos.y)
      + v1->pFacePlane_old.vNormal.z * (v2->z - pBLVRenderParams->vPartyPos.z) < 0 )
   {
-    dword_50B700 = 1;
+    stru_50B700.field_0 = 1;
   }
   else
   {
-    dword_50B700 = 0;
+    stru_50B700.field_0 = 0;
     if ( !v1->Portal() )
       return 0;
   }
@@ -1598,9 +1599,9 @@
         v6->x,
         v6->y,
         v6->z,
-        &_50B924_view_transformed_xs[i],
-        &_50B834_view_transformed_zs[i],
-        &_50B744_view_transformed_ys[i],
+        &stru_50B700._view_transformed_xs[i],
+        &stru_50B700._view_transformed_zs[i],
+        &stru_50B700._view_transformed_ys[i],
         0);
   }
 
@@ -1611,7 +1612,7 @@
 
   bool bFound = false;
   for (uint i = 0; i < v1->uNumVertices; ++i)
-    if (_50B924_view_transformed_xs[i] >= 0x80000u)
+    if (stru_50B700._view_transformed_xs[i] >= 0x80000u)
     {
       bFound = true;
       break;
@@ -1620,27 +1621,27 @@
     return 0;
 
   v79 = 0;
-  _50B924_view_transformed_xs[v1->uNumVertices] = _50B924_view_transformed_xs[0];
-  _50B834_view_transformed_zs[v1->uNumVertices] = _50B834_view_transformed_zs[0];
-  _50B744_view_transformed_ys[v1->uNumVertices] = _50B744_view_transformed_ys[0];
-  thisa = _50B924_view_transformed_xs[0] >= (signed int)0x80000u;
+  stru_50B700._view_transformed_xs[v1->uNumVertices] = stru_50B700._view_transformed_xs[0];
+  stru_50B700._view_transformed_zs[v1->uNumVertices] = stru_50B700._view_transformed_zs[0];
+  stru_50B700._view_transformed_ys[v1->uNumVertices] = stru_50B700._view_transformed_ys[0];
+  thisa = stru_50B700._view_transformed_xs[0] >= (signed int)0x80000u;
   //int i = 1;
   for (uint i = 1; i <= v1->uNumVertices; ++i)
   {
-      v10 = _50B924_view_transformed_xs[i];
+      v10 = stru_50B700._view_transformed_xs[i];
       v81 = v10 >= (signed int)0x80000u;
       if ( thisa ^ v81 )
       {
-        v11 = _50B924_view_transformed_xs[i - 1];
+        v11 = stru_50B700._view_transformed_xs[i - 1];
         if ( v10 >= (signed int)0x80000u )
         {
           v12 = v10 - v11;
           v13 = 0x80000 - v11;
           LODWORD(v14) = v13 << 16;
           HIDWORD(v14) = v13 >> 16;
-          v15 = &_50B744_view_transformed_ys[i - 1];
-          dword_50B828[v79] = ((unsigned __int64)((_50B834_view_transformed_zs[i] - _50B834_view_transformed_zs[i - 1]) * v14 / v12) >> 16) + _50B834_view_transformed_zs[i - 1];
-          thisb = (unsigned __int64)((_50B744_view_transformed_ys[i] - _50B744_view_transformed_ys[i - 1]) * v14 / v12) >> 16;
+          v15 = &stru_50B700._view_transformed_ys[i - 1];
+          stru_50B700.field_128[v79] = ((unsigned __int64)((stru_50B700._view_transformed_zs[i] - stru_50B700._view_transformed_zs[i - 1]) * v14 / v12) >> 16) + stru_50B700._view_transformed_zs[i - 1];
+          thisb = (unsigned __int64)((stru_50B700._view_transformed_ys[i] - stru_50B700._view_transformed_ys[i - 1]) * v14 / v12) >> 16;
         }
         else
         {
@@ -1648,93 +1649,93 @@
           v17 = 0x80000 - v10;
           LODWORD(v18) = v17 << 16;
           HIDWORD(v18) = v17 >> 16;
-          v15 = &_50B744_view_transformed_ys[i];
-          dword_50B828[v79] = ((unsigned __int64)((_50B834_view_transformed_zs[i - 1] - _50B834_view_transformed_zs[i]) * v18 / v16) >> 16) + _50B834_view_transformed_zs[i];
-          thisb = (unsigned __int64)((_50B744_view_transformed_ys[i - 1] - _50B744_view_transformed_ys[i]) * v18 / v16) >> 16;
+          v15 = &stru_50B700._view_transformed_ys[i];
+          stru_50B700.field_128[v79] = ((unsigned __int64)((stru_50B700._view_transformed_zs[i - 1] - stru_50B700._view_transformed_zs[i]) * v18 / v16) >> 16) + stru_50B700._view_transformed_zs[i];
+          thisb = (unsigned __int64)((stru_50B700._view_transformed_ys[i - 1] - stru_50B700._view_transformed_ys[i]) * v18 / v16) >> 16;
         }
         v19 = v79++;
         //v7 = v66;
-        dword_50B738[v19] = thisb + *v15;
-        dword_50B918[v19] = 0x80000u;
+        stru_50B700.field_38[v19] = thisb + *v15;
+        stru_50B700.field_218[v19] = 0x80000u;
       }
       if ( v81 )
       {
         v20 = v79++;
-        dword_50B918[v20] = _50B924_view_transformed_xs[i];
-        dword_50B828[v20] = _50B834_view_transformed_zs[i];
-        dword_50B738[v20] = _50B744_view_transformed_ys[i];
+        stru_50B700.field_218[v20] = stru_50B700._view_transformed_xs[i];
+        stru_50B700.field_128[v20] = stru_50B700._view_transformed_zs[i];
+        stru_50B700.field_38[v20] = stru_50B700._view_transformed_ys[i];
       }
       //++i;
       thisa = v81;
   }
   v21 = v79;
-  dword_50B918[v79] = dword_50B918[0];
-  dword_50B828[v79] = dword_50B828[0];
-  dword_50B738[v79] = dword_50B738[0];
+  stru_50B700.field_218[v79] = stru_50B700.field_218[0];
+  stru_50B700.field_128[v79] = stru_50B700.field_128[0];
+  stru_50B700.field_38[v79] = stru_50B700.field_38[0];
   for (ia = 0; ia < v79; ++ia)
   {
     v22 = ia;
-    thisc = abs(dword_50B918[ia]);
-    if ( abs(dword_50B828[ia]) >> 13 <= thisc )
+    thisc = abs(stru_50B700.field_218[ia]);
+    if ( abs(stru_50B700.field_128[ia]) >> 13 <= thisc )
     {
-      v27 = dword_50B828[v22];
+      v27 = stru_50B700.field_128[v22];
       LODWORD(v28) = v27 << 16;
       HIDWORD(v28) = v27 >> 16;
-      v26 = v28 / dword_50B918[v22];
+      v26 = v28 / stru_50B700.field_218[v22];
       v23 = 0;
     }
     else
     {
       v23 = 0;
       v24 = 0;
-      if ( dword_50B828[v22] >= 0 )
+      if ( stru_50B700.field_128[v22] >= 0 )
       {
-        LOBYTE(v24) = dword_50B918[v22] >= 0;
+        LOBYTE(v24) = stru_50B700.field_218[v22] >= 0;
         v26 = ((v24 - 1) & 0xFF800000) + 0x400000;
       }
       else
       {
-        LOBYTE(v24) = dword_50B918[v22] >= 0;
+        LOBYTE(v24) = stru_50B700.field_218[v22] >= 0;
         v25 = v24 - 1;
         v26 = (v25 & 0x800000) - 0x400000;
       }
     }
-    v29 = dword_50B738[v22];
-    dword_50BAF8_xs[v22] = v26;
+    v29 = stru_50B700.field_38[v22];
+    stru_50B700._xs3[v22] = v26;
     if ( abs(v29) >> 13 <= thisc )
     {
-      v33 = dword_50B738[v22];
+      v33 = stru_50B700.field_38[v22];
       LODWORD(v34) = v33 << 16;
       HIDWORD(v34) = v33 >> 16;
-      v32 = v34 / dword_50B918[v22];
+      v32 = v34 / stru_50B700.field_218[v22];
     }
     else
     {
       v30 = 0;
-      if ( dword_50B738[v22] >= v23 )
+      if ( stru_50B700.field_38[v22] >= v23 )
       {
-        LOBYTE(v30) = dword_50B918[v22] >= v23;
+        LOBYTE(v30) = stru_50B700.field_218[v22] >= v23;
         v32 = ((v30 - 1) & 0xFF800000) + 0x400000;
       }
       else
       {
-        LOBYTE(v30) = dword_50B918[v22] >= v23;
+        LOBYTE(v30) = stru_50B700.field_218[v22] >= v23;
         v31 = v30 - 1;
         v32 = (v31 & 0x800000) - 0x400000;
       }
     }
-    dword_50BA08_ys[v22] = v32;
-    dword_50BAF8_xs[v22] = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) * (signed __int64)dword_50BAF8_xs[v22]) >> 16;
-    v35 = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) * (signed __int64)dword_50BA08_ys[v22]) >> 16;
-    dword_50BAF8_xs[v22] = pBLVRenderParams->uViewportCenterX - dword_50BAF8_xs[v22];
-    dword_50BA08_ys[v22] = pBLVRenderParams->uViewportCenterY - v35;
+    stru_50B700._ys2[v22] = v32;
+    stru_50B700._xs3[v22] = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) * (signed __int64)stru_50B700._xs3[v22]) >> 16;
+    v35 = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) * (signed __int64)stru_50B700._ys2[v22]) >> 16;
+    stru_50B700._xs3[v22] = pBLVRenderParams->uViewportCenterX - stru_50B700._xs3[v22];
+    stru_50B700._ys2[v22] = pBLVRenderParams->uViewportCenterY - v35;
   }
   v36 = 0;
-  dword_50BAF8_xs[v21] = dword_50BAF8_xs[0];
-  dword_50BA08_ys[v21] = dword_50BA08_ys[0];
+  stru_50B700._xs3[v21] = stru_50B700._xs3[0];
+  stru_50B700._ys2[v21] = stru_50B700._ys2[0];
   v37 = pBLVRenderParams->uViewportX;
-  v38 = dword_50BAF8_xs[0] < (signed int)pBLVRenderParams->uViewportX;
-  LOBYTE(v38) = dword_50BAF8_xs[0] >= (signed int)pBLVRenderParams->uViewportX;
+  v38 = stru_50B700._xs3[0] < (signed int)pBLVRenderParams->uViewportX;
+  LOBYTE(v38) = stru_50B700._xs3[0] >= (signed int)pBLVRenderParams->uViewportX;
   v39 = 1;
   ib = 1;
   if ( v79 < 1 )
@@ -1742,30 +1743,30 @@
   do
   {
     v40 = v39;
-    v41 = dword_50BAF8_xs[v40];
+    v41 = stru_50B700._xs3[v40];
     v82 = v41 >= (signed int)v37;
     if ( v38 ^ v82 )
     {
       if ( v41 >= (signed int)v37 )
       {
-        v67 = (signed int)(v37 - dword_50BAF8_xs[v40 - 1]) * (signed __int64)(dword_50BA08_ys[v40] - dword_50BA08_ys[v40 - 1]) / (v41 - dword_50BAF8_xs[v40 - 1]);
-        v42 = dword_50BA08_ys[v40 - 1];
+        v67 = (signed int)(v37 - stru_50B700._xs3[v40 - 1]) * (signed __int64)(stru_50B700._ys2[v40] - stru_50B700._ys2[v40 - 1]) / (v41 - stru_50B700._xs3[v40 - 1]);
+        v42 = stru_50B700._ys2[v40 - 1];
       }
       else
       {
-        v67 = (signed int)(v37 - v41) * (signed __int64)(dword_50BA08_ys[v40 - 1] - dword_50BA08_ys[v40]) / (dword_50BAF8_xs[v40 - 1] - v41);
-        v42 = dword_50BA08_ys[v40];
+        v67 = (signed int)(v37 - v41) * (signed __int64)(stru_50B700._ys2[v40 - 1] - stru_50B700._ys2[v40]) / (stru_50B700._xs3[v40 - 1] - v41);
+        v42 = stru_50B700._ys2[v40];
       }
-      dword_50B9FC_ys[v36] = v67 + v42;
+      stru_50B700._ys[v36] = v67 + v42;
       v37 = pBLVRenderParams->uViewportX;
-      dword_50BAEC_xs[v36] = pBLVRenderParams->uViewportX;
+      stru_50B700._xs2[v36] = pBLVRenderParams->uViewportX;
       ++v36;
     }
     v38 = v82;
     if ( v82 )
     {
-      dword_50BAEC_xs[v36] = dword_50BAF8_xs[v40];
-      dword_50B9FC_ys[v36] = dword_50BA08_ys[v40];
+      stru_50B700._xs2[v36] = stru_50B700._xs3[v40];
+      stru_50B700._ys[v36] = stru_50B700._ys2[v40];
       ++v36;
     }
     v39 = ib++ + 1;
@@ -1776,38 +1777,38 @@
     return 0;
 
   v43 = 0;
-  dword_50BAEC_xs[v36] = dword_50BAEC_xs[0];
-  dword_50B9FC_ys[v36] = dword_50B9FC_ys[0];
+  stru_50B700._xs2[v36] = stru_50B700._xs2[0];
+  stru_50B700._ys[v36] = stru_50B700._ys[0];
   v44 = pBLVRenderParams->uViewportZ;
-  thisd = dword_50BAEC_xs[0] <= (signed int)pBLVRenderParams->uViewportZ;
+  thisd = stru_50B700._xs2[0] <= (signed int)pBLVRenderParams->uViewportZ;
   ic = 1;
 
   do
   {
     v45 = ic;
-    v46 = dword_50BAEC_xs[ic];
+    v46 = stru_50B700._xs2[ic];
     v83 = v46 <= (signed int)v44;
     if ( thisd ^ v83 )
     {
       if ( v46 <= (signed int)v44 )
       {
-        v68 = (signed int)(v44 - dword_50BAEC_xs[v45 - 1]) * (signed __int64)(dword_50B9FC_ys[v45] - dword_50B9FC_ys[v45 - 1]) / (v46 - dword_50BAEC_xs[v45 - 1]);
-        v47 = dword_50B9FC_ys[v45 - 1];
+        v68 = (signed int)(v44 - stru_50B700._xs2[v45 - 1]) * (signed __int64)(stru_50B700._ys[v45] - stru_50B700._ys[v45 - 1]) / (v46 - stru_50B700._xs2[v45 - 1]);
+        v47 = stru_50B700._ys[v45 - 1];
       }
       else
       {
-        v68 = (signed int)(v44 - v46) * (signed __int64)(dword_50B9FC_ys[v45 - 1] - dword_50B9FC_ys[v45]) / (dword_50BAEC_xs[v45 - 1] - v46);
-        v47 = dword_50B9FC_ys[v45];
+        v68 = (signed int)(v44 - v46) * (signed __int64)(stru_50B700._ys[v45 - 1] - stru_50B700._ys[v45]) / (stru_50B700._xs2[v45 - 1] - v46);
+        v47 = stru_50B700._ys[v45];
       }
-      dword_50B9F0[v43] = v68 + v47;
+      stru_50B700.field_2F0[v43] = v68 + v47;
       v44 = pBLVRenderParams->uViewportZ;
-      dword_50BAE0[v43] = pBLVRenderParams->uViewportZ;
+      stru_50B700._xs[v43] = pBLVRenderParams->uViewportZ;
       ++v43;
     }
     if ( v83 )
     {
-      dword_50BAE0[v43] = dword_50BAEC_xs[v45];
-      dword_50B9F0[v43++] = dword_50B9FC_ys[v45];
+      stru_50B700._xs[v43] = stru_50B700._xs2[v45];
+      stru_50B700.field_2F0[v43++] = stru_50B700._ys[v45];
     }
     ++ic;
     thisd = v83;
@@ -1818,40 +1819,41 @@
     return 0;
 
   v48 = 0;
-  dword_50BAE0[v43] = dword_50BAE0[0];
-  dword_50B9F0[v43] = dword_50B9F0[0];
+  stru_50B700._xs[v43] = stru_50B700._xs[0];
+  stru_50B700.field_2F0[v43] = stru_50B700.field_2F0[0];
   v49 = pBLVRenderParams->uViewportY;
-  v50 = dword_50B9F0[0] < (signed int)pBLVRenderParams->uViewportY;
-  LOBYTE(v50) = dword_50B9F0[0] >= (signed int)pBLVRenderParams->uViewportY;
+  v50 = stru_50B700.field_2F0[0] < (signed int)pBLVRenderParams->uViewportY;
+  LOBYTE(v50) = stru_50B700.field_2F0[0] >= (signed int)pBLVRenderParams->uViewportY;
   v51 = 1;
   id = 1;
   do
   {
     v52 = v51;
-    v53 = dword_50B9F0[v52];
+    v53 = stru_50B700.field_2F0[v52];
     v84 = v53 >= (signed int)v49;
     if ( v50 ^ v84 )
     {
       if ( v53 >= (signed int)v49 )
       {
-        v69 = (signed int)(v49 - dword_50B9F0[v52 - 1]) * (signed __int64)(dword_50BAE0[v52] - dword_50BAE0[v52 - 1]) / (v53 - dword_50B9F0[v52 - 1]);
-        v54 = dword_50BAE0[v52 - 1];
+        v69 = (signed int)(v49 - stru_50B700.field_2F0[v52 - 1]) * (signed __int64)(stru_50B700._xs[v52] - stru_50B700._xs[v52 - 1]) / (v53 - stru_50B700.field_2F0[v52 - 1]);
+        v54 = stru_50B700._xs[v52 - 1];
       }
       else
       {
-        v69 = (signed int)(v49 - v53) * (signed __int64)(dword_50BAE0[v52 - 1] - dword_50BAE0[v52]) / (dword_50B9F0[v52 - 1] - v53);
-        v54 = dword_50BAE0[v52];
+        v69 = (signed int)(v49 - v53) * (signed __int64)(stru_50B700._xs[v52 - 1] - stru_50B700._xs[v52]) / (stru_50B700.field_2F0[v52 - 1] - v53);
+        v54 = stru_50B700._xs[v52];
       }
-      dword_50BAD4[v48] = v69 + v54;
+      stru_50B700.field_3D4[v48] = v69 + v54;
       v49 = pBLVRenderParams->uViewportY;
-      dword_50B9E4[v48] = pBLVRenderParams->uViewportY;
+      stru_50B700._xs[v48+1] = pBLVRenderParams->uViewportY;
       ++v48;
     }
     v50 = v84;
     if ( v84 )
     {
-      dword_50BAD4[v48] = dword_50BAE0[v52];
-      dword_50B9E4[v48++] = dword_50B9F0[v52];
+      stru_50B700.field_3D4[v48] = stru_50B700._xs[v52];
+      stru_50B700._xs[v48+1] = stru_50B700.field_2F0[v52];
+	  v48++;
     }
     v51 = id++ + 1;
   }
@@ -1861,37 +1863,37 @@
     return 0;
 
   v55 = 0;
-  dword_50BAD4[v48] = dword_50BAD4[0];
-  dword_50B9E4[v48] = dword_50B9E4[0];
+  stru_50B700.field_3D4[v48] = stru_50B700.field_3D4[0];
+  stru_50B700._xs[v48+1] = stru_50B700._xs[1];
   v56 = pBLVRenderParams->uViewportW;
-  thise = dword_50B9E4[0] <= (signed int)pBLVRenderParams->uViewportW;
+  thise = stru_50B700._xs[1] <= (signed int)pBLVRenderParams->uViewportW;
   ie = 1;
   do
   {
     v57 = ie;
-    v58 = dword_50B9E4[ie];
+    v58 = stru_50B700._xs[ie+1];
     v85 = v58 <= (signed int)v56;
     if ( thise ^ v85 )
     {
       if ( v58 <= (signed int)v56 )
       {
-        v70 = (signed int)(v56 - dword_50B9E4[v57 - 1]) * (signed __int64)(dword_50BAD4[v57] - dword_50BAD4[v57 - 1]) / (v58 - dword_50B9E4[v57 - 1]);
-        v59 = dword_50BAD4[v57 - 1];
+        v70 = (signed int)(v56 - stru_50B700._xs[v57]) * (signed __int64)(stru_50B700.field_3D4[v57] - stru_50B700.field_3D4[v57 - 1]) / (v58 - stru_50B700._xs[v57]);
+        v59 = stru_50B700.field_3D4[v57 - 1];
       }
       else
       {
-        v70 = (signed int)(v56 - v58) * (signed __int64)(dword_50BAD4[v57 - 1] - dword_50BAD4[v57]) / (dword_50B9E4[v57 - 1] - v58);
-        v59 = dword_50BAD4[v57];
+        v70 = (signed int)(v56 - v58) * (signed __int64)(stru_50B700.field_3D4[v57 - 1] - stru_50B700.field_3D4[v57]) / (stru_50B700._xs[v57] - v58);
+        v59 = stru_50B700.field_3D4[v57];
       }
-      _50BAC8_screen_space_x[v55] = v70 + v59;
+      stru_50B700._screen_space_x[v55] = v70 + v59;
       v56 = pBLVRenderParams->uViewportW;
-      _50B9D8_screen_space_y[v55] = pBLVRenderParams->uViewportW;
+      stru_50B700._screen_space_y[v55] = pBLVRenderParams->uViewportW;
       ++v55;
     }
     if ( v85 )
     {
-      _50BAC8_screen_space_x[v55] = dword_50BAD4[v57];
-      _50B9D8_screen_space_y[v55++] = dword_50B9E4[v57];
+      stru_50B700._screen_space_x[v55] = stru_50B700.field_3D4[v57];
+      stru_50B700._screen_space_y[v55++] = stru_50B700._xs[v57+1];
     }
     ++ie;
     thise = v85;
@@ -1901,13 +1903,13 @@
   if ( !v55 )
     return 0;
   v61 = pRenderer->pRenderD3D == 0;
-  _50BAC8_screen_space_x[v55] = _50BAC8_screen_space_x[0];
-  _50B9D8_screen_space_y[v55] = _50B9D8_screen_space_y[0];
+  stru_50B700._screen_space_x[v55] = stru_50B700._screen_space_x[0];
+  stru_50B700._screen_space_y[v55] = stru_50B700._screen_space_y[0];
   if ( v61 && v55 > 3 )
   {
-    _50BAC8_screen_space_x[v55 + 1] = _50BAC8_screen_space_x[1];
-    _50B9D8_screen_space_y[v55 + 1] = _50B9D8_screen_space_y[1];
-    thisf = 2 * (dword_50B700 != 0) - 1;
+    stru_50B700._screen_space_x[v55 + 1] = stru_50B700._screen_space_x[1];
+    stru_50B700._screen_space_y[v55 + 1] = stru_50B700._screen_space_y[1];
+    thisf = 2 * (stru_50B700.field_0 != 0) - 1;
     if ( v55 > 0 )
     {
       v62 = 1;
@@ -1924,8 +1926,8 @@
         if ( v64 >= v55 )
           v64 -= v55;
         if ( thisf
-           * ((_50B9D8_screen_space_y[v64] - _50B9D8_screen_space_y[v63]) * (_50BAC8_screen_space_x[v62] - _50BAC8_screen_space_x[v63])
-            - (_50B9D8_screen_space_y[v62] - _50B9D8_screen_space_y[v63]) * (_50BAC8_screen_space_x[v64] - _50BAC8_screen_space_x[v63])) < 0 )
+           * ((stru_50B700._screen_space_y[v64] - stru_50B700._screen_space_y[v63]) * (stru_50B700._screen_space_x[v62] - stru_50B700._screen_space_x[v63])
+            - (stru_50B700._screen_space_y[v62] - stru_50B700._screen_space_y[v63]) * (stru_50B700._screen_space_x[v64] - stru_50B700._screen_space_x[v63])) < 0 )
         {
           v62 = v80;
           v71 = v80;
@@ -1936,16 +1938,16 @@
           v65 = v71;
           if ( v71 < v55 || (v65 = v71 - v55, v71 - v55 < v55) )
           {
-            memcpy(&_50B9D8_screen_space_y[v65], &_50B9D8_screen_space_y[v65 + 1], 4 * ((unsigned int)(4 * (v55 - v65)) >> 2));
-            memcpy(&_50BAC8_screen_space_x[v65], &_50BAC8_screen_space_x[v65 + 1], 4 * ((unsigned int)(4 * (v55 - v65)) >> 2));
+            memcpy(&stru_50B700._screen_space_y[v65], &stru_50B700._screen_space_y[v65 + 1], 4 * ((unsigned int)(4 * (v55 - v65)) >> 2));
+            memcpy(&stru_50B700._screen_space_x[v65], &stru_50B700._screen_space_x[v65 + 1], 4 * ((unsigned int)(4 * (v55 - v65)) >> 2));
           }
           --v55;
         }
       }
       while ( v62 - 1 < v55 );
     }
-    _50BAC8_screen_space_x[v55] = _50BAC8_screen_space_x[0];
-    _50B9D8_screen_space_y[v55] = _50B9D8_screen_space_y[0];
+    stru_50B700._screen_space_x[v55] = stru_50B700._screen_space_x[0];
+    stru_50B700._screen_space_y[v55] = stru_50B700._screen_space_y[0];
   }
   return v55;
 }
@@ -1983,11 +1985,11 @@
      + v2->pFacePlane_old.vNormal.y * ((signed __int16)(*(int *)&v4->x >> 16) - pBLVRenderParams->vPartyPos.y)
      + v2->pFacePlane_old.vNormal.z * (v4->z - pBLVRenderParams->vPartyPos.z) < 0 )
   {
-    dword_50B700 = 1;
+    stru_50B700.field_0 = 1;
   }
   else
   {
-    dword_50B700 = 0;
+    stru_50B700.field_0 = 0;
     if ( !(v2->uAttributes & 1) )
       return 0;
   }
@@ -2303,24 +2305,24 @@
   v74 = a1;
   v60 = a2;
   if ( !a1
-    || (!dword_50B700 ? (v64 = -1, v6 = 1, v63 = 1) : (v6 = 1, v63 = -1, v64 = 1),
-        v7 = _50B9D8_screen_space_y[0],
+    || (!stru_50B700.field_0 ? (v64 = -1, v6 = 1, v63 = 1) : (v6 = 1, v63 = -1, v64 = 1),
+        v7 = stru_50B700._screen_space_y[0],
         v65 = 0,
-        v8 = _50B9D8_screen_space_y[0],
+        v8 = stru_50B700._screen_space_y[0],
         a1 <= v6) )
     return 0;
   do
   {
-    v9 = _50B9D8_screen_space_y[v6];
+    v9 = stru_50B700._screen_space_y[v6];
     if ( v9 >= v7 )
     {
       if ( v9 > v8 )
-        v8 = _50B9D8_screen_space_y[v6];
+        v8 = stru_50B700._screen_space_y[v6];
     }
     else
     {
       v65 = v6;
-      v7 = _50B9D8_screen_space_y[v6];
+      v7 = stru_50B700._screen_space_y[v6];
     }
     ++v6;
   }
@@ -2348,8 +2350,8 @@
       {
         v10 -= v74;
       }
-      v12 = _50B9D8_screen_space_y[v10];
-      if ( v12 <= _50B9D8_screen_space_y[v11] )
+      v12 = stru_50B700._screen_space_y[v10];
+      if ( v12 <= stru_50B700._screen_space_y[v11] )
       {
         v55 = v10;
         v11 = v10;
@@ -2374,12 +2376,12 @@
   }
   v67 = v13;
 LABEL_27:
-  if ( _50B9D8_screen_space_y[v13] != _50B9D8_screen_space_y[v55] )
+  if ( stru_50B700._screen_space_y[v13] != stru_50B700._screen_space_y[v55] )
   {
-    v14 = _50BAC8_screen_space_x[v55];
+    v14 = stru_50B700._screen_space_x[v55];
     v62 = v14 << 16;
-    v54 = ((_50BAC8_screen_space_x[v13] - v14) << 16) / (_50B9D8_screen_space_y[v13] - _50B9D8_screen_space_y[v55]);
-    v5->array_18[v7] = LOWORD(_50BAC8_screen_space_x[v55]);
+    v54 = ((stru_50B700._screen_space_x[v13] - v14) << 16) / (stru_50B700._screen_space_y[v13] - stru_50B700._screen_space_y[v55]);
+    v5->array_18[v7] = LOWORD(stru_50B700._screen_space_x[v55]);
   }
   v15 = v65;
   v69 = 0;
@@ -2399,8 +2401,8 @@
       {
         v15 -= v74;
       }
-      v17 = _50B9D8_screen_space_y[v15];
-      if ( v17 <= _50B9D8_screen_space_y[v16] )
+      v17 = stru_50B700._screen_space_y[v15];
+      if ( v17 <= stru_50B700._screen_space_y[v16] )
       {
         v61 = v15;
         v16 = v15;
@@ -2427,14 +2429,14 @@
 LABEL_44:
   v19 = v18;
   v20 = v61;
-  v53 = _50B9D8_screen_space_y[v19] - _50B9D8_screen_space_y[v61];
-  if ( _50B9D8_screen_space_y[v19] != _50B9D8_screen_space_y[v61] )
+  v53 = stru_50B700._screen_space_y[v19] - stru_50B700._screen_space_y[v61];
+  if ( stru_50B700._screen_space_y[v19] != stru_50B700._screen_space_y[v61] )
   {
-    v21 = _50BAC8_screen_space_x[v20];
+    v21 = stru_50B700._screen_space_x[v20];
     v5 = v60;
     v61 = v21 << 16;
-    v53 = ((_50BAC8_screen_space_x[v19] - v21) << 16) / v53;
-    v60->array_3D8[v73] = LOWORD(_50BAC8_screen_space_x[v20]);
+    v53 = ((stru_50B700._screen_space_x[v19] - v21) << 16) / v53;
+    v60->array_3D8[v73] = LOWORD(stru_50B700._screen_space_x[v20]);
   }
   v22 = v7;
   v70 = v7;
@@ -2445,7 +2447,7 @@
     do
     {
       v24 = v67;
-      if ( v22 < _50B9D8_screen_space_y[v67] || v22 == v73 )
+      if ( v22 < stru_50B700._screen_space_y[v67] || v22 == v73 )
         goto LABEL_57;
       v25 = v64 + v67;
       v67 = v25;
@@ -2462,16 +2464,16 @@
       v67 = v25;
 LABEL_55:
       v26 = v25;
-      v27 = _50B9D8_screen_space_y[v26] - _50B9D8_screen_space_y[v24];
-      if ( _50B9D8_screen_space_y[v26] - _50B9D8_screen_space_y[v24] > 0 )
+      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 )
       {
-        v28 = _50BAC8_screen_space_x[v24];
-        v54 = ((_50BAC8_screen_space_x[v26] - v28) << 16) / v27;
+        v28 = stru_50B700._screen_space_x[v24];
+        v54 = ((stru_50B700._screen_space_x[v26] - v28) << 16) / v27;
         v62 = v28 << 16;
       }
 LABEL_57:
       v29 = v66;
-      if ( v70 >= _50B9D8_screen_space_y[v66] && v70 != v73 )
+      if ( v70 >= stru_50B700._screen_space_y[v66] && v70 != v73 )
       {
         v30 = v63 + v66;
         v66 += v63;
@@ -2487,11 +2489,11 @@
           v66 = v30;
         }
         v31 = v30;
-        v32 = _50B9D8_screen_space_y[v31] - _50B9D8_screen_space_y[v29];
-        if ( _50B9D8_screen_space_y[v31] - _50B9D8_screen_space_y[v29] > 0 )
+        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 )
         {
-          v33 = _50BAC8_screen_space_x[v29];
-          v53 = ((_50BAC8_screen_space_x[v31] - v33) << 16) / v32;
+          v33 = stru_50B700._screen_space_x[v29];
+          v53 = ((stru_50B700._screen_space_x[v31] - v33) << 16) / v32;
           v61 = v33 << 16;
         }
       }
@@ -2611,7 +2613,7 @@
   }
   return 1;
 }
-// 50B700: using guessed type int dword_50B700;
+// 50B700: using guessed type int stru_50B700.field_0;
 
 //----- (00424CD7) --------------------------------------------------------
 signed int __fastcall sr_424CD7(unsigned int uVertexID)
--- a/mm7_data.cpp	Sat May 25 23:50:56 2013 +0400
+++ b/mm7_data.cpp	Sat May 25 23:51:56 2013 +0400
@@ -330,7 +330,7 @@
 };
 
 #include "stru314.h"
-
+#include "stru367.h"
 
 
 
@@ -1207,24 +1207,25 @@
 int dword_507CD8; // weak
 int dword_50B570[50]; // weak
 int dword_50B638[50]; // weak
-int dword_50B700; // weak
-int dword_50B738[777]; // idb
-int _50B744_view_transformed_ys[45];
-int dword_50B828[777];
-int _50B834_view_transformed_zs[45];
-int dword_50B918[777];
-int _50B924_view_transformed_xs[45];
-int _50B9D8_screen_space_y[777];
-int dword_50B9E4[777];
-int dword_50B9F0[2]; // idb
-int dword_50B9FC_ys[3 + 45];
-int dword_50BA08_ys[48]; // idb
-int _50BAC8_screen_space_x[777]; // idb
-int dword_50BAD4[777]; // weak
-int dword_50BAE0[777]; // weak
+stru367 stru_50B700;
+/*int stru_50B700.field_0; // weak
+int stru_50B700.field_38[777]; // idb
+int stru_50B700._view_transformed_ys[45];
+int stru_50B700.field_128[777];
+int stru_50B700._view_transformed_zs[45];
+int stru_50B700.field_218[777];
+int stru_50B700._view_transformed_xs[45];
+int stru_50B700._screen_space_y[777];
+int stru_50B700.field_3E4[777];
+int stru_50B700.field_2F0[2]; // idb
+int stru_50B700._ys[3 + 45];
+int stru_50B700._ys2[48]; // idb
+int stru_50B700._screen_space_x[777]; // idb
+int stru_50B700.field_3D4[777]; // weak
+int stru_50B700._xs[777]; // weak
 int dword_50BAE8[777]; // weak
-int dword_50BAEC_xs[3 + 45]; // weak
-int dword_50BAF8_xs[48]; // weak
+int stru_50B700._xs2[3 + 45]; // weak
+int stru_50B700._xs3[48]; // weak*/
 int dword_50BC10[777]; // weak
 int dword_50BDA0[777]; // weak
 int dword_50BF30[777]; // weak
--- a/mm7_data.h	Sat May 25 23:50:56 2013 +0400
+++ b/mm7_data.h	Sat May 25 23:51:56 2013 +0400
@@ -699,24 +699,25 @@
 extern int dword_507CD8; // weak
 extern int dword_50B570[]; // weak
 extern int dword_50B638[]; // weak
-extern int dword_50B700; // weak
-extern int dword_50B738[]; // idb
-extern int _50B744_view_transformed_ys[];
-extern int dword_50B828[];
-extern int _50B834_view_transformed_zs[];
-extern int dword_50B918[];
-extern int _50B924_view_transformed_xs[];
-extern int _50B9D8_screen_space_y[];
-extern int dword_50B9E4[];
-extern int dword_50B9F0[]; // idb
-extern int dword_50B9FC_ys[];
-extern int dword_50BA08_ys[]; // idb
-extern int _50BAC8_screen_space_x[]; // idb
-extern int dword_50BAD4[]; // weak
-extern int dword_50BAE0[]; // weak
+extern struct stru367 stru_50B700;
+/*extern int stru_50B700.field_0; // weak
+extern int stru_50B700.field_38[]; // idb
+extern int stru_50B700._view_transformed_ys[];
+extern int stru_50B700.field_128[];
+extern int stru_50B700._view_transformed_zs[];
+extern int stru_50B700.field_218[];
+extern int stru_50B700._view_transformed_xs[];
+extern int stru_50B700._screen_space_y[];
+extern int stru_50B700.field_3E4[];
+extern int stru_50B700.field_2F0[]; // idb
+extern int stru_50B700._ys[];
+extern int stru_50B700._ys2[]; // idb
+extern int stru_50B700._screen_space_x[]; // idb
+extern int stru_50B700.field_3D4[]; // weak
+extern int stru_50B700._xs[]; // weak
 extern int dword_50BAE8[]; // weak
-extern int dword_50BAEC_xs[]; // weak
-extern int dword_50BAF8_xs[]; // weak
+extern int stru_50B700._xs2[]; // weak
+extern int stru_50B700._xs3[]; // weak*/
 extern int dword_50BC10[]; // weak
 extern int dword_50BDA0[]; // weak
 extern int dword_50BF30[]; // weak
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/stru367.h	Sat May 25 23:51:56 2013 +0400
@@ -0,0 +1,42 @@
+#pragma once
+
+
+
+/*  152 */
+#pragma pack(push, 1)
+struct stru367
+{
+	int field_0;
+	int field_4[13];
+	int field_38[2];
+	int _view_transformed_ys_minus1;
+	int _view_transformed_ys[57];
+	int field_128[2];
+	int _view_transformed_zs_minus1;
+	int _view_transformed_zs[57];
+	int field_218[2];
+	int _view_transformed_xs_minus1;
+	int _view_transformed_xs[45];
+	int _screen_space_y[2];
+	int field_2E0;
+	int field_2E4[2];
+	int field_2EC;
+	int field_2F0[2];
+	int field_2F8;
+	int _ys[3];
+	int _ys2[48];
+	int _screen_space_x[2];
+	int field_3D0;
+	int field_3D4[2];
+	int field_3DC;
+	//int field_3E0;
+	int _xs[54];
+	int field_3E4;
+	int field_3E8;
+	int _xs2[3];
+	int _xs3[48];
+};
+#pragma pack(pop)
+
+
+//extern  const stru367 stru_367;
\ No newline at end of file