diff Indoor.cpp @ 1291:1577d75db258

m
author Ritor1
date Fri, 14 Jun 2013 16:06:20 +0600
parents 6c55c6bd67e0
children 24bc24b64ec2
line wrap: on
line diff
--- a/Indoor.cpp	Tue Jun 11 17:31:03 2013 +0600
+++ b/Indoor.cpp	Fri Jun 14 16:06:20 2013 +0600
@@ -347,9 +347,9 @@
 		  v4 = pRenderer->uTargetSurfacePitch * pNode->field_C._viewport_space_y;
 		  if ( pNode->field_C._viewport_space_y <= pNode->field_C._viewport_space_w )
 		  {
-			//v5 = (char *)&pBspRenderer->nodes[0].field_C.array_3D8[pNode->field_C._viewport_space_y + v7];
-			v5 = &pNode->field_C.array_3D8[pNode->field_C._viewport_space_y];
-			v8 = &pNode->field_C.array_18[pNode->field_C._viewport_space_y];
+			//v5 = (char *)&pBspRenderer->nodes[0].field_C.viewport_right_side[pNode->field_C._viewport_space_y + v7];
+			v5 = &pNode->field_C.viewport_right_side[pNode->field_C._viewport_space_y];
+			v8 = &pNode->field_C.viewport_left_side[pNode->field_C._viewport_space_y];
 			do
 			{
 				v1[v4 + *v8] = 255;
@@ -875,29 +875,29 @@
                   v120 = 2 * stru_F8A590._viewport_space_y;
                   while ( 1 )
                   {
-                    a1 = *(__int16 *)((char *)stru_F8A590.array_18 + v24);
+                    a1 = *(__int16 *)((char *)stru_F8A590.viewport_left_side + v24);
                     sub_4AE313(a1, v21, &stru_F81018.field_0);
                     if ( LOBYTE(viewparams->field_20) )
                     {
                       v27 = v111 * (v24 - pBLVRenderParams->uViewportY);
                       pZPixel = &pBLVRenderParams->pTargetZBuffer[2
-                                                               * (*(__int16 *)((char *)stru_F8A590.array_18 + v24)
+                                                               * (*(__int16 *)((char *)stru_F8A590.viewport_left_side + v24)
                                                                 + 320 * (v24 - pBLVRenderParams->uViewportY))
                                                                - pBLVRenderParams->uViewportX];
                       pColorPixel = &pBLVRenderParams->pRenderTarget[v27
-                                                                  + 2 * *(__int16 *)((char *)stru_F8A590.array_18 + v24)
+                                                                  + 2 * *(__int16 *)((char *)stru_F8A590.viewport_left_side + v24)
                                                                   - pBLVRenderParams->uViewportX];
                       v26 = &pBLVRenderParams->pRenderTarget[v27
-                                                          + 2 * *(__int16 *)((char *)stru_F8A590.array_3D8 + v24)
+                                                          + 2 * *(__int16 *)((char *)stru_F8A590.viewport_right_side + v24)
                                                           - pBLVRenderParams->uViewportX];
                       v23 = v119;
                     }
                     else
                     {
-                      v25 = *(__int16 *)((char *)stru_F8A590.array_18 + v24);
+                      v25 = *(__int16 *)((char *)stru_F8A590.viewport_left_side + v24);
                       pZPixel = &pBLVRenderParams->pTargetZBuffer[v25 + v23];
                       pColorPixel = &pBLVRenderParams->pRenderTarget[v25 + v110];
-                      v26 = &pBLVRenderParams->pRenderTarget[v110 + *(__int16 *)((char *)stru_F8A590.array_3D8 + v24)];
+                      v26 = &pBLVRenderParams->pRenderTarget[v110 + *(__int16 *)((char *)stru_F8A590.viewport_right_side + v24)];
                     }
                     v131 = (unsigned int)v26;
                     HIWORD(v28) = HIWORD(stru_F81018.field_0.field_0);
@@ -1259,8 +1259,8 @@
   //stru170 *v4; // ebx@1
   //BLVFace *v5; // eax@1
   //int v6; // ecx@2
-  unsigned __int16 v7; // ax@11
-  Vec3_short_ *v8; // esi@15
+  unsigned __int16 TransitionSectorID; // ax@11
+  //Vec3_short_ *v8; // esi@15
   int v9; // edx@15
   //signed int v10; // eax@18
   //signed int v11; // edi@19
@@ -1326,16 +1326,16 @@
                                           + 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
-          v7 = pFace->uBackSectorID;
-        nodes[num_nodes].uSectorID = v7;
+        TransitionSectorID = pFace->uSectorID;
+        if ( nodes[0].uSectorID == TransitionSectorID )  // draw back sector
+          TransitionSectorID = pFace->uBackSectorID;
+        nodes[num_nodes].uSectorID = TransitionSectorID;
         nodes[num_nodes].uFaceID = uFaceID;
         nodes[num_nodes].uViewportX = pBLVRenderParams->uViewportX;
         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,
+        nodes[num_nodes].field_C.GetViewportData(pBLVRenderParams->uViewportX, pBLVRenderParams->uViewportY,
                                          pBLVRenderParams->uViewportZ, pBLVRenderParams->uViewportW);
         AddBspNodeToRenderList(++num_nodes - 1);
         return;
@@ -1344,10 +1344,10 @@
       //v6 = a0;
     }
 
-    v8 = &pIndoor->pVertices[pFace->pVertexIDs[0]];
-    v9 = pFace->pFacePlane_old.vNormal.x * (v8->x - pBLVRenderParams->vPartyPos.x)
-       + pFace->pFacePlane_old.vNormal.y * (v8->y - pBLVRenderParams->vPartyPos.y)
-       + pFace->pFacePlane_old.vNormal.z * (v8->z - pBLVRenderParams->vPartyPos.z);
+    //отбраковка по ориентации
+    v9 = pFace->pFacePlane_old.vNormal.x * (pIndoor->pVertices[pFace->pVertexIDs[0]].x - pBLVRenderParams->vPartyPos.x)
+       + pFace->pFacePlane_old.vNormal.y * (pIndoor->pVertices[pFace->pVertexIDs[0]].y - pBLVRenderParams->vPartyPos.y)
+       + pFace->pFacePlane_old.vNormal.z * (pIndoor->pVertices[pFace->pVertexIDs[0]].z - pBLVRenderParams->vPartyPos.z);
     if (p->uSectorID != pFace->uSectorID)
       v9 = -v9;
     if (v9 >= 0)
@@ -1491,7 +1491,7 @@
         v3->nodes[v3->num_nodes].uViewportZ = LOWORD(pBLVRenderParams->uViewportZ);
         v3->nodes[v3->num_nodes].uViewportY = LOWORD(pBLVRenderParams->uViewportY);
         v3->nodes[v3->num_nodes].uViewportW = LOWORD(pBLVRenderParams->uViewportW);
-        v3->nodes[v3->num_nodes++].field_C._43F9E1(
+        v3->nodes[v3->num_nodes++].field_C.GetViewportData(
           SLOWORD(pBLVRenderParams->uViewportX),
           pBLVRenderParams->uViewportY,
           SLOWORD(pBLVRenderParams->uViewportZ),
@@ -1610,8 +1610,8 @@
               v6 = 640 * stru_F8A590._viewport_space_y;
               do
               {
-                v5[v6 + stru_F8A590.array_18[v4]] = -1;
-                v7 = v6 + stru_F8A590.array_3D8[v4];
+                v5[v6 + stru_F8A590.viewport_left_side[v4]] = -1;
+                v7 = v6 + stru_F8A590.viewport_right_side[v4];
                 v6 += 640;
                 v5[v7] = -1;
                 ++v4;