Mercurial > mm7
comparison Engine/Graphics/Render.cpp @ 2543:b6140dfeac27
GameOver h/cpp
author | a.parshin |
---|---|
date | Sun, 10 May 2015 03:21:14 +0200 |
parents | a902abdfc7f2 |
children | c674d547cc7c |
comparison
equal
deleted
inserted
replaced
2542:bacf9809126a | 2543:b6140dfeac27 |
---|---|
257 for (unsigned int x = 0; x < 128; ++x) | 257 for (unsigned int x = 0; x < 128; ++x) |
258 { | 258 { |
259 pTerrainVertices[z * 128 + x].vWorldPosition.x = (-64 + (signed)x) * blockScale; | 259 pTerrainVertices[z * 128 + x].vWorldPosition.x = (-64 + (signed)x) * blockScale; |
260 pTerrainVertices[z * 128 + x].vWorldPosition.y = (64 - (signed)z) * blockScale; | 260 pTerrainVertices[z * 128 + x].vWorldPosition.y = (64 - (signed)z) * blockScale; |
261 pTerrainVertices[z * 128 + x].vWorldPosition.z = heightScale * pOutdoor->pTerrain.pHeightmap[z * 128 + x]; | 261 pTerrainVertices[z * 128 + x].vWorldPosition.z = heightScale * pOutdoor->pTerrain.pHeightmap[z * 128 + x]; |
262 pEngine->pIndoorCameraD3D->ViewTransform(&pTerrainVertices[z * 128 + x], 1); | 262 pIndoorCameraD3D->ViewTransform(&pTerrainVertices[z * 128 + x], 1); |
263 pEngine->pIndoorCameraD3D->Project(&pTerrainVertices[z * 128 + x], 1, 0); | 263 pIndoorCameraD3D->Project(&pTerrainVertices[z * 128 + x], 1, 0); |
264 } | 264 } |
265 } | 265 } |
266 //-------(Отсечение невидимой части карты)------------------------------------------------------------------------------------------ | 266 //-------(Отсечение невидимой части карты)------------------------------------------------------------------------------------------ |
267 float direction = (float)(pEngine->pIndoorCameraD3D->sRotationY / 256);//direction of the camera(напрвление камеры) | 267 float direction = (float)(pIndoorCameraD3D->sRotationY / 256);//direction of the camera(напрвление камеры) |
268 //0-East(B) | 268 //0-East(B) |
269 //1-NorthEast(CB) | 269 //1-NorthEast(CB) |
270 //2-North(C) | 270 //2-North(C) |
271 //3-WestNorth(CЗ) | 271 //3-WestNorth(CЗ) |
272 //4-West(З) | 272 //4-West(З) |
610 x = object->vPosition.x; | 610 x = object->vPosition.x; |
611 y = object->vPosition.y; | 611 y = object->vPosition.y; |
612 z = object->vPosition.z; | 612 z = object->vPosition.z; |
613 frame = pSpriteFrameTable->GetFrame(object_desc->uSpriteID, object->uSpriteFrameID); | 613 frame = pSpriteFrameTable->GetFrame(object_desc->uSpriteID, object->uSpriteFrameID); |
614 a6 = frame->uGlowRadius * object->field_22_glow_radius_multiplier; | 614 a6 = frame->uGlowRadius * object->field_22_glow_radius_multiplier; |
615 v6 = stru_5C6E00->Atan2(object->vPosition.x - pEngine->pIndoorCameraD3D->vPartyPos.x, object->vPosition.y - pEngine->pIndoorCameraD3D->vPartyPos.y); | 615 v6 = stru_5C6E00->Atan2(object->vPosition.x - pIndoorCameraD3D->vPartyPos.x, object->vPosition.y - pIndoorCameraD3D->vPartyPos.y); |
616 //LOWORD(v7) = object->uFacing; | 616 //LOWORD(v7) = object->uFacing; |
617 //v8 = v36; | 617 //v8 = v36; |
618 v9 = ((signed int)(stru_5C6E00->uIntegerPi + ((signed int)stru_5C6E00->uIntegerPi >> 3) + object->uFacing - v6) >> 8) & 7; | 618 v9 = ((signed int)(stru_5C6E00->uIntegerPi + ((signed int)stru_5C6E00->uIntegerPi >> 3) + object->uFacing - v6) >> 8) & 7; |
619 pBillboardRenderList[::uNumBillboardsToDraw].HwSpriteID = frame->pHwSpriteIDs[v9]; | 619 pBillboardRenderList[::uNumBillboardsToDraw].HwSpriteID = frame->pHwSpriteIDs[v9]; |
620 if ( frame->uFlags & 0x20 ) | 620 if ( frame->uFlags & 0x20 ) |
635 if ( a6 ) | 635 if ( a6 ) |
636 { | 636 { |
637 //LOBYTE(v11) = _4E94D3_light_type; | 637 //LOBYTE(v11) = _4E94D3_light_type; |
638 pMobileLightsStack->AddLight(x, y, z, object->uSectorID, a6, 0xFF, 0xFF, 0xFF, _4E94D3_light_type); | 638 pMobileLightsStack->AddLight(x, y, z, object->uSectorID, a6, 0xFF, 0xFF, 0xFF, _4E94D3_light_type); |
639 } | 639 } |
640 if (pEngine->pIndoorCameraD3D->sRotationX) | 640 if (pIndoorCameraD3D->sRotationX) |
641 { | 641 { |
642 v30 = fixpoint_mul((x - pEngine->pIndoorCameraD3D->vPartyPos.x) << 16, pEngine->pIndoorCameraD3D->int_cosine_y) | 642 v30 = fixpoint_mul((x - pIndoorCameraD3D->vPartyPos.x) << 16, pIndoorCameraD3D->int_cosine_y) |
643 + fixpoint_mul((y - pEngine->pIndoorCameraD3D->vPartyPos.y) << 16, pEngine->pIndoorCameraD3D->int_sine_y); | 643 + fixpoint_mul((y - pIndoorCameraD3D->vPartyPos.y) << 16, pIndoorCameraD3D->int_sine_y); |
644 v37 = fixpoint_mul((x - pEngine->pIndoorCameraD3D->vPartyPos.x) << 16, pEngine->pIndoorCameraD3D->int_sine_y); | 644 v37 = fixpoint_mul((x - pIndoorCameraD3D->vPartyPos.x) << 16, pIndoorCameraD3D->int_sine_y); |
645 v42 = fixpoint_mul((z - pEngine->pIndoorCameraD3D->vPartyPos.z) << 16, pEngine->pIndoorCameraD3D->int_sine_x) | 645 v42 = fixpoint_mul((z - pIndoorCameraD3D->vPartyPos.z) << 16, pIndoorCameraD3D->int_sine_x) |
646 + fixpoint_mul(v30, pEngine->pIndoorCameraD3D->int_cosine_x); | 646 + fixpoint_mul(v30, pIndoorCameraD3D->int_cosine_x); |
647 if ( v42 >= 0x40000 && v42 <= pODMRenderParams->shading_dist_mist << 16 ) | 647 if ( v42 >= 0x40000 && v42 <= pODMRenderParams->shading_dist_mist << 16 ) |
648 { | 648 { |
649 v17 = fixpoint_mul((y - pEngine->pIndoorCameraD3D->vPartyPos.y) << 16, pEngine->pIndoorCameraD3D->int_cosine_y) - v37; | 649 v17 = fixpoint_mul((y - pIndoorCameraD3D->vPartyPos.y) << 16, pIndoorCameraD3D->int_cosine_y) - v37; |
650 v18 = fixpoint_mul((z - pEngine->pIndoorCameraD3D->vPartyPos.z) << 16, pEngine->pIndoorCameraD3D->int_cosine_x) | 650 v18 = fixpoint_mul((z - pIndoorCameraD3D->vPartyPos.z) << 16, pIndoorCameraD3D->int_cosine_x) |
651 - fixpoint_mul(v30, pEngine->pIndoorCameraD3D->int_sine_x); | 651 - fixpoint_mul(v30, pIndoorCameraD3D->int_sine_x); |
652 if ( abs(v42) >= abs(v17) ) | 652 if ( abs(v42) >= abs(v17) ) |
653 { | 653 { |
654 LODWORD(v23) = 0; | 654 LODWORD(v23) = 0; |
655 HIDWORD(v23) = SLOWORD(pODMRenderParams->int_fov_rad); | 655 HIDWORD(v23) = SLOWORD(pODMRenderParams->int_fov_rad); |
656 | 656 |
687 } | 687 } |
688 } | 688 } |
689 } | 689 } |
690 else | 690 else |
691 { | 691 { |
692 v42 = fixpoint_mul((y - pEngine->pIndoorCameraD3D->vPartyPos.y) << 16, pEngine->pIndoorCameraD3D->int_sine_y) | 692 v42 = fixpoint_mul((y - pIndoorCameraD3D->vPartyPos.y) << 16, pIndoorCameraD3D->int_sine_y) |
693 + fixpoint_mul((x - pEngine->pIndoorCameraD3D->vPartyPos.x) << 16, pEngine->pIndoorCameraD3D->int_cosine_y); | 693 + fixpoint_mul((x - pIndoorCameraD3D->vPartyPos.x) << 16, pIndoorCameraD3D->int_cosine_y); |
694 if ( v42 >= 0x40000 && v42 <= pODMRenderParams->shading_dist_mist << 16 ) | 694 if ( v42 >= 0x40000 && v42 <= pODMRenderParams->shading_dist_mist << 16 ) |
695 { | 695 { |
696 v17 = fixpoint_mul((y - pEngine->pIndoorCameraD3D->vPartyPos.y) << 16, pEngine->pIndoorCameraD3D->int_cosine_y) | 696 v17 = fixpoint_mul((y - pIndoorCameraD3D->vPartyPos.y) << 16, pIndoorCameraD3D->int_cosine_y) |
697 - fixpoint_mul(((x - pEngine->pIndoorCameraD3D->vPartyPos.x) << 16), pEngine->pIndoorCameraD3D->int_sine_y); | 697 - fixpoint_mul(((x - pIndoorCameraD3D->vPartyPos.x) << 16), pIndoorCameraD3D->int_sine_y); |
698 v18 = (z - pEngine->pIndoorCameraD3D->vPartyPos.z) << 16; | 698 v18 = (z - pIndoorCameraD3D->vPartyPos.z) << 16; |
699 if ( abs(v42) >= abs(v17) ) | 699 if ( abs(v42) >= abs(v17) ) |
700 { | 700 { |
701 LODWORD(v23) = 0; | 701 LODWORD(v23) = 0; |
702 HIDWORD(v23) = SLOWORD(pODMRenderParams->int_fov_rad); | 702 HIDWORD(v23) = SLOWORD(pODMRenderParams->int_fov_rad); |
703 | 703 |
1023 else | 1023 else |
1024 frame = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID, v6 + v7); | 1024 frame = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID, v6 + v7); |
1025 #pragma endregion | 1025 #pragma endregion |
1026 //v8 = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID, v6 + v7); | 1026 //v8 = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID, v6 + v7); |
1027 | 1027 |
1028 v10 = (unsigned __int16 *)stru_5C6E00->Atan2(pLevelDecorations[i].vPosition.x - pEngine->pIndoorCameraD3D->vPartyPos.x, | 1028 v10 = (unsigned __int16 *)stru_5C6E00->Atan2(pLevelDecorations[i].vPosition.x - pIndoorCameraD3D->vPartyPos.x, |
1029 pLevelDecorations[i].vPosition.y - pEngine->pIndoorCameraD3D->vPartyPos.y); | 1029 pLevelDecorations[i].vPosition.y - pIndoorCameraD3D->vPartyPos.y); |
1030 v38 = 0; | 1030 v38 = 0; |
1031 v13 = ((signed int)(stru_5C6E00->uIntegerPi + ((signed int)stru_5C6E00->uIntegerPi >> 3) + pLevelDecorations[i].field_10_y_rot - (signed int)v10) >> 8) & 7; | 1031 v13 = ((signed int)(stru_5C6E00->uIntegerPi + ((signed int)stru_5C6E00->uIntegerPi >> 3) + pLevelDecorations[i].field_10_y_rot - (signed int)v10) >> 8) & 7; |
1032 v37 = (unsigned __int16 *)v13; | 1032 v37 = (unsigned __int16 *)v13; |
1033 if ( frame->uFlags & 2 ) | 1033 if ( frame->uFlags & 2 ) |
1034 v38 = 2; | 1034 v38 = 2; |
1055 pLevelDecorations[i].vPosition.y, | 1055 pLevelDecorations[i].vPosition.y, |
1056 pLevelDecorations[i].vPosition.z + decor_desc->uDecorationHeight / 2, | 1056 pLevelDecorations[i].vPosition.z + decor_desc->uDecorationHeight / 2, |
1057 frame->uGlowRadius, r, g, b_, _4E94D0_light_type); | 1057 frame->uGlowRadius, r, g, b_, _4E94D0_light_type); |
1058 }//for light | 1058 }//for light |
1059 | 1059 |
1060 v17 = (pLevelDecorations[i].vPosition.x - pEngine->pIndoorCameraD3D->vPartyPos.x) << 16; | 1060 v17 = (pLevelDecorations[i].vPosition.x - pIndoorCameraD3D->vPartyPos.x) << 16; |
1061 if (pEngine->pIndoorCameraD3D->sRotationX) | 1061 if (pIndoorCameraD3D->sRotationX) |
1062 { | 1062 { |
1063 v40 = (pLevelDecorations[i].vPosition.y - pEngine->pIndoorCameraD3D->vPartyPos.y) << 16; | 1063 v40 = (pLevelDecorations[i].vPosition.y - pIndoorCameraD3D->vPartyPos.y) << 16; |
1064 v18 = fixpoint_mul(v17, pEngine->pIndoorCameraD3D->int_cosine_y) + fixpoint_mul(v40, pEngine->pIndoorCameraD3D->int_sine_y); | 1064 v18 = fixpoint_mul(v17, pIndoorCameraD3D->int_cosine_y) + fixpoint_mul(v40, pIndoorCameraD3D->int_sine_y); |
1065 v41 = fixpoint_mul((pLevelDecorations[i].vPosition.z - pEngine->pIndoorCameraD3D->vPartyPos.z) << 16, pEngine->pIndoorCameraD3D->int_sine_x); | 1065 v41 = fixpoint_mul((pLevelDecorations[i].vPosition.z - pIndoorCameraD3D->vPartyPos.z) << 16, pIndoorCameraD3D->int_sine_x); |
1066 v19 = fixpoint_mul(v18, pEngine->pIndoorCameraD3D->int_cosine_x); | 1066 v19 = fixpoint_mul(v18, pIndoorCameraD3D->int_cosine_x); |
1067 v20 = v19 + fixpoint_mul((pLevelDecorations[i].vPosition.z - pEngine->pIndoorCameraD3D->vPartyPos.z) << 16, pEngine->pIndoorCameraD3D->int_sine_x); | 1067 v20 = v19 + fixpoint_mul((pLevelDecorations[i].vPosition.z - pIndoorCameraD3D->vPartyPos.z) << 16, pIndoorCameraD3D->int_sine_x); |
1068 if ( v20 >= 0x40000 && v20 <= pODMRenderParams->shading_dist_mist << 16 ) | 1068 if ( v20 >= 0x40000 && v20 <= pODMRenderParams->shading_dist_mist << 16 ) |
1069 { | 1069 { |
1070 v21 = fixpoint_mul(v40, pEngine->pIndoorCameraD3D->int_cosine_y) - fixpoint_mul(v17, pEngine->pIndoorCameraD3D->int_sine_y); | 1070 v21 = fixpoint_mul(v40, pIndoorCameraD3D->int_cosine_y) - fixpoint_mul(v17, pIndoorCameraD3D->int_sine_y); |
1071 v22 = fixpoint_mul((pLevelDecorations[i].vPosition.z - pEngine->pIndoorCameraD3D->vPartyPos.z) << 16, pEngine->pIndoorCameraD3D->int_cosine_x) - fixpoint_mul(v18, pEngine->pIndoorCameraD3D->int_sine_x); | 1071 v22 = fixpoint_mul((pLevelDecorations[i].vPosition.z - pIndoorCameraD3D->vPartyPos.z) << 16, pIndoorCameraD3D->int_cosine_x) - fixpoint_mul(v18, pIndoorCameraD3D->int_sine_x); |
1072 if ( 2 * abs(v20) >= abs(v21) ) | 1072 if ( 2 * abs(v20) >= abs(v21) ) |
1073 { | 1073 { |
1074 LODWORD(v24) = 0; | 1074 LODWORD(v24) = 0; |
1075 HIDWORD(v24) = SLOWORD(pODMRenderParams->int_fov_rad); | 1075 HIDWORD(v24) = SLOWORD(pODMRenderParams->int_fov_rad); |
1076 v25 = pViewport->uScreenCenterX - ((signed int)(fixpoint_mul(v24 / v20, v21) + 0x8000) >> 16); | 1076 v25 = pViewport->uScreenCenterX - ((signed int)(fixpoint_mul(v24 / v20, v21) + 0x8000) >> 16); |
1114 continue; | 1114 continue; |
1115 } | 1115 } |
1116 } | 1116 } |
1117 else | 1117 else |
1118 { | 1118 { |
1119 v42 = (pLevelDecorations[i].vPosition.x - pEngine->pIndoorCameraD3D->vPartyPos.x) << 16; | 1119 v42 = (pLevelDecorations[i].vPosition.x - pIndoorCameraD3D->vPartyPos.x) << 16; |
1120 v40 = (pLevelDecorations[i].vPosition.y - pEngine->pIndoorCameraD3D->vPartyPos.y) << 16; | 1120 v40 = (pLevelDecorations[i].vPosition.y - pIndoorCameraD3D->vPartyPos.y) << 16; |
1121 v20 = fixpoint_mul(v17, pEngine->pIndoorCameraD3D->int_cosine_y) + fixpoint_mul(v40, pEngine->pIndoorCameraD3D->int_sine_y); | 1121 v20 = fixpoint_mul(v17, pIndoorCameraD3D->int_cosine_y) + fixpoint_mul(v40, pIndoorCameraD3D->int_sine_y); |
1122 if ( v20 >= 0x40000 && v20 <= pODMRenderParams->shading_dist_mist << 16 ) | 1122 if ( v20 >= 0x40000 && v20 <= pODMRenderParams->shading_dist_mist << 16 ) |
1123 { | 1123 { |
1124 v21 = fixpoint_mul(v40, pEngine->pIndoorCameraD3D->int_cosine_y) - fixpoint_mul(v42, pEngine->pIndoorCameraD3D->int_sine_y); | 1124 v21 = fixpoint_mul(v40, pIndoorCameraD3D->int_cosine_y) - fixpoint_mul(v42, pIndoorCameraD3D->int_sine_y); |
1125 v22 = (pLevelDecorations[i].vPosition.z - pEngine->pIndoorCameraD3D->vPartyPos.z) << 16; | 1125 v22 = (pLevelDecorations[i].vPosition.z - pIndoorCameraD3D->vPartyPos.z) << 16; |
1126 v42 = v22; | 1126 v42 = v22; |
1127 if ( 2 * abs(v20) >= abs(v21) ) | 1127 if ( 2 * abs(v20) >= abs(v21) ) |
1128 { | 1128 { |
1129 LODWORD(v24) = 0; | 1129 LODWORD(v24) = 0; |
1130 HIDWORD(v24) = SLOWORD(pODMRenderParams->int_fov_rad); | 1130 HIDWORD(v24) = SLOWORD(pODMRenderParams->int_fov_rad); |
4743 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, v8)); | 4743 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, v8)); |
4744 } | 4744 } |
4745 } | 4745 } |
4746 | 4746 |
4747 //if (pIndoorCamera->flags & INDOOR_CAMERA_DRAW_TERRAIN_OUTLINES || pBLVRenderParams->uFlags & INDOOR_CAMERA_DRAW_TERRAIN_OUTLINES) | 4747 //if (pIndoorCamera->flags & INDOOR_CAMERA_DRAW_TERRAIN_OUTLINES || pBLVRenderParams->uFlags & INDOOR_CAMERA_DRAW_TERRAIN_OUTLINES) |
4748 if (pEngine->pIndoorCameraD3D->debug_flags & ODM_RENDER_DRAW_TERRAIN_OUTLINES) | 4748 if (pIndoorCameraD3D->debug_flags & ODM_RENDER_DRAW_TERRAIN_OUTLINES) |
4749 pEngine->pIndoorCameraD3D->debug_outline_d3d(d3d_vertex_buffer, uNumVertices, 0x00FFFFFF, 0.0); | 4749 pIndoorCameraD3D->debug_outline_d3d(d3d_vertex_buffer, uNumVertices, 0x00FFFFFF, 0.0); |
4750 } | 4750 } |
4751 // 4A26BC: could not find valid save-restore pair for esi | 4751 // 4A26BC: could not find valid save-restore pair for esi |
4752 // 4D864C: using guessed type char byte_4D864C; | 4752 // 4D864C: using guessed type char byte_4D864C; |
4753 | 4753 |
4754 //----- (004A2DA3) -------------------------------------------------------- | 4754 //----- (004A2DA3) -------------------------------------------------------- |
4868 | 4868 |
4869 pFace = &pIndoor->pFaces[uFaceID]; | 4869 pFace = &pIndoor->pFaces[uFaceID]; |
4870 //for floor and wall(for example Selesta)------------------- | 4870 //for floor and wall(for example Selesta)------------------- |
4871 if (pFace->uPolygonType == POLYGON_InBetweenFloorAndWall || pFace->uPolygonType == POLYGON_Floor) | 4871 if (pFace->uPolygonType == POLYGON_InBetweenFloorAndWall || pFace->uPolygonType == POLYGON_Floor) |
4872 { | 4872 { |
4873 int v69 = (GetTickCount() / 32) - pEngine->pIndoorCameraD3D->vPartyPos.x; | 4873 int v69 = (GetTickCount() / 32) - pIndoorCameraD3D->vPartyPos.x; |
4874 int v55 = (GetTickCount() / 32) + pEngine->pIndoorCameraD3D->vPartyPos.y; | 4874 int v55 = (GetTickCount() / 32) + pIndoorCameraD3D->vPartyPos.y; |
4875 for (uint i = 0; i < uNumVertices; ++i) | 4875 for (uint i = 0; i < uNumVertices; ++i) |
4876 { | 4876 { |
4877 array_507D30[i].u = (v69 + array_507D30[i].u) * 0.25f; | 4877 array_507D30[i].u = (v69 + array_507D30[i].u) * 0.25f; |
4878 array_507D30[i].v = (v55 + array_507D30[i].v) * 0.25f; | 4878 array_507D30[i].v = (v55 + array_507D30[i].v) * 0.25f; |
4879 } | 4879 } |
4880 pRenderer->DrawIndoorPolygon(uNumVertices, pFace, pBitmaps_LOD->pHardwareTextures[pFace->uBitmapID], pFace->GetTexture(), PID(OBJECT_BModel, uFaceID), -1, 0); | 4880 pRenderer->DrawIndoorPolygon(uNumVertices, pFace, pBitmaps_LOD->pHardwareTextures[pFace->uBitmapID], pFace->GetTexture(), PID(OBJECT_BModel, uFaceID), -1, 0); |
4881 return; | 4881 return; |
4882 } | 4882 } |
4883 //--------------------------------------- | 4883 //--------------------------------------- |
4884 v70 = (signed __int64)((double)(pBLVRenderParams->fov_rad_fixpoint * pEngine->pIndoorCameraD3D->vPartyPos.z)//179 | 4884 v70 = (signed __int64)((double)(pBLVRenderParams->fov_rad_fixpoint * pIndoorCameraD3D->vPartyPos.z)//179 |
4885 / (((double)pBLVRenderParams->fov_rad_fixpoint + 16192.0) | 4885 / (((double)pBLVRenderParams->fov_rad_fixpoint + 16192.0) |
4886 * 65536.0) | 4886 * 65536.0) |
4887 + (double)pBLVRenderParams->uViewportCenterY); | 4887 + (double)pBLVRenderParams->uViewportCenterY); |
4888 v5 = (double)pEngine->pIndoorCameraD3D->sRotationX * 0.0030664064;//0 | 4888 v5 = (double)pIndoorCameraD3D->sRotationX * 0.0030664064;//0 |
4889 v6 = (signed __int64)((double)pBLVRenderParams->uViewportCenterY//183 | 4889 v6 = (signed __int64)((double)pBLVRenderParams->uViewportCenterY//183 |
4890 - (double)pBLVRenderParams->fov_rad_fixpoint | 4890 - (double)pBLVRenderParams->fov_rad_fixpoint |
4891 / ((cos(v5) * 16192.0 + 0.0000001) | 4891 / ((cos(v5) * 16192.0 + 0.0000001) |
4892 * 65535.0) | 4892 * 65535.0) |
4893 * (sin(v5) * -16192.0 - (double)pEngine->pIndoorCameraD3D->vPartyPos.z)); | 4893 * (sin(v5) * -16192.0 - (double)pIndoorCameraD3D->vPartyPos.z)); |
4894 | 4894 |
4895 stru_8019C8._48653D_frustum_blv(65536, 0, 0, 0, 65536, 0); | 4895 stru_8019C8._48653D_frustum_blv(65536, 0, 0, 0, 65536, 0); |
4896 pSkyPolygon.Create_48607B(&stru_8019C8); | 4896 pSkyPolygon.Create_48607B(&stru_8019C8); |
4897 pSkyPolygon.uTileBitmapID = pFace->uBitmapID; | 4897 pSkyPolygon.uTileBitmapID = pFace->uBitmapID; |
4898 | 4898 |
4901 return; | 4901 return; |
4902 | 4902 |
4903 pSkyPolygon.dimming_level = 0; | 4903 pSkyPolygon.dimming_level = 0; |
4904 pSkyPolygon.uNumVertices = uNumVertices; | 4904 pSkyPolygon.uNumVertices = uNumVertices; |
4905 | 4905 |
4906 pSkyPolygon.v_18.x = -stru_5C6E00->Sin(pEngine->pIndoorCameraD3D->sRotationX + 16); | 4906 pSkyPolygon.v_18.x = -stru_5C6E00->Sin(pIndoorCameraD3D->sRotationX + 16); |
4907 pSkyPolygon.v_18.y = 0; | 4907 pSkyPolygon.v_18.y = 0; |
4908 pSkyPolygon.v_18.z = -stru_5C6E00->Cos(pEngine->pIndoorCameraD3D->sRotationX + 16); | 4908 pSkyPolygon.v_18.z = -stru_5C6E00->Cos(pIndoorCameraD3D->sRotationX + 16); |
4909 | 4909 |
4910 memcpy(&array_507D30[uNumVertices], array_507D30, sizeof(array_507D30[uNumVertices])); | 4910 memcpy(&array_507D30[uNumVertices], array_507D30, sizeof(array_507D30[uNumVertices])); |
4911 pSkyPolygon.field_24 = 0x2000000; | 4911 pSkyPolygon.field_24 = 0x2000000; |
4912 | 4912 |
4913 extern float _calc_fov(int viewport_width, int angle_degree); | 4913 extern float _calc_fov(int viewport_width, int angle_degree); |
8497 } | 8497 } |
8498 for ( uint i = 1; i <= pOutdoor->pBModels[model_id].pFaces[face_id].uNumVertices; i++ ) | 8498 for ( uint i = 1; i <= pOutdoor->pBModels[model_id].pFaces[face_id].uNumVertices; i++ ) |
8499 { | 8499 { |
8500 if ( pOutdoor->pBModels[model_id].pVertices.pVertices[pOutdoor->pBModels[model_id].pFaces[face_id].pVertexIDs[0]].z == array_73D150[i - 1].vWorldPosition.z ) | 8500 if ( pOutdoor->pBModels[model_id].pVertices.pVertices[pOutdoor->pBModels[model_id].pFaces[face_id].pVertexIDs[0]].z == array_73D150[i - 1].vWorldPosition.z ) |
8501 ++v53; | 8501 ++v53; |
8502 pEngine->pIndoorCameraD3D->ViewTransform(&array_73D150[i - 1], 1); | 8502 pIndoorCameraD3D->ViewTransform(&array_73D150[i - 1], 1); |
8503 if ( array_73D150[i - 1].vWorldViewPosition.x < 8.0 || array_73D150[i - 1].vWorldViewPosition.x > pODMRenderParams->shading_dist_mist ) | 8503 if ( array_73D150[i - 1].vWorldViewPosition.x < 8.0 || array_73D150[i - 1].vWorldViewPosition.x > pODMRenderParams->shading_dist_mist ) |
8504 { | 8504 { |
8505 if ( array_73D150[i - 1].vWorldViewPosition.x >= 8.0 ) | 8505 if ( array_73D150[i - 1].vWorldViewPosition.x >= 8.0 ) |
8506 v49 = 1; | 8506 v49 = 1; |
8507 else | 8507 else |
8508 v50 = 1; | 8508 v50 = 1; |
8509 } | 8509 } |
8510 else | 8510 else |
8511 pEngine->pIndoorCameraD3D->Project(&array_73D150[i - 1], 1, 0); | 8511 pIndoorCameraD3D->Project(&array_73D150[i - 1], 1, 0); |
8512 } | 8512 } |
8513 } | 8513 } |
8514 if ( v53 == pOutdoor->pBModels[model_id].pFaces[face_id].uNumVertices ) | 8514 if ( v53 == pOutdoor->pBModels[model_id].pFaces[face_id].uNumVertices ) |
8515 LOBYTE(array_77EC08[pODMRenderParams->uNumPolygons].field_32) |= 1; | 8515 LOBYTE(array_77EC08[pODMRenderParams->uNumPolygons].field_32) |= 1; |
8516 array_77EC08[pODMRenderParams->uNumPolygons].pODMFace = &pOutdoor->pBModels[model_id].pFaces[face_id]; | 8516 array_77EC08[pODMRenderParams->uNumPolygons].pODMFace = &pOutdoor->pBModels[model_id].pFaces[face_id]; |
8622 int v36; // [sp+14Ch] [bp-18h]@2 | 8622 int v36; // [sp+14Ch] [bp-18h]@2 |
8623 int v37; // [sp+154h] [bp-10h]@8 | 8623 int v37; // [sp+154h] [bp-10h]@8 |
8624 int v38; // [sp+158h] [bp-Ch]@1 | 8624 int v38; // [sp+158h] [bp-Ch]@1 |
8625 int v39; // [sp+15Ch] [bp-8h]@4 | 8625 int v39; // [sp+15Ch] [bp-8h]@4 |
8626 | 8626 |
8627 v30 = (signed __int64)((double)(pODMRenderParams->int_fov_rad * pEngine->pIndoorCameraD3D->vPartyPos.z) | 8627 v30 = (signed __int64)((double)(pODMRenderParams->int_fov_rad * pIndoorCameraD3D->vPartyPos.z) |
8628 / ((double)pODMRenderParams->int_fov_rad + 8192.0) | 8628 / ((double)pODMRenderParams->int_fov_rad + 8192.0) |
8629 + (double)(pViewport->uScreenCenterY)); | 8629 + (double)(pViewport->uScreenCenterY)); |
8630 v34 = cos((double)pEngine->pIndoorCameraD3D->sRotationX * 0.0030664064) * 0x2000;//(double)pODMRenderParams->shading_dist_mist, 8192 | 8630 v34 = cos((double)pIndoorCameraD3D->sRotationX * 0.0030664064) * 0x2000;//(double)pODMRenderParams->shading_dist_mist, 8192 |
8631 v38 = (signed __int64)((double)(pViewport->uScreenCenterY) | 8631 v38 = (signed __int64)((double)(pViewport->uScreenCenterY) |
8632 - (double)pODMRenderParams->int_fov_rad | 8632 - (double)pODMRenderParams->int_fov_rad |
8633 / (v34 + 0.0000001) | 8633 / (v34 + 0.0000001) |
8634 * (sin((double)pEngine->pIndoorCameraD3D->sRotationX * 0.0030664064) | 8634 * (sin((double)pIndoorCameraD3D->sRotationX * 0.0030664064) |
8635 * (double)-0x2000//(double)pODMRenderParams->shading_dist_mist | 8635 * (double)-0x2000//(double)pODMRenderParams->shading_dist_mist |
8636 - (double)pEngine->pIndoorCameraD3D->vPartyPos.z)); | 8636 - (double)pIndoorCameraD3D->vPartyPos.z)); |
8637 pSkyPolygon.Create_48607B(&stru_8019C8);//заполняется ptr_38 | 8637 pSkyPolygon.Create_48607B(&stru_8019C8);//заполняется ptr_38 |
8638 pSkyPolygon.ptr_38->_48694B_frustum_sky(); | 8638 pSkyPolygon.ptr_38->_48694B_frustum_sky(); |
8639 | 8639 |
8640 //if ( pParty->uCurrentHour > 20 || pParty->uCurrentHour < 5 ) | 8640 //if ( pParty->uCurrentHour > 20 || pParty->uCurrentHour < 5 ) |
8641 //pSkyPolygon.uTileBitmapID = pOutdoor->New_SKY_NIGHT_ID; | 8641 //pSkyPolygon.uTileBitmapID = pOutdoor->New_SKY_NIGHT_ID; |
8645 if ( pSkyPolygon.pTexture ) | 8645 if ( pSkyPolygon.pTexture ) |
8646 { | 8646 { |
8647 pSkyPolygon.dimming_level = 0; | 8647 pSkyPolygon.dimming_level = 0; |
8648 pSkyPolygon.uNumVertices = 4; | 8648 pSkyPolygon.uNumVertices = 4; |
8649 //centering(центруем)----------------------------------------------------------------- | 8649 //centering(центруем)----------------------------------------------------------------- |
8650 pSkyPolygon.v_18.x = -stru_5C6E00->Sin(pEngine->pIndoorCameraD3D->sRotationX + 16); | 8650 pSkyPolygon.v_18.x = -stru_5C6E00->Sin(pIndoorCameraD3D->sRotationX + 16); |
8651 pSkyPolygon.v_18.y = 0; | 8651 pSkyPolygon.v_18.y = 0; |
8652 pSkyPolygon.v_18.z = -stru_5C6E00->Cos(pEngine->pIndoorCameraD3D->sRotationX + 16); | 8652 pSkyPolygon.v_18.z = -stru_5C6E00->Cos(pIndoorCameraD3D->sRotationX + 16); |
8653 | 8653 |
8654 //sky wiew position(положение неба на экране)------------------------------------------ | 8654 //sky wiew position(положение неба на экране)------------------------------------------ |
8655 // X | 8655 // X |
8656 // 0._____________________________.3 | 8656 // 0._____________________________.3 |
8657 // |8,8 468,8 | | 8657 // |8,8 468,8 | |
8886 if (bUsingSpecular) | 8886 if (bUsingSpecular) |
8887 pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_FOGENABLE, FALSE); | 8887 pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_FOGENABLE, FALSE); |
8888 | 8888 |
8889 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, TRUE)); | 8889 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, TRUE)); |
8890 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DITHERENABLE, FALSE)); | 8890 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DITHERENABLE, FALSE)); |
8891 ErrD3D(pRenderD3D->pDevice->SetTexture(0, pEngine->pIndoorCameraD3D->LoadTextureAndGetHardwarePtr("effpar03"))); | 8891 ErrD3D(pRenderD3D->pDevice->SetTexture(0, pIndoorCameraD3D->LoadTextureAndGetHardwarePtr("effpar03"))); |
8892 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ONE)); | 8892 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ONE)); |
8893 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_ONE)); | 8893 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_ONE)); |
8894 } | 8894 } |
8895 | 8895 |
8896 void Render::EndLightmaps() | 8896 void Render::EndLightmaps() |
8916 | 8916 |
8917 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_CULLMODE, D3DCULL_NONE)); | 8917 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_CULLMODE, D3DCULL_NONE)); |
8918 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, FALSE)); | 8918 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ZWRITEENABLE, FALSE)); |
8919 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, TRUE)); | 8919 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_ALPHABLENDENABLE, TRUE)); |
8920 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DITHERENABLE, FALSE)); | 8920 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DITHERENABLE, FALSE)); |
8921 ErrD3D(pRenderD3D->pDevice->SetTexture(0, pEngine->pIndoorCameraD3D->LoadTextureAndGetHardwarePtr("effpar03"))); | 8921 ErrD3D(pRenderD3D->pDevice->SetTexture(0, pIndoorCameraD3D->LoadTextureAndGetHardwarePtr("effpar03"))); |
8922 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ONE)); | 8922 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ONE)); |
8923 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_ONE)); | 8923 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_ONE)); |
8924 } | 8924 } |
8925 | 8925 |
8926 | 8926 |
9007 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_CULLMODE, D3DCULL_NONE)); | 9007 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_CULLMODE, D3DCULL_NONE)); |
9008 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ONE)); | 9008 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_SRCBLEND, D3DBLEND_ONE)); |
9009 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_ONE)); | 9009 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DESTBLEND, D3DBLEND_ONE)); |
9010 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DITHERENABLE, FALSE)); | 9010 ErrD3D(pRenderD3D->pDevice->SetRenderState(D3DRENDERSTATE_DITHERENABLE, FALSE)); |
9011 | 9011 |
9012 ErrD3D(pRenderD3D->pDevice->SetTexture(0, pEngine->pIndoorCameraD3D->LoadTextureAndGetHardwarePtr("hwsplat04"))); | 9012 ErrD3D(pRenderD3D->pDevice->SetTexture(0, pIndoorCameraD3D->LoadTextureAndGetHardwarePtr("hwsplat04"))); |
9013 } | 9013 } |
9014 | 9014 |
9015 | 9015 |
9016 void Render::EndDecals() | 9016 void Render::EndDecals() |
9017 { | 9017 { |
9062 uFinalG = floorf(uTintG / 255.0 * color_mult * uDecalColorMultG + 0.0f), | 9062 uFinalG = floorf(uTintG / 255.0 * color_mult * uDecalColorMultG + 0.0f), |
9063 uFinalB = floorf(uTintB / 255.0 * color_mult * uDecalColorMultB + 0.0f); | 9063 uFinalB = floorf(uTintB / 255.0 * color_mult * uDecalColorMultB + 0.0f); |
9064 | 9064 |
9065 float v15; | 9065 float v15; |
9066 if (fabs(z_bias) < 1e-5) | 9066 if (fabs(z_bias) < 1e-5) |
9067 v15 = 1.0 - 1.0 / ((1.0f / pEngine->pIndoorCameraD3D->GetShadingDistMist()) * pDecal->pVertices[i].vWorldViewPosition.x * 1000.0); | 9067 v15 = 1.0 - 1.0 / ((1.0f / pIndoorCameraD3D->GetShadingDistMist()) * pDecal->pVertices[i].vWorldViewPosition.x * 1000.0); |
9068 else | 9068 else |
9069 { | 9069 { |
9070 v15 = 1.0 - 1.0 / ((1.0f / pEngine->pIndoorCameraD3D->GetShadingDistMist()) * pDecal->pVertices[i].vWorldViewPosition.x * 1000.0) - z_bias; | 9070 v15 = 1.0 - 1.0 / ((1.0f / pIndoorCameraD3D->GetShadingDistMist()) * pDecal->pVertices[i].vWorldViewPosition.x * 1000.0) - z_bias; |
9071 if (v15 < 0.000099999997) | 9071 if (v15 < 0.000099999997) |
9072 v15 = 0.000099999997; | 9072 v15 = 0.000099999997; |
9073 } | 9073 } |
9074 | 9074 |
9075 pVerticesD3D[i].pos.x = pDecal->pVertices[i].vWorldViewProjX; | 9075 pVerticesD3D[i].pos.x = pDecal->pVertices[i].vWorldViewProjX; |
10511 int v17; // [sp+1Ch] [bp-10h]@1 | 10511 int v17; // [sp+1Ch] [bp-10h]@1 |
10512 int v19; // [sp+20h] [bp-Ch]@3 | 10512 int v19; // [sp+20h] [bp-Ch]@3 |
10513 int angle; // [sp+24h] [bp-8h]@1 | 10513 int angle; // [sp+24h] [bp-8h]@1 |
10514 | 10514 |
10515 angle = (signed int)(pODMRenderParams->uCameraFovInDegrees << 11) / 360 / 2; | 10515 angle = (signed int)(pODMRenderParams->uCameraFovInDegrees << 11) / 360 / 2; |
10516 v3 = pOutdoor->pBModels[uModelID].vBoundingCenter.x - pEngine->pIndoorCameraD3D->vPartyPos.x; | 10516 v3 = pOutdoor->pBModels[uModelID].vBoundingCenter.x - pIndoorCameraD3D->vPartyPos.x; |
10517 v4 = pOutdoor->pBModels[uModelID].vBoundingCenter.y - pEngine->pIndoorCameraD3D->vPartyPos.y; | 10517 v4 = pOutdoor->pBModels[uModelID].vBoundingCenter.y - pIndoorCameraD3D->vPartyPos.y; |
10518 stru_5C6E00->Sin(pEngine->pIndoorCameraD3D->sRotationX); | 10518 stru_5C6E00->Sin(pIndoorCameraD3D->sRotationX); |
10519 v17 = v3 * stru_5C6E00->Cos(pEngine->pIndoorCameraD3D->sRotationY) + v4 * stru_5C6E00->Sin(pEngine->pIndoorCameraD3D->sRotationY); | 10519 v17 = v3 * stru_5C6E00->Cos(pIndoorCameraD3D->sRotationY) + v4 * stru_5C6E00->Sin(pIndoorCameraD3D->sRotationY); |
10520 if (pEngine->pIndoorCameraD3D->sRotationX) | 10520 if (pIndoorCameraD3D->sRotationX) |
10521 v17 = fixpoint_mul(v17, stru_5C6E00->Cos(pEngine->pIndoorCameraD3D->sRotationX)); | 10521 v17 = fixpoint_mul(v17, stru_5C6E00->Cos(pIndoorCameraD3D->sRotationX)); |
10522 v19 = v4 * stru_5C6E00->Cos(pEngine->pIndoorCameraD3D->sRotationY) - v3 * stru_5C6E00->Sin(pEngine->pIndoorCameraD3D->sRotationY); | 10522 v19 = v4 * stru_5C6E00->Cos(pIndoorCameraD3D->sRotationY) - v3 * stru_5C6E00->Sin(pIndoorCameraD3D->sRotationY); |
10523 v9 = int_get_vector_length(abs(v3), abs(v4), 0); | 10523 v9 = int_get_vector_length(abs(v3), abs(v4), 0); |
10524 //v10 = v14 * 188; | 10524 //v10 = v14 * 188; |
10525 //v22 = v9; | 10525 //v22 = v9; |
10526 *reachable = false; | 10526 *reachable = false; |
10527 if (v9 < pOutdoor->pBModels[uModelID].sBoundingRadius + 256) | 10527 if (v9 < pOutdoor->pBModels[uModelID].sBoundingRadius + 256) |
11114 int v19; // ST0C_4@9 | 11114 int v19; // ST0C_4@9 |
11115 int v24; // [sp+14h] [bp-14h]@1 | 11115 int v24; // [sp+14h] [bp-14h]@1 |
11116 int v25; // [sp+18h] [bp-10h]@1 | 11116 int v25; // [sp+18h] [bp-10h]@1 |
11117 int v27; // [sp+24h] [bp-4h]@1 | 11117 int v27; // [sp+24h] [bp-4h]@1 |
11118 | 11118 |
11119 v25 = pEngine->pIndoorCameraD3D->int_cosine_x; | 11119 v25 = pIndoorCameraD3D->int_cosine_x; |
11120 v7 = pEngine->pIndoorCameraD3D->int_sine_y; | 11120 v7 = pIndoorCameraD3D->int_sine_y; |
11121 v27 = pEngine->pIndoorCameraD3D->int_sine_x; | 11121 v27 = pIndoorCameraD3D->int_sine_x; |
11122 //v8 = -pIndoorCamera->pos.y; | 11122 //v8 = -pIndoorCamera->pos.y; |
11123 v9 = pEngine->pIndoorCameraD3D->int_cosine_y; | 11123 v9 = pIndoorCameraD3D->int_cosine_y; |
11124 //v26 = -pIndoorCamera->pos.z; | 11124 //v26 = -pIndoorCamera->pos.z; |
11125 v11 = pEngine->pIndoorCameraD3D->int_cosine_y * -pEngine->pIndoorCameraD3D->vPartyPos.x + pEngine->pIndoorCameraD3D->int_sine_y * -pEngine->pIndoorCameraD3D->vPartyPos.y; | 11125 v11 = pIndoorCameraD3D->int_cosine_y * -pIndoorCameraD3D->vPartyPos.x + pIndoorCameraD3D->int_sine_y * -pIndoorCameraD3D->vPartyPos.y; |
11126 v24 = pEngine->pIndoorCameraD3D->int_cosine_y * -pEngine->pIndoorCameraD3D->vPartyPos.y - pEngine->pIndoorCameraD3D->int_sine_y * -pEngine->pIndoorCameraD3D->vPartyPos.x; | 11126 v24 = pIndoorCameraD3D->int_cosine_y * -pIndoorCameraD3D->vPartyPos.y - pIndoorCameraD3D->int_sine_y * -pIndoorCameraD3D->vPartyPos.x; |
11127 if (pEngine->pIndoorCameraD3D->sRotationX) | 11127 if (pIndoorCameraD3D->sRotationX) |
11128 { | 11128 { |
11129 this->field_0_party_dir_x = fixpoint_mul(v11, pEngine->pIndoorCameraD3D->int_cosine_x) + | 11129 this->field_0_party_dir_x = fixpoint_mul(v11, pIndoorCameraD3D->int_cosine_x) + |
11130 fixpoint_mul((-pEngine->pIndoorCameraD3D->vPartyPos.z) << 16, pEngine->pIndoorCameraD3D->int_sine_x); | 11130 fixpoint_mul((-pIndoorCameraD3D->vPartyPos.z) << 16, pIndoorCameraD3D->int_sine_x); |
11131 this->field_4_party_dir_y = v24; | 11131 this->field_4_party_dir_y = v24; |
11132 this->field_8_party_dir_z = fixpoint_mul((-pEngine->pIndoorCameraD3D->vPartyPos.z) << 16, v25) - fixpoint_mul(v11, v27); | 11132 this->field_8_party_dir_z = fixpoint_mul((-pIndoorCameraD3D->vPartyPos.z) << 16, v25) - fixpoint_mul(v11, v27); |
11133 } | 11133 } |
11134 else | 11134 else |
11135 { | 11135 { |
11136 this->field_0_party_dir_x = v11; | 11136 this->field_0_party_dir_x = v11; |
11137 this->field_4_party_dir_y = v24; | 11137 this->field_4_party_dir_y = v24; |
11138 this->field_8_party_dir_z = (-pEngine->pIndoorCameraD3D->vPartyPos.z) << 16; | 11138 this->field_8_party_dir_z = (-pIndoorCameraD3D->vPartyPos.z) << 16; |
11139 } | 11139 } |
11140 | 11140 |
11141 if (pEngine->pIndoorCameraD3D->sRotationX) | 11141 if (pIndoorCameraD3D->sRotationX) |
11142 { | 11142 { |
11143 v17 = fixpoint_mul(a2, v9) + fixpoint_mul(a3, v7); | 11143 v17 = fixpoint_mul(a2, v9) + fixpoint_mul(a3, v7); |
11144 | 11144 |
11145 this->angle_from_north = fixpoint_mul(v17, v25) + fixpoint_mul(a4, v27); | 11145 this->angle_from_north = fixpoint_mul(v17, v25) + fixpoint_mul(a4, v27); |
11146 this->angle_from_west = fixpoint_mul(a3, v9) - fixpoint_mul(a2, v7); | 11146 this->angle_from_west = fixpoint_mul(a3, v9) - fixpoint_mul(a2, v7); |
11151 this->angle_from_north = fixpoint_mul(a2, v9) + fixpoint_mul(a3, v7); | 11151 this->angle_from_north = fixpoint_mul(a2, v9) + fixpoint_mul(a3, v7); |
11152 this->angle_from_west = fixpoint_mul(a3, v9) - fixpoint_mul(a2, v7); | 11152 this->angle_from_west = fixpoint_mul(a3, v9) - fixpoint_mul(a2, v7); |
11153 this->viewing_angle_from_west_east = a4; | 11153 this->viewing_angle_from_west_east = a4; |
11154 } | 11154 } |
11155 | 11155 |
11156 if (pEngine->pIndoorCameraD3D->sRotationX) | 11156 if (pIndoorCameraD3D->sRotationX) |
11157 { | 11157 { |
11158 v19 = fixpoint_mul(a5, v9) + fixpoint_mul(a6, v7); | 11158 v19 = fixpoint_mul(a5, v9) + fixpoint_mul(a6, v7); |
11159 | 11159 |
11160 this->angle_from_east = fixpoint_mul(v19, v25) + fixpoint_mul(a7, v27); | 11160 this->angle_from_east = fixpoint_mul(v19, v25) + fixpoint_mul(a7, v27); |
11161 this->angle_from_south = fixpoint_mul(a6, v9) - fixpoint_mul(a5, v7); | 11161 this->angle_from_south = fixpoint_mul(a6, v9) - fixpoint_mul(a5, v7); |