diff Engine/Graphics/Indoor.cpp @ 2543:b6140dfeac27

GameOver h/cpp
author a.parshin
date Sun, 10 May 2015 03:21:14 +0200
parents a902abdfc7f2
children b8a56afc6ba1
line wrap: on
line diff
--- a/Engine/Graphics/Indoor.cpp	Sun May 10 02:04:52 2015 +0200
+++ b/Engine/Graphics/Indoor.cpp	Sun May 10 03:21:14 2015 +0200
@@ -109,9 +109,9 @@
     //LOBYTE(v1) = _4E94D0_light_type;
     //v4 = pParty->flt_TorchlightColorR + 6.7553994e15;
     //v3 = pParty->flt_TorchlightColorG + 6.7553994e15;
-    pMobileLightsStack->AddLight(pEngine->pIndoorCameraD3D->vPartyPos.x,
-                                 pEngine->pIndoorCameraD3D->vPartyPos.y,
-                                 pEngine->pIndoorCameraD3D->vPartyPos.z,
+    pMobileLightsStack->AddLight(pIndoorCameraD3D->vPartyPos.x,
+                                 pIndoorCameraD3D->vPartyPos.y,
+                                 pIndoorCameraD3D->vPartyPos.z,
                                  pBLVRenderParams->uPartySectorID,
                                  v5,
                                  floorf(pParty->flt_TorchlightColorR + 0.5f),
@@ -142,11 +142,11 @@
 
   this->field_0_timer_ = pEventTimer->uTotalGameTimeElapsed;
 
-  pEngine->pIndoorCameraD3D->debug_flags = 0;
+  pIndoorCameraD3D->debug_flags = 0;
   if (viewparams->draw_sw_outlines)
-    pEngine->pIndoorCameraD3D->debug_flags |= BLV_RENDER_DRAW_SW_OUTLINES;
+    pIndoorCameraD3D->debug_flags |= BLV_RENDER_DRAW_SW_OUTLINES;
   if (viewparams->draw_d3d_outlines)
-    pEngine->pIndoorCameraD3D->debug_flags |= BLV_RENDER_DRAW_D3D_OUTLINES;
+    pIndoorCameraD3D->debug_flags |= BLV_RENDER_DRAW_D3D_OUTLINES;
 
   //v2 = a2;
   //this->field_0_timer_ = a2->field_0_timer;
@@ -159,9 +159,9 @@
   //this->sPartyRotY = a2->sRotationY;
   //v6 = this->vPartyPos.x;
   //this->sPartyRotX = a2->sRotationX;
-  v7 = pIndoor->GetSector(pEngine->pIndoorCameraD3D->vPartyPos.x,
-                          pEngine->pIndoorCameraD3D->vPartyPos.y,
-                          pEngine->pIndoorCameraD3D->vPartyPos.z);
+  v7 = pIndoor->GetSector(pIndoorCameraD3D->vPartyPos.x,
+                          pIndoorCameraD3D->vPartyPos.y,
+                          pIndoorCameraD3D->vPartyPos.z);
   this->uPartySectorID = v7;
   if ( !v7 )
   {
@@ -175,14 +175,14 @@
   }
   //if ( pRenderer->pRenderD3D )
   {
-    //this->sCosineY = stru_5C6E00->Cos(pEngine->pIndoorCameraD3D->sRotationY);
-    //this->sSineY = stru_5C6E00->Sin(pEngine->pIndoorCameraD3D->sRotationY);
-    //this->sCosineNegX = stru_5C6E00->Cos(-pEngine->pIndoorCameraD3D->sRotationX);
-    //this->sSineNegX = stru_5C6E00->Sin(-pEngine->pIndoorCameraD3D->sRotationX);
-    //this->fCosineY = cos((3.141592653589793 + 3.141592653589793) * (double)pEngine->pIndoorCameraD3D->sRotationY * 0.00048828125);
-    //this->fSineY = sin((3.141592653589793 + 3.141592653589793) * (double)pEngine->pIndoorCameraD3D->sRotationY * 0.00048828125);
-    //this->fCosineNegX = cos((3.141592653589793 + 3.141592653589793) * (double)-pEngine->pIndoorCameraD3D->sRotationX * 0.00048828125);
-    //this->fSineNegX = sin((3.141592653589793 + 3.141592653589793) * (double)-pEngine->pIndoorCameraD3D->sRotationX * 0.00048828125);
+    //this->sCosineY = stru_5C6E00->Cos(pIndoorCameraD3D->sRotationY);
+    //this->sSineY = stru_5C6E00->Sin(pIndoorCameraD3D->sRotationY);
+    //this->sCosineNegX = stru_5C6E00->Cos(-pIndoorCameraD3D->sRotationX);
+    //this->sSineNegX = stru_5C6E00->Sin(-pIndoorCameraD3D->sRotationX);
+    //this->fCosineY = cos((3.141592653589793 + 3.141592653589793) * (double)pIndoorCameraD3D->sRotationY * 0.00048828125);
+    //this->fSineY = sin((3.141592653589793 + 3.141592653589793) * (double)pIndoorCameraD3D->sRotationY * 0.00048828125);
+    //this->fCosineNegX = cos((3.141592653589793 + 3.141592653589793) * (double)-pIndoorCameraD3D->sRotationX * 0.00048828125);
+    //this->fSineNegX = sin((3.141592653589793 + 3.141592653589793) * (double)-pIndoorCameraD3D->sRotationX * 0.00048828125);
     this->field_64 = pViewport->field_of_view;
     
     this->uViewportX = pViewport->uScreen_TL_X;
@@ -428,7 +428,7 @@
   if (!pFace->GetTexture())
     return;
 
-  if (!pEngine->pIndoorCameraD3D->IsCulled(pFace))
+  if (!pIndoorCameraD3D->IsCulled(pFace))
   {
     uNumVerticesa = pFace->uNumVertices;
     for (uint i = 0; i < pFace->uNumVertices; ++i)
@@ -443,8 +443,8 @@
     if (!pVertices ||
         (pEngine->pStru9Instance->_498377(pPortalBounding, 4, pVertices, static_vertices_F7C228, &uNumVerticesa), uNumVerticesa) )
     {
-      if (pEngine->pIndoorCameraD3D->CalcPortalShape(static_vertices_F7C228, &uNumVerticesa,
-                     static_vertices_F7B628, pEngine->pIndoorCameraD3D->std__vector_000034_prolly_frustrum, 4, false, 0) != 1 || uNumVerticesa )
+      if (pIndoorCameraD3D->CalcPortalShape(static_vertices_F7C228, &uNumVerticesa,
+                     static_vertices_F7B628, pIndoorCameraD3D->std__vector_000034_prolly_frustrum, 4, false, 0) != 1 || uNumVerticesa )
       {
         a4a = SHIWORD(stru_F8AD28.uCurrentAmbientLightLevel);
         v17 = (248 - (SHIWORD(stru_F8AD28.uCurrentAmbientLightLevel) << 3))
@@ -453,8 +453,8 @@
         sub_4B0E07(uFaceID);
         pEngine->pLightmapBuilder->ApplyLights_IndoorFace(uFaceID);
         pDecalBuilder->ApplyBloodsplatDecals_IndoorFace(uFaceID);
-        pEngine->pIndoorCameraD3D->ViewTransfrom_OffsetUV(static_vertices_F7B628, uNumVerticesa, array_507D30, &stru_F8AD28);
-        pEngine->pIndoorCameraD3D->Project(array_507D30, uNumVerticesa, 0);
+        pIndoorCameraD3D->ViewTransfrom_OffsetUV(static_vertices_F7B628, uNumVerticesa, array_507D30, &stru_F8AD28);
+        pIndoorCameraD3D->Project(array_507D30, uNumVerticesa, 0);
         pEngine->pLightmapBuilder->std__vector_000004_size = 0;
         if (stru_F8AD28.uNumLightsApplied > 0 || pDecalBuilder->uNumDecals > 0)
         {
@@ -557,16 +557,16 @@
   if (nodes[node_id].uFaceID == uFaceID)
     return;
   if (!node_id &&
-      pEngine->pIndoorCameraD3D->vPartyPos.x >= pFace->pBounding.x1 - 16 &&  // we are probably standing at the portal plane
-      pEngine->pIndoorCameraD3D->vPartyPos.x <= pFace->pBounding.x2 + 16 &&
-      pEngine->pIndoorCameraD3D->vPartyPos.y >= pFace->pBounding.y1 - 16 &&
-      pEngine->pIndoorCameraD3D->vPartyPos.y <= pFace->pBounding.y2 + 16 &&
-      pEngine->pIndoorCameraD3D->vPartyPos.z >= pFace->pBounding.z1 - 16 &&
-      pEngine->pIndoorCameraD3D->vPartyPos.z <= pFace->pBounding.z2 + 16 )
+      pIndoorCameraD3D->vPartyPos.x >= pFace->pBounding.x1 - 16 &&  // we are probably standing at the portal plane
+      pIndoorCameraD3D->vPartyPos.x <= pFace->pBounding.x2 + 16 &&
+      pIndoorCameraD3D->vPartyPos.y >= pFace->pBounding.y1 - 16 &&
+      pIndoorCameraD3D->vPartyPos.y <= pFace->pBounding.y2 + 16 &&
+      pIndoorCameraD3D->vPartyPos.z >= pFace->pBounding.z1 - 16 &&
+      pIndoorCameraD3D->vPartyPos.z <= pFace->pBounding.z2 + 16 )
   {
-    if ( abs(pFace->pFacePlane_old.dist + pEngine->pIndoorCameraD3D->vPartyPos.x * pFace->pFacePlane_old.vNormal.x
-                                        + pEngine->pIndoorCameraD3D->vPartyPos.y * pFace->pFacePlane_old.vNormal.y
-                                        + pEngine->pIndoorCameraD3D->vPartyPos.z * pFace->pFacePlane_old.vNormal.z) <= 589824 ) // we sure are standing at the portal plane
+    if ( abs(pFace->pFacePlane_old.dist + pIndoorCameraD3D->vPartyPos.x * pFace->pFacePlane_old.vNormal.x
+                                        + pIndoorCameraD3D->vPartyPos.y * pFace->pFacePlane_old.vNormal.y
+                                        + pIndoorCameraD3D->vPartyPos.z * pFace->pFacePlane_old.vNormal.z) <= 589824 ) // we sure are standing at the portal plane
     {
       pTransitionSector = pFace->uSectorID;
       if ( nodes[0].uSectorID == pTransitionSector )  // draw back sector
@@ -584,9 +584,9 @@
     }
   }
 
-  v9 = pFace->pFacePlane_old.vNormal.x * (pIndoor->pVertices[pFace->pVertexIDs[0]].x - pEngine->pIndoorCameraD3D->vPartyPos.x)
-     + pFace->pFacePlane_old.vNormal.y * (pIndoor->pVertices[pFace->pVertexIDs[0]].y - pEngine->pIndoorCameraD3D->vPartyPos.y)
-     + pFace->pFacePlane_old.vNormal.z * (pIndoor->pVertices[pFace->pVertexIDs[0]].z - pEngine->pIndoorCameraD3D->vPartyPos.z);
+  v9 = pFace->pFacePlane_old.vNormal.x * (pIndoor->pVertices[pFace->pVertexIDs[0]].x - pIndoorCameraD3D->vPartyPos.x)
+     + pFace->pFacePlane_old.vNormal.y * (pIndoor->pVertices[pFace->pVertexIDs[0]].y - pIndoorCameraD3D->vPartyPos.y)
+     + pFace->pFacePlane_old.vNormal.z * (pIndoor->pVertices[pFace->pVertexIDs[0]].z - pIndoorCameraD3D->vPartyPos.z);
   if (nodes[node_id].uSectorID != pFace->uSectorID)
     v9 = -v9;
   if (v9 >= 0)
@@ -646,7 +646,7 @@
       }
 
       unsigned int pNewNumVertices = pFace->uNumVertices;
-      pEngine->pIndoorCameraD3D->CalcPortalShape(static_subAddFaceToRenderList_d3d_stru_F7AA08, &pNewNumVertices,
+      pIndoorCameraD3D->CalcPortalShape(static_subAddFaceToRenderList_d3d_stru_F7AA08, &pNewNumVertices,
                                                static_subAddFaceToRenderList_d3d_stru_F79E08, nodes[node_id].std__vector_0007AC, 4, 0, 0);
 
       v29 = pEngine->pStru10Instance->_49C5DA(pFace, static_subAddFaceToRenderList_d3d_stru_F79E08, &pNewNumVertices,
@@ -659,9 +659,9 @@
       nodes[num_nodes].viewing_portal_id = uFaceID;
       AddBspNodeToRenderList(++num_nodes - 1);
     }
-    if (pEngine->pIndoorCameraD3D->debug_flags & BLV_RENDER_DRAW_SW_OUTLINES)
-      pEngine->pIndoorCameraD3D->PrepareAndDrawDebugOutline(pFace, 0x1E1EFF);
-    //pEngine->pIndoorCameraD3D->DebugDrawPortal(pFace);
+    if (pIndoorCameraD3D->debug_flags & BLV_RENDER_DRAW_SW_OUTLINES)
+      pIndoorCameraD3D->PrepareAndDrawDebugOutline(pFace, 0x1E1EFF);
+    //pIndoorCameraD3D->DebugDrawPortal(pFace);
   }
 }
 
@@ -3413,7 +3413,7 @@
     if (pActors[i].uAIState == Removed || pActors[i].uAIState == Disabled)
       continue;
 
-    v4 = stru_5C6E00->Atan2(pActors[i].vPosition.x - pEngine->pIndoorCameraD3D->vPartyPos.x, pActors[i].vPosition.y - pEngine->pIndoorCameraD3D->vPartyPos.y);
+    v4 = stru_5C6E00->Atan2(pActors[i].vPosition.x - pIndoorCameraD3D->vPartyPos.x, pActors[i].vPosition.y - pIndoorCameraD3D->vPartyPos.y);
     v6 = ((signed int)(pActors[i].uYawAngle + ((signed int)stru_5C6E00->uIntegerPi >> 3) - v4 + stru_5C6E00->uIntegerPi) >> 8) & 7;
     v8 = pActors[i].uCurrentActionTime;
     if ( pParty->bTurnBasedModeOn )
@@ -3452,10 +3452,10 @@
     {
       if ( pBspRenderer->pVisibleSectorIDs_toDrawDecorsActorsEtcFrom[v12] == pActors[i].uSectorID )
       {
-        if ( !pEngine->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible_BLV(pActors[i].vPosition.x, pActors[i].vPosition.y, pActors[i].vPosition.z, &x, &y, &z, 1)
+        if ( !pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible_BLV(pActors[i].vPosition.x, pActors[i].vPosition.y, pActors[i].vPosition.z, &x, &y, &z, 1)
           || abs(x) < abs(y) )
           continue;
-        pEngine->pIndoorCameraD3D->Project(x, y, z, &v43, &a6);
+        pIndoorCameraD3D->Project(x, y, z, &v43, &a6);
         if (uNumBillboardsToDraw >= 500)
           break;
         ++uNumBillboardsToDraw;
@@ -3473,8 +3473,8 @@
         }
         else
         {*/
-          pBillboardRenderList[uNumBillboardsToDraw - 1].fov_x = pEngine->pIndoorCameraD3D->fov_x;
-          pBillboardRenderList[uNumBillboardsToDraw - 1].fov_y = pEngine->pIndoorCameraD3D->fov_y;
+          pBillboardRenderList[uNumBillboardsToDraw - 1].fov_x = pIndoorCameraD3D->fov_x;
+          pBillboardRenderList[uNumBillboardsToDraw - 1].fov_y = pIndoorCameraD3D->fov_y;
           LODWORD(v18) = 0;
           HIDWORD(v18) = floorf(pBillboardRenderList[uNumBillboardsToDraw - 1].fov_x + 0.5f);
           pBillboardRenderList[uNumBillboardsToDraw - 1]._screenspace_x_scaler_packedfloat = fixpoint_mul(v9->scale, v18 / x);
@@ -3549,8 +3549,8 @@
           {
             v4 = pSpriteFrameTable->GetFrame(pObjectList->pObjects[pSpriteObjects[i].uObjectDescID].uSpriteID, pSpriteObjects[i].uSpriteFrameID);
             a6 = v4->uGlowRadius * pSpriteObjects[i].field_22_glow_radius_multiplier;
-            v6 = stru_5C6E00->Atan2(pSpriteObjects[i].vPosition.x - pEngine->pIndoorCameraD3D->vPartyPos.x,
-                                    pSpriteObjects[i].vPosition.y - pEngine->pIndoorCameraD3D->vPartyPos.y);
+            v6 = stru_5C6E00->Atan2(pSpriteObjects[i].vPosition.x - pIndoorCameraD3D->vPartyPos.x,
+                                    pSpriteObjects[i].vPosition.y - pIndoorCameraD3D->vPartyPos.y);
             LOWORD(v7) = pSpriteObjects[i].uFacing;
             v9 = ((signed int)(stru_5C6E00->uIntegerPi + ((signed int)stru_5C6E00->uIntegerPi >> 3) + v7 - v6) >> 8) & 7;
             pBillboardRenderList[uNumBillboardsToDraw].HwSpriteID = v4->pHwSpriteIDs[v9];
@@ -3575,10 +3575,10 @@
                                                     pObjectList->pObjects[pSpriteObjects[i].uObjectDescID].uParticleTrailColorG,
                                                     pObjectList->pObjects[pSpriteObjects[i].uObjectDescID].uParticleTrailColorB, _4E94D3_light_type);
             }
-            if ( pEngine->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible_BLV(pSpriteObjects[i].vPosition.x, pSpriteObjects[i].vPosition.y,
+            if ( pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible_BLV(pSpriteObjects[i].vPosition.x, pSpriteObjects[i].vPosition.y,
                                                                                     pSpriteObjects[i].vPosition.z, &x, &y, &z, 1) )
             {
-              pEngine->pIndoorCameraD3D->Project(x, y, z, &v36, &v35);
+              pIndoorCameraD3D->Project(x, y, z, &v36, &v35);
 
               assert(uNumBillboardsToDraw < 500);
               //if ( (signed int)uNumBillboardsToDraw >= 500 )
@@ -3590,8 +3590,8 @@
               pBillboardRenderList[uNumBillboardsToDraw - 1].uIndoorSectorID = pSpriteObjects[i].uSectorID;
               //if ( pRenderer->pRenderD3D )
               {
-                pBillboardRenderList[uNumBillboardsToDraw - 1].fov_x = pEngine->pIndoorCameraD3D->fov_x;
-                pBillboardRenderList[uNumBillboardsToDraw - 1].fov_y = pEngine->pIndoorCameraD3D->fov_y;
+                pBillboardRenderList[uNumBillboardsToDraw - 1].fov_x = pIndoorCameraD3D->fov_x;
+                pBillboardRenderList[uNumBillboardsToDraw - 1].fov_y = pIndoorCameraD3D->fov_y;
                 LODWORD(v18) = 0;
                 HIDWORD(v18) = (int)floorf(pBillboardRenderList[uNumBillboardsToDraw - 1].fov_x + 0.5f);
                 pBillboardRenderList[uNumBillboardsToDraw - 1]._screenspace_x_scaler_packedfloat = fixpoint_mul(v4->scale, v18 / x);
@@ -3679,9 +3679,9 @@
     pNode = &pIndoor->pNodes[uFirstNode];
     pFace = &pIndoor->pFaces[pSector->pFaceIDs[pNode->uCoplanarOffset]];
     v5 = pFace->pFacePlane_old.dist +
-         pEngine->pIndoorCameraD3D->vPartyPos.x * pFace->pFacePlane_old.vNormal.x +
-         pEngine->pIndoorCameraD3D->vPartyPos.y * pFace->pFacePlane_old.vNormal.y +
-         pEngine->pIndoorCameraD3D->vPartyPos.z * pFace->pFacePlane_old.vNormal.z;//plane equation
+         pIndoorCameraD3D->vPartyPos.x * pFace->pFacePlane_old.vNormal.x +
+         pIndoorCameraD3D->vPartyPos.y * pFace->pFacePlane_old.vNormal.y +
+         pIndoorCameraD3D->vPartyPos.z * pFace->pFacePlane_old.vNormal.z;//plane equation
     if (pFace->Portal() && pFace->uSectorID != node->uSectorID )
       v5 = -v5;
     //v11 = v5 > 0;
@@ -3754,8 +3754,8 @@
     return;
 
   v8 = pLevelDecorations[uDecorationID].field_10_y_rot + ((signed int)stru_5C6E00->uIntegerPi >> 3)
-     - stru_5C6E00->Atan2(pLevelDecorations[uDecorationID].vPosition.x - pEngine->pIndoorCameraD3D->vPartyPos.x,
-                          pLevelDecorations[uDecorationID].vPosition.y - pEngine->pIndoorCameraD3D->vPartyPos.y);
+     - stru_5C6E00->Atan2(pLevelDecorations[uDecorationID].vPosition.x - pIndoorCameraD3D->vPartyPos.x,
+                          pLevelDecorations[uDecorationID].vPosition.y - pIndoorCameraD3D->vPartyPos.y);
   v9 = ((signed int)(stru_5C6E00->uIntegerPi + v8) >> 8) & 7;
   v37 = pBLVRenderParams->field_0_timer_;
   if (pParty->bTurnBasedModeOn)
@@ -3771,13 +3771,13 @@
     LOBYTE(v30) = v30 | 0x80;
   if ( (256 << v9) & v11->uFlags )
     v30 |= 4;
-  if ( pEngine->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible_BLV(pLevelDecorations[uDecorationID].vPosition.x,
+  if ( pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible_BLV(pLevelDecorations[uDecorationID].vPosition.x,
                                                                           pLevelDecorations[uDecorationID].vPosition.y,
                                                                           pLevelDecorations[uDecorationID].vPosition.z, &x, &y, &z, 1) )
   {
     if ( abs(x) >= abs(y) )
     {
-      pEngine->pIndoorCameraD3D->Project(x, y, z, &a5, &a6);
+      pIndoorCameraD3D->Project(x, y, z, &a5, &a6);
 
       assert(uNumBillboardsToDraw < 500);
 
@@ -3796,8 +3796,8 @@
       }
       else
       {*/
-        pBillboardRenderList[uNumBillboardsToDraw - 1].fov_x = pEngine->pIndoorCameraD3D->fov_x;
-        pBillboardRenderList[uNumBillboardsToDraw - 1].fov_y = pEngine->pIndoorCameraD3D->fov_y;
+        pBillboardRenderList[uNumBillboardsToDraw - 1].fov_x = pIndoorCameraD3D->fov_x;
+        pBillboardRenderList[uNumBillboardsToDraw - 1].fov_y = pIndoorCameraD3D->fov_y;
         LODWORD(v20) = 0;
         HIDWORD(v20) = floorf(pBillboardRenderList[uNumBillboardsToDraw - 1].fov_x + 0.5f);
         pBillboardRenderList[uNumBillboardsToDraw - 1]._screenspace_x_scaler_packedfloat = fixpoint_mul(v11->scale, v20 / x);
@@ -3881,30 +3881,30 @@
   int v28; // [sp+1Ch] [bp-Ch]@1
   int v29; // [sp+24h] [bp-4h]@1
 
-  v8 = stru_5C6E00->Cos(pEngine->pIndoorCameraD3D->sRotationY);
-  v29 = stru_5C6E00->Sin(pEngine->pIndoorCameraD3D->sRotationY);
-  v28 = stru_5C6E00->Cos(pEngine->pIndoorCameraD3D->sRotationX);
-  v9 = stru_5C6E00->Sin(pEngine->pIndoorCameraD3D->sRotationX);
+  v8 = stru_5C6E00->Cos(pIndoorCameraD3D->sRotationY);
+  v29 = stru_5C6E00->Sin(pIndoorCameraD3D->sRotationY);
+  v28 = stru_5C6E00->Cos(pIndoorCameraD3D->sRotationX);
+  v9 = stru_5C6E00->Sin(pIndoorCameraD3D->sRotationX);
   //v11 = -pBLVRenderParams->vPartyPos.y;
   //v26 = -pBLVRenderParams->vPartyPos.x;
   //v27 = v9;
   //v12 = -pBLVRenderParams->vPartyPos.z;
-  if (pEngine->pIndoorCameraD3D->sRotationX)
+  if (pIndoorCameraD3D->sRotationX)
   {
-    v16 = v8 * -pEngine->pIndoorCameraD3D->vPartyPos.x + v29 * -pEngine->pIndoorCameraD3D->vPartyPos.y;
-    v17 = -65536 * pEngine->pIndoorCameraD3D->vPartyPos.z;
-    this->field_0_party_dir_x = fixpoint_mul(v16, v28) + fixpoint_mul((-pEngine->pIndoorCameraD3D->vPartyPos.z) << 16, v9);
-    this->field_4_party_dir_y = v8 * -pEngine->pIndoorCameraD3D->vPartyPos.y - v29 * -pEngine->pIndoorCameraD3D->vPartyPos.x;
+    v16 = v8 * -pIndoorCameraD3D->vPartyPos.x + v29 * -pIndoorCameraD3D->vPartyPos.y;
+    v17 = -65536 * pIndoorCameraD3D->vPartyPos.z;
+    this->field_0_party_dir_x = fixpoint_mul(v16, v28) + fixpoint_mul((-pIndoorCameraD3D->vPartyPos.z) << 16, v9);
+    this->field_4_party_dir_y = v8 * -pIndoorCameraD3D->vPartyPos.y - v29 * -pIndoorCameraD3D->vPartyPos.x;
     this->field_8_party_dir_z = fixpoint_mul(v17, v28) - fixpoint_mul(v16, v9);
   }
   else
   {
-    this->field_0_party_dir_x = v8 * -pEngine->pIndoorCameraD3D->vPartyPos.x + v29 * -pEngine->pIndoorCameraD3D->vPartyPos.y;
-    this->field_4_party_dir_y = v8 * -pEngine->pIndoorCameraD3D->vPartyPos.y - v29 * -pEngine->pIndoorCameraD3D->vPartyPos.x;
-    this->field_8_party_dir_z = (-pEngine->pIndoorCameraD3D->vPartyPos.z) << 16;
+    this->field_0_party_dir_x = v8 * -pIndoorCameraD3D->vPartyPos.x + v29 * -pIndoorCameraD3D->vPartyPos.y;
+    this->field_4_party_dir_y = v8 * -pIndoorCameraD3D->vPartyPos.y - v29 * -pIndoorCameraD3D->vPartyPos.x;
+    this->field_8_party_dir_z = (-pIndoorCameraD3D->vPartyPos.z) << 16;
   }
 
-  if (pEngine->pIndoorCameraD3D->sRotationX)
+  if (pIndoorCameraD3D->sRotationX)
   {
     v19 = fixpoint_mul(a2, v8) + fixpoint_mul(a3, v29);
 
@@ -3919,7 +3919,7 @@
     this->viewing_angle_from_west_east = a4;
   }
 
-  if (pEngine->pIndoorCameraD3D->sRotationX)
+  if (pIndoorCameraD3D->sRotationX)
   {
     v21 = fixpoint_mul(a5, v8) + fixpoint_mul(a6, v29);
 
@@ -4843,9 +4843,9 @@
   memset(&PortalFace, 0, sizeof(stru367));
 
   //get direction the face(определение направленности фейса)*********************************************************************************
-  if ( pFace->pFacePlane_old.vNormal.x * (pIndoor->pVertices[pIndoor->pFaces[uFaceID].pVertexIDs[0]].x - pEngine->pIndoorCameraD3D->vPartyPos.x)
-     + pFace->pFacePlane_old.vNormal.y * (pIndoor->pVertices[pIndoor->pFaces[uFaceID].pVertexIDs[0]].y - pEngine->pIndoorCameraD3D->vPartyPos.y)
-     + pFace->pFacePlane_old.vNormal.z * (pIndoor->pVertices[pIndoor->pFaces[uFaceID].pVertexIDs[0]].z - pEngine->pIndoorCameraD3D->vPartyPos.z) < 0 )
+  if ( pFace->pFacePlane_old.vNormal.x * (pIndoor->pVertices[pIndoor->pFaces[uFaceID].pVertexIDs[0]].x - pIndoorCameraD3D->vPartyPos.x)
+     + pFace->pFacePlane_old.vNormal.y * (pIndoor->pVertices[pIndoor->pFaces[uFaceID].pVertexIDs[0]].y - pIndoorCameraD3D->vPartyPos.y)
+     + pFace->pFacePlane_old.vNormal.z * (pIndoor->pVertices[pIndoor->pFaces[uFaceID].pVertexIDs[0]].z - pIndoorCameraD3D->vPartyPos.z) < 0 )
   {
     PortalFace.direction = true;
   }
@@ -4878,7 +4878,7 @@
   {
     for (uint i = 0; i < pFace->uNumVertices; ++i)
     {
-      pEngine->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible_BLV(pIndoor->pVertices[pFace->pVertexIDs[i]].x,
+      pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible_BLV(pIndoor->pVertices[pFace->pVertexIDs[i]].x,
                                                                      pIndoor->pVertices[pFace->pVertexIDs[i]].y,
                                                                      pIndoor->pVertices[pFace->pVertexIDs[i]].z,
         &PortalFace._view_transformed_z[i + 3], &PortalFace._view_transformed_x[i + 3], &PortalFace._view_transformed_y[i + 3], 0);
@@ -5246,23 +5246,23 @@
   float v13; // [sp+Ch] [bp-4h]@2
   float v14; // [sp+Ch] [bp-4h]@6
 
-  if (pEngine->pIndoorCameraD3D->sRotationX)
+  if (pIndoorCameraD3D->sRotationX)
   {
     v13 = a1->vWorldPosition.x - (double)pParty->vPosition.x;
     v11 = a1->vWorldPosition.y - (double)pParty->vPosition.y;
     v4 = a1->vWorldPosition.z - (double)pParty->vPosition.z;
     //if ( pRenderer->pRenderD3D )
     //{
-      v5 = v11 * pEngine->pIndoorCameraD3D->fRotationYSine + v13 * pEngine->pIndoorCameraD3D->fRotationYCosine;
-      a1->vWorldViewPosition.y = v13 * pEngine->pIndoorCameraD3D->fRotationYSine - v11 * pEngine->pIndoorCameraD3D->fRotationYCosine;
+      v5 = v11 * pIndoorCameraD3D->fRotationYSine + v13 * pIndoorCameraD3D->fRotationYCosine;
+      a1->vWorldViewPosition.y = v13 * pIndoorCameraD3D->fRotationYSine - v11 * pIndoorCameraD3D->fRotationYCosine;
     /*}
     else
     {
       v5 = v13 * pBLVRenderParams->fCosineY - v11 * pBLVRenderParams->fSineY;
       a1->vWorldViewPosition.y = v13 * pBLVRenderParams->fSineY + v11 * pBLVRenderParams->fCosineY;
     }*/
-    a1->vWorldViewPosition.x = v5 * pEngine->pIndoorCameraD3D->fRotationXCosine - v4 * pEngine->pIndoorCameraD3D->fRotationXSine;
-    a1->vWorldViewPosition.z = v5 * pEngine->pIndoorCameraD3D->fRotationXSine + v4 * pEngine->pIndoorCameraD3D->fRotationXCosine;
+    a1->vWorldViewPosition.x = v5 * pIndoorCameraD3D->fRotationXCosine - v4 * pIndoorCameraD3D->fRotationXSine;
+    a1->vWorldViewPosition.z = v5 * pIndoorCameraD3D->fRotationXSine + v4 * pIndoorCameraD3D->fRotationXCosine;
   }
   else
   {
@@ -5271,8 +5271,8 @@
     a1->vWorldViewPosition.z = a1->vWorldPosition.z - (double)pParty->vPosition.z;
     //if ( pRenderer->pRenderD3D )
     //{
-      a1->vWorldViewPosition.x = v12 * pEngine->pIndoorCameraD3D->fRotationYSine + v14 * pEngine->pIndoorCameraD3D->fRotationYCosine;
-      a1->vWorldViewPosition.y = v14 * pEngine->pIndoorCameraD3D->fRotationYSine - v12 * pEngine->pIndoorCameraD3D->fRotationYCosine;
+      a1->vWorldViewPosition.x = v12 * pIndoorCameraD3D->fRotationYSine + v14 * pIndoorCameraD3D->fRotationYCosine;
+      a1->vWorldViewPosition.y = v14 * pIndoorCameraD3D->fRotationYSine - v12 * pIndoorCameraD3D->fRotationYCosine;
     /*}
     else
     {