diff Game.cpp @ 1669:bd28d08e2c75

Merge
author Ritor1
date Tue, 17 Sep 2013 22:55:48 +0600
parents afc1c3514dd5
children 8971dc85b8fb
line wrap: on
line diff
--- a/Game.cpp	Tue Sep 17 22:55:34 2013 +0600
+++ b/Game.cpp	Tue Sep 17 22:55:48 2013 +0600
@@ -17,7 +17,6 @@
 
 #include "Game.h"
 #include "Party.h"
-#include "IndoorCamera.h"
 #include "Viewport.h"
 #include "Time.h"
 #include "Outdoor.h"
@@ -74,14 +73,28 @@
   uFlags2 &= ~0x02;
   if ( pParty->_497FC5_check_party_perception_against_level() )
     uFlags2 |= 2u;
-  pIndoorCamera->sRotationX = pParty->sRotationX;
-  pIndoorCamera->sRotationY = pParty->sRotationY;
-  //pIndoorCamera->pos.x = pParty->vPosition.x - ((__int64)pParty->y_rotation_granularity * stru_5C6E00->SinCos(pIndoorCamera->sRotationY)) / 2048.0;//12552
-  //pIndoorCamera->pos.y = pParty->vPosition.y - ((__int64)pParty->y_rotation_granularity * stru_5C6E00->SinCos(pIndoorCamera->sRotationY)) / 2048.0;//800
-  pIndoorCamera->pos.x = pParty->vPosition.x - pParty->y_rotation_granularity * cosf(2 * 3.141592653589 * pIndoorCamera->sRotationY / 2048.0);
-  pIndoorCamera->pos.y = pParty->vPosition.y - pParty->y_rotation_granularity * sinf(2 * 3.141592653589 * pIndoorCamera->sRotationY / 2048.0);
-  pIndoorCamera->pos.z = pParty->vPosition.z + pParty->sEyelevel;//193, but real 353
-  pIndoorCamera->Initialize2();
+
+  pGame->pIndoorCameraD3D->sRotationX = pParty->sRotationX;
+  pGame->pIndoorCameraD3D->sRotationY = pParty->sRotationY;
+  pGame->pIndoorCameraD3D->vPartyPos.x = pParty->vPosition.x - pParty->y_rotation_granularity * cosf(2 * 3.141592653589 * pParty->sRotationY / 2048.0);
+  pGame->pIndoorCameraD3D->vPartyPos.y = pParty->vPosition.y - pParty->y_rotation_granularity * sinf(2 * 3.141592653589 * pParty->sRotationY / 2048.0);
+  pGame->pIndoorCameraD3D->vPartyPos.z = pParty->vPosition.z + pParty->sEyelevel;//193, but real 353
+
+  //pIndoorCamera->Initialize2();
+  {
+    pIndoorCameraD3D->fRotationYSine = sin((3.141592653589793 + 3.141592653589793) * (double)pParty->sRotationY / 2048.0);
+    pIndoorCameraD3D->fRotationYCosine = cos((3.141592653589793 + 3.141592653589793) * (double)pParty->sRotationY / 2048.0);
+    if ( byte_4D864C && pGame->uFlags & 0x80 || uCurrentlyLoadedLevelType == LEVEL_Indoor)
+    {
+      pIndoorCameraD3D->fRotationXSine = sin((3.141592653589793 + 3.141592653589793) * (double)-pParty->sRotationX / 2048.0);
+      pIndoorCameraD3D->fRotationXCosine = cos((3.141592653589793 + 3.141592653589793) * (double)-pParty->sRotationX / 2048.0);
+    }
+    else
+    {
+      pIndoorCameraD3D->fRotationXSine = sin((3.141592653589793 + 3.141592653589793) * (double)pParty->sRotationX / 2048.0);
+      pIndoorCameraD3D->fRotationXCosine = cos((3.141592653589793 + 3.141592653589793) * (double)pParty->sRotationX / 2048.0);
+    }
+  }
   pIndoorCameraD3D->CreateWorldMatrixAndSomeStuff();
   pIndoorCameraD3D->_4374E8_ProllyBuildFrustrum();