Mercurial > mm7
changeset 1642:8971dc85b8fb
More camera unifications.
author | Nomad |
---|---|
date | Tue, 17 Sep 2013 20:15:56 +0200 |
parents | 466c5e15f524 |
children | 7182930263b3 dbd6f940f26c |
files | AudioPlayer.cpp Game.cpp Indoor.cpp Indoor.h IndoorCameraD3D.cpp IndoorCameraD3D.h Outdoor.cpp Outdoor_stuff.h ParticleEngine.cpp Render.cpp _deleted.cpp mm7_3.cpp |
diffstat | 12 files changed, 324 insertions(+), 298 deletions(-) [+] |
line wrap: on
line diff
--- a/AudioPlayer.cpp Tue Sep 17 18:39:32 2013 +0200 +++ b/AudioPlayer.cpp Tue Sep 17 20:15:56 2013 +0200 @@ -1494,10 +1494,10 @@ a1.vWorldPosition.z = v11; if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) { - v16 = pBLVRenderParams->fCosineNegX; - v17 = pBLVRenderParams->fSineNegX; - v55 = pBLVRenderParams->fCosineY; - v56 = pBLVRenderParams->fSineY; + v16 = pGame->pIndoorCameraD3D->fRotationXCosine; + v17 = pGame->pIndoorCameraD3D->fRotationXSine; + v55 = pGame->pIndoorCameraD3D->fRotationYCosine; + v56 = pGame->pIndoorCameraD3D->fRotationYSine; if (pGame->pIndoorCameraD3D->sRotationX) { v58 = a1.vWorldPosition.x - (double)pParty->vPosition.x;
--- a/Game.cpp Tue Sep 17 18:39:32 2013 +0200 +++ b/Game.cpp Tue Sep 17 20:15:56 2013 +0200 @@ -81,20 +81,7 @@ 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->CalculateRotations(pParty->sRotationX, pParty->sRotationY); pIndoorCameraD3D->CreateWorldMatrixAndSomeStuff(); pIndoorCameraD3D->_4374E8_ProllyBuildFrustrum();
--- 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 {
--- a/Indoor.h Tue Sep 17 18:39:32 2013 +0200 +++ b/Indoor.h Tue Sep 17 20:15:56 2013 +0200 @@ -469,15 +469,12 @@ -#define BLV_RENDER_DRAW_SW_OUTLINES 1 -#define BLV_RENDER_DRAW_D3D_OUTLINES 2 /* 162 */ #pragma pack(push, 1) struct BLVRenderParams { - inline BLVRenderParams(): - uFlags(0) + inline BLVRenderParams() { uViewportX = 0; uViewportY = 0; @@ -488,19 +485,19 @@ void Reset(); int field_0_timer_; - int uFlags; // & INDOOR_CAMERA_DRAW_D3D_OUTLINES: render d3d outlines + int _unused_uFlags; // & INDOOR_CAMERA_DRAW_D3D_OUTLINES: render d3d outlines Vec3_int_ _unused_vPartyPos; int _unused_sPartyRotY; int _unused_sPartyRotX; int uPartySectorID; - int sCosineY; - int sSineY; - int sCosineNegX; - int sSineNegX; - float fCosineY; - float fSineY; - float fCosineNegX; - float fSineNegX; + int _unused_sCosineY; // matches ODMRenderParams::int sines and cosines + int _unused_sSineY; // computed in 0048600E + int _unused_sCosineNegX; // merged into IndoorCameraD3D + int _unused_sSineNegX; // --//-- + float _unused_fCosineY; // matches old IndoorCamera::fRotationCosineY (new IndoorCameraD3D::fRotationCosineY) + float _unused_fSineY; // matches old IndoorCamera::fRotationSineY (new IndoorCameraD3D::fRotationSineY) + float _unused_fCosineNegX; // the same + float _unused_fSineNegX; // the same int fov_rad_fixpoint; int fov_rad_inv_fixpoint;//float unsigned __int16 *pRenderTarget;
--- a/IndoorCameraD3D.cpp Tue Sep 17 18:39:32 2013 +0200 +++ b/IndoorCameraD3D.cpp Tue Sep 17 20:15:56 2013 +0200 @@ -160,18 +160,18 @@ to_z = (z - pGame->pIndoorCameraD3D->vPartyPos.z) << 16; //if ( pRenderer->pRenderD3D ) //{ - v14 = (unsigned __int64)(to_x * (signed __int64)pBLVRenderParams->sCosineY) - + (unsigned __int64)(to_y * (signed __int64)pBLVRenderParams->sSineY); - v9 = (unsigned __int64)(to_x * (signed __int64)pBLVRenderParams->sSineY) - - (unsigned __int64)(to_y * (signed __int64)pBLVRenderParams->sCosineY); + v14 = (unsigned __int64)(to_x * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) + + (unsigned __int64)(to_y * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y); + v9 = (unsigned __int64)(to_x * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) + - (unsigned __int64)(to_y * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y); //} a3a = (z - pGame->pIndoorCameraD3D->vPartyPos.z) << 16; - a2b = (unsigned __int64)(to_z * (signed __int64)pBLVRenderParams->sSineNegX) >> 16; + a2b = (unsigned __int64)(to_z * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16; //v10 = pOutX; - *pOutX = ((unsigned __int64)(v14 * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16) - a2b; + *pOutX = ((unsigned __int64)(v14 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16) - a2b; *pOutZ = v9; - *pOutY = ((unsigned __int64)(v14 * (signed __int64)pBLVRenderParams->sSineNegX) >> 16) - + ((unsigned __int64)(a3a * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16); + *pOutY = ((unsigned __int64)(v14 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16) + + ((unsigned __int64)(a3a * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16); } else { @@ -179,10 +179,10 @@ //if ( pRenderer->pRenderD3D ) //{ //v10 = pOutX; - *pOutX = (unsigned __int64)(to_x * (signed __int64)pBLVRenderParams->sCosineY) - + (unsigned __int64)(to_y * (signed __int64)pBLVRenderParams->sSineY); - *pOutZ = (unsigned __int64)(to_x * (signed __int64)pBLVRenderParams->sSineY) - - (unsigned __int64)(to_y * (signed __int64)pBLVRenderParams->sCosineY); + *pOutX = (unsigned __int64)(to_x * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) + + (unsigned __int64)(to_y * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y); + *pOutZ = (unsigned __int64)(to_x * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) + - (unsigned __int64)(to_y * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y); //} } if (!bDoNotShow) @@ -1608,4 +1608,39 @@ while ( v3 ); } return result; +} + + + +// -- new +// merged from IndoorCamera::Initialize2 +// and ODMRenderParams::RotationToInts +// and BLVRenderParams::Reset +void IndoorCameraD3D::CalculateRotations(int camera_rot_x, int camera_rot_y) +{ + sRotationX = camera_rot_x; + sRotationY = camera_rot_y; + + fRotationYSine = sin((3.141592653589793 + 3.141592653589793) * (double)sRotationY / 2048.0); + fRotationYCosine = cos((3.141592653589793 + 3.141592653589793) * (double)sRotationY / 2048.0); + if (byte_4D864C && pGame->uFlags & 0x80 || uCurrentlyLoadedLevelType == LEVEL_Indoor) + { + fRotationXSine = sin((3.141592653589793 + 3.141592653589793) * (double)-sRotationX / 2048.0); + fRotationXCosine = cos((3.141592653589793 + 3.141592653589793) * (double)-sRotationX / 2048.0); + + int_sine_y = stru_5C6E00->Sin( pGame->pIndoorCameraD3D->sRotationY); + int_cosine_y = stru_5C6E00->Cos( pGame->pIndoorCameraD3D->sRotationY); + int_sine_x = stru_5C6E00->Sin(-pGame->pIndoorCameraD3D->sRotationX); + int_cosine_x = stru_5C6E00->Cos(-pGame->pIndoorCameraD3D->sRotationX); + } + else + { + fRotationXSine = sin((3.141592653589793 + 3.141592653589793) * (double)sRotationX / 2048.0); + fRotationXCosine = cos((3.141592653589793 + 3.141592653589793) * (double)sRotationX / 2048.0); + + int_sine_y = stru_5C6E00->Sin(pGame->pIndoorCameraD3D->sRotationY); + int_cosine_y = stru_5C6E00->Cos(pGame->pIndoorCameraD3D->sRotationY); + int_sine_x = stru_5C6E00->Sin(pGame->pIndoorCameraD3D->sRotationX); + int_cosine_x = stru_5C6E00->Cos(pGame->pIndoorCameraD3D->sRotationX); + } } \ No newline at end of file
--- a/IndoorCameraD3D.h Tue Sep 17 18:39:32 2013 +0200 +++ b/IndoorCameraD3D.h Tue Sep 17 20:15:56 2013 +0200 @@ -110,6 +110,13 @@ }; #pragma pack(pop) + + +#define BLV_RENDER_DRAW_SW_OUTLINES (1 << 0) // 1 +#define BLV_RENDER_DRAW_D3D_OUTLINES (1 << 1) // 2 +#define ODM_RENDER_DRAW_D3D_OUTLINES (1 << 2) // 4 +#define ODM_RENDER_DRAW_TERRAIN_OUTLINES (1 << 3) // 8 + /* 123 */ #pragma pack(push, 1) struct IndoorCameraD3D @@ -223,7 +230,9 @@ unsigned int list_0037C_size; IndoorCameraD3D_stru2 list_E0380[256]; int list_E0380_size; - + + + void CalculateRotations(int camera_rot_x, int camera_rot_y); int sRotationY; // moved from 157 struct IndoorCamera::18 int sRotationX; // moved from 157 struct IndoorCamera::14 float fRotationYSine; // moved from 157 struct IndoorCamera::2C @@ -232,5 +241,15 @@ float fRotationXCosine; // moved from 157 struct IndoorCamera::38 Vec3<int> vPartyPos; // moved from 157 struct IndoorCamera::00 // merged from 162 struct BLVRenderParams::08 + int debug_flags; // moved from 157 struct IndoorCamera::4C + // merged from 162 struct BLVRenderParams::04 + int int_sine_y; // moved from 157 struct ODMRenderParams::1C + // merged from 162 struct BLVRenderParams::24 + int int_cosine_y; // moved from 157 struct ODMRenderParams::20 + // merged from 162 struct BLVRenderParams::20 + int int_sine_x; // moved from 157 struct ODMRenderParams::24 + // merged from 162 struct BLVRenderParams::2C + int int_cosine_x; // moved from 157 struct ODMRenderParams::28 + // merged from 162 struct BLVRenderParams::28 }; #pragma pack(pop) \ No newline at end of file
--- a/Outdoor.cpp Tue Sep 17 18:39:32 2013 +0200 +++ b/Outdoor.cpp Tue Sep 17 20:15:56 2013 +0200 @@ -87,14 +87,13 @@ int v4; // ST04_4@19 int v5; // eax@19 - pODMRenderParams->flags = 0; + pGame->pIndoorCameraD3D->debug_flags = 0; if (viewparams->draw_d3d_outlines) - pODMRenderParams->flags |= ODM_RENDER_DRAW_D3D_OUTLINES; - //INDOOR_CAMERA_DRAW_TERRAIN_OUTLINES + pGame->pIndoorCameraD3D->debug_flags |= ODM_RENDER_DRAW_D3D_OUTLINES; if (bRedraw || pRenderer->pRenderD3D) { - pODMRenderParams->RotationToInts(); + //pODMRenderParams->RotationToInts(); sub_481ED9_MessWithODMRenderParams(); } @@ -3005,34 +3004,34 @@ if (pGame->pIndoorCameraD3D->sRotationX) { v18 = (y - pGame->pIndoorCameraD3D->vPartyPos.y) << 16; - v47 = ((unsigned __int64)(v17 * (signed __int64)pODMRenderParams->camera_rotation_y_int_cosine) >> 16) - + ((unsigned __int64)(v18 * (signed __int64)pODMRenderParams->camera_rotation_y_int_sine) >> 16); - v50 = (unsigned __int64)(v17 * (signed __int64)pODMRenderParams->camera_rotation_y_int_sine) >> 16; - v53 = (unsigned __int64)(v18 * (signed __int64)pODMRenderParams->camera_rotation_y_int_cosine) >> 16; + v47 = ((unsigned __int64)(v17 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16) + + ((unsigned __int64)(v18 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16); + v50 = (unsigned __int64)(v17 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16; + v53 = (unsigned __int64)(v18 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16; v44 = (z - pGame->pIndoorCameraD3D->vPartyPos.z) << 16; - v19 = ((unsigned __int64)(v44 * (signed __int64)pODMRenderParams->camera_rotation_x_int_sine) >> 16) - + ((unsigned __int64)(v47 * (signed __int64)pODMRenderParams->camera_rotation_x_int_cosine) >> 16); - X = ((unsigned __int64)(v44 * (signed __int64)pODMRenderParams->camera_rotation_x_int_sine) >> 16) - + ((unsigned __int64)(v47 * (signed __int64)pODMRenderParams->camera_rotation_x_int_cosine) >> 16); + v19 = ((unsigned __int64)(v44 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16) + + ((unsigned __int64)(v47 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16); + X = ((unsigned __int64)(v44 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16) + + ((unsigned __int64)(v47 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16); if ( v19 < 262144 || v19 > pODMRenderParams->shading_dist_mist << 16 ) continue; v20 = v53 - v50; v42 = v53 - v50; - v21 = ((unsigned __int64)(v44 * (signed __int64)pODMRenderParams->camera_rotation_x_int_cosine) >> 16) - - ((unsigned __int64)(v47 * (signed __int64)pODMRenderParams->camera_rotation_x_int_sine) >> 16); + v21 = ((unsigned __int64)(v44 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16) + - ((unsigned __int64)(v47 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16); } else { v48 = (y - pGame->pIndoorCameraD3D->vPartyPos.y) << 16; - v51 = (unsigned __int64)(v17 * (signed __int64)pODMRenderParams->camera_rotation_y_int_cosine) >> 16; - v22 = (unsigned __int64)(v48 * (signed __int64)pODMRenderParams->camera_rotation_y_int_sine) >> 16; + v51 = (unsigned __int64)(v17 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16; + v22 = (unsigned __int64)(v48 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16; X = v22 + v51; if ( v22 + v51 < 262144 || v22 + v51 > pODMRenderParams->shading_dist_mist << 16 ) continue; v23 = (unsigned __int64)(((x - pGame->pIndoorCameraD3D->vPartyPos.x) << 16) - * (signed __int64)pODMRenderParams->camera_rotation_y_int_sine) >> 16; - v20 = ((unsigned __int64)(v48 * (signed __int64)pODMRenderParams->camera_rotation_y_int_cosine) >> 16) - v23; - v42 = ((unsigned __int64)(v48 * (signed __int64)pODMRenderParams->camera_rotation_y_int_cosine) >> 16) - v23; + * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16; + v20 = ((unsigned __int64)(v48 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16) - v23; + v42 = ((unsigned __int64)(v48 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16) - v23; v21 = (z - pGame->pIndoorCameraD3D->vPartyPos.z) << 16; } v45 = v21; @@ -3519,7 +3518,7 @@ pActors[ai_near_actors_ids[i]].uAttributes |= 0x0400; } //----- (0046BE0A) -------------------------------------------------------- -void ODM_UpdateUserInputAndOther() +void ODM_UpdateUserInputAndOther() { bool v0; // eax@5 char pOut[32]; // [sp+8h] [bp-20h]@5 @@ -3554,7 +3553,7 @@ check_event_triggers(); } //----- (0041F54A) -------------------------------------------------------- -void LoadActualSkyFrame() +void LoadActualSkyFrame() { if ( pTexture_RestUI_CurrentSkyFrame ) pTexture_RestUI_CurrentSkyFrame->Release(); @@ -3646,14 +3645,5 @@ this->int_fov_rad_inv = 65536 / v4; this->field_50 = 115; //sr_6BE060[1] = 1; - RotationToInts(); + //RotationToInts(); } - -//----- (0048600E) -------------------------------------------------------- -void ODMRenderParams::RotationToInts() -{ - camera_rotation_y_int_sine = stru_5C6E00->Sin(pGame->pIndoorCameraD3D->sRotationY); - camera_rotation_y_int_cosine = stru_5C6E00->Cos(pGame->pIndoorCameraD3D->sRotationY); - camera_rotation_x_int_sine = stru_5C6E00->Sin(pGame->pIndoorCameraD3D->sRotationX); - camera_rotation_x_int_cosine = stru_5C6E00->Cos(pGame->pIndoorCameraD3D->sRotationX); -} \ No newline at end of file
--- a/Outdoor_stuff.h Tue Sep 17 18:39:32 2013 +0200 +++ b/Outdoor_stuff.h Tue Sep 17 20:15:56 2013 +0200 @@ -88,11 +88,6 @@ extern stru149 stru_8019C8; - - -#define ODM_RENDER_DRAW_D3D_OUTLINES (1 << 1) // 2 -#define ODM_RENDER_DRAW_TERRAIN_OUTLINES (1 << 2) // 4 - /* 88 */ #pragma pack(push, 1) struct ODMRenderParams @@ -114,23 +109,22 @@ } void Initialize(); - void RotationToInts(); int uPickDepth; int shading_dist_shade; int shading_dist_shademist; int shading_dist_mist; unsigned int uCameraFovInDegrees; - int int_fov_rad; // 157 struct IndoorCamera::fov_rad - int int_fov_rad_inv; // 157 struct IndoorCamera::fov_rad_inv - int camera_rotation_y_int_sine; - int camera_rotation_y_int_cosine; - int camera_rotation_x_int_sine; - int camera_rotation_x_int_cosine; + int int_fov_rad; // 157 struct IndoorCamera::fov_rad + int int_fov_rad_inv; // 157 struct IndoorCamera::fov_rad_inv + int _unused_camera_rotation_y_int_sine; // merged with BLVRenderParams equivalents + int _unused_camera_rotation_y_int_cosine; // into IndoorCameraD3D + int _unused_camera_rotation_x_int_sine; // --//-- + int _unused_camera_rotation_x_int_cosine; // --//-- int uNumPolygons; - unsigned int uNumEdges; - unsigned int uNumSurfs; - unsigned int uNumSpans; + unsigned int _unused_uNumEdges; + unsigned int _unused_uNumSurfs; + unsigned int _unused_uNumSpans; unsigned int uNumBillboards; float field_40; int field_44; @@ -146,7 +140,6 @@ int building_gamme; int terrain_gamma; - unsigned int flags; // moved from 157 struct IndoorCamera::4C unsigned int uMapGridCellX; // moved from 157 struct IndoorCamera::0C unsigned int uMapGridCellZ; // moved from 157 struct IndoorCamera::10 };
--- a/ParticleEngine.cpp Tue Sep 17 18:39:32 2013 +0200 +++ b/ParticleEngine.cpp Tue Sep 17 20:15:56 2013 +0200 @@ -313,22 +313,22 @@ int _uParticleID = (int)(floorf(pParticle->_x + 0.5f) - pBLVRenderParams->vPartyPos.x) << 16; //v12 = pParticle->_y + 6.7553994e15; y = (int)(floorf(pParticle->_y + 0.5f) - pBLVRenderParams->vPartyPos.y) << 16; - z = (unsigned __int64)(y * (signed __int64)pBLVRenderParams->sSineY) >> 16; - HIDWORD(a5) = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pBLVRenderParams->sCosineY) >> 16) + z = (unsigned __int64)(y * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16; + HIDWORD(a5) = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16) - z; - a6 = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pBLVRenderParams->sSineY) >> 16; + a6 = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16; //v13 = pParticle->_z + 6.7553994e15; _uParticleID = (int)(floorf(pParticle->_z + 0.5f) - pBLVRenderParams->vPartyPos.z) << 16; - z = ((unsigned __int64)(SHIDWORD(a5) * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16) - - ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pBLVRenderParams->sSineNegX) >> 16); + z = ((unsigned __int64)(SHIDWORD(a5) * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16) + - ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16); v14 = z; - HIDWORD(v13) = (unsigned __int64)(SHIDWORD(a5) * (signed __int64)pBLVRenderParams->sSineNegX) >> 16; - HIDWORD(a5) = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16; + HIDWORD(v13) = (unsigned __int64)(SHIDWORD(a5) * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16; + HIDWORD(a5) = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16; //LODWORD(v15) = pBLVRenderParams->field_40 << 16; //HIDWORD(v15) = pBLVRenderParams->field_40 >> 16; //v16 = v15 / z; v16 = fixpoint_div(pBLVRenderParams->field_40, z); - v17 = (unsigned __int64)(y * (signed __int64)pBLVRenderParams->sCosineY) >> 16; + v17 = (unsigned __int64)(y * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16; pParticle->_screenspace_scale = v16; _uParticleID = (unsigned __int64)(v16 * (signed __int64)(a6 + v17)) >> 16; LODWORD(v18) = pBLVRenderParams->uViewportCenterX @@ -343,20 +343,20 @@ } int _uParticleID = (x_int - pBLVRenderParams->vPartyPos.x) << 16; y = (y_int_ - pBLVRenderParams->vPartyPos.y) << 16; - HIDWORD(a5) = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pBLVRenderParams->sCosineY) >> 16) - - ((unsigned __int64)(y * (signed __int64)pBLVRenderParams->sSineY) >> 16); - a6 = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pBLVRenderParams->sSineY) >> 16; - z_int_4 = (unsigned __int64)(y * (signed __int64)pBLVRenderParams->sCosineY) >> 16; + HIDWORD(a5) = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16) + - ((unsigned __int64)(y * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16); + a6 = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16; + z_int_4 = (unsigned __int64)(y * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16; _uParticleID = (z_int_ - pBLVRenderParams->vPartyPos.z) << 16; - v21 = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pBLVRenderParams->sSineNegX) >> 16; - v22 = ((unsigned __int64)(SHIDWORD(a5) * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16) - v21; - z = ((unsigned __int64)(SHIDWORD(a5) * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16) - v21; + v21 = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16; + v22 = ((unsigned __int64)(SHIDWORD(a5) * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16) - v21; + z = ((unsigned __int64)(SHIDWORD(a5) * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16) - v21; if ( v22 < (signed int)0x40000u || v22 > (signed int)0x1F400000u ) return 0; v23 = a6 + z_int_4; a2 = a6 + z_int_4; - v24 = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16) - + ((unsigned __int64)(SHIDWORD(a5) * (signed __int64)pBLVRenderParams->sSineNegX) >> 16); + v24 = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16) + + ((unsigned __int64)(SHIDWORD(a5) * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16); } else { @@ -366,17 +366,17 @@ int _uParticleID = ((int)floorf(pParticle->_x + 0.5f) - pBLVRenderParams->vPartyPos.x) << 16; //v26 = pParticle->_y + 6.7553994e15; y = ((int)floorf(pParticle->_y + 0.5f) - pBLVRenderParams->vPartyPos.y) << 16; - auto _hiword_v25 = (__int64)(y * (signed __int64)pBLVRenderParams->sSineY) >> 16; - v27 = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pBLVRenderParams->sCosineY) >> 16) - _hiword_v25; - z = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pBLVRenderParams->sCosineY) >> 16) - _hiword_v25; - v28 = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pBLVRenderParams->sSineY) >> 16; + auto _hiword_v25 = (__int64)(y * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16; + v27 = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16) - _hiword_v25; + z = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16) - _hiword_v25; + v28 = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16; //a5 = pParticle->_z + 6.7553994e15; v29 = ((int)floorf(pParticle->_z + 0.5f) - pBLVRenderParams->vPartyPos.z) << 16; //LODWORD(v30) = pBLVRenderParams->field_40 << 16; //HIDWORD(v30) = pBLVRenderParams->field_40 >> 16; //v31 = v30 / z; v31 = fixpoint_div(pBLVRenderParams->field_40, z); - v32 = (unsigned __int64)(y * (signed __int64)pBLVRenderParams->sCosineY) >> 16; + v32 = (unsigned __int64)(y * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16; pParticle->_screenspace_scale = v31; _uParticleID = (unsigned __int64)(v31 * (signed __int64)(v28 + v32)) >> 16; LODWORD(v33) = pBLVRenderParams->uViewportCenterX - ((signed int)((unsigned __int64)(v31 * (signed __int64)(v28 + v32)) >> 16) >> 16); @@ -388,15 +388,15 @@ } int _uParticleID = (x_int - pBLVRenderParams->vPartyPos.x) << 16; y = (y_int_ - pBLVRenderParams->vPartyPos.y) << 16; - v36 = (unsigned __int64)(y * (signed __int64)pBLVRenderParams->sSineY) >> 16; - v22 = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pBLVRenderParams->sCosineY) >> 16) - v36; - z = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pBLVRenderParams->sCosineY) >> 16) - v36; + v36 = (unsigned __int64)(y * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16; + v22 = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16) - v36; + z = ((unsigned __int64)((signed int)_uParticleID * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16) - v36; if ( v22 < 262144 || v22 > 524288000 ) return 0; - v37 = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pBLVRenderParams->sSineY) >> 16; - _uParticleID = (unsigned __int64)(y * (signed __int64)pBLVRenderParams->sCosineY) >> 16; - v23 = v37 + ((unsigned __int64)(y * (signed __int64)pBLVRenderParams->sCosineY) >> 16); - a2 = v37 + ((unsigned __int64)(y * (signed __int64)pBLVRenderParams->sCosineY) >> 16); + v37 = (unsigned __int64)((signed int)_uParticleID * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16; + _uParticleID = (unsigned __int64)(y * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16; + v23 = v37 + ((unsigned __int64)(y * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16); + a2 = v37 + ((unsigned __int64)(y * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16); v24 = (z_int_ - pBLVRenderParams->vPartyPos.z) << 16; } int _uParticleID = abs(v23);
--- a/Render.cpp Tue Sep 17 18:39:32 2013 +0200 +++ b/Render.cpp Tue Sep 17 20:15:56 2013 +0200 @@ -546,36 +546,36 @@ if (pGame->pIndoorCameraD3D->sRotationX) { v13 = (y - pGame->pIndoorCameraD3D->vPartyPos.y) << 16; - v30 = ((unsigned __int64)(v12 * (signed __int64)pODMRenderParams->camera_rotation_y_int_cosine) >> 16) - + ((unsigned __int64)(v13 * (signed __int64)pODMRenderParams->camera_rotation_y_int_sine) >> 16); - v37 = (unsigned __int64)(v12 * (signed __int64)pODMRenderParams->camera_rotation_y_int_sine) >> 16; - a6a = (unsigned __int64)(v13 * (signed __int64)pODMRenderParams->camera_rotation_y_int_cosine) >> 16; + v30 = ((unsigned __int64)(v12 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16) + + ((unsigned __int64)(v13 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16); + v37 = (unsigned __int64)(v12 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16; + a6a = (unsigned __int64)(v13 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16; v33 = (z - pGame->pIndoorCameraD3D->vPartyPos.z) << 16; - v14 = (unsigned __int64)(v30 * (signed __int64)pODMRenderParams->camera_rotation_x_int_cosine) >> 16; - v15 = (unsigned __int64)(v33 * (signed __int64)pODMRenderParams->camera_rotation_x_int_sine) >> 16; + v14 = (unsigned __int64)(v30 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16; + v15 = (unsigned __int64)(v33 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16; v16 = v15 + v14; v42 = v15 + v14; if ( v15 + v14 >= 262144 && v16 <= pODMRenderParams->shading_dist_mist << 16 ) { v17 = a6a - v37; v40 = a6a - v37; - v18 = ((unsigned __int64)(v33 * (signed __int64)pODMRenderParams->camera_rotation_x_int_cosine) >> 16) - - ((unsigned __int64)(v30 * (signed __int64)pODMRenderParams->camera_rotation_x_int_sine) >> 16); + v18 = ((unsigned __int64)(v33 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16) + - ((unsigned __int64)(v30 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16); goto LABEL_29; } } else { v34 = (y - pGame->pIndoorCameraD3D->vPartyPos.y) << 16; - v19 = (unsigned __int64)(v12 * (signed __int64)pODMRenderParams->camera_rotation_y_int_cosine) >> 16; - v20 = (unsigned __int64)(v34 * (signed __int64)pODMRenderParams->camera_rotation_y_int_sine) >> 16; + v19 = (unsigned __int64)(v12 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16; + v20 = (unsigned __int64)(v34 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16; v16 = v20 + v19; v42 = v20 + v19; if ( v20 + v19 >= 262144 && v16 <= pODMRenderParams->shading_dist_mist << 16 ) { - v21 = (unsigned __int64)(((x - pGame->pIndoorCameraD3D->vPartyPos.x) << 16) * (signed __int64)pODMRenderParams->camera_rotation_y_int_sine) >> 16; - v17 = ((unsigned __int64)(v34 * (signed __int64)pODMRenderParams->camera_rotation_y_int_cosine) >> 16) - v21; - v40 = ((unsigned __int64)(v34 * (signed __int64)pODMRenderParams->camera_rotation_y_int_cosine) >> 16) - v21; + v21 = (unsigned __int64)(((x - pGame->pIndoorCameraD3D->vPartyPos.x) << 16) * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16; + v17 = ((unsigned __int64)(v34 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16) - v21; + v40 = ((unsigned __int64)(v34 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16) - v21; v18 = (z - pGame->pIndoorCameraD3D->vPartyPos.z) << 16; LABEL_29: v31 = v18; @@ -1044,23 +1044,23 @@ if (pGame->pIndoorCameraD3D->sRotationX) { v40 = (decor->vPosition.y - pGame->pIndoorCameraD3D->vPartyPos.y) << 16; - v18 = ((unsigned __int64)(v17 * (signed __int64)pODMRenderParams->camera_rotation_y_int_cosine) >> 16) - + ((unsigned __int64)(v40 * (signed __int64)pODMRenderParams->camera_rotation_y_int_sine) >> 16); + v18 = ((unsigned __int64)(v17 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16) + + ((unsigned __int64)(v40 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16); v42 = v18; - b = (unsigned __int64)(v17 * (signed __int64)pODMRenderParams->camera_rotation_y_int_sine) >> 16; - a5 = (unsigned __int64)(v40 * (signed __int64)pODMRenderParams->camera_rotation_y_int_cosine) >> 16; + b = (unsigned __int64)(v17 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16; + a5 = (unsigned __int64)(v40 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16; v40 = (decor->vPosition.z - pGame->pIndoorCameraD3D->vPartyPos.z) << 16; - v41 = (unsigned __int64)(v40 * (signed __int64)pODMRenderParams->camera_rotation_x_int_sine) >> 16; - v19 = (unsigned __int64)(v18 * (signed __int64)pODMRenderParams->camera_rotation_x_int_cosine) >> 16; - v20 = v19 + ((unsigned __int64)(v40 * (signed __int64)pODMRenderParams->camera_rotation_x_int_sine) >> 16); - v39 = v19 + ((unsigned __int64)(v40 * (signed __int64)pODMRenderParams->camera_rotation_x_int_sine) >> 16); + v41 = (unsigned __int64)(v40 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16; + v19 = (unsigned __int64)(v18 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16; + v20 = v19 + ((unsigned __int64)(v40 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16); + v39 = v19 + ((unsigned __int64)(v40 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16); if ( v20 >= 262144 && v20 <= pODMRenderParams->shading_dist_mist << 16 ) { v21 = a5 - b; v41 = a5 - b; - a5 = (unsigned __int64)(v42 * (signed __int64)pODMRenderParams->camera_rotation_x_int_sine) >> 16; - b = (unsigned __int64)(v40 * (signed __int64)pODMRenderParams->camera_rotation_x_int_cosine) >> 16; - v22 = ((unsigned __int64)(v40 * (signed __int64)pODMRenderParams->camera_rotation_x_int_cosine) >> 16) - a5; + a5 = (unsigned __int64)(v42 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16; + b = (unsigned __int64)(v40 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16; + v22 = ((unsigned __int64)(v40 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16) - a5; LABEL_30: v42 = v22; v40 = 2 * abs(v20); @@ -1127,16 +1127,16 @@ { v42 = (decor->vPosition.x - pGame->pIndoorCameraD3D->vPartyPos.x) << 16; v40 = (decor->vPosition.y - pGame->pIndoorCameraD3D->vPartyPos.y) << 16; - b = (unsigned __int64)(v17 * (signed __int64)pODMRenderParams->camera_rotation_y_int_cosine) >> 16; - a5 = (unsigned __int64)(v40 * (signed __int64)pODMRenderParams->camera_rotation_y_int_sine) >> 16; - v20 = b + ((unsigned __int64)(v40 * (signed __int64)pODMRenderParams->camera_rotation_y_int_sine) >> 16); - v39 = b + ((unsigned __int64)(v40 * (signed __int64)pODMRenderParams->camera_rotation_y_int_sine) >> 16); + b = (unsigned __int64)(v17 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16; + a5 = (unsigned __int64)(v40 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16; + v20 = b + ((unsigned __int64)(v40 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16); + v39 = b + ((unsigned __int64)(v40 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16); if ( v20 >= 262144 && v20 <= pODMRenderParams->shading_dist_mist << 16 ) { - a5 = (unsigned __int64)(v42 * (signed __int64)pODMRenderParams->camera_rotation_y_int_sine) >> 16; - b = (unsigned __int64)(v40 * (signed __int64)pODMRenderParams->camera_rotation_y_int_cosine) >> 16; - v21 = ((unsigned __int64)(v40 * (signed __int64)pODMRenderParams->camera_rotation_y_int_cosine) >> 16) - a5; - v41 = ((unsigned __int64)(v40 * (signed __int64)pODMRenderParams->camera_rotation_y_int_cosine) >> 16) - a5; + a5 = (unsigned __int64)(v42 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16; + b = (unsigned __int64)(v40 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16; + v21 = ((unsigned __int64)(v40 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16) - a5; + v41 = ((unsigned __int64)(v40 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16) - a5; v22 = (decor->vPosition.z - pGame->pIndoorCameraD3D->vPartyPos.z) << 16; goto LABEL_30; } @@ -4916,7 +4916,7 @@ } //if (pIndoorCamera->flags & INDOOR_CAMERA_DRAW_TERRAIN_OUTLINES || pBLVRenderParams->uFlags & INDOOR_CAMERA_DRAW_TERRAIN_OUTLINES) - if (pODMRenderParams->flags & ODM_RENDER_DRAW_TERRAIN_OUTLINES) + if (pGame->pIndoorCameraD3D->debug_flags & ODM_RENDER_DRAW_TERRAIN_OUTLINES) pGame->pIndoorCameraD3D->debug_outline_d3d(d3d_vertex_buffer, uNumVertices, 0x00FFFFFF, 0.0); } // 4A26BC: could not find valid save-restore pair for esi
--- a/_deleted.cpp Tue Sep 17 18:39:32 2013 +0200 +++ b/_deleted.cpp Tue Sep 17 20:15:56 2013 +0200 @@ -1176,8 +1176,8 @@ v28 = v3->sTextureDeltaU << 16; v35 = v3->sTextureDeltaV << 16; v10 = v2->field_8; - v29 = pODMRenderParams->camera_rotation_y_int_sine; - v32 = pODMRenderParams->camera_rotation_y_int_cosine; + v29 = pGame->pIndoorCameraD3D->int_sine_y; + v32 = pGame->pIndoorCameraD3D->int_cosine_y; a1.field_28 = v2->field_C; v11 = v3->field_24; v37 = pODMRenderParams->int_fov_rad_inv * (pViewport->uScreenCenterX - v10); @@ -2325,8 +2325,8 @@ v8 = v3->ptr_38; v42 = ((unsigned __int64)(v3->ptr_38->field_14 * (signed __int64)v7) >> 16) + v8->field_C; v40 = ((unsigned __int64)(v8->field_20 * (signed __int64)v7) >> 16) + v3->ptr_38->field_18; - v38 = pODMRenderParams->camera_rotation_y_int_sine; - HIDWORD(v35) = pODMRenderParams->camera_rotation_y_int_cosine; + v38 = pGame->pIndoorCameraD3D->int_sine_y; + HIDWORD(v35) = pGame->pIndoorCameraD3D->int_cosine_y; v45 = v4->field_C; v9 = ((unsigned __int64)(v3->v_18.z * (signed __int64)v7) >> 16) + v3->v_18.x; v10 = 65536 / SLODWORD(v35) * (pViewport->uScreenCenterX - v4->field_8); @@ -10177,78 +10177,78 @@ stru_F8AD28.uDefaultAmbientLightLevel = v2->field_22; if ( pBLVRenderParams->sPartyRotX ) { - v74 = (unsigned __int64)(stru_F8AD28.plane_4.vNormal.y * (signed __int64)pBLVRenderParams->sSineY) >> 16; - v74 = ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.x * (signed __int64)pBLVRenderParams->sCosineY) >> 16) - v74; - X = (unsigned __int64)(stru_F8AD28.plane_4.vNormal.z * (signed __int64)pBLVRenderParams->sSineNegX) >> 16; - stru_F8AD28.rotated_normal.x = ((unsigned __int64)(v74 * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16) - X; + v74 = (unsigned __int64)(stru_F8AD28.plane_4.vNormal.y * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16; + v74 = ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.x * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16) - v74; + X = (unsigned __int64)(stru_F8AD28.plane_4.vNormal.z * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16; + stru_F8AD28.rotated_normal.x = ((unsigned __int64)(v74 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16) - X; stru_F8AD28.rotated_normal.y = ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.x - * (signed __int64)pBLVRenderParams->sSineY) >> 16) + * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16) + ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.y - * (signed __int64)pBLVRenderParams->sCosineY) >> 16); - stru_F8AD28.rotated_normal.z = ((unsigned __int64)(v74 * (signed __int64)pBLVRenderParams->sSineNegX) >> 16) + * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16); + stru_F8AD28.rotated_normal.z = ((unsigned __int64)(v74 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16) + ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.z - * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16); - v70 = (unsigned __int64)(stru_F8AD28.vec_14.y * (signed __int64)pBLVRenderParams->sSineY) >> 16; - v74 = ((unsigned __int64)(stru_F8AD28.vec_14.x * (signed __int64)pBLVRenderParams->sCosineY) >> 16) - v70; - v70 = (unsigned __int64)(stru_F8AD28.vec_14.z * (signed __int64)pBLVRenderParams->sSineNegX) >> 16; - stru_F8AD28.vec_60.y = ((unsigned __int64)(v74 * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16) - v70; - stru_F8AD28.vec_60.z = ((unsigned __int64)(stru_F8AD28.vec_14.x * (signed __int64)pBLVRenderParams->sSineY) >> 16) - + ((unsigned __int64)(stru_F8AD28.vec_14.y * (signed __int64)pBLVRenderParams->sCosineY) >> 16); - stru_F8AD28.field_6C = ((unsigned __int64)(v74 * (signed __int64)pBLVRenderParams->sSineNegX) >> 16) - + ((unsigned __int64)(stru_F8AD28.vec_14.z * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16); - v70 = (unsigned __int64)(stru_F8AD28.vec_20.y * (signed __int64)pBLVRenderParams->sSineY) >> 16; - v74 = ((unsigned __int64)(stru_F8AD28.vec_20.x * (signed __int64)pBLVRenderParams->sCosineY) >> 16) - v70; - X = (unsigned __int64)(stru_F8AD28.vec_20.x * (signed __int64)pBLVRenderParams->sSineY) >> 16; - v72 = (unsigned __int64)(stru_F8AD28.vec_20.y * (signed __int64)pBLVRenderParams->sCosineY) >> 16; - v70 = (unsigned __int64)(stru_F8AD28.vec_20.z * (signed __int64)pBLVRenderParams->sSineNegX) >> 16; - stru_F8AD28.vec_70.x = ((unsigned __int64)(v74 * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16) - v70; - stru_F8AD28.vec_70.y = ((unsigned __int64)(stru_F8AD28.vec_20.x * (signed __int64)pBLVRenderParams->sSineY) >> 16) - + ((unsigned __int64)(stru_F8AD28.vec_20.y * (signed __int64)pBLVRenderParams->sCosineY) >> 16); - stru_F8AD28.vec_70.z = ((unsigned __int64)(v74 * (signed __int64)pBLVRenderParams->sSineNegX) >> 16) - + ((unsigned __int64)(stru_F8AD28.vec_20.z * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16); - v74 = pBLVRenderParams->sSineY * pBLVRenderParams->vPartyPos.y - - pBLVRenderParams->sCosineY * pBLVRenderParams->vPartyPos.x; - v11 = -(pBLVRenderParams->sCosineY * pBLVRenderParams->vPartyPos.y - + pBLVRenderParams->sSineY * pBLVRenderParams->vPartyPos.x); + * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16); + v70 = (unsigned __int64)(stru_F8AD28.vec_14.y * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16; + v74 = ((unsigned __int64)(stru_F8AD28.vec_14.x * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16) - v70; + v70 = (unsigned __int64)(stru_F8AD28.vec_14.z * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16; + stru_F8AD28.vec_60.y = ((unsigned __int64)(v74 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16) - v70; + stru_F8AD28.vec_60.z = ((unsigned __int64)(stru_F8AD28.vec_14.x * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16) + + ((unsigned __int64)(stru_F8AD28.vec_14.y * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16); + stru_F8AD28.field_6C = ((unsigned __int64)(v74 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16) + + ((unsigned __int64)(stru_F8AD28.vec_14.z * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16); + v70 = (unsigned __int64)(stru_F8AD28.vec_20.y * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16; + v74 = ((unsigned __int64)(stru_F8AD28.vec_20.x * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16) - v70; + X = (unsigned __int64)(stru_F8AD28.vec_20.x * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16; + v72 = (unsigned __int64)(stru_F8AD28.vec_20.y * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16; + v70 = (unsigned __int64)(stru_F8AD28.vec_20.z * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16; + stru_F8AD28.vec_70.x = ((unsigned __int64)(v74 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16) - v70; + stru_F8AD28.vec_70.y = ((unsigned __int64)(stru_F8AD28.vec_20.x * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16) + + ((unsigned __int64)(stru_F8AD28.vec_20.y * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16); + stru_F8AD28.vec_70.z = ((unsigned __int64)(v74 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16) + + ((unsigned __int64)(stru_F8AD28.vec_20.z * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16); + v74 = pGame->pIndoorCameraD3D->int_sine_y * pBLVRenderParams->vPartyPos.y + - pGame->pIndoorCameraD3D->int_cosine_y * pBLVRenderParams->vPartyPos.x; + v11 = -(pGame->pIndoorCameraD3D->int_cosine_y * pBLVRenderParams->vPartyPos.y + + pGame->pIndoorCameraD3D->int_sine_y * pBLVRenderParams->vPartyPos.x); v73 = -65536 * pBLVRenderParams->vPartyPos.z; - v70 = (unsigned __int64)(-65536 * pBLVRenderParams->vPartyPos.z * (signed __int64)pBLVRenderParams->sSineNegX) >> 16; - v12 = ((unsigned __int64)(v74 * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16) - v70; - v69 = (unsigned __int64)(v74 * (signed __int64)pBLVRenderParams->sSineNegX) >> 16; + v70 = (unsigned __int64)(-65536 * pBLVRenderParams->vPartyPos.z * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16; + v12 = ((unsigned __int64)(v74 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16) - v70; + v69 = (unsigned __int64)(v74 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16; v13 = pBLVRenderParams->vPartyPos.y; - v70 = ((unsigned __int64)(v74 * (signed __int64)pBLVRenderParams->sSineNegX) >> 16) - + ((unsigned __int64)(-65536 * pBLVRenderParams->vPartyPos.z * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16); + v70 = ((unsigned __int64)(v74 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16) + + ((unsigned __int64)(-65536 * pBLVRenderParams->vPartyPos.z * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16); v14 = pBLVRenderParams->vPartyPos.x; } else { - v70 = (unsigned __int64)(stru_F8AD28.plane_4.vNormal.y * (signed __int64)pBLVRenderParams->sSineY) >> 16; + v70 = (unsigned __int64)(stru_F8AD28.plane_4.vNormal.y * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16; stru_F8AD28.rotated_normal.x = ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.x - * (signed __int64)pBLVRenderParams->sCosineY) >> 16) + * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16) - v70; stru_F8AD28.rotated_normal.z = stru_F8AD28.plane_4.vNormal.z; stru_F8AD28.rotated_normal.y = ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.x - * (signed __int64)pBLVRenderParams->sSineY) >> 16) + * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16) + ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.y - * (signed __int64)pBLVRenderParams->sCosineY) >> 16); - v70 = (unsigned __int64)(stru_F8AD28.vec_14.y * (signed __int64)pBLVRenderParams->sSineY) >> 16; - stru_F8AD28.vec_60.y = ((unsigned __int64)(stru_F8AD28.vec_14.x * (signed __int64)pBLVRenderParams->sCosineY) >> 16) + * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16); + v70 = (unsigned __int64)(stru_F8AD28.vec_14.y * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16; + stru_F8AD28.vec_60.y = ((unsigned __int64)(stru_F8AD28.vec_14.x * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16) - v70; stru_F8AD28.field_6C = stru_F8AD28.vec_14.z; - stru_F8AD28.vec_60.z = ((unsigned __int64)(stru_F8AD28.vec_14.x * (signed __int64)pBLVRenderParams->sSineY) >> 16) - + ((unsigned __int64)(stru_F8AD28.vec_14.y * (signed __int64)pBLVRenderParams->sCosineY) >> 16); - v70 = (unsigned __int64)(stru_F8AD28.vec_20.y * (signed __int64)pBLVRenderParams->sSineY) >> 16; - stru_F8AD28.vec_70.x = ((unsigned __int64)(stru_F8AD28.vec_20.x * (signed __int64)pBLVRenderParams->sCosineY) >> 16) + stru_F8AD28.vec_60.z = ((unsigned __int64)(stru_F8AD28.vec_14.x * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16) + + ((unsigned __int64)(stru_F8AD28.vec_14.y * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16); + v70 = (unsigned __int64)(stru_F8AD28.vec_20.y * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16; + stru_F8AD28.vec_70.x = ((unsigned __int64)(stru_F8AD28.vec_20.x * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16) - v70; - v69 = (unsigned __int64)(stru_F8AD28.vec_20.x * (signed __int64)pBLVRenderParams->sSineY) >> 16; + v69 = (unsigned __int64)(stru_F8AD28.vec_20.x * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16; v14 = pBLVRenderParams->vPartyPos.x; stru_F8AD28.vec_70.z = stru_F8AD28.vec_20.z; v13 = pBLVRenderParams->vPartyPos.y; - stru_F8AD28.vec_70.y = ((unsigned __int64)(stru_F8AD28.vec_20.x * (signed __int64)pBLVRenderParams->sSineY) >> 16) - + ((unsigned __int64)(stru_F8AD28.vec_20.y * (signed __int64)pBLVRenderParams->sCosineY) >> 16); - v12 = pBLVRenderParams->sSineY * pBLVRenderParams->vPartyPos.y - - pBLVRenderParams->sCosineY * pBLVRenderParams->vPartyPos.x; - v11 = -(pBLVRenderParams->sCosineY * pBLVRenderParams->vPartyPos.y - + pBLVRenderParams->sSineY * pBLVRenderParams->vPartyPos.x); + stru_F8AD28.vec_70.y = ((unsigned __int64)(stru_F8AD28.vec_20.x * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16) + + ((unsigned __int64)(stru_F8AD28.vec_20.y * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16); + v12 = pGame->pIndoorCameraD3D->int_sine_y * pBLVRenderParams->vPartyPos.y + - pGame->pIndoorCameraD3D->int_cosine_y * pBLVRenderParams->vPartyPos.x; + v11 = -(pGame->pIndoorCameraD3D->int_cosine_y * pBLVRenderParams->vPartyPos.y + + pGame->pIndoorCameraD3D->int_sine_y * pBLVRenderParams->vPartyPos.x); v70 = -65536 * pBLVRenderParams->vPartyPos.z; } stru_F8AD28.field_7C = stru_F8AD28.rotated_normal.x; @@ -10603,74 +10603,74 @@ stru_F8AD28.uDefaultAmbientLightLevel = 0; if ( pBLVRenderParams->sPartyRotX ) { - v0 = ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.x * (signed __int64)pBLVRenderParams->sCosineY) >> 16) - - ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.y * (signed __int64)pBLVRenderParams->sSineY) >> 16); - stru_F8AD28.rotated_normal.x = ((unsigned __int64)(v0 * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16) + v0 = ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.x * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16) + - ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.y * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16); + stru_F8AD28.rotated_normal.x = ((unsigned __int64)(v0 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16) - ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.z - * (signed __int64)pBLVRenderParams->sSineNegX) >> 16); + * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16); stru_F8AD28.rotated_normal.y = ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.x - * (signed __int64)pBLVRenderParams->sSineY) >> 16) + * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16) + ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.y - * (signed __int64)pBLVRenderParams->sCosineY) >> 16); - stru_F8AD28.rotated_normal.z = ((unsigned __int64)(v0 * (signed __int64)pBLVRenderParams->sSineNegX) >> 16) + * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16); + stru_F8AD28.rotated_normal.z = ((unsigned __int64)(v0 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16) + ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.z - * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16); - v1 = ((unsigned __int64)(stru_F8AD28.vec_14.x * (signed __int64)pBLVRenderParams->sCosineY) >> 16) - - ((unsigned __int64)(stru_F8AD28.vec_14.y * (signed __int64)pBLVRenderParams->sSineY) >> 16); - stru_F8AD28.vec_60.y = ((unsigned __int64)(v1 * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16) - - ((unsigned __int64)(stru_F8AD28.vec_14.z * (signed __int64)pBLVRenderParams->sSineNegX) >> 16); - stru_F8AD28.vec_60.z = ((unsigned __int64)(stru_F8AD28.vec_14.x * (signed __int64)pBLVRenderParams->sSineY) >> 16) - + ((unsigned __int64)(stru_F8AD28.vec_14.y * (signed __int64)pBLVRenderParams->sCosineY) >> 16); - stru_F8AD28.field_6C = ((unsigned __int64)(v1 * (signed __int64)pBLVRenderParams->sSineNegX) >> 16) - + ((unsigned __int64)(stru_F8AD28.vec_14.z * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16); - v2 = ((unsigned __int64)(stru_F8AD28.vec_20.x * (signed __int64)pBLVRenderParams->sCosineY) >> 16) - - ((unsigned __int64)(stru_F8AD28.vec_20.y * (signed __int64)pBLVRenderParams->sSineY) >> 16); - stru_F8AD28.vec_70.x = ((unsigned __int64)(v2 * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16) - - ((unsigned __int64)(stru_F8AD28.vec_20.z * (signed __int64)pBLVRenderParams->sSineNegX) >> 16); - stru_F8AD28.vec_70.y = ((unsigned __int64)(stru_F8AD28.vec_20.x * (signed __int64)pBLVRenderParams->sSineY) >> 16) - + ((unsigned __int64)(stru_F8AD28.vec_20.y * (signed __int64)pBLVRenderParams->sCosineY) >> 16); - stru_F8AD28.vec_70.z = ((unsigned __int64)(v2 * (signed __int64)pBLVRenderParams->sSineNegX) >> 16) - + ((unsigned __int64)(stru_F8AD28.vec_20.z * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16); - v3 = -(pBLVRenderParams->sCosineY * pBLVRenderParams->vPartyPos.y - + pBLVRenderParams->sSineY * pBLVRenderParams->vPartyPos.x); - v4 = pBLVRenderParams->sSineY * pBLVRenderParams->vPartyPos.y - - pBLVRenderParams->sCosineY * pBLVRenderParams->vPartyPos.x; - v5 = ((unsigned __int64)(v4 * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16) - - ((unsigned __int64)(-65536 * pBLVRenderParams->vPartyPos.z * (signed __int64)pBLVRenderParams->sSineNegX) >> 16); + * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16); + v1 = ((unsigned __int64)(stru_F8AD28.vec_14.x * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16) + - ((unsigned __int64)(stru_F8AD28.vec_14.y * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16); + stru_F8AD28.vec_60.y = ((unsigned __int64)(v1 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16) + - ((unsigned __int64)(stru_F8AD28.vec_14.z * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16); + stru_F8AD28.vec_60.z = ((unsigned __int64)(stru_F8AD28.vec_14.x * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16) + + ((unsigned __int64)(stru_F8AD28.vec_14.y * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16); + stru_F8AD28.field_6C = ((unsigned __int64)(v1 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16) + + ((unsigned __int64)(stru_F8AD28.vec_14.z * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16); + v2 = ((unsigned __int64)(stru_F8AD28.vec_20.x * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16) + - ((unsigned __int64)(stru_F8AD28.vec_20.y * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16); + stru_F8AD28.vec_70.x = ((unsigned __int64)(v2 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16) + - ((unsigned __int64)(stru_F8AD28.vec_20.z * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16); + stru_F8AD28.vec_70.y = ((unsigned __int64)(stru_F8AD28.vec_20.x * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16) + + ((unsigned __int64)(stru_F8AD28.vec_20.y * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16); + stru_F8AD28.vec_70.z = ((unsigned __int64)(v2 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16) + + ((unsigned __int64)(stru_F8AD28.vec_20.z * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16); + v3 = -(pGame->pIndoorCameraD3D->int_cosine_y * pBLVRenderParams->vPartyPos.y + + pGame->pIndoorCameraD3D->int_sine_y * pBLVRenderParams->vPartyPos.x); + v4 = pGame->pIndoorCameraD3D->int_sine_y * pBLVRenderParams->vPartyPos.y + - pGame->pIndoorCameraD3D->int_cosine_y * pBLVRenderParams->vPartyPos.x; + v5 = ((unsigned __int64)(v4 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16) + - ((unsigned __int64)(-65536 * pBLVRenderParams->vPartyPos.z * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16); v6 = pBLVRenderParams->vPartyPos.z; - v7 = ((unsigned __int64)(-65536 * pBLVRenderParams->vPartyPos.z * (signed __int64)pBLVRenderParams->sCosineNegX) >> 16) - + ((unsigned __int64)(v4 * (signed __int64)pBLVRenderParams->sSineNegX) >> 16); + v7 = ((unsigned __int64)(-65536 * pBLVRenderParams->vPartyPos.z * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_x) >> 16) + + ((unsigned __int64)(v4 * (signed __int64)pGame->pIndoorCameraD3D->int_sine_x) >> 16); v8 = pBLVRenderParams->vPartyPos.y; v9 = pBLVRenderParams->vPartyPos.x; } else { stru_F8AD28.rotated_normal.x = ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.x - * (signed __int64)pBLVRenderParams->sCosineY) >> 16) + * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16) - ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.y - * (signed __int64)pBLVRenderParams->sSineY) >> 16); + * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16); stru_F8AD28.rotated_normal.z = stru_F8AD28.plane_4.vNormal.z; stru_F8AD28.rotated_normal.y = ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.x - * (signed __int64)pBLVRenderParams->sSineY) >> 16) + * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16) + ((unsigned __int64)(stru_F8AD28.plane_4.vNormal.y - * (signed __int64)pBLVRenderParams->sCosineY) >> 16); - stru_F8AD28.vec_60.y = ((unsigned __int64)(stru_F8AD28.vec_14.x * (signed __int64)pBLVRenderParams->sCosineY) >> 16) - - ((unsigned __int64)(stru_F8AD28.vec_14.y * (signed __int64)pBLVRenderParams->sSineY) >> 16); + * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16); + stru_F8AD28.vec_60.y = ((unsigned __int64)(stru_F8AD28.vec_14.x * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16) + - ((unsigned __int64)(stru_F8AD28.vec_14.y * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16); stru_F8AD28.field_6C = stru_F8AD28.vec_14.z; - stru_F8AD28.vec_60.z = ((unsigned __int64)(stru_F8AD28.vec_14.x * (signed __int64)pBLVRenderParams->sSineY) >> 16) - + ((unsigned __int64)(stru_F8AD28.vec_14.y * (signed __int64)pBLVRenderParams->sCosineY) >> 16); - stru_F8AD28.vec_70.x = ((unsigned __int64)(stru_F8AD28.vec_20.x * (signed __int64)pBLVRenderParams->sCosineY) >> 16) - - ((unsigned __int64)(stru_F8AD28.vec_20.y * (signed __int64)pBLVRenderParams->sSineY) >> 16); + stru_F8AD28.vec_60.z = ((unsigned __int64)(stru_F8AD28.vec_14.x * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16) + + ((unsigned __int64)(stru_F8AD28.vec_14.y * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16); + stru_F8AD28.vec_70.x = ((unsigned __int64)(stru_F8AD28.vec_20.x * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16) + - ((unsigned __int64)(stru_F8AD28.vec_20.y * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16); v8 = pBLVRenderParams->vPartyPos.y; - stru_F8AD28.vec_70.y = ((unsigned __int64)(stru_F8AD28.vec_20.x * (signed __int64)pBLVRenderParams->sSineY) >> 16) - + ((unsigned __int64)(stru_F8AD28.vec_20.y * (signed __int64)pBLVRenderParams->sCosineY) >> 16); + stru_F8AD28.vec_70.y = ((unsigned __int64)(stru_F8AD28.vec_20.x * (signed __int64)pGame->pIndoorCameraD3D->int_sine_y) >> 16) + + ((unsigned __int64)(stru_F8AD28.vec_20.y * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16); stru_F8AD28.vec_70.z = stru_F8AD28.vec_20.z; v9 = pBLVRenderParams->vPartyPos.x; - v5 = pBLVRenderParams->sSineY * pBLVRenderParams->vPartyPos.y - - pBLVRenderParams->sCosineY * pBLVRenderParams->vPartyPos.x; + v5 = pGame->pIndoorCameraD3D->int_sine_y * pBLVRenderParams->vPartyPos.y + - pGame->pIndoorCameraD3D->int_cosine_y * pBLVRenderParams->vPartyPos.x; v6 = pBLVRenderParams->vPartyPos.z; - v3 = -(pBLVRenderParams->sCosineY * pBLVRenderParams->vPartyPos.y - + pBLVRenderParams->sSineY * pBLVRenderParams->vPartyPos.x); + v3 = -(pGame->pIndoorCameraD3D->int_cosine_y * pBLVRenderParams->vPartyPos.y + + pGame->pIndoorCameraD3D->int_sine_y * pBLVRenderParams->vPartyPos.x); v7 = -65536 * pBLVRenderParams->vPartyPos.z; } stru_F8AD28.field_7C = stru_F8AD28.rotated_normal.x; @@ -10856,8 +10856,8 @@ v45 = v14->field_4 >> 3; v44 = v16 >> 3; v17 = (signed int)((unsigned __int64)(SLODWORD(pBLVRenderParams->field_44) * (signed __int64)v14->field_28) >> 16) >> 3; - v52 = (unsigned __int64)(v17 * (signed __int64)-pBLVRenderParams->sSineY) >> 16; - v53 = (unsigned __int64)(v17 * (signed __int64)pBLVRenderParams->sCosineY) >> 16; + v52 = (unsigned __int64)(v17 * (signed __int64)-pGame->pIndoorCameraD3D->int_sine_y) >> 16; + v53 = (unsigned __int64)(v17 * (signed __int64)pGame->pIndoorCameraD3D->int_cosine_y) >> 16; v18 = v14->field_28; v19 = *(__int16 *)((char *)stru_F8A590.viewport_left_side + v13); LOWORD(v18) = 0; @@ -13198,9 +13198,14 @@ _int_sine_2 = stru_5C6E00->Sin(sRotationX); _int_cosine_2 = stru_5C6E00->Cos(sRotationX); } -// 4D864C: using guessed type char byte_4D864C; - - +//----- (0048600E) -------------------------------------------------------- +void ODMRenderParams::RotationToInts() +{ + camera_rotation_y_int_sine = stru_5C6E00->Sin(pGame->pIndoorCameraD3D->sRotationY); + camera_rotation_y_int_cosine = stru_5C6E00->Cos(pGame->pIndoorCameraD3D->sRotationY); + camera_rotation_x_int_sine = stru_5C6E00->Sin(pGame->pIndoorCameraD3D->sRotationX); + camera_rotation_x_int_cosine = stru_5C6E00->Cos(pGame->pIndoorCameraD3D->sRotationX); +}
--- a/mm7_3.cpp Tue Sep 17 18:39:32 2013 +0200 +++ b/mm7_3.cpp Tue Sep 17 20:15:56 2013 +0200 @@ -4067,8 +4067,8 @@ v6 = v37 - (double)pGame->pIndoorCameraD3D->vPartyPos.y; //if ( pRenderer->pRenderD3D ) //{ - v41 = pBLVRenderParams->fSineY * v6 + pBLVRenderParams->fCosineY * v5; - v7 = pBLVRenderParams->fSineY * v5 - pBLVRenderParams->fCosineY * v6; + v41 = pGame->pIndoorCameraD3D->fRotationYSine * v6 + pGame->pIndoorCameraD3D->fRotationYCosine * v5; + v7 = pGame->pIndoorCameraD3D->fRotationYSine * v5 - pGame->pIndoorCameraD3D->fRotationYCosine * v6; /*} else { @@ -4077,9 +4077,9 @@ }*/ v8 = v7; v9 = v36 - (double)pGame->pIndoorCameraD3D->vPartyPos.z; - v10 = pBLVRenderParams->fCosineNegX * v41 - pBLVRenderParams->fSineNegX * v9; + v10 = pGame->pIndoorCameraD3D->fRotationXCosine * v41 - pGame->pIndoorCameraD3D->fRotationXSine * v9; v11 = v8; - v12 = pBLVRenderParams->fCosineNegX * v9 + pBLVRenderParams->fSineNegX * v41; + v12 = pGame->pIndoorCameraD3D->fRotationXCosine * v9 + pGame->pIndoorCameraD3D->fRotationXSine * v41; } else { @@ -4087,8 +4087,8 @@ v39 = v37 - (double)pGame->pIndoorCameraD3D->vPartyPos.y; //if ( pRenderer->pRenderD3D ) //{ - v10 = pBLVRenderParams->fSineY * v39 + pBLVRenderParams->fCosineY * v42; - v11 = pBLVRenderParams->fSineY * v42 - pBLVRenderParams->fCosineY * v39; + v10 = pGame->pIndoorCameraD3D->fRotationYSine * v39 + pGame->pIndoorCameraD3D->fRotationYCosine * v42; + v11 = pGame->pIndoorCameraD3D->fRotationYSine * v42 - pGame->pIndoorCameraD3D->fRotationYCosine * v39; /*} else { @@ -5560,7 +5560,7 @@ pWeather->Initialize(); pGame->pIndoorCameraD3D->sRotationY = pParty->sRotationY; pGame->pIndoorCameraD3D->sRotationX = pParty->sRotationX; - pODMRenderParams->RotationToInts(); + //pODMRenderParams->RotationToInts(); pOutdoor->UpdateSunlightVectors(); float fov_rad; @@ -5898,9 +5898,9 @@ { stru_8019C8._48616B_frustum_odm(65536, 0, 0, 0, 65536, 0); pODMRenderParams->uNumPolygons = 0; - pODMRenderParams->uNumEdges = 0; - pODMRenderParams->uNumSpans = 0; - pODMRenderParams->uNumSurfs = 0; + //pODMRenderParams->uNumEdges = 0; + //pODMRenderParams->uNumSpans = 0; + //pODMRenderParams->uNumSurfs = 0; pODMRenderParams->uNumBillboards = 0; pODMRenderParams->field_44 = 0; } @@ -6145,18 +6145,18 @@ //int v28; // [sp+30h] [bp+8h]@10 //int v29; // [sp+3Ch] [bp+14h]@10 - v25 = pODMRenderParams->camera_rotation_x_int_cosine; - v7 = pODMRenderParams->camera_rotation_y_int_sine; - v27 = pODMRenderParams->camera_rotation_x_int_sine; + v25 = pGame->pIndoorCameraD3D->int_cosine_x; + v7 = pGame->pIndoorCameraD3D->int_sine_y; + v27 = pGame->pIndoorCameraD3D->int_sine_x; //v8 = -pIndoorCamera->pos.y; - v9 = pODMRenderParams->camera_rotation_y_int_cosine; + v9 = pGame->pIndoorCameraD3D->int_cosine_y; //v26 = -pIndoorCamera->pos.z; - v11 = pODMRenderParams->camera_rotation_y_int_cosine * -pGame->pIndoorCameraD3D->vPartyPos.x + pODMRenderParams->camera_rotation_y_int_sine * -pGame->pIndoorCameraD3D->vPartyPos.y; - v24 = pODMRenderParams->camera_rotation_y_int_cosine * -pGame->pIndoorCameraD3D->vPartyPos.y - pODMRenderParams->camera_rotation_y_int_sine * -pGame->pIndoorCameraD3D->vPartyPos.x; + v11 = pGame->pIndoorCameraD3D->int_cosine_y * -pGame->pIndoorCameraD3D->vPartyPos.x + pGame->pIndoorCameraD3D->int_sine_y * -pGame->pIndoorCameraD3D->vPartyPos.y; + v24 = pGame->pIndoorCameraD3D->int_cosine_y * -pGame->pIndoorCameraD3D->vPartyPos.y - pGame->pIndoorCameraD3D->int_sine_y * -pGame->pIndoorCameraD3D->vPartyPos.x; if (pGame->pIndoorCameraD3D->sRotationX) { - this->field_0_party_dir_x = fixpoint_sub0(v11, pODMRenderParams->camera_rotation_x_int_cosine) + - fixpoint_sub0((-pGame->pIndoorCameraD3D->vPartyPos.z) << 16, pODMRenderParams->camera_rotation_x_int_sine); + this->field_0_party_dir_x = fixpoint_sub0(v11, pGame->pIndoorCameraD3D->int_cosine_x) + + fixpoint_sub0((-pGame->pIndoorCameraD3D->vPartyPos.z) << 16, pGame->pIndoorCameraD3D->int_sine_x); this->field_4_party_dir_y = v24; this->field_8_party_dir_z = fixpoint_sub0((-pGame->pIndoorCameraD3D->vPartyPos.z) << 16, v25) - fixpoint_sub0(v11, v27); }