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

GameOver h/cpp
author a.parshin
date Sun, 10 May 2015 03:21:14 +0200
parents a902abdfc7f2
children e06a3fe9ad6e
line wrap: on
line diff
--- a/Engine/Graphics/Outdoor.cpp	Sun May 10 02:04:52 2015 +0200
+++ b/Engine/Graphics/Outdoor.cpp	Sun May 10 03:21:14 2015 +0200
@@ -83,9 +83,9 @@
 void OutdoorLocation::ExecDraw(unsigned int bRedraw)
 {
 
-  pEngine->pIndoorCameraD3D->debug_flags = 0;
+  pIndoorCameraD3D->debug_flags = 0;
   if (viewparams->draw_d3d_outlines)
-    pEngine->pIndoorCameraD3D->debug_flags |= ODM_RENDER_DRAW_D3D_OUTLINES;
+    pIndoorCameraD3D->debug_flags |= ODM_RENDER_DRAW_D3D_OUTLINES;
 
   if (bRedraw || true/*pRenderer->pRenderD3D*/)
   {
@@ -104,7 +104,7 @@
   if ( pParty->uCurrentMinute != pOutdoor->uLastSunlightUpdateMinute )
     pOutdoor->UpdateSunlightVectors();
   pOutdoor->UpdateFog();
-  //pEngine->pIndoorCameraD3D->sr_Reset_list_0037C();
+  //pIndoorCameraD3D->sr_Reset_list_0037C();
 
   //if (pRenderer->pRenderD3D) // d3d - redraw always
   {
@@ -132,7 +132,7 @@
   /*if ( !pRenderer->pRenderD3D )
   {
     pRenderer->ExecOutdoorDrawSW();
-    pEngine->pIndoorCameraD3D->sr_438240_draw_lits();
+    pIndoorCameraD3D->sr_438240_draw_lits();
   }*/
   pEngine->PushStationaryLights(-1);
   pEngine->PrepareBloodsplats();
@@ -622,9 +622,9 @@
     currVertex--;
   }
 
-  if ( ((double)pEngine->pIndoorCameraD3D->vPartyPos.x - a2->vWorldPosition.x) * v26
-    + ((double)pEngine->pIndoorCameraD3D->vPartyPos.z - a2->vWorldPosition.z) * v25
-    + ((double)pEngine->pIndoorCameraD3D->vPartyPos.y - a2->vWorldPosition.y) * v24 > 0.0 )
+  if ( ((double)pIndoorCameraD3D->vPartyPos.x - a2->vWorldPosition.x) * v26
+    + ((double)pIndoorCameraD3D->vPartyPos.z - a2->vWorldPosition.z) * v25
+    + ((double)pIndoorCameraD3D->vPartyPos.y - a2->vWorldPosition.y) * v24 > 0.0 )
   {
 
     v19 = a2[1].vWorldViewPosition.x - a2->vWorldViewPosition.x;
@@ -2445,8 +2445,8 @@
             z = pActors[i].vPosition.z;
         }
       }
-      v8 = stru_5C6E00->Atan2(pActors[i].vPosition.x - pEngine->pIndoorCameraD3D->vPartyPos.x,
-                              pActors[i].vPosition.y - pEngine->pIndoorCameraD3D->vPartyPos.y);
+      v8 = stru_5C6E00->Atan2(pActors[i].vPosition.x - pIndoorCameraD3D->vPartyPos.x,
+                              pActors[i].vPosition.y - pIndoorCameraD3D->vPartyPos.y);
 	  LOWORD(v9) = pActors[i].uYawAngle;
       v41 = ((signed int)(stru_5C6E00->uIntegerPi + ((signed int)stru_5C6E00->uIntegerPi >> 3) + v9 - v8) >> 8) & 7;
       if ( pParty->bTurnBasedModeOn )
@@ -2485,34 +2485,34 @@
         //LOBYTE(v16) = _4E94D3_light_type;
         pMobileLightsStack->AddLight(x, y, z, 0, v15->uGlowRadius, 0xFFu, 0xFFu, 0xFFu, _4E94D3_light_type);
       }
-      v17 = (x - pEngine->pIndoorCameraD3D->vPartyPos.x) << 16;
-      if (pEngine->pIndoorCameraD3D->sRotationX)
+      v17 = (x - pIndoorCameraD3D->vPartyPos.x) << 16;
+      if (pIndoorCameraD3D->sRotationX)
       {
-        v18 = (y - pEngine->pIndoorCameraD3D->vPartyPos.y) << 16;
-        v47 = (fixpoint_mul(v17, pEngine->pIndoorCameraD3D->int_cosine_y) + fixpoint_mul(v18, pEngine->pIndoorCameraD3D->int_sine_y));
-        v50 = fixpoint_mul(v17, pEngine->pIndoorCameraD3D->int_sine_y);
-        v53 = fixpoint_mul(v18, pEngine->pIndoorCameraD3D->int_cosine_y);
-        v44 = (z - pEngine->pIndoorCameraD3D->vPartyPos.z) << 16;
-        v19 = (fixpoint_mul(v44, pEngine->pIndoorCameraD3D->int_sine_x) + fixpoint_mul(v47, pEngine->pIndoorCameraD3D->int_cosine_x));
-        X = fixpoint_mul(v44, pEngine->pIndoorCameraD3D->int_sine_x) + fixpoint_mul(v47, pEngine->pIndoorCameraD3D->int_cosine_x);
+        v18 = (y - pIndoorCameraD3D->vPartyPos.y) << 16;
+        v47 = (fixpoint_mul(v17, pIndoorCameraD3D->int_cosine_y) + fixpoint_mul(v18, pIndoorCameraD3D->int_sine_y));
+        v50 = fixpoint_mul(v17, pIndoorCameraD3D->int_sine_y);
+        v53 = fixpoint_mul(v18, pIndoorCameraD3D->int_cosine_y);
+        v44 = (z - pIndoorCameraD3D->vPartyPos.z) << 16;
+        v19 = (fixpoint_mul(v44, pIndoorCameraD3D->int_sine_x) + fixpoint_mul(v47, pIndoorCameraD3D->int_cosine_x));
+        X = fixpoint_mul(v44, pIndoorCameraD3D->int_sine_x) + fixpoint_mul(v47, pIndoorCameraD3D->int_cosine_x);
         if ( v19 < 262144 || v19 > pODMRenderParams->shading_dist_mist << 16 )
           continue;
         v20 = v53 - v50;
         v42 = v53 - v50;
-        v21 = (fixpoint_mul(v44, pEngine->pIndoorCameraD3D->int_cosine_x) - fixpoint_mul(v47, pEngine->pIndoorCameraD3D->int_sine_x));
+        v21 = (fixpoint_mul(v44, pIndoorCameraD3D->int_cosine_x) - fixpoint_mul(v47, pIndoorCameraD3D->int_sine_x));
       }
       else
       {
-        v48 = (y - pEngine->pIndoorCameraD3D->vPartyPos.y) << 16;
-        v51 = fixpoint_mul(v17, pEngine->pIndoorCameraD3D->int_cosine_y);
-        v22 = fixpoint_mul(v48, pEngine->pIndoorCameraD3D->int_sine_y);
+        v48 = (y - pIndoorCameraD3D->vPartyPos.y) << 16;
+        v51 = fixpoint_mul(v17, pIndoorCameraD3D->int_cosine_y);
+        v22 = fixpoint_mul(v48, pIndoorCameraD3D->int_sine_y);
         X = v22 + v51;
         if ( v22 + v51 < 262144 || v22 + v51 > pODMRenderParams->shading_dist_mist << 16 )
           continue;
-        v23 = fixpoint_mul(((x - pEngine->pIndoorCameraD3D->vPartyPos.x) << 16), pEngine->pIndoorCameraD3D->int_sine_y);
-        v20 = fixpoint_mul(v48, pEngine->pIndoorCameraD3D->int_cosine_y) - v23;
-        v42 = fixpoint_mul(v48, pEngine->pIndoorCameraD3D->int_cosine_y) - v23;
-        v21 = (z - pEngine->pIndoorCameraD3D->vPartyPos.z) << 16;
+        v23 = fixpoint_mul(((x - pIndoorCameraD3D->vPartyPos.x) << 16), pIndoorCameraD3D->int_sine_y);
+        v20 = fixpoint_mul(v48, pIndoorCameraD3D->int_cosine_y) - v23;
+        v42 = fixpoint_mul(v48, pIndoorCameraD3D->int_cosine_y) - v23;
+        v21 = (z - pIndoorCameraD3D->vPartyPos.z) << 16;
       }
       v45 = v21;
       v24 = abs(v20);
@@ -4538,8 +4538,8 @@
 	strcpy(Source, &pFilename[v7]);
 	strcpy(pOutdoor->pLevelFilename, Source);
 	pWeather->Initialize();
-	pEngine->pIndoorCameraD3D->sRotationY = pParty->sRotationY;
-	pEngine->pIndoorCameraD3D->sRotationX = pParty->sRotationX;
+	pIndoorCameraD3D->sRotationY = pParty->sRotationY;
+	pIndoorCameraD3D->sRotationX = pParty->sRotationX;
 	//pODMRenderParams->RotationToInts();
 	pOutdoor->UpdateSunlightVectors();