diff Indoor.cpp @ 1642:8971dc85b8fb

More camera unifications.
author Nomad
date Tue, 17 Sep 2013 20:15:56 +0200
parents 466c5e15f524
children 7182930263b3
line wrap: on
line diff
--- a/Indoor.cpp	Tue Sep 17 18:39:32 2013 +0200
+++ b/Indoor.cpp	Tue Sep 17 20:15:56 2013 +0200
@@ -195,11 +195,11 @@
 
   this->field_0_timer_ = pEventTimer->uTotalGameTimeElapsed;
 
-  this->uFlags = 0;
+  pGame->pIndoorCameraD3D->debug_flags = 0;
   if (viewparams->draw_sw_outlines)
-    this->uFlags |= BLV_RENDER_DRAW_SW_OUTLINES;
+    pGame->pIndoorCameraD3D->debug_flags |= BLV_RENDER_DRAW_SW_OUTLINES;
   if (viewparams->draw_d3d_outlines)
-    this->uFlags |= BLV_RENDER_DRAW_D3D_OUTLINES;
+    pGame->pIndoorCameraD3D->debug_flags |= BLV_RENDER_DRAW_D3D_OUTLINES;
 
   //v2 = a2;
   //this->field_0_timer_ = a2->field_0_timer;
@@ -228,14 +228,14 @@
   }
   if ( pRenderer->pRenderD3D )
   {
-    this->sCosineY = stru_5C6E00->Cos(pGame->pIndoorCameraD3D->sRotationY);
-    this->sSineY = stru_5C6E00->Sin(pGame->pIndoorCameraD3D->sRotationY);
-    this->sCosineNegX = stru_5C6E00->Cos(-pGame->pIndoorCameraD3D->sRotationX);
-    this->sSineNegX = stru_5C6E00->Sin(-pGame->pIndoorCameraD3D->sRotationX);
-    this->fCosineY = cos((3.141592653589793 + 3.141592653589793) * (double)pGame->pIndoorCameraD3D->sRotationY * 0.00048828125);
-    this->fSineY = sin((3.141592653589793 + 3.141592653589793) * (double)pGame->pIndoorCameraD3D->sRotationY * 0.00048828125);
-    this->fCosineNegX = cos((3.141592653589793 + 3.141592653589793) * (double)-pGame->pIndoorCameraD3D->sRotationX * 0.00048828125);
-    this->fSineNegX = sin((3.141592653589793 + 3.141592653589793) * (double)-pGame->pIndoorCameraD3D->sRotationX * 0.00048828125);
+    //this->sCosineY = stru_5C6E00->Cos(pGame->pIndoorCameraD3D->sRotationY);
+    //this->sSineY = stru_5C6E00->Sin(pGame->pIndoorCameraD3D->sRotationY);
+    //this->sCosineNegX = stru_5C6E00->Cos(-pGame->pIndoorCameraD3D->sRotationX);
+    //this->sSineNegX = stru_5C6E00->Sin(-pGame->pIndoorCameraD3D->sRotationX);
+    //this->fCosineY = cos((3.141592653589793 + 3.141592653589793) * (double)pGame->pIndoorCameraD3D->sRotationY * 0.00048828125);
+    //this->fSineY = sin((3.141592653589793 + 3.141592653589793) * (double)pGame->pIndoorCameraD3D->sRotationY * 0.00048828125);
+    //this->fCosineNegX = cos((3.141592653589793 + 3.141592653589793) * (double)-pGame->pIndoorCameraD3D->sRotationX * 0.00048828125);
+    //this->fSineNegX = sin((3.141592653589793 + 3.141592653589793) * (double)-pGame->pIndoorCameraD3D->sRotationX * 0.00048828125);
     this->field_64 = pViewport->field_30;
     
     this->uViewportX = pViewport->uScreen_TL_X;
@@ -818,7 +818,7 @@
       nodes[num_nodes].viewing_portal_id = uFaceID;
       AddBspNodeToRenderList(++num_nodes - 1);
     }
-    if (pBLVRenderParams->uFlags & BLV_RENDER_DRAW_SW_OUTLINES)
+    if (pGame->pIndoorCameraD3D->debug_flags & BLV_RENDER_DRAW_SW_OUTLINES)
       pGame->pIndoorCameraD3D->PrepareAndDrawDebugOutline(pFace, 0x1E1EFF);
     //pGame->pIndoorCameraD3D->DebugDrawPortal(pFace);
   }
@@ -6892,16 +6892,16 @@
     v4 = a1->vWorldPosition.z - (double)pParty->vPosition.z;
     //if ( pRenderer->pRenderD3D )
     //{
-      v5 = v11 * pBLVRenderParams->fSineY + v13 * pBLVRenderParams->fCosineY;
-      a1->vWorldViewPosition.y = v13 * pBLVRenderParams->fSineY - v11 * pBLVRenderParams->fCosineY;
+      v5 = v11 * pGame->pIndoorCameraD3D->fRotationYSine + v13 * pGame->pIndoorCameraD3D->fRotationYCosine;
+      a1->vWorldViewPosition.y = v13 * pGame->pIndoorCameraD3D->fRotationYSine - v11 * pGame->pIndoorCameraD3D->fRotationYCosine;
     /*}
     else
     {
       v5 = v13 * pBLVRenderParams->fCosineY - v11 * pBLVRenderParams->fSineY;
       a1->vWorldViewPosition.y = v13 * pBLVRenderParams->fSineY + v11 * pBLVRenderParams->fCosineY;
     }*/
-    a1->vWorldViewPosition.x = v5 * pBLVRenderParams->fCosineNegX - v4 * pBLVRenderParams->fSineNegX;
-    a1->vWorldViewPosition.z = v5 * pBLVRenderParams->fSineNegX + v4 * pBLVRenderParams->fCosineNegX;
+    a1->vWorldViewPosition.x = v5 * pGame->pIndoorCameraD3D->fRotationXCosine - v4 * pGame->pIndoorCameraD3D->fRotationXSine;
+    a1->vWorldViewPosition.z = v5 * pGame->pIndoorCameraD3D->fRotationXSine + v4 * pGame->pIndoorCameraD3D->fRotationXCosine;
   }
   else
   {
@@ -6910,8 +6910,8 @@
     a1->vWorldViewPosition.z = a1->vWorldPosition.z - (double)pParty->vPosition.z;
     //if ( pRenderer->pRenderD3D )
     //{
-      a1->vWorldViewPosition.x = v12 * pBLVRenderParams->fSineY + v14 * pBLVRenderParams->fCosineY;
-      a1->vWorldViewPosition.y = v14 * pBLVRenderParams->fSineY - v12 * pBLVRenderParams->fCosineY;
+      a1->vWorldViewPosition.x = v12 * pGame->pIndoorCameraD3D->fRotationYSine + v14 * pGame->pIndoorCameraD3D->fRotationYCosine;
+      a1->vWorldViewPosition.y = v14 * pGame->pIndoorCameraD3D->fRotationYSine - v12 * pGame->pIndoorCameraD3D->fRotationYCosine;
     /*}
     else
     {