Mercurial > mm7
comparison Engine/Graphics/Indoor.cpp @ 2543:b6140dfeac27
GameOver h/cpp
author | a.parshin |
---|---|
date | Sun, 10 May 2015 03:21:14 +0200 |
parents | a902abdfc7f2 |
children | b8a56afc6ba1 |
comparison
equal
deleted
inserted
replaced
2542:bacf9809126a | 2543:b6140dfeac27 |
---|---|
107 if (pParty->TorchlightActive()) | 107 if (pParty->TorchlightActive()) |
108 v5 *= pParty->pPartyBuffs[PARTY_BUFF_TORCHLIGHT].uPower; | 108 v5 *= pParty->pPartyBuffs[PARTY_BUFF_TORCHLIGHT].uPower; |
109 //LOBYTE(v1) = _4E94D0_light_type; | 109 //LOBYTE(v1) = _4E94D0_light_type; |
110 //v4 = pParty->flt_TorchlightColorR + 6.7553994e15; | 110 //v4 = pParty->flt_TorchlightColorR + 6.7553994e15; |
111 //v3 = pParty->flt_TorchlightColorG + 6.7553994e15; | 111 //v3 = pParty->flt_TorchlightColorG + 6.7553994e15; |
112 pMobileLightsStack->AddLight(pEngine->pIndoorCameraD3D->vPartyPos.x, | 112 pMobileLightsStack->AddLight(pIndoorCameraD3D->vPartyPos.x, |
113 pEngine->pIndoorCameraD3D->vPartyPos.y, | 113 pIndoorCameraD3D->vPartyPos.y, |
114 pEngine->pIndoorCameraD3D->vPartyPos.z, | 114 pIndoorCameraD3D->vPartyPos.z, |
115 pBLVRenderParams->uPartySectorID, | 115 pBLVRenderParams->uPartySectorID, |
116 v5, | 116 v5, |
117 floorf(pParty->flt_TorchlightColorR + 0.5f), | 117 floorf(pParty->flt_TorchlightColorR + 0.5f), |
118 floorf(pParty->flt_TorchlightColorG + 0.5f), | 118 floorf(pParty->flt_TorchlightColorG + 0.5f), |
119 floorf(pParty->flt_TorchlightColorB + 0.5f), | 119 floorf(pParty->flt_TorchlightColorB + 0.5f), |
140 { | 140 { |
141 int v7; // eax@1 | 141 int v7; // eax@1 |
142 | 142 |
143 this->field_0_timer_ = pEventTimer->uTotalGameTimeElapsed; | 143 this->field_0_timer_ = pEventTimer->uTotalGameTimeElapsed; |
144 | 144 |
145 pEngine->pIndoorCameraD3D->debug_flags = 0; | 145 pIndoorCameraD3D->debug_flags = 0; |
146 if (viewparams->draw_sw_outlines) | 146 if (viewparams->draw_sw_outlines) |
147 pEngine->pIndoorCameraD3D->debug_flags |= BLV_RENDER_DRAW_SW_OUTLINES; | 147 pIndoorCameraD3D->debug_flags |= BLV_RENDER_DRAW_SW_OUTLINES; |
148 if (viewparams->draw_d3d_outlines) | 148 if (viewparams->draw_d3d_outlines) |
149 pEngine->pIndoorCameraD3D->debug_flags |= BLV_RENDER_DRAW_D3D_OUTLINES; | 149 pIndoorCameraD3D->debug_flags |= BLV_RENDER_DRAW_D3D_OUTLINES; |
150 | 150 |
151 //v2 = a2; | 151 //v2 = a2; |
152 //this->field_0_timer_ = a2->field_0_timer; | 152 //this->field_0_timer_ = a2->field_0_timer; |
153 //this->uFlags = a2->uFlags; | 153 //this->uFlags = a2->uFlags; |
154 //this->vPartyPos.x = a2->vPosition.x; | 154 //this->vPartyPos.x = a2->vPosition.x; |
157 //v4 = this->vPartyPos.z; | 157 //v4 = this->vPartyPos.z; |
158 //v5 = this->vPartyPos.y; | 158 //v5 = this->vPartyPos.y; |
159 //this->sPartyRotY = a2->sRotationY; | 159 //this->sPartyRotY = a2->sRotationY; |
160 //v6 = this->vPartyPos.x; | 160 //v6 = this->vPartyPos.x; |
161 //this->sPartyRotX = a2->sRotationX; | 161 //this->sPartyRotX = a2->sRotationX; |
162 v7 = pIndoor->GetSector(pEngine->pIndoorCameraD3D->vPartyPos.x, | 162 v7 = pIndoor->GetSector(pIndoorCameraD3D->vPartyPos.x, |
163 pEngine->pIndoorCameraD3D->vPartyPos.y, | 163 pIndoorCameraD3D->vPartyPos.y, |
164 pEngine->pIndoorCameraD3D->vPartyPos.z); | 164 pIndoorCameraD3D->vPartyPos.z); |
165 this->uPartySectorID = v7; | 165 this->uPartySectorID = v7; |
166 if ( !v7 ) | 166 if ( !v7 ) |
167 { | 167 { |
168 //__debugbreak(); // shouldnt happen, please provide savegame | 168 //__debugbreak(); // shouldnt happen, please provide savegame |
169 /*v8 = this->vPartyPos.z; | 169 /*v8 = this->vPartyPos.z; |
173 this->vPartyPos.y = pParty->vPosition.y;*/ | 173 this->vPartyPos.y = pParty->vPosition.y;*/ |
174 this->uPartySectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z); | 174 this->uPartySectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z); |
175 } | 175 } |
176 //if ( pRenderer->pRenderD3D ) | 176 //if ( pRenderer->pRenderD3D ) |
177 { | 177 { |
178 //this->sCosineY = stru_5C6E00->Cos(pEngine->pIndoorCameraD3D->sRotationY); | 178 //this->sCosineY = stru_5C6E00->Cos(pIndoorCameraD3D->sRotationY); |
179 //this->sSineY = stru_5C6E00->Sin(pEngine->pIndoorCameraD3D->sRotationY); | 179 //this->sSineY = stru_5C6E00->Sin(pIndoorCameraD3D->sRotationY); |
180 //this->sCosineNegX = stru_5C6E00->Cos(-pEngine->pIndoorCameraD3D->sRotationX); | 180 //this->sCosineNegX = stru_5C6E00->Cos(-pIndoorCameraD3D->sRotationX); |
181 //this->sSineNegX = stru_5C6E00->Sin(-pEngine->pIndoorCameraD3D->sRotationX); | 181 //this->sSineNegX = stru_5C6E00->Sin(-pIndoorCameraD3D->sRotationX); |
182 //this->fCosineY = cos((3.141592653589793 + 3.141592653589793) * (double)pEngine->pIndoorCameraD3D->sRotationY * 0.00048828125); | 182 //this->fCosineY = cos((3.141592653589793 + 3.141592653589793) * (double)pIndoorCameraD3D->sRotationY * 0.00048828125); |
183 //this->fSineY = sin((3.141592653589793 + 3.141592653589793) * (double)pEngine->pIndoorCameraD3D->sRotationY * 0.00048828125); | 183 //this->fSineY = sin((3.141592653589793 + 3.141592653589793) * (double)pIndoorCameraD3D->sRotationY * 0.00048828125); |
184 //this->fCosineNegX = cos((3.141592653589793 + 3.141592653589793) * (double)-pEngine->pIndoorCameraD3D->sRotationX * 0.00048828125); | 184 //this->fCosineNegX = cos((3.141592653589793 + 3.141592653589793) * (double)-pIndoorCameraD3D->sRotationX * 0.00048828125); |
185 //this->fSineNegX = sin((3.141592653589793 + 3.141592653589793) * (double)-pEngine->pIndoorCameraD3D->sRotationX * 0.00048828125); | 185 //this->fSineNegX = sin((3.141592653589793 + 3.141592653589793) * (double)-pIndoorCameraD3D->sRotationX * 0.00048828125); |
186 this->field_64 = pViewport->field_of_view; | 186 this->field_64 = pViewport->field_of_view; |
187 | 187 |
188 this->uViewportX = pViewport->uScreen_TL_X; | 188 this->uViewportX = pViewport->uScreen_TL_X; |
189 this->uViewportY = pViewport->uScreen_TL_Y; | 189 this->uViewportY = pViewport->uScreen_TL_Y; |
190 this->uViewportZ = pViewport->uScreen_BR_X; | 190 this->uViewportZ = pViewport->uScreen_BR_X; |
426 pFace->uAttributes |= FACE_UNKNOW7; | 426 pFace->uAttributes |= FACE_UNKNOW7; |
427 | 427 |
428 if (!pFace->GetTexture()) | 428 if (!pFace->GetTexture()) |
429 return; | 429 return; |
430 | 430 |
431 if (!pEngine->pIndoorCameraD3D->IsCulled(pFace)) | 431 if (!pIndoorCameraD3D->IsCulled(pFace)) |
432 { | 432 { |
433 uNumVerticesa = pFace->uNumVertices; | 433 uNumVerticesa = pFace->uNumVertices; |
434 for (uint i = 0; i < pFace->uNumVertices; ++i) | 434 for (uint i = 0; i < pFace->uNumVertices; ++i) |
435 { | 435 { |
436 static_vertices_F7C228[i].vWorldPosition.x = pIndoor->pVertices[pFace->pVertexIDs[i]].x; | 436 static_vertices_F7C228[i].vWorldPosition.x = pIndoor->pVertices[pFace->pVertexIDs[i]].x; |
441 } | 441 } |
442 | 442 |
443 if (!pVertices || | 443 if (!pVertices || |
444 (pEngine->pStru9Instance->_498377(pPortalBounding, 4, pVertices, static_vertices_F7C228, &uNumVerticesa), uNumVerticesa) ) | 444 (pEngine->pStru9Instance->_498377(pPortalBounding, 4, pVertices, static_vertices_F7C228, &uNumVerticesa), uNumVerticesa) ) |
445 { | 445 { |
446 if (pEngine->pIndoorCameraD3D->CalcPortalShape(static_vertices_F7C228, &uNumVerticesa, | 446 if (pIndoorCameraD3D->CalcPortalShape(static_vertices_F7C228, &uNumVerticesa, |
447 static_vertices_F7B628, pEngine->pIndoorCameraD3D->std__vector_000034_prolly_frustrum, 4, false, 0) != 1 || uNumVerticesa ) | 447 static_vertices_F7B628, pIndoorCameraD3D->std__vector_000034_prolly_frustrum, 4, false, 0) != 1 || uNumVerticesa ) |
448 { | 448 { |
449 a4a = SHIWORD(stru_F8AD28.uCurrentAmbientLightLevel); | 449 a4a = SHIWORD(stru_F8AD28.uCurrentAmbientLightLevel); |
450 v17 = (248 - (SHIWORD(stru_F8AD28.uCurrentAmbientLightLevel) << 3)) | 450 v17 = (248 - (SHIWORD(stru_F8AD28.uCurrentAmbientLightLevel) << 3)) |
451 | (((248 - (SHIWORD(stru_F8AD28.uCurrentAmbientLightLevel) << 3)) | 451 | (((248 - (SHIWORD(stru_F8AD28.uCurrentAmbientLightLevel) << 3)) |
452 | ((248 - (SHIWORD(stru_F8AD28.uCurrentAmbientLightLevel) << 3)) << 8)) << 8); | 452 | ((248 - (SHIWORD(stru_F8AD28.uCurrentAmbientLightLevel) << 3)) << 8)) << 8); |
453 sub_4B0E07(uFaceID); | 453 sub_4B0E07(uFaceID); |
454 pEngine->pLightmapBuilder->ApplyLights_IndoorFace(uFaceID); | 454 pEngine->pLightmapBuilder->ApplyLights_IndoorFace(uFaceID); |
455 pDecalBuilder->ApplyBloodsplatDecals_IndoorFace(uFaceID); | 455 pDecalBuilder->ApplyBloodsplatDecals_IndoorFace(uFaceID); |
456 pEngine->pIndoorCameraD3D->ViewTransfrom_OffsetUV(static_vertices_F7B628, uNumVerticesa, array_507D30, &stru_F8AD28); | 456 pIndoorCameraD3D->ViewTransfrom_OffsetUV(static_vertices_F7B628, uNumVerticesa, array_507D30, &stru_F8AD28); |
457 pEngine->pIndoorCameraD3D->Project(array_507D30, uNumVerticesa, 0); | 457 pIndoorCameraD3D->Project(array_507D30, uNumVerticesa, 0); |
458 pEngine->pLightmapBuilder->std__vector_000004_size = 0; | 458 pEngine->pLightmapBuilder->std__vector_000004_size = 0; |
459 if (stru_F8AD28.uNumLightsApplied > 0 || pDecalBuilder->uNumDecals > 0) | 459 if (stru_F8AD28.uNumLightsApplied > 0 || pDecalBuilder->uNumDecals > 0) |
460 { | 460 { |
461 stru_F7B60C.face_plane.vNormal.x = pFace->pFacePlane.vNormal.x; | 461 stru_F7B60C.face_plane.vNormal.x = pFace->pFacePlane.vNormal.x; |
462 stru_F7B60C.polygonType = pFace->uPolygonType; | 462 stru_F7B60C.polygonType = pFace->uPolygonType; |
555 } | 555 } |
556 | 556 |
557 if (nodes[node_id].uFaceID == uFaceID) | 557 if (nodes[node_id].uFaceID == uFaceID) |
558 return; | 558 return; |
559 if (!node_id && | 559 if (!node_id && |
560 pEngine->pIndoorCameraD3D->vPartyPos.x >= pFace->pBounding.x1 - 16 && // we are probably standing at the portal plane | 560 pIndoorCameraD3D->vPartyPos.x >= pFace->pBounding.x1 - 16 && // we are probably standing at the portal plane |
561 pEngine->pIndoorCameraD3D->vPartyPos.x <= pFace->pBounding.x2 + 16 && | 561 pIndoorCameraD3D->vPartyPos.x <= pFace->pBounding.x2 + 16 && |
562 pEngine->pIndoorCameraD3D->vPartyPos.y >= pFace->pBounding.y1 - 16 && | 562 pIndoorCameraD3D->vPartyPos.y >= pFace->pBounding.y1 - 16 && |
563 pEngine->pIndoorCameraD3D->vPartyPos.y <= pFace->pBounding.y2 + 16 && | 563 pIndoorCameraD3D->vPartyPos.y <= pFace->pBounding.y2 + 16 && |
564 pEngine->pIndoorCameraD3D->vPartyPos.z >= pFace->pBounding.z1 - 16 && | 564 pIndoorCameraD3D->vPartyPos.z >= pFace->pBounding.z1 - 16 && |
565 pEngine->pIndoorCameraD3D->vPartyPos.z <= pFace->pBounding.z2 + 16 ) | 565 pIndoorCameraD3D->vPartyPos.z <= pFace->pBounding.z2 + 16 ) |
566 { | 566 { |
567 if ( abs(pFace->pFacePlane_old.dist + pEngine->pIndoorCameraD3D->vPartyPos.x * pFace->pFacePlane_old.vNormal.x | 567 if ( abs(pFace->pFacePlane_old.dist + pIndoorCameraD3D->vPartyPos.x * pFace->pFacePlane_old.vNormal.x |
568 + pEngine->pIndoorCameraD3D->vPartyPos.y * pFace->pFacePlane_old.vNormal.y | 568 + pIndoorCameraD3D->vPartyPos.y * pFace->pFacePlane_old.vNormal.y |
569 + pEngine->pIndoorCameraD3D->vPartyPos.z * pFace->pFacePlane_old.vNormal.z) <= 589824 ) // we sure are standing at the portal plane | 569 + pIndoorCameraD3D->vPartyPos.z * pFace->pFacePlane_old.vNormal.z) <= 589824 ) // we sure are standing at the portal plane |
570 { | 570 { |
571 pTransitionSector = pFace->uSectorID; | 571 pTransitionSector = pFace->uSectorID; |
572 if ( nodes[0].uSectorID == pTransitionSector ) // draw back sector | 572 if ( nodes[0].uSectorID == pTransitionSector ) // draw back sector |
573 pTransitionSector = pFace->uBackSectorID; | 573 pTransitionSector = pFace->uBackSectorID; |
574 nodes[num_nodes].uSectorID = pTransitionSector; | 574 nodes[num_nodes].uSectorID = pTransitionSector; |
582 AddBspNodeToRenderList(++num_nodes - 1); | 582 AddBspNodeToRenderList(++num_nodes - 1); |
583 return; | 583 return; |
584 } | 584 } |
585 } | 585 } |
586 | 586 |
587 v9 = pFace->pFacePlane_old.vNormal.x * (pIndoor->pVertices[pFace->pVertexIDs[0]].x - pEngine->pIndoorCameraD3D->vPartyPos.x) | 587 v9 = pFace->pFacePlane_old.vNormal.x * (pIndoor->pVertices[pFace->pVertexIDs[0]].x - pIndoorCameraD3D->vPartyPos.x) |
588 + pFace->pFacePlane_old.vNormal.y * (pIndoor->pVertices[pFace->pVertexIDs[0]].y - pEngine->pIndoorCameraD3D->vPartyPos.y) | 588 + pFace->pFacePlane_old.vNormal.y * (pIndoor->pVertices[pFace->pVertexIDs[0]].y - pIndoorCameraD3D->vPartyPos.y) |
589 + pFace->pFacePlane_old.vNormal.z * (pIndoor->pVertices[pFace->pVertexIDs[0]].z - pEngine->pIndoorCameraD3D->vPartyPos.z); | 589 + pFace->pFacePlane_old.vNormal.z * (pIndoor->pVertices[pFace->pVertexIDs[0]].z - pIndoorCameraD3D->vPartyPos.z); |
590 if (nodes[node_id].uSectorID != pFace->uSectorID) | 590 if (nodes[node_id].uSectorID != pFace->uSectorID) |
591 v9 = -v9; | 591 v9 = -v9; |
592 if (v9 >= 0) | 592 if (v9 >= 0) |
593 return; | 593 return; |
594 | 594 |
644 static_subAddFaceToRenderList_d3d_stru_F7AA08[k].vWorldPosition.y = pIndoor->pVertices[pFace->pVertexIDs[k]].y; | 644 static_subAddFaceToRenderList_d3d_stru_F7AA08[k].vWorldPosition.y = pIndoor->pVertices[pFace->pVertexIDs[k]].y; |
645 static_subAddFaceToRenderList_d3d_stru_F7AA08[k].vWorldPosition.z = pIndoor->pVertices[pFace->pVertexIDs[k]].z; | 645 static_subAddFaceToRenderList_d3d_stru_F7AA08[k].vWorldPosition.z = pIndoor->pVertices[pFace->pVertexIDs[k]].z; |
646 } | 646 } |
647 | 647 |
648 unsigned int pNewNumVertices = pFace->uNumVertices; | 648 unsigned int pNewNumVertices = pFace->uNumVertices; |
649 pEngine->pIndoorCameraD3D->CalcPortalShape(static_subAddFaceToRenderList_d3d_stru_F7AA08, &pNewNumVertices, | 649 pIndoorCameraD3D->CalcPortalShape(static_subAddFaceToRenderList_d3d_stru_F7AA08, &pNewNumVertices, |
650 static_subAddFaceToRenderList_d3d_stru_F79E08, nodes[node_id].std__vector_0007AC, 4, 0, 0); | 650 static_subAddFaceToRenderList_d3d_stru_F79E08, nodes[node_id].std__vector_0007AC, 4, 0, 0); |
651 | 651 |
652 v29 = pEngine->pStru10Instance->_49C5DA(pFace, static_subAddFaceToRenderList_d3d_stru_F79E08, &pNewNumVertices, | 652 v29 = pEngine->pStru10Instance->_49C5DA(pFace, static_subAddFaceToRenderList_d3d_stru_F79E08, &pNewNumVertices, |
653 nodes[num_nodes].std__vector_0007AC, nodes[num_nodes].pPortalBounding); | 653 nodes[num_nodes].std__vector_0007AC, nodes[num_nodes].pPortalBounding); |
654 } | 654 } |
657 assert(num_nodes < 150); | 657 assert(num_nodes < 150); |
658 | 658 |
659 nodes[num_nodes].viewing_portal_id = uFaceID; | 659 nodes[num_nodes].viewing_portal_id = uFaceID; |
660 AddBspNodeToRenderList(++num_nodes - 1); | 660 AddBspNodeToRenderList(++num_nodes - 1); |
661 } | 661 } |
662 if (pEngine->pIndoorCameraD3D->debug_flags & BLV_RENDER_DRAW_SW_OUTLINES) | 662 if (pIndoorCameraD3D->debug_flags & BLV_RENDER_DRAW_SW_OUTLINES) |
663 pEngine->pIndoorCameraD3D->PrepareAndDrawDebugOutline(pFace, 0x1E1EFF); | 663 pIndoorCameraD3D->PrepareAndDrawDebugOutline(pFace, 0x1E1EFF); |
664 //pEngine->pIndoorCameraD3D->DebugDrawPortal(pFace); | 664 //pIndoorCameraD3D->DebugDrawPortal(pFace); |
665 } | 665 } |
666 } | 666 } |
667 | 667 |
668 //----- (004AE5BA) -------------------------------------------------------- | 668 //----- (004AE5BA) -------------------------------------------------------- |
669 Texture *BLVFace::GetTexture() | 669 Texture *BLVFace::GetTexture() |
3411 for (uint i = 0; i < uNumActors; ++i) | 3411 for (uint i = 0; i < uNumActors; ++i) |
3412 { | 3412 { |
3413 if (pActors[i].uAIState == Removed || pActors[i].uAIState == Disabled) | 3413 if (pActors[i].uAIState == Removed || pActors[i].uAIState == Disabled) |
3414 continue; | 3414 continue; |
3415 | 3415 |
3416 v4 = stru_5C6E00->Atan2(pActors[i].vPosition.x - pEngine->pIndoorCameraD3D->vPartyPos.x, pActors[i].vPosition.y - pEngine->pIndoorCameraD3D->vPartyPos.y); | 3416 v4 = stru_5C6E00->Atan2(pActors[i].vPosition.x - pIndoorCameraD3D->vPartyPos.x, pActors[i].vPosition.y - pIndoorCameraD3D->vPartyPos.y); |
3417 v6 = ((signed int)(pActors[i].uYawAngle + ((signed int)stru_5C6E00->uIntegerPi >> 3) - v4 + stru_5C6E00->uIntegerPi) >> 8) & 7; | 3417 v6 = ((signed int)(pActors[i].uYawAngle + ((signed int)stru_5C6E00->uIntegerPi >> 3) - v4 + stru_5C6E00->uIntegerPi) >> 8) & 7; |
3418 v8 = pActors[i].uCurrentActionTime; | 3418 v8 = pActors[i].uCurrentActionTime; |
3419 if ( pParty->bTurnBasedModeOn ) | 3419 if ( pParty->bTurnBasedModeOn ) |
3420 { | 3420 { |
3421 if ( pActors[i].uCurrentActionAnimation == 1 ) | 3421 if ( pActors[i].uCurrentActionAnimation == 1 ) |
3450 } | 3450 } |
3451 for ( v12 = 0; v12 < pBspRenderer->uNumVisibleNotEmptySectors; ++v12 ) | 3451 for ( v12 = 0; v12 < pBspRenderer->uNumVisibleNotEmptySectors; ++v12 ) |
3452 { | 3452 { |
3453 if ( pBspRenderer->pVisibleSectorIDs_toDrawDecorsActorsEtcFrom[v12] == pActors[i].uSectorID ) | 3453 if ( pBspRenderer->pVisibleSectorIDs_toDrawDecorsActorsEtcFrom[v12] == pActors[i].uSectorID ) |
3454 { | 3454 { |
3455 if ( !pEngine->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible_BLV(pActors[i].vPosition.x, pActors[i].vPosition.y, pActors[i].vPosition.z, &x, &y, &z, 1) | 3455 if ( !pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible_BLV(pActors[i].vPosition.x, pActors[i].vPosition.y, pActors[i].vPosition.z, &x, &y, &z, 1) |
3456 || abs(x) < abs(y) ) | 3456 || abs(x) < abs(y) ) |
3457 continue; | 3457 continue; |
3458 pEngine->pIndoorCameraD3D->Project(x, y, z, &v43, &a6); | 3458 pIndoorCameraD3D->Project(x, y, z, &v43, &a6); |
3459 if (uNumBillboardsToDraw >= 500) | 3459 if (uNumBillboardsToDraw >= 500) |
3460 break; | 3460 break; |
3461 ++uNumBillboardsToDraw; | 3461 ++uNumBillboardsToDraw; |
3462 ++uNumSpritesDrawnThisFrame; | 3462 ++uNumSpritesDrawnThisFrame; |
3463 pActors[i].uAttributes |= ACTOR_UNKNOW2; | 3463 pActors[i].uAttributes |= ACTOR_UNKNOW2; |
3471 v0->_screenspace_x_scaler_packedfloat = fixpoint_mul(v10->scale, v20 / x); | 3471 v0->_screenspace_x_scaler_packedfloat = fixpoint_mul(v10->scale, v20 / x); |
3472 a5a = fixpoint_mul(v10->scale, v20 / x); | 3472 a5a = fixpoint_mul(v10->scale, v20 / x); |
3473 } | 3473 } |
3474 else | 3474 else |
3475 {*/ | 3475 {*/ |
3476 pBillboardRenderList[uNumBillboardsToDraw - 1].fov_x = pEngine->pIndoorCameraD3D->fov_x; | 3476 pBillboardRenderList[uNumBillboardsToDraw - 1].fov_x = pIndoorCameraD3D->fov_x; |
3477 pBillboardRenderList[uNumBillboardsToDraw - 1].fov_y = pEngine->pIndoorCameraD3D->fov_y; | 3477 pBillboardRenderList[uNumBillboardsToDraw - 1].fov_y = pIndoorCameraD3D->fov_y; |
3478 LODWORD(v18) = 0; | 3478 LODWORD(v18) = 0; |
3479 HIDWORD(v18) = floorf(pBillboardRenderList[uNumBillboardsToDraw - 1].fov_x + 0.5f); | 3479 HIDWORD(v18) = floorf(pBillboardRenderList[uNumBillboardsToDraw - 1].fov_x + 0.5f); |
3480 pBillboardRenderList[uNumBillboardsToDraw - 1]._screenspace_x_scaler_packedfloat = fixpoint_mul(v9->scale, v18 / x); | 3480 pBillboardRenderList[uNumBillboardsToDraw - 1]._screenspace_x_scaler_packedfloat = fixpoint_mul(v9->scale, v18 / x); |
3481 a5a = fixpoint_mul(v9->scale, v18 / x); | 3481 a5a = fixpoint_mul(v9->scale, v18 / x); |
3482 //} | 3482 //} |
3547 && (pSpriteObjects[i].uType < 811 || pSpriteObjects[i].uType >= 815) | 3547 && (pSpriteObjects[i].uType < 811 || pSpriteObjects[i].uType >= 815) |
3548 || pEngine->pStru6Instance->_4A81CA(&pSpriteObjects[i])) | 3548 || pEngine->pStru6Instance->_4A81CA(&pSpriteObjects[i])) |
3549 { | 3549 { |
3550 v4 = pSpriteFrameTable->GetFrame(pObjectList->pObjects[pSpriteObjects[i].uObjectDescID].uSpriteID, pSpriteObjects[i].uSpriteFrameID); | 3550 v4 = pSpriteFrameTable->GetFrame(pObjectList->pObjects[pSpriteObjects[i].uObjectDescID].uSpriteID, pSpriteObjects[i].uSpriteFrameID); |
3551 a6 = v4->uGlowRadius * pSpriteObjects[i].field_22_glow_radius_multiplier; | 3551 a6 = v4->uGlowRadius * pSpriteObjects[i].field_22_glow_radius_multiplier; |
3552 v6 = stru_5C6E00->Atan2(pSpriteObjects[i].vPosition.x - pEngine->pIndoorCameraD3D->vPartyPos.x, | 3552 v6 = stru_5C6E00->Atan2(pSpriteObjects[i].vPosition.x - pIndoorCameraD3D->vPartyPos.x, |
3553 pSpriteObjects[i].vPosition.y - pEngine->pIndoorCameraD3D->vPartyPos.y); | 3553 pSpriteObjects[i].vPosition.y - pIndoorCameraD3D->vPartyPos.y); |
3554 LOWORD(v7) = pSpriteObjects[i].uFacing; | 3554 LOWORD(v7) = pSpriteObjects[i].uFacing; |
3555 v9 = ((signed int)(stru_5C6E00->uIntegerPi + ((signed int)stru_5C6E00->uIntegerPi >> 3) + v7 - v6) >> 8) & 7; | 3555 v9 = ((signed int)(stru_5C6E00->uIntegerPi + ((signed int)stru_5C6E00->uIntegerPi >> 3) + v7 - v6) >> 8) & 7; |
3556 pBillboardRenderList[uNumBillboardsToDraw].HwSpriteID = v4->pHwSpriteIDs[v9]; | 3556 pBillboardRenderList[uNumBillboardsToDraw].HwSpriteID = v4->pHwSpriteIDs[v9]; |
3557 if ( v4->uFlags & 0x20 ) | 3557 if ( v4->uFlags & 0x20 ) |
3558 pSpriteObjects[i].vPosition.z -= (signed int)(fixpoint_mul(v4->scale, pSprites_LOD->pSpriteHeaders[pBillboardRenderList[uNumBillboardsToDraw].HwSpriteID].uHeight) / 2); | 3558 pSpriteObjects[i].vPosition.z -= (signed int)(fixpoint_mul(v4->scale, pSprites_LOD->pSpriteHeaders[pBillboardRenderList[uNumBillboardsToDraw].HwSpriteID].uHeight) / 2); |
3573 pMobileLightsStack->AddLight(pSpriteObjects[i].vPosition.x, pSpriteObjects[i].vPosition.y, pSpriteObjects[i].vPosition.z, | 3573 pMobileLightsStack->AddLight(pSpriteObjects[i].vPosition.x, pSpriteObjects[i].vPosition.y, pSpriteObjects[i].vPosition.z, |
3574 pSpriteObjects[i].uSectorID, a6, pObjectList->pObjects[pSpriteObjects[i].uObjectDescID].uParticleTrailColorR, | 3574 pSpriteObjects[i].uSectorID, a6, pObjectList->pObjects[pSpriteObjects[i].uObjectDescID].uParticleTrailColorR, |
3575 pObjectList->pObjects[pSpriteObjects[i].uObjectDescID].uParticleTrailColorG, | 3575 pObjectList->pObjects[pSpriteObjects[i].uObjectDescID].uParticleTrailColorG, |
3576 pObjectList->pObjects[pSpriteObjects[i].uObjectDescID].uParticleTrailColorB, _4E94D3_light_type); | 3576 pObjectList->pObjects[pSpriteObjects[i].uObjectDescID].uParticleTrailColorB, _4E94D3_light_type); |
3577 } | 3577 } |
3578 if ( pEngine->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible_BLV(pSpriteObjects[i].vPosition.x, pSpriteObjects[i].vPosition.y, | 3578 if ( pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible_BLV(pSpriteObjects[i].vPosition.x, pSpriteObjects[i].vPosition.y, |
3579 pSpriteObjects[i].vPosition.z, &x, &y, &z, 1) ) | 3579 pSpriteObjects[i].vPosition.z, &x, &y, &z, 1) ) |
3580 { | 3580 { |
3581 pEngine->pIndoorCameraD3D->Project(x, y, z, &v36, &v35); | 3581 pIndoorCameraD3D->Project(x, y, z, &v36, &v35); |
3582 | 3582 |
3583 assert(uNumBillboardsToDraw < 500); | 3583 assert(uNumBillboardsToDraw < 500); |
3584 //if ( (signed int)uNumBillboardsToDraw >= 500 ) | 3584 //if ( (signed int)uNumBillboardsToDraw >= 500 ) |
3585 // return; | 3585 // return; |
3586 ++uNumBillboardsToDraw; | 3586 ++uNumBillboardsToDraw; |
3588 pSpriteObjects[i].uAttributes |= 1; | 3588 pSpriteObjects[i].uAttributes |= 1; |
3589 pBillboardRenderList[uNumBillboardsToDraw - 1].uPalette = v4->uPaletteIndex; | 3589 pBillboardRenderList[uNumBillboardsToDraw - 1].uPalette = v4->uPaletteIndex; |
3590 pBillboardRenderList[uNumBillboardsToDraw - 1].uIndoorSectorID = pSpriteObjects[i].uSectorID; | 3590 pBillboardRenderList[uNumBillboardsToDraw - 1].uIndoorSectorID = pSpriteObjects[i].uSectorID; |
3591 //if ( pRenderer->pRenderD3D ) | 3591 //if ( pRenderer->pRenderD3D ) |
3592 { | 3592 { |
3593 pBillboardRenderList[uNumBillboardsToDraw - 1].fov_x = pEngine->pIndoorCameraD3D->fov_x; | 3593 pBillboardRenderList[uNumBillboardsToDraw - 1].fov_x = pIndoorCameraD3D->fov_x; |
3594 pBillboardRenderList[uNumBillboardsToDraw - 1].fov_y = pEngine->pIndoorCameraD3D->fov_y; | 3594 pBillboardRenderList[uNumBillboardsToDraw - 1].fov_y = pIndoorCameraD3D->fov_y; |
3595 LODWORD(v18) = 0; | 3595 LODWORD(v18) = 0; |
3596 HIDWORD(v18) = (int)floorf(pBillboardRenderList[uNumBillboardsToDraw - 1].fov_x + 0.5f); | 3596 HIDWORD(v18) = (int)floorf(pBillboardRenderList[uNumBillboardsToDraw - 1].fov_x + 0.5f); |
3597 pBillboardRenderList[uNumBillboardsToDraw - 1]._screenspace_x_scaler_packedfloat = fixpoint_mul(v4->scale, v18 / x); | 3597 pBillboardRenderList[uNumBillboardsToDraw - 1]._screenspace_x_scaler_packedfloat = fixpoint_mul(v4->scale, v18 / x); |
3598 v31 = fixpoint_mul(v4->scale, v18 / x); | 3598 v31 = fixpoint_mul(v4->scale, v18 / x); |
3599 } | 3599 } |
3677 { | 3677 { |
3678 pSector = &pIndoor->pSectors[node->uSectorID]; | 3678 pSector = &pIndoor->pSectors[node->uSectorID]; |
3679 pNode = &pIndoor->pNodes[uFirstNode]; | 3679 pNode = &pIndoor->pNodes[uFirstNode]; |
3680 pFace = &pIndoor->pFaces[pSector->pFaceIDs[pNode->uCoplanarOffset]]; | 3680 pFace = &pIndoor->pFaces[pSector->pFaceIDs[pNode->uCoplanarOffset]]; |
3681 v5 = pFace->pFacePlane_old.dist + | 3681 v5 = pFace->pFacePlane_old.dist + |
3682 pEngine->pIndoorCameraD3D->vPartyPos.x * pFace->pFacePlane_old.vNormal.x + | 3682 pIndoorCameraD3D->vPartyPos.x * pFace->pFacePlane_old.vNormal.x + |
3683 pEngine->pIndoorCameraD3D->vPartyPos.y * pFace->pFacePlane_old.vNormal.y + | 3683 pIndoorCameraD3D->vPartyPos.y * pFace->pFacePlane_old.vNormal.y + |
3684 pEngine->pIndoorCameraD3D->vPartyPos.z * pFace->pFacePlane_old.vNormal.z;//plane equation | 3684 pIndoorCameraD3D->vPartyPos.z * pFace->pFacePlane_old.vNormal.z;//plane equation |
3685 if (pFace->Portal() && pFace->uSectorID != node->uSectorID ) | 3685 if (pFace->Portal() && pFace->uSectorID != node->uSectorID ) |
3686 v5 = -v5; | 3686 v5 = -v5; |
3687 //v11 = v5 > 0; | 3687 //v11 = v5 > 0; |
3688 if ( v5 <= 0 ) | 3688 if ( v5 <= 0 ) |
3689 v6 = pNode->uFront; | 3689 v6 = pNode->uFront; |
3752 | 3752 |
3753 if (pDecorationList->pDecorations[pLevelDecorations[uDecorationID].uDecorationDescID].uFlags & DECORATION_DESC_DONT_DRAW) | 3753 if (pDecorationList->pDecorations[pLevelDecorations[uDecorationID].uDecorationDescID].uFlags & DECORATION_DESC_DONT_DRAW) |
3754 return; | 3754 return; |
3755 | 3755 |
3756 v8 = pLevelDecorations[uDecorationID].field_10_y_rot + ((signed int)stru_5C6E00->uIntegerPi >> 3) | 3756 v8 = pLevelDecorations[uDecorationID].field_10_y_rot + ((signed int)stru_5C6E00->uIntegerPi >> 3) |
3757 - stru_5C6E00->Atan2(pLevelDecorations[uDecorationID].vPosition.x - pEngine->pIndoorCameraD3D->vPartyPos.x, | 3757 - stru_5C6E00->Atan2(pLevelDecorations[uDecorationID].vPosition.x - pIndoorCameraD3D->vPartyPos.x, |
3758 pLevelDecorations[uDecorationID].vPosition.y - pEngine->pIndoorCameraD3D->vPartyPos.y); | 3758 pLevelDecorations[uDecorationID].vPosition.y - pIndoorCameraD3D->vPartyPos.y); |
3759 v9 = ((signed int)(stru_5C6E00->uIntegerPi + v8) >> 8) & 7; | 3759 v9 = ((signed int)(stru_5C6E00->uIntegerPi + v8) >> 8) & 7; |
3760 v37 = pBLVRenderParams->field_0_timer_; | 3760 v37 = pBLVRenderParams->field_0_timer_; |
3761 if (pParty->bTurnBasedModeOn) | 3761 if (pParty->bTurnBasedModeOn) |
3762 v37 = pMiscTimer->uTotalGameTimeElapsed; | 3762 v37 = pMiscTimer->uTotalGameTimeElapsed; |
3763 v10 = abs(pLevelDecorations[uDecorationID].vPosition.x + pLevelDecorations[uDecorationID].vPosition.y); | 3763 v10 = abs(pLevelDecorations[uDecorationID].vPosition.x + pLevelDecorations[uDecorationID].vPosition.y); |
3769 v30 |= 0x40u; | 3769 v30 |= 0x40u; |
3770 if ( v11->uFlags & 0x20000 ) | 3770 if ( v11->uFlags & 0x20000 ) |
3771 LOBYTE(v30) = v30 | 0x80; | 3771 LOBYTE(v30) = v30 | 0x80; |
3772 if ( (256 << v9) & v11->uFlags ) | 3772 if ( (256 << v9) & v11->uFlags ) |
3773 v30 |= 4; | 3773 v30 |= 4; |
3774 if ( pEngine->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible_BLV(pLevelDecorations[uDecorationID].vPosition.x, | 3774 if ( pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible_BLV(pLevelDecorations[uDecorationID].vPosition.x, |
3775 pLevelDecorations[uDecorationID].vPosition.y, | 3775 pLevelDecorations[uDecorationID].vPosition.y, |
3776 pLevelDecorations[uDecorationID].vPosition.z, &x, &y, &z, 1) ) | 3776 pLevelDecorations[uDecorationID].vPosition.z, &x, &y, &z, 1) ) |
3777 { | 3777 { |
3778 if ( abs(x) >= abs(y) ) | 3778 if ( abs(x) >= abs(y) ) |
3779 { | 3779 { |
3780 pEngine->pIndoorCameraD3D->Project(x, y, z, &a5, &a6); | 3780 pIndoorCameraD3D->Project(x, y, z, &a5, &a6); |
3781 | 3781 |
3782 assert(uNumBillboardsToDraw < 500); | 3782 assert(uNumBillboardsToDraw < 500); |
3783 | 3783 |
3784 ++uNumBillboardsToDraw; | 3784 ++uNumBillboardsToDraw; |
3785 ++uNumDecorationsDrawnThisFrame; | 3785 ++uNumDecorationsDrawnThisFrame; |
3794 pBillboardRenderList[uNumBillboardsToDraw - 1]._screenspace_x_scaler_packedfloat = fixpoint_mul(v12->scale, v21 / x); | 3794 pBillboardRenderList[uNumBillboardsToDraw - 1]._screenspace_x_scaler_packedfloat = fixpoint_mul(v12->scale, v21 / x); |
3795 v37 = fixpoint_mul(v12->scale, v21 / x); | 3795 v37 = fixpoint_mul(v12->scale, v21 / x); |
3796 } | 3796 } |
3797 else | 3797 else |
3798 {*/ | 3798 {*/ |
3799 pBillboardRenderList[uNumBillboardsToDraw - 1].fov_x = pEngine->pIndoorCameraD3D->fov_x; | 3799 pBillboardRenderList[uNumBillboardsToDraw - 1].fov_x = pIndoorCameraD3D->fov_x; |
3800 pBillboardRenderList[uNumBillboardsToDraw - 1].fov_y = pEngine->pIndoorCameraD3D->fov_y; | 3800 pBillboardRenderList[uNumBillboardsToDraw - 1].fov_y = pIndoorCameraD3D->fov_y; |
3801 LODWORD(v20) = 0; | 3801 LODWORD(v20) = 0; |
3802 HIDWORD(v20) = floorf(pBillboardRenderList[uNumBillboardsToDraw - 1].fov_x + 0.5f); | 3802 HIDWORD(v20) = floorf(pBillboardRenderList[uNumBillboardsToDraw - 1].fov_x + 0.5f); |
3803 pBillboardRenderList[uNumBillboardsToDraw - 1]._screenspace_x_scaler_packedfloat = fixpoint_mul(v11->scale, v20 / x); | 3803 pBillboardRenderList[uNumBillboardsToDraw - 1]._screenspace_x_scaler_packedfloat = fixpoint_mul(v11->scale, v20 / x); |
3804 LODWORD(v20) = 0; | 3804 LODWORD(v20) = 0; |
3805 HIDWORD(v20) = floorf(pBillboardRenderList[uNumBillboardsToDraw - 1].fov_y + 0.5f); | 3805 HIDWORD(v20) = floorf(pBillboardRenderList[uNumBillboardsToDraw - 1].fov_y + 0.5f); |
3879 int v19; // ST10_4@6 | 3879 int v19; // ST10_4@6 |
3880 int v21; // ST10_4@9 | 3880 int v21; // ST10_4@9 |
3881 int v28; // [sp+1Ch] [bp-Ch]@1 | 3881 int v28; // [sp+1Ch] [bp-Ch]@1 |
3882 int v29; // [sp+24h] [bp-4h]@1 | 3882 int v29; // [sp+24h] [bp-4h]@1 |
3883 | 3883 |
3884 v8 = stru_5C6E00->Cos(pEngine->pIndoorCameraD3D->sRotationY); | 3884 v8 = stru_5C6E00->Cos(pIndoorCameraD3D->sRotationY); |
3885 v29 = stru_5C6E00->Sin(pEngine->pIndoorCameraD3D->sRotationY); | 3885 v29 = stru_5C6E00->Sin(pIndoorCameraD3D->sRotationY); |
3886 v28 = stru_5C6E00->Cos(pEngine->pIndoorCameraD3D->sRotationX); | 3886 v28 = stru_5C6E00->Cos(pIndoorCameraD3D->sRotationX); |
3887 v9 = stru_5C6E00->Sin(pEngine->pIndoorCameraD3D->sRotationX); | 3887 v9 = stru_5C6E00->Sin(pIndoorCameraD3D->sRotationX); |
3888 //v11 = -pBLVRenderParams->vPartyPos.y; | 3888 //v11 = -pBLVRenderParams->vPartyPos.y; |
3889 //v26 = -pBLVRenderParams->vPartyPos.x; | 3889 //v26 = -pBLVRenderParams->vPartyPos.x; |
3890 //v27 = v9; | 3890 //v27 = v9; |
3891 //v12 = -pBLVRenderParams->vPartyPos.z; | 3891 //v12 = -pBLVRenderParams->vPartyPos.z; |
3892 if (pEngine->pIndoorCameraD3D->sRotationX) | 3892 if (pIndoorCameraD3D->sRotationX) |
3893 { | 3893 { |
3894 v16 = v8 * -pEngine->pIndoorCameraD3D->vPartyPos.x + v29 * -pEngine->pIndoorCameraD3D->vPartyPos.y; | 3894 v16 = v8 * -pIndoorCameraD3D->vPartyPos.x + v29 * -pIndoorCameraD3D->vPartyPos.y; |
3895 v17 = -65536 * pEngine->pIndoorCameraD3D->vPartyPos.z; | 3895 v17 = -65536 * pIndoorCameraD3D->vPartyPos.z; |
3896 this->field_0_party_dir_x = fixpoint_mul(v16, v28) + fixpoint_mul((-pEngine->pIndoorCameraD3D->vPartyPos.z) << 16, v9); | 3896 this->field_0_party_dir_x = fixpoint_mul(v16, v28) + fixpoint_mul((-pIndoorCameraD3D->vPartyPos.z) << 16, v9); |
3897 this->field_4_party_dir_y = v8 * -pEngine->pIndoorCameraD3D->vPartyPos.y - v29 * -pEngine->pIndoorCameraD3D->vPartyPos.x; | 3897 this->field_4_party_dir_y = v8 * -pIndoorCameraD3D->vPartyPos.y - v29 * -pIndoorCameraD3D->vPartyPos.x; |
3898 this->field_8_party_dir_z = fixpoint_mul(v17, v28) - fixpoint_mul(v16, v9); | 3898 this->field_8_party_dir_z = fixpoint_mul(v17, v28) - fixpoint_mul(v16, v9); |
3899 } | 3899 } |
3900 else | 3900 else |
3901 { | 3901 { |
3902 this->field_0_party_dir_x = v8 * -pEngine->pIndoorCameraD3D->vPartyPos.x + v29 * -pEngine->pIndoorCameraD3D->vPartyPos.y; | 3902 this->field_0_party_dir_x = v8 * -pIndoorCameraD3D->vPartyPos.x + v29 * -pIndoorCameraD3D->vPartyPos.y; |
3903 this->field_4_party_dir_y = v8 * -pEngine->pIndoorCameraD3D->vPartyPos.y - v29 * -pEngine->pIndoorCameraD3D->vPartyPos.x; | 3903 this->field_4_party_dir_y = v8 * -pIndoorCameraD3D->vPartyPos.y - v29 * -pIndoorCameraD3D->vPartyPos.x; |
3904 this->field_8_party_dir_z = (-pEngine->pIndoorCameraD3D->vPartyPos.z) << 16; | 3904 this->field_8_party_dir_z = (-pIndoorCameraD3D->vPartyPos.z) << 16; |
3905 } | 3905 } |
3906 | 3906 |
3907 if (pEngine->pIndoorCameraD3D->sRotationX) | 3907 if (pIndoorCameraD3D->sRotationX) |
3908 { | 3908 { |
3909 v19 = fixpoint_mul(a2, v8) + fixpoint_mul(a3, v29); | 3909 v19 = fixpoint_mul(a2, v8) + fixpoint_mul(a3, v29); |
3910 | 3910 |
3911 this->angle_from_north = fixpoint_mul(v19, v28) + fixpoint_mul(a4, v9); | 3911 this->angle_from_north = fixpoint_mul(v19, v28) + fixpoint_mul(a4, v9); |
3912 this->angle_from_west = fixpoint_mul(a3, v8) - fixpoint_mul(a2, v29); | 3912 this->angle_from_west = fixpoint_mul(a3, v8) - fixpoint_mul(a2, v29); |
3917 this->angle_from_north = fixpoint_mul(a2, v8) + fixpoint_mul(a3, v29); | 3917 this->angle_from_north = fixpoint_mul(a2, v8) + fixpoint_mul(a3, v29); |
3918 this->angle_from_west = fixpoint_mul(a3, v8) - fixpoint_mul(a2, v29); | 3918 this->angle_from_west = fixpoint_mul(a3, v8) - fixpoint_mul(a2, v29); |
3919 this->viewing_angle_from_west_east = a4; | 3919 this->viewing_angle_from_west_east = a4; |
3920 } | 3920 } |
3921 | 3921 |
3922 if (pEngine->pIndoorCameraD3D->sRotationX) | 3922 if (pIndoorCameraD3D->sRotationX) |
3923 { | 3923 { |
3924 v21 = fixpoint_mul(a5, v8) + fixpoint_mul(a6, v29); | 3924 v21 = fixpoint_mul(a5, v8) + fixpoint_mul(a6, v29); |
3925 | 3925 |
3926 this->angle_from_east = fixpoint_mul(v21, v28) + fixpoint_mul(a7, v9); | 3926 this->angle_from_east = fixpoint_mul(v21, v28) + fixpoint_mul(a7, v9); |
3927 this->angle_from_south = fixpoint_mul(a6, v8) - fixpoint_mul(a5, v29); | 3927 this->angle_from_south = fixpoint_mul(a6, v8) - fixpoint_mul(a5, v29); |
4841 | 4841 |
4842 pFace = &pIndoor->pFaces[uFaceID]; | 4842 pFace = &pIndoor->pFaces[uFaceID]; |
4843 memset(&PortalFace, 0, sizeof(stru367)); | 4843 memset(&PortalFace, 0, sizeof(stru367)); |
4844 | 4844 |
4845 //get direction the face(определение направленности фейса)********************************************************************************* | 4845 //get direction the face(определение направленности фейса)********************************************************************************* |
4846 if ( pFace->pFacePlane_old.vNormal.x * (pIndoor->pVertices[pIndoor->pFaces[uFaceID].pVertexIDs[0]].x - pEngine->pIndoorCameraD3D->vPartyPos.x) | 4846 if ( pFace->pFacePlane_old.vNormal.x * (pIndoor->pVertices[pIndoor->pFaces[uFaceID].pVertexIDs[0]].x - pIndoorCameraD3D->vPartyPos.x) |
4847 + pFace->pFacePlane_old.vNormal.y * (pIndoor->pVertices[pIndoor->pFaces[uFaceID].pVertexIDs[0]].y - pEngine->pIndoorCameraD3D->vPartyPos.y) | 4847 + pFace->pFacePlane_old.vNormal.y * (pIndoor->pVertices[pIndoor->pFaces[uFaceID].pVertexIDs[0]].y - pIndoorCameraD3D->vPartyPos.y) |
4848 + pFace->pFacePlane_old.vNormal.z * (pIndoor->pVertices[pIndoor->pFaces[uFaceID].pVertexIDs[0]].z - pEngine->pIndoorCameraD3D->vPartyPos.z) < 0 ) | 4848 + pFace->pFacePlane_old.vNormal.z * (pIndoor->pVertices[pIndoor->pFaces[uFaceID].pVertexIDs[0]].z - pIndoorCameraD3D->vPartyPos.z) < 0 ) |
4849 { | 4849 { |
4850 PortalFace.direction = true; | 4850 PortalFace.direction = true; |
4851 } | 4851 } |
4852 else | 4852 else |
4853 { | 4853 { |
4876 | 4876 |
4877 if ( (signed int)pFace->uNumVertices > 0 ) | 4877 if ( (signed int)pFace->uNumVertices > 0 ) |
4878 { | 4878 { |
4879 for (uint i = 0; i < pFace->uNumVertices; ++i) | 4879 for (uint i = 0; i < pFace->uNumVertices; ++i) |
4880 { | 4880 { |
4881 pEngine->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible_BLV(pIndoor->pVertices[pFace->pVertexIDs[i]].x, | 4881 pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible_BLV(pIndoor->pVertices[pFace->pVertexIDs[i]].x, |
4882 pIndoor->pVertices[pFace->pVertexIDs[i]].y, | 4882 pIndoor->pVertices[pFace->pVertexIDs[i]].y, |
4883 pIndoor->pVertices[pFace->pVertexIDs[i]].z, | 4883 pIndoor->pVertices[pFace->pVertexIDs[i]].z, |
4884 &PortalFace._view_transformed_z[i + 3], &PortalFace._view_transformed_x[i + 3], &PortalFace._view_transformed_y[i + 3], 0); | 4884 &PortalFace._view_transformed_z[i + 3], &PortalFace._view_transformed_x[i + 3], &PortalFace._view_transformed_y[i + 3], 0); |
4885 } | 4885 } |
4886 } | 4886 } |
5244 float v11; // [sp+8h] [bp-8h]@2 | 5244 float v11; // [sp+8h] [bp-8h]@2 |
5245 float v12; // [sp+8h] [bp-8h]@6 | 5245 float v12; // [sp+8h] [bp-8h]@6 |
5246 float v13; // [sp+Ch] [bp-4h]@2 | 5246 float v13; // [sp+Ch] [bp-4h]@2 |
5247 float v14; // [sp+Ch] [bp-4h]@6 | 5247 float v14; // [sp+Ch] [bp-4h]@6 |
5248 | 5248 |
5249 if (pEngine->pIndoorCameraD3D->sRotationX) | 5249 if (pIndoorCameraD3D->sRotationX) |
5250 { | 5250 { |
5251 v13 = a1->vWorldPosition.x - (double)pParty->vPosition.x; | 5251 v13 = a1->vWorldPosition.x - (double)pParty->vPosition.x; |
5252 v11 = a1->vWorldPosition.y - (double)pParty->vPosition.y; | 5252 v11 = a1->vWorldPosition.y - (double)pParty->vPosition.y; |
5253 v4 = a1->vWorldPosition.z - (double)pParty->vPosition.z; | 5253 v4 = a1->vWorldPosition.z - (double)pParty->vPosition.z; |
5254 //if ( pRenderer->pRenderD3D ) | 5254 //if ( pRenderer->pRenderD3D ) |
5255 //{ | 5255 //{ |
5256 v5 = v11 * pEngine->pIndoorCameraD3D->fRotationYSine + v13 * pEngine->pIndoorCameraD3D->fRotationYCosine; | 5256 v5 = v11 * pIndoorCameraD3D->fRotationYSine + v13 * pIndoorCameraD3D->fRotationYCosine; |
5257 a1->vWorldViewPosition.y = v13 * pEngine->pIndoorCameraD3D->fRotationYSine - v11 * pEngine->pIndoorCameraD3D->fRotationYCosine; | 5257 a1->vWorldViewPosition.y = v13 * pIndoorCameraD3D->fRotationYSine - v11 * pIndoorCameraD3D->fRotationYCosine; |
5258 /*} | 5258 /*} |
5259 else | 5259 else |
5260 { | 5260 { |
5261 v5 = v13 * pBLVRenderParams->fCosineY - v11 * pBLVRenderParams->fSineY; | 5261 v5 = v13 * pBLVRenderParams->fCosineY - v11 * pBLVRenderParams->fSineY; |
5262 a1->vWorldViewPosition.y = v13 * pBLVRenderParams->fSineY + v11 * pBLVRenderParams->fCosineY; | 5262 a1->vWorldViewPosition.y = v13 * pBLVRenderParams->fSineY + v11 * pBLVRenderParams->fCosineY; |
5263 }*/ | 5263 }*/ |
5264 a1->vWorldViewPosition.x = v5 * pEngine->pIndoorCameraD3D->fRotationXCosine - v4 * pEngine->pIndoorCameraD3D->fRotationXSine; | 5264 a1->vWorldViewPosition.x = v5 * pIndoorCameraD3D->fRotationXCosine - v4 * pIndoorCameraD3D->fRotationXSine; |
5265 a1->vWorldViewPosition.z = v5 * pEngine->pIndoorCameraD3D->fRotationXSine + v4 * pEngine->pIndoorCameraD3D->fRotationXCosine; | 5265 a1->vWorldViewPosition.z = v5 * pIndoorCameraD3D->fRotationXSine + v4 * pIndoorCameraD3D->fRotationXCosine; |
5266 } | 5266 } |
5267 else | 5267 else |
5268 { | 5268 { |
5269 v14 = a1->vWorldPosition.x - (double)pParty->vPosition.x; | 5269 v14 = a1->vWorldPosition.x - (double)pParty->vPosition.x; |
5270 v12 = a1->vWorldPosition.y - (double)pParty->vPosition.y; | 5270 v12 = a1->vWorldPosition.y - (double)pParty->vPosition.y; |
5271 a1->vWorldViewPosition.z = a1->vWorldPosition.z - (double)pParty->vPosition.z; | 5271 a1->vWorldViewPosition.z = a1->vWorldPosition.z - (double)pParty->vPosition.z; |
5272 //if ( pRenderer->pRenderD3D ) | 5272 //if ( pRenderer->pRenderD3D ) |
5273 //{ | 5273 //{ |
5274 a1->vWorldViewPosition.x = v12 * pEngine->pIndoorCameraD3D->fRotationYSine + v14 * pEngine->pIndoorCameraD3D->fRotationYCosine; | 5274 a1->vWorldViewPosition.x = v12 * pIndoorCameraD3D->fRotationYSine + v14 * pIndoorCameraD3D->fRotationYCosine; |
5275 a1->vWorldViewPosition.y = v14 * pEngine->pIndoorCameraD3D->fRotationYSine - v12 * pEngine->pIndoorCameraD3D->fRotationYCosine; | 5275 a1->vWorldViewPosition.y = v14 * pIndoorCameraD3D->fRotationYSine - v12 * pIndoorCameraD3D->fRotationYCosine; |
5276 /*} | 5276 /*} |
5277 else | 5277 else |
5278 { | 5278 { |
5279 a1->vWorldViewPosition.x = v14 * pBLVRenderParams->fCosineY - v12 * pBLVRenderParams->fSineY; | 5279 a1->vWorldViewPosition.x = v14 * pBLVRenderParams->fCosineY - v12 * pBLVRenderParams->fSineY; |
5280 a1->vWorldViewPosition.y = v14 * pBLVRenderParams->fSineY + v12 * pBLVRenderParams->fCosineY; | 5280 a1->vWorldViewPosition.y = v14 * pBLVRenderParams->fSineY + v12 * pBLVRenderParams->fCosineY; |