Mercurial > mm7
comparison Indoor.cpp @ 1642:8971dc85b8fb
More camera unifications.
author | Nomad |
---|---|
date | Tue, 17 Sep 2013 20:15:56 +0200 |
parents | 466c5e15f524 |
children | 7182930263b3 |
comparison
equal
deleted
inserted
replaced
1641:466c5e15f524 | 1642:8971dc85b8fb |
---|---|
193 //int result; // eax@6 | 193 //int result; // eax@6 |
194 int v29; // [sp+24h] [bp+8h]@5 | 194 int v29; // [sp+24h] [bp+8h]@5 |
195 | 195 |
196 this->field_0_timer_ = pEventTimer->uTotalGameTimeElapsed; | 196 this->field_0_timer_ = pEventTimer->uTotalGameTimeElapsed; |
197 | 197 |
198 this->uFlags = 0; | 198 pGame->pIndoorCameraD3D->debug_flags = 0; |
199 if (viewparams->draw_sw_outlines) | 199 if (viewparams->draw_sw_outlines) |
200 this->uFlags |= BLV_RENDER_DRAW_SW_OUTLINES; | 200 pGame->pIndoorCameraD3D->debug_flags |= BLV_RENDER_DRAW_SW_OUTLINES; |
201 if (viewparams->draw_d3d_outlines) | 201 if (viewparams->draw_d3d_outlines) |
202 this->uFlags |= BLV_RENDER_DRAW_D3D_OUTLINES; | 202 pGame->pIndoorCameraD3D->debug_flags |= BLV_RENDER_DRAW_D3D_OUTLINES; |
203 | 203 |
204 //v2 = a2; | 204 //v2 = a2; |
205 //this->field_0_timer_ = a2->field_0_timer; | 205 //this->field_0_timer_ = a2->field_0_timer; |
206 //this->uFlags = a2->uFlags; | 206 //this->uFlags = a2->uFlags; |
207 //this->vPartyPos.x = a2->vPosition.x; | 207 //this->vPartyPos.x = a2->vPosition.x; |
226 this->vPartyPos.y = pParty->vPosition.y;*/ | 226 this->vPartyPos.y = pParty->vPosition.y;*/ |
227 this->uPartySectorID = pIndoor->GetSector(v10, v9, v8); | 227 this->uPartySectorID = pIndoor->GetSector(v10, v9, v8); |
228 } | 228 } |
229 if ( pRenderer->pRenderD3D ) | 229 if ( pRenderer->pRenderD3D ) |
230 { | 230 { |
231 this->sCosineY = stru_5C6E00->Cos(pGame->pIndoorCameraD3D->sRotationY); | 231 //this->sCosineY = stru_5C6E00->Cos(pGame->pIndoorCameraD3D->sRotationY); |
232 this->sSineY = stru_5C6E00->Sin(pGame->pIndoorCameraD3D->sRotationY); | 232 //this->sSineY = stru_5C6E00->Sin(pGame->pIndoorCameraD3D->sRotationY); |
233 this->sCosineNegX = stru_5C6E00->Cos(-pGame->pIndoorCameraD3D->sRotationX); | 233 //this->sCosineNegX = stru_5C6E00->Cos(-pGame->pIndoorCameraD3D->sRotationX); |
234 this->sSineNegX = stru_5C6E00->Sin(-pGame->pIndoorCameraD3D->sRotationX); | 234 //this->sSineNegX = stru_5C6E00->Sin(-pGame->pIndoorCameraD3D->sRotationX); |
235 this->fCosineY = cos((3.141592653589793 + 3.141592653589793) * (double)pGame->pIndoorCameraD3D->sRotationY * 0.00048828125); | 235 //this->fCosineY = cos((3.141592653589793 + 3.141592653589793) * (double)pGame->pIndoorCameraD3D->sRotationY * 0.00048828125); |
236 this->fSineY = sin((3.141592653589793 + 3.141592653589793) * (double)pGame->pIndoorCameraD3D->sRotationY * 0.00048828125); | 236 //this->fSineY = sin((3.141592653589793 + 3.141592653589793) * (double)pGame->pIndoorCameraD3D->sRotationY * 0.00048828125); |
237 this->fCosineNegX = cos((3.141592653589793 + 3.141592653589793) * (double)-pGame->pIndoorCameraD3D->sRotationX * 0.00048828125); | 237 //this->fCosineNegX = cos((3.141592653589793 + 3.141592653589793) * (double)-pGame->pIndoorCameraD3D->sRotationX * 0.00048828125); |
238 this->fSineNegX = sin((3.141592653589793 + 3.141592653589793) * (double)-pGame->pIndoorCameraD3D->sRotationX * 0.00048828125); | 238 //this->fSineNegX = sin((3.141592653589793 + 3.141592653589793) * (double)-pGame->pIndoorCameraD3D->sRotationX * 0.00048828125); |
239 this->field_64 = pViewport->field_30; | 239 this->field_64 = pViewport->field_30; |
240 | 240 |
241 this->uViewportX = pViewport->uScreen_TL_X; | 241 this->uViewportX = pViewport->uScreen_TL_X; |
242 this->uViewportY = pViewport->uScreen_TL_Y; | 242 this->uViewportY = pViewport->uScreen_TL_Y; |
243 this->uViewportZ = pViewport->uScreen_BR_X; | 243 this->uViewportZ = pViewport->uScreen_BR_X; |
816 assert(num_nodes < 150); | 816 assert(num_nodes < 150); |
817 | 817 |
818 nodes[num_nodes].viewing_portal_id = uFaceID; | 818 nodes[num_nodes].viewing_portal_id = uFaceID; |
819 AddBspNodeToRenderList(++num_nodes - 1); | 819 AddBspNodeToRenderList(++num_nodes - 1); |
820 } | 820 } |
821 if (pBLVRenderParams->uFlags & BLV_RENDER_DRAW_SW_OUTLINES) | 821 if (pGame->pIndoorCameraD3D->debug_flags & BLV_RENDER_DRAW_SW_OUTLINES) |
822 pGame->pIndoorCameraD3D->PrepareAndDrawDebugOutline(pFace, 0x1E1EFF); | 822 pGame->pIndoorCameraD3D->PrepareAndDrawDebugOutline(pFace, 0x1E1EFF); |
823 //pGame->pIndoorCameraD3D->DebugDrawPortal(pFace); | 823 //pGame->pIndoorCameraD3D->DebugDrawPortal(pFace); |
824 } | 824 } |
825 } | 825 } |
826 | 826 |
6890 v13 = a1->vWorldPosition.x - (double)pParty->vPosition.x; | 6890 v13 = a1->vWorldPosition.x - (double)pParty->vPosition.x; |
6891 v11 = a1->vWorldPosition.y - (double)pParty->vPosition.y; | 6891 v11 = a1->vWorldPosition.y - (double)pParty->vPosition.y; |
6892 v4 = a1->vWorldPosition.z - (double)pParty->vPosition.z; | 6892 v4 = a1->vWorldPosition.z - (double)pParty->vPosition.z; |
6893 //if ( pRenderer->pRenderD3D ) | 6893 //if ( pRenderer->pRenderD3D ) |
6894 //{ | 6894 //{ |
6895 v5 = v11 * pBLVRenderParams->fSineY + v13 * pBLVRenderParams->fCosineY; | 6895 v5 = v11 * pGame->pIndoorCameraD3D->fRotationYSine + v13 * pGame->pIndoorCameraD3D->fRotationYCosine; |
6896 a1->vWorldViewPosition.y = v13 * pBLVRenderParams->fSineY - v11 * pBLVRenderParams->fCosineY; | 6896 a1->vWorldViewPosition.y = v13 * pGame->pIndoorCameraD3D->fRotationYSine - v11 * pGame->pIndoorCameraD3D->fRotationYCosine; |
6897 /*} | 6897 /*} |
6898 else | 6898 else |
6899 { | 6899 { |
6900 v5 = v13 * pBLVRenderParams->fCosineY - v11 * pBLVRenderParams->fSineY; | 6900 v5 = v13 * pBLVRenderParams->fCosineY - v11 * pBLVRenderParams->fSineY; |
6901 a1->vWorldViewPosition.y = v13 * pBLVRenderParams->fSineY + v11 * pBLVRenderParams->fCosineY; | 6901 a1->vWorldViewPosition.y = v13 * pBLVRenderParams->fSineY + v11 * pBLVRenderParams->fCosineY; |
6902 }*/ | 6902 }*/ |
6903 a1->vWorldViewPosition.x = v5 * pBLVRenderParams->fCosineNegX - v4 * pBLVRenderParams->fSineNegX; | 6903 a1->vWorldViewPosition.x = v5 * pGame->pIndoorCameraD3D->fRotationXCosine - v4 * pGame->pIndoorCameraD3D->fRotationXSine; |
6904 a1->vWorldViewPosition.z = v5 * pBLVRenderParams->fSineNegX + v4 * pBLVRenderParams->fCosineNegX; | 6904 a1->vWorldViewPosition.z = v5 * pGame->pIndoorCameraD3D->fRotationXSine + v4 * pGame->pIndoorCameraD3D->fRotationXCosine; |
6905 } | 6905 } |
6906 else | 6906 else |
6907 { | 6907 { |
6908 v14 = a1->vWorldPosition.x - (double)pParty->vPosition.x; | 6908 v14 = a1->vWorldPosition.x - (double)pParty->vPosition.x; |
6909 v12 = a1->vWorldPosition.y - (double)pParty->vPosition.y; | 6909 v12 = a1->vWorldPosition.y - (double)pParty->vPosition.y; |
6910 a1->vWorldViewPosition.z = a1->vWorldPosition.z - (double)pParty->vPosition.z; | 6910 a1->vWorldViewPosition.z = a1->vWorldPosition.z - (double)pParty->vPosition.z; |
6911 //if ( pRenderer->pRenderD3D ) | 6911 //if ( pRenderer->pRenderD3D ) |
6912 //{ | 6912 //{ |
6913 a1->vWorldViewPosition.x = v12 * pBLVRenderParams->fSineY + v14 * pBLVRenderParams->fCosineY; | 6913 a1->vWorldViewPosition.x = v12 * pGame->pIndoorCameraD3D->fRotationYSine + v14 * pGame->pIndoorCameraD3D->fRotationYCosine; |
6914 a1->vWorldViewPosition.y = v14 * pBLVRenderParams->fSineY - v12 * pBLVRenderParams->fCosineY; | 6914 a1->vWorldViewPosition.y = v14 * pGame->pIndoorCameraD3D->fRotationYSine - v12 * pGame->pIndoorCameraD3D->fRotationYCosine; |
6915 /*} | 6915 /*} |
6916 else | 6916 else |
6917 { | 6917 { |
6918 a1->vWorldViewPosition.x = v14 * pBLVRenderParams->fCosineY - v12 * pBLVRenderParams->fSineY; | 6918 a1->vWorldViewPosition.x = v14 * pBLVRenderParams->fCosineY - v12 * pBLVRenderParams->fSineY; |
6919 a1->vWorldViewPosition.y = v14 * pBLVRenderParams->fSineY + v12 * pBLVRenderParams->fCosineY; | 6919 a1->vWorldViewPosition.y = v14 * pBLVRenderParams->fSineY + v12 * pBLVRenderParams->fCosineY; |