Mercurial > mm7
comparison Engine/Graphics/Render.cpp @ 2508:491f0babd563
use_music_folder
author | Ritor1 |
---|---|
date | Thu, 02 Oct 2014 11:52:31 +0600 |
parents | a77c34acdbc9 |
children | 3a1b56ab8749 |
comparison
equal
deleted
inserted
replaced
2507:6dcc6e8dd041 | 2508:491f0babd563 |
---|---|
908 //----- (0047A95E) -------------------------------------------------------- | 908 //----- (0047A95E) -------------------------------------------------------- |
909 void Render::PrepareDecorationsRenderList_ODM() | 909 void Render::PrepareDecorationsRenderList_ODM() |
910 { | 910 { |
911 unsigned int v6; // edi@9 | 911 unsigned int v6; // edi@9 |
912 int v7; // eax@9 | 912 int v7; // eax@9 |
913 SpriteFrame *v8; // eax@9 | 913 SpriteFrame *frame; // eax@9 |
914 unsigned __int16 *v10; // eax@9 | 914 unsigned __int16 *v10; // eax@9 |
915 int v13; // ecx@9 | 915 int v13; // ecx@9 |
916 int v14; // ecx@20 | 916 int v14; // ecx@20 |
917 char v15; // dl@20 | 917 char v15; // dl@20 |
918 signed int v16; // eax@20 | 918 signed int v16; // eax@20 |
966 | 966 |
967 case 483: // tree01 | 967 case 483: // tree01 |
968 case 486: // tree04 | 968 case 486: // tree04 |
969 case 492: // tree10 | 969 case 492: // tree10 |
970 pSpriteFrameTable->InitializeSprite(decor_desc->uSpriteID + 2); | 970 pSpriteFrameTable->InitializeSprite(decor_desc->uSpriteID + 2); |
971 v8 = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID + 2, v6 + v7); | 971 frame = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID + 2, v6 + v7); |
972 break; | 972 break; |
973 | 973 |
974 default: | 974 default: |
975 v8 = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID, v6 + v7); | 975 frame = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID, v6 + v7); |
976 } | 976 } |
977 break; | 977 break; |
978 | 978 |
979 case 2: case 3: case 4: // spring | 979 case 2: case 3: case 4: // spring |
980 switch (decor_desc->uSpriteID) | 980 switch (decor_desc->uSpriteID) |
981 { | 981 { |
982 } | 982 } |
983 v8 = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID, v6 + v7); | 983 frame = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID, v6 + v7); |
984 break; | 984 break; |
985 | 985 |
986 case 8: case 9: case 10: // autumn | 986 case 8: case 9: case 10: // autumn |
987 switch (decor_desc->uSpriteID) | 987 switch (decor_desc->uSpriteID) |
988 { | 988 { |
994 | 994 |
995 case 483: // tree01 | 995 case 483: // tree01 |
996 case 486: // tree04 | 996 case 486: // tree04 |
997 case 492: // tree10 | 997 case 492: // tree10 |
998 pSpriteFrameTable->InitializeSprite(decor_desc->uSpriteID + 1); | 998 pSpriteFrameTable->InitializeSprite(decor_desc->uSpriteID + 1); |
999 v8 = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID + 1, v6 + v7); | 999 frame = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID + 1, v6 + v7); |
1000 break; | 1000 break; |
1001 | 1001 |
1002 default: | 1002 default: |
1003 v8 = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID, v6 + v7); | 1003 frame = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID, v6 + v7); |
1004 } | 1004 } |
1005 break; | 1005 break; |
1006 | 1006 |
1007 case 5: case 6: case 7: // summer | 1007 case 5: case 6: case 7: // summer |
1008 //all green by default | 1008 //all green by default |
1009 v8 = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID, v6 + v7); | 1009 frame = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID, v6 + v7); |
1010 break; | 1010 break; |
1011 | 1011 |
1012 default: assert(pParty->uCurrentMonth >= 0 && pParty->uCurrentMonth < 12); | 1012 default: assert(pParty->uCurrentMonth >= 0 && pParty->uCurrentMonth < 12); |
1013 } | 1013 } |
1014 else | 1014 else |
1015 v8 = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID, v6 + v7); | 1015 frame = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID, v6 + v7); |
1016 #pragma endregion | 1016 #pragma endregion |
1017 //v8 = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID, v6 + v7); | 1017 //v8 = pSpriteFrameTable->GetFrame(decor_desc->uSpriteID, v6 + v7); |
1018 | 1018 |
1019 v10 = (unsigned __int16 *)stru_5C6E00->Atan2(pLevelDecorations[i].vPosition.x - pGame->pIndoorCameraD3D->vPartyPos.x, | 1019 v10 = (unsigned __int16 *)stru_5C6E00->Atan2(pLevelDecorations[i].vPosition.x - pGame->pIndoorCameraD3D->vPartyPos.x, |
1020 pLevelDecorations[i].vPosition.y - pGame->pIndoorCameraD3D->vPartyPos.y); | 1020 pLevelDecorations[i].vPosition.y - pGame->pIndoorCameraD3D->vPartyPos.y); |
1021 v38 = 0; | 1021 v38 = 0; |
1022 v13 = ((signed int)(stru_5C6E00->uIntegerPi + ((signed int)stru_5C6E00->uIntegerPi >> 3) + pLevelDecorations[i].field_10_y_rot - (signed int)v10) >> 8) & 7; | 1022 v13 = ((signed int)(stru_5C6E00->uIntegerPi + ((signed int)stru_5C6E00->uIntegerPi >> 3) + pLevelDecorations[i].field_10_y_rot - (signed int)v10) >> 8) & 7; |
1023 v37 = (unsigned __int16 *)v13; | 1023 v37 = (unsigned __int16 *)v13; |
1024 if ( v8->uFlags & 2 ) | 1024 if ( frame->uFlags & 2 ) |
1025 v38 = 2; | 1025 v38 = 2; |
1026 if ( (256 << v13) & v8->uFlags ) | 1026 if ( (256 << v13) & frame->uFlags ) |
1027 v38 |= 4; | 1027 v38 |= 4; |
1028 if ( v8->uFlags & 0x40000 ) | 1028 if ( frame->uFlags & 0x40000 ) |
1029 v38 |= 0x40; | 1029 v38 |= 0x40; |
1030 if ( v8->uFlags & 0x20000 ) | 1030 if ( frame->uFlags & 0x20000 ) |
1031 LOBYTE(v38) = v38 | 0x80; | 1031 LOBYTE(v38) = v38 | 0x80; |
1032 if ( v8->uGlowRadius ) | 1032 if ( frame->uGlowRadius ) |
1033 { | 1033 { |
1034 if ( pRenderD3D && bUseColoredLights ) | 1034 if ( pRenderD3D && bUseColoredLights ) |
1035 { | 1035 { |
1036 v14 = /*255;//*/decor_desc->uColoredLightRed; | 1036 v14 = /*255;//*/decor_desc->uColoredLightRed; |
1037 v15 = /*255;//*/decor_desc->uColoredLightGreen; | 1037 v15 = /*255;//*/decor_desc->uColoredLightGreen; |
1042 v16 = 255; | 1042 v16 = 255; |
1043 v14 = 255; | 1043 v14 = 255; |
1044 v15 = 255; | 1044 v15 = 255; |
1045 } | 1045 } |
1046 pStationaryLightsStack->AddLight(pLevelDecorations[i].vPosition.x, pLevelDecorations[i].vPosition.y, pLevelDecorations[i].vPosition.z + decor_desc->uDecorationHeight / 2, | 1046 pStationaryLightsStack->AddLight(pLevelDecorations[i].vPosition.x, pLevelDecorations[i].vPosition.y, pLevelDecorations[i].vPosition.z + decor_desc->uDecorationHeight / 2, |
1047 v8->uGlowRadius, v14, v15, v16, _4E94D0_light_type); | 1047 frame->uGlowRadius, v14, v15, v16, _4E94D0_light_type); |
1048 } | 1048 } |
1049 v17 = (pLevelDecorations[i].vPosition.x - pGame->pIndoorCameraD3D->vPartyPos.x) << 16; | 1049 v17 = (pLevelDecorations[i].vPosition.x - pGame->pIndoorCameraD3D->vPartyPos.x) << 16; |
1050 if (pGame->pIndoorCameraD3D->sRotationX) | 1050 if (pGame->pIndoorCameraD3D->sRotationX) |
1051 { | 1051 { |
1052 v40 = (pLevelDecorations[i].vPosition.y - pGame->pIndoorCameraD3D->vPartyPos.y) << 16; | 1052 v40 = (pLevelDecorations[i].vPosition.y - pGame->pIndoorCameraD3D->vPartyPos.y) << 16; |
1062 { | 1062 { |
1063 LODWORD(v24) = 0; | 1063 LODWORD(v24) = 0; |
1064 HIDWORD(v24) = SLOWORD(pODMRenderParams->int_fov_rad); | 1064 HIDWORD(v24) = SLOWORD(pODMRenderParams->int_fov_rad); |
1065 v25 = pViewport->uScreenCenterX - ((signed int)(fixpoint_mul(v24 / v20, v21) + 0x8000) >> 16); | 1065 v25 = pViewport->uScreenCenterX - ((signed int)(fixpoint_mul(v24 / v20, v21) + 0x8000) >> 16); |
1066 v40 = pViewport->uScreenCenterY - ((signed int)(fixpoint_mul(v24 / v20, v22) + 0x8000) >> 16); | 1066 v40 = pViewport->uScreenCenterY - ((signed int)(fixpoint_mul(v24 / v20, v22) + 0x8000) >> 16); |
1067 v41 = fixpoint_mul(v8->scale, v24 / v20); | 1067 v41 = fixpoint_mul(frame->scale, v24 / v20); |
1068 if ( pRenderD3D ) | 1068 if ( pRenderD3D ) |
1069 b = fixpoint_mul(pSprites_LOD->pHardwareSprites[v8->pHwSpriteIDs[(int)v37]].uBufferWidth / 2, v41); | 1069 b = fixpoint_mul(pSprites_LOD->pHardwareSprites[frame->pHwSpriteIDs[(int)v37]].uBufferWidth / 2, v41); |
1070 else | 1070 else |
1071 { | 1071 { |
1072 __debugbreak(); | 1072 __debugbreak(); |
1073 b = fixpoint_mul(pSprites_LOD->pSpriteHeaders[v8->pHwSpriteIDs[(int)v37]].uWidth / 2, v41); | 1073 b = fixpoint_mul(pSprites_LOD->pSpriteHeaders[frame->pHwSpriteIDs[(int)v37]].uWidth / 2, v41); |
1074 } | 1074 } |
1075 if ( b + v25 >= (signed int)pViewport->uViewportTL_X && v25 - b <= (signed int)pViewport->uViewportBR_X ) | 1075 if ( b + v25 >= (signed int)pViewport->uViewportTL_X && v25 - b <= (signed int)pViewport->uViewportBR_X ) |
1076 { | 1076 { |
1077 if (::uNumBillboardsToDraw >= 500) | 1077 if (::uNumBillboardsToDraw >= 500) |
1078 return; | 1078 return; |
1079 pBillboardRenderList[::uNumBillboardsToDraw].HwSpriteID = v8->pHwSpriteIDs[(int)v37]; | 1079 pBillboardRenderList[::uNumBillboardsToDraw].HwSpriteID = frame->pHwSpriteIDs[(int)v37]; |
1080 pBillboardRenderList[::uNumBillboardsToDraw]._screenspace_x_scaler_packedfloat = v41; | 1080 pBillboardRenderList[::uNumBillboardsToDraw]._screenspace_x_scaler_packedfloat = v41; |
1081 pBillboardRenderList[::uNumBillboardsToDraw]._screenspace_y_scaler_packedfloat = v41; | 1081 pBillboardRenderList[::uNumBillboardsToDraw]._screenspace_y_scaler_packedfloat = v41; |
1082 v29 = v38; | 1082 v29 = v38; |
1083 pBillboardRenderList[::uNumBillboardsToDraw].uScreenSpaceX = v25; | 1083 pBillboardRenderList[::uNumBillboardsToDraw].uScreenSpaceX = v25; |
1084 HIBYTE(v29) |= 2; | 1084 HIBYTE(v29) |= 2; |
1085 pBillboardRenderList[::uNumBillboardsToDraw].uPalette = v8->uPaletteIndex; | 1085 pBillboardRenderList[::uNumBillboardsToDraw].uPalette = frame->uPaletteIndex; |
1086 pBillboardRenderList[::uNumBillboardsToDraw].field_1E = v29; | 1086 pBillboardRenderList[::uNumBillboardsToDraw].field_1E = v29; |
1087 pBillboardRenderList[::uNumBillboardsToDraw].world_x = pLevelDecorations[i].vPosition.x; | 1087 pBillboardRenderList[::uNumBillboardsToDraw].world_x = pLevelDecorations[i].vPosition.x; |
1088 pBillboardRenderList[::uNumBillboardsToDraw].world_y = pLevelDecorations[i].vPosition.y; | 1088 pBillboardRenderList[::uNumBillboardsToDraw].world_y = pLevelDecorations[i].vPosition.y; |
1089 pBillboardRenderList[::uNumBillboardsToDraw].world_z = pLevelDecorations[i].vPosition.z; | 1089 pBillboardRenderList[::uNumBillboardsToDraw].world_z = pLevelDecorations[i].vPosition.z; |
1090 pBillboardRenderList[::uNumBillboardsToDraw].uScreenSpaceY = v40; | 1090 pBillboardRenderList[::uNumBillboardsToDraw].uScreenSpaceY = v40; |
1092 v31 = PID(OBJECT_Decoration,i); | 1092 v31 = PID(OBJECT_Decoration,i); |
1093 LOWORD(v30) = 0; | 1093 LOWORD(v30) = 0; |
1094 pBillboardRenderList[::uNumBillboardsToDraw].uIndoorSectorID = 0; | 1094 pBillboardRenderList[::uNumBillboardsToDraw].uIndoorSectorID = 0; |
1095 pBillboardRenderList[::uNumBillboardsToDraw].sZValue = v30 + v31; | 1095 pBillboardRenderList[::uNumBillboardsToDraw].sZValue = v30 + v31; |
1096 pBillboardRenderList[::uNumBillboardsToDraw].dimming_level = 0; | 1096 pBillboardRenderList[::uNumBillboardsToDraw].dimming_level = 0; |
1097 pBillboardRenderList[::uNumBillboardsToDraw].pSpriteFrame = v8; | 1097 pBillboardRenderList[::uNumBillboardsToDraw].pSpriteFrame = frame; |
1098 pBillboardRenderList[::uNumBillboardsToDraw].sTintColor = 0; | 1098 pBillboardRenderList[::uNumBillboardsToDraw].sTintColor = 0; |
1099 ::uNumBillboardsToDraw++; | 1099 ::uNumBillboardsToDraw++; |
1100 ++uNumDecorationsDrawnThisFrame; | 1100 ++uNumDecorationsDrawnThisFrame; |
1101 } | 1101 } |
1102 } | 1102 } |
1117 { | 1117 { |
1118 LODWORD(v24) = 0; | 1118 LODWORD(v24) = 0; |
1119 HIDWORD(v24) = SLOWORD(pODMRenderParams->int_fov_rad); | 1119 HIDWORD(v24) = SLOWORD(pODMRenderParams->int_fov_rad); |
1120 v25 = pViewport->uScreenCenterX - ((signed int)(fixpoint_mul(v24 / v20, v21) + 0x8000) >> 16); | 1120 v25 = pViewport->uScreenCenterX - ((signed int)(fixpoint_mul(v24 / v20, v21) + 0x8000) >> 16); |
1121 v40 = pViewport->uScreenCenterY - ((signed int)(fixpoint_mul(v24 / v20, v42) + 0x8000) >> 16); | 1121 v40 = pViewport->uScreenCenterY - ((signed int)(fixpoint_mul(v24 / v20, v42) + 0x8000) >> 16); |
1122 v41 = fixpoint_mul(v8->scale, v24 / v20); | 1122 v41 = fixpoint_mul(frame->scale, v24 / v20); |
1123 if ( pRenderD3D ) | 1123 if ( pRenderD3D ) |
1124 b = fixpoint_mul(pSprites_LOD->pHardwareSprites[v8->pHwSpriteIDs[(int)v37]].uBufferWidth / 2, v41); | 1124 b = fixpoint_mul(pSprites_LOD->pHardwareSprites[frame->pHwSpriteIDs[(int)v37]].uBufferWidth / 2, v41); |
1125 else | 1125 else |
1126 { | 1126 { |
1127 __debugbreak(); | 1127 __debugbreak(); |
1128 b = fixpoint_mul(pSprites_LOD->pSpriteHeaders[v8->pHwSpriteIDs[(int)v37]].uWidth / 2, v41); | 1128 b = fixpoint_mul(pSprites_LOD->pSpriteHeaders[frame->pHwSpriteIDs[(int)v37]].uWidth / 2, v41); |
1129 } | 1129 } |
1130 if ( b + v25 >= (signed int)pViewport->uViewportTL_X && v25 - b <= (signed int)pViewport->uViewportBR_X ) | 1130 if ( b + v25 >= (signed int)pViewport->uViewportTL_X && v25 - b <= (signed int)pViewport->uViewportBR_X ) |
1131 { | 1131 { |
1132 if (::uNumBillboardsToDraw >= 500) | 1132 if (::uNumBillboardsToDraw >= 500) |
1133 return; | 1133 return; |
1134 pBillboardRenderList[::uNumBillboardsToDraw].HwSpriteID = v8->pHwSpriteIDs[(int)v37]; | 1134 pBillboardRenderList[::uNumBillboardsToDraw].HwSpriteID = frame->pHwSpriteIDs[(int)v37]; |
1135 pBillboardRenderList[::uNumBillboardsToDraw]._screenspace_x_scaler_packedfloat = v41; | 1135 pBillboardRenderList[::uNumBillboardsToDraw]._screenspace_x_scaler_packedfloat = v41; |
1136 pBillboardRenderList[::uNumBillboardsToDraw]._screenspace_y_scaler_packedfloat = v41; | 1136 pBillboardRenderList[::uNumBillboardsToDraw]._screenspace_y_scaler_packedfloat = v41; |
1137 v29 = v38; | 1137 v29 = v38; |
1138 pBillboardRenderList[::uNumBillboardsToDraw].uScreenSpaceX = v25; | 1138 pBillboardRenderList[::uNumBillboardsToDraw].uScreenSpaceX = v25; |
1139 HIBYTE(v29) |= 2; | 1139 HIBYTE(v29) |= 2; |
1140 pBillboardRenderList[::uNumBillboardsToDraw].uPalette = v8->uPaletteIndex; | 1140 pBillboardRenderList[::uNumBillboardsToDraw].uPalette = frame->uPaletteIndex; |
1141 pBillboardRenderList[::uNumBillboardsToDraw].field_1E = v29; | 1141 pBillboardRenderList[::uNumBillboardsToDraw].field_1E = v29; |
1142 pBillboardRenderList[::uNumBillboardsToDraw].world_x = pLevelDecorations[i].vPosition.x; | 1142 pBillboardRenderList[::uNumBillboardsToDraw].world_x = pLevelDecorations[i].vPosition.x; |
1143 pBillboardRenderList[::uNumBillboardsToDraw].world_y = pLevelDecorations[i].vPosition.y; | 1143 pBillboardRenderList[::uNumBillboardsToDraw].world_y = pLevelDecorations[i].vPosition.y; |
1144 pBillboardRenderList[::uNumBillboardsToDraw].world_z = pLevelDecorations[i].vPosition.z; | 1144 pBillboardRenderList[::uNumBillboardsToDraw].world_z = pLevelDecorations[i].vPosition.z; |
1145 pBillboardRenderList[::uNumBillboardsToDraw].uScreenSpaceY = v40; | 1145 pBillboardRenderList[::uNumBillboardsToDraw].uScreenSpaceY = v40; |
1147 v31 = PID(OBJECT_Decoration,i); | 1147 v31 = PID(OBJECT_Decoration,i); |
1148 LOWORD(v30) = 0; | 1148 LOWORD(v30) = 0; |
1149 pBillboardRenderList[::uNumBillboardsToDraw].uIndoorSectorID = 0; | 1149 pBillboardRenderList[::uNumBillboardsToDraw].uIndoorSectorID = 0; |
1150 pBillboardRenderList[::uNumBillboardsToDraw].sZValue = v30 + v31; | 1150 pBillboardRenderList[::uNumBillboardsToDraw].sZValue = v30 + v31; |
1151 pBillboardRenderList[::uNumBillboardsToDraw].dimming_level = 0; | 1151 pBillboardRenderList[::uNumBillboardsToDraw].dimming_level = 0; |
1152 pBillboardRenderList[::uNumBillboardsToDraw].pSpriteFrame = v8; | 1152 pBillboardRenderList[::uNumBillboardsToDraw].pSpriteFrame = frame; |
1153 pBillboardRenderList[::uNumBillboardsToDraw].sTintColor = 0; | 1153 pBillboardRenderList[::uNumBillboardsToDraw].sTintColor = 0; |
1154 ::uNumBillboardsToDraw++; | 1154 ::uNumBillboardsToDraw++; |
1155 ++uNumDecorationsDrawnThisFrame; | 1155 ++uNumDecorationsDrawnThisFrame; |
1156 } | 1156 } |
1157 } | 1157 } |