Mercurial > mm7
comparison UI/UiGame.cpp @ 1572:19f1735fca80
Слияние
author | Ritor1 |
---|---|
date | Sun, 08 Sep 2013 17:07:58 +0600 |
parents | c4ab816fcc5e |
children | 434b796cdfd3 fa0e700bcc80 |
comparison
equal
deleted
inserted
replaced
1571:ef20d4608b1a | 1572:19f1735fca80 |
---|---|
1 #ifdef _MSC_VER | 1 #ifdef _MSC_VER |
2 #define _CRT_SECURE_NO_WARNINGS | 2 #define _CRT_SECURE_NO_WARNINGS |
3 #endif | 3 #endif |
4 | |
5 #include <assert.h> | |
6 | 4 |
7 #include "..\Texture.h" | 5 #include "..\Texture.h" |
8 #include "..\MM7.h" | 6 #include "..\MM7.h" |
9 | 7 |
10 #include "..\Mouse.h" | 8 #include "..\Mouse.h" |
31 #include "..\IconFrameTable.h" | 29 #include "..\IconFrameTable.h" |
32 #include "..\TurnEngine.h" | 30 #include "..\TurnEngine.h" |
33 #include "..\texts.h" | 31 #include "..\texts.h" |
34 #include "UIHouses.h" | 32 #include "UIHouses.h" |
35 #include "..\BSPModel.h" | 33 #include "..\BSPModel.h" |
34 #include "..\Math.h" | |
36 | 35 |
37 | 36 |
38 int uTextureID_GameUI_CharSelectionFrame; // 50C98C | 37 int uTextureID_GameUI_CharSelectionFrame; // 50C98C |
39 | 38 |
40 //----- (00421D00) -------------------------------------------------------- | 39 //----- (00421D00) -------------------------------------------------------- |
174 pTmpBuf[v1++] = (char)lpsz + 2; | 173 pTmpBuf[v1++] = (char)lpsz + 2; |
175 ++lpsz; | 174 ++lpsz; |
176 ++v4; | 175 ++v4; |
177 } | 176 } |
178 while ( (signed int)lpsz < (signed int)pNPCStats->uNumNewNPCs );*/ | 177 while ( (signed int)lpsz < (signed int)pNPCStats->uNumNewNPCs );*/ |
179 for (int i = 0; i < pNPCStats->uNumNewNPCs; ++i) | 178 for ( uint i = 0; i < pNPCStats->uNumNewNPCs; ++i ) |
180 { | 179 { |
181 if (pNPCStats->pNewNPCData[i].Hired()) | 180 if (pNPCStats->pNewNPCData[i].Hired()) |
182 { | 181 { |
183 if (!pParty->pHirelings[0].pName || strcmp((char *)pNPCStats->pNewNPCData[i].pName, (char *)pParty->pHirelings[0].pName)) | 182 if (!pParty->pHirelings[0].pName || strcmp((char *)pNPCStats->pNewNPCData[i].pName, (char *)pParty->pHirelings[0].pName)) |
184 { | 183 { |
347 NPCData *pNPC; // ebx@2 | 346 NPCData *pNPC; // ebx@2 |
348 int pGreetType; // eax@2 | 347 int pGreetType; // eax@2 |
349 int pTextHeight; // esi@39 | 348 int pTextHeight; // esi@39 |
350 GUIButton *pButton; // eax@43 | 349 GUIButton *pButton; // eax@43 |
351 int v32; // ebx@93 | 350 int v32; // ebx@93 |
352 int v35; // esi@93 | 351 uint v35; // esi@93 |
353 int v38; // eax@95 | 352 int v38; // eax@95 |
354 signed int v39; // esi@99 | 353 signed int v39; // esi@99 |
355 signed int v40; // eax@102 | 354 signed int v40; // eax@102 |
356 unsigned int v41; // ebx@102 | 355 unsigned int v41; // ebx@102 |
357 int v42; // edi@102 | 356 int v42; // edi@102 |
598 } | 597 } |
599 } | 598 } |
600 | 599 |
601 // Install Buttons( )-------- | 600 // Install Buttons( )-------- |
602 v32 = 0; | 601 v32 = 0; |
603 v35 = pDialogueWindow->pStartingPosActiveItem; | 602 v35 = (uint)pDialogueWindow->pStartingPosActiveItem; |
604 for ( uint i = v35 + pDialogueWindow->pNumPresenceButton; v35 < i; i = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ) | 603 for ( uint i = v35 + pDialogueWindow->pNumPresenceButton; v35 < i; i = pDialogueWindow->pNumPresenceButton + pDialogueWindow->pStartingPosActiveItem ) |
605 { | 604 { |
606 pButton = pDialogueWindow->GetControl(v35); | 605 pButton = pDialogueWindow->GetControl(v35); |
607 if ( !pButton ) | 606 if ( !pButton ) |
608 break; | 607 break; |
729 else | 728 else |
730 result = pMapStats->pInfos[pMapID].pName; | 729 result = pMapStats->pInfos[pMapID].pName; |
731 } | 730 } |
732 else | 731 else |
733 { | 732 { |
734 for ( uint j = 0; j < (signed int)pOutdoor->uNumBModels; ++j ) | 733 for ( uint j = 0; j < (uint)pOutdoor->uNumBModels; ++j ) |
735 { | 734 { |
736 v7 = int_get_vector_length(abs((signed)pOutdoor->pBModels[j].vBoundingCenter.x - v19), | 735 v7 = int_get_vector_length(abs((signed)pOutdoor->pBModels[j].vBoundingCenter.x - v19), |
737 abs((signed)pOutdoor->pBModels[j].vBoundingCenter.y - v20), 0); | 736 abs((signed)pOutdoor->pBModels[j].vBoundingCenter.y - v20), 0); |
738 if ( v7 < 2 * pOutdoor->pBModels[j].sBoundingRadius ) | 737 if ( v7 < 2 * pOutdoor->pBModels[j].sBoundingRadius ) |
739 { | 738 { |
740 if ( pOutdoor->pBModels[j].uNumFaces ) | 739 if ( pOutdoor->pBModels[j].uNumFaces ) |
741 { | 740 { |
742 for ( uint i = 0; i < (signed int)pOutdoor->pBModels[j].uNumFaces; ++i ) | 741 for ( uint i = 0; i < (uint)pOutdoor->pBModels[j].uNumFaces; ++i ) |
743 { | 742 { |
744 pFace = &pOutdoor->pBModels[j].pFaces[i]; | 743 pFace = &pOutdoor->pBModels[j].pFaces[i]; |
745 if ( pFace->sCogTriggeredID ) | 744 if ( pFace->sCogTriggeredID ) |
746 { | 745 { |
747 if ( !(BYTE2(pFace->uAttributes) & 0x10) ) | 746 if ( !(BYTE2(pFace->uAttributes) & 0x10) ) |
973 } | 972 } |
974 | 973 |
975 //----- (0041AD6E) -------------------------------------------------------- | 974 //----- (0041AD6E) -------------------------------------------------------- |
976 void GameUI_DrawRightPanelItems() | 975 void GameUI_DrawRightPanelItems() |
977 { | 976 { |
978 if (GameUI_RightPanel_BookFlashTimer > pParty->uTimePlayed) | 977 if ( (unsigned long long)GameUI_RightPanel_BookFlashTimer > pParty->uTimePlayed ) |
979 GameUI_RightPanel_BookFlashTimer = 0; | 978 GameUI_RightPanel_BookFlashTimer = 0; |
980 | 979 |
981 if (pParty->uTimePlayed - GameUI_RightPanel_BookFlashTimer > 128) | 980 if ( pParty->uTimePlayed - GameUI_RightPanel_BookFlashTimer > 128 ) |
982 { | 981 { |
983 GameUI_RightPanel_BookFlashTimer = pParty->uTimePlayed; | 982 GameUI_RightPanel_BookFlashTimer = pParty->uTimePlayed; |
984 | 983 |
985 static bool byte_50697C = false; // 50697C | 984 static bool byte_50697C = false; // 50697C |
986 byte_50697C = !byte_50697C; | 985 byte_50697C = !byte_50697C; |
1165 void GameUI_WritePointedObjectStatusString() | 1164 void GameUI_WritePointedObjectStatusString() |
1166 { | 1165 { |
1167 int v1; // ebx@6 | 1166 int v1; // ebx@6 |
1168 GUIWindow *pWindow; // edi@7 | 1167 GUIWindow *pWindow; // edi@7 |
1169 GUIButton *pButton; // ecx@11 | 1168 GUIButton *pButton; // ecx@11 |
1170 Player *pPlayer; // eax@19 | |
1171 char v5; // cl@19 | |
1172 unsigned int v6; // eax@19 | |
1173 int v7; // ecx@19 | 1169 int v7; // ecx@19 |
1174 __int16 v8; // fps@23 | |
1175 unsigned __int8 v9; // c0@23 | |
1176 unsigned __int8 v10; // c3@23 | |
1177 enum UIMessageType pMessageType1; // esi@24 | 1170 enum UIMessageType pMessageType1; // esi@24 |
1178 char *v13; // ecx@28 | |
1179 int v14; // eax@41 | 1171 int v14; // eax@41 |
1180 ItemGen *pItemGen; // ecx@44 | 1172 ItemGen *pItemGen; // ecx@44 |
1181 int v16; // ecx@46 | 1173 int v16; // ecx@46 |
1182 const char *v17; // eax@49 | |
1183 signed int v18; // eax@55 | 1174 signed int v18; // eax@55 |
1184 signed int v18b; | 1175 signed int v18b; |
1185 signed int v19; // ecx@63 | 1176 signed int v19; // ecx@63 |
1186 BLVFace *pFace; // eax@69 | 1177 BLVFace *pFace; // eax@69 |
1187 __int16 v21; // ax@70 | 1178 const char *pText; // ecx@79 |
1188 const char *v22; // eax@72 | |
1189 LevelDecoration *v23; // ecx@75 | |
1190 LevelDecoration *v24; // esi@75 | |
1191 __int16 v25; // ax@75 | |
1192 const char *v26; // ecx@79 | |
1193 Actor *pActor; // ecx@82 | |
1194 char *v28; // esi@82 | 1179 char *v28; // esi@82 |
1195 int v29; // eax@82 | |
1196 signed int v30; // ecx@88 | |
1197 const char *v31; // eax@91 | |
1198 __int16 v32; // fps@109 | |
1199 enum UIMessageType pMessageType2; // esi@110 | 1180 enum UIMessageType pMessageType2; // esi@110 |
1200 enum UIMessageType pMessageType3; // edx@117 | 1181 enum UIMessageType pMessageType3; // edx@117 |
1201 const char *v39; // [sp-8h] [bp-E8h]@20 | |
1202 char *v40; // [sp-8h] [bp-E8h]@83 | |
1203 int v41; // [sp-4h] [bp-E4h]@20 | |
1204 char Str1[200]; // [sp+Ch] [bp-D4h]@129 | 1182 char Str1[200]; // [sp+Ch] [bp-D4h]@129 |
1205 unsigned int pX; // [sp+D4h] [bp-Ch]@1 | 1183 unsigned int pX; // [sp+D4h] [bp-Ch]@1 |
1206 unsigned int pY; // [sp+D8h] [bp-8h]@1 | 1184 unsigned int pY; // [sp+D8h] [bp-8h]@1 |
1207 unsigned int v45; // [sp+DCh] [bp-4h]@21 | 1185 unsigned int v45; // [sp+DCh] [bp-4h]@21 |
1208 | 1186 |
1209 v13 = nullptr; | 1187 int interaction_distance_limit = 512; |
1188 | |
1210 pMouse->uPointingObjectID = 0; | 1189 pMouse->uPointingObjectID = 0; |
1211 pMouse->GetClickPos(&pX, &pY); | 1190 pMouse->GetClickPos(&pX, &pY); |
1212 if ( pX < 0 || (signed int)pX > 639 || pY < 0 || (signed int)pY > 479 )//( (pX & 0x80000000u) != 0 || (signed int)pX > 639 || (pY & 0x80000000u) != 0 || (signed int)pY > 479 ) | 1191 if ( pX < 0 || pX > 639 || pY < 0 || pY > 479 ) |
1213 return; | 1192 return; |
1214 if (pCurrentScreen == SCREEN_GAME) | 1193 if (pCurrentScreen == SCREEN_GAME) |
1215 { | 1194 { |
1216 if ( (signed int)pX > 467 || (signed int)pY > 351 ) | 1195 if ( pX > 467 || pY > 351 ) |
1217 goto _click_on_game_ui; | 1196 goto _click_on_game_ui; |
1218 if ( pRenderer->pRenderD3D ) // inlined mm8::4C1E01 | 1197 if ( pRenderer->pRenderD3D ) // inlined mm8::4C1E01 |
1219 { | 1198 { |
1220 v18 = pGame->pVisInstance->get_picked_object_zbuf_val(); | 1199 v18 = pGame->pVisInstance->get_picked_object_zbuf_val(); |
1221 if ( (signed int)pX < (signed int)pViewport->uScreen_TL_X | 1200 if ( pX < (unsigned int)pViewport->uScreen_TL_X || pX > (unsigned int)pViewport->uScreen_BR_X |
1222 || (signed int)pX > (signed int)pViewport->uScreen_BR_X | 1201 || pY < (unsigned int)pViewport->uScreen_TL_Y || pY > (unsigned int)pViewport->uScreen_BR_Y ) |
1223 || (signed int)pY < (signed int)pViewport->uScreen_TL_Y | |
1224 || (signed int)pY > (signed int)pViewport->uScreen_BR_Y ) | |
1225 v18 = -1; | 1202 v18 = -1; |
1226 if ( v18 == -1 ) | 1203 if ( v18 == -1 ) |
1227 { | 1204 { |
1228 pMouse->uPointingObjectID = 0; | 1205 pMouse->uPointingObjectID = 0; |
1229 if ( pMouse->uPointingObjectID == 0 ) | 1206 if ( pMouse->uPointingObjectID == 0 ) |
1240 } | 1217 } |
1241 else | 1218 else |
1242 v18 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; | 1219 v18 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; |
1243 pMouse->uPointingObjectID = (unsigned __int16)v18; | 1220 pMouse->uPointingObjectID = (unsigned __int16)v18; |
1244 v19 = (signed)PID_ID(v18); | 1221 v19 = (signed)PID_ID(v18); |
1222 //For Items------------------------------------ | |
1245 if (PID_TYPE(v18) == OBJECT_Item) | 1223 if (PID_TYPE(v18) == OBJECT_Item) |
1246 { | 1224 { |
1247 v30 = v19; | 1225 if ( pObjectList->pObjects[pSpriteObjects[v19].uObjectDescID].uFlags & 0x10 ) |
1248 if ( pObjectList->pObjects[pSpriteObjects[v30].uObjectDescID].uFlags & 0x10 ) | |
1249 { | 1226 { |
1250 pMouse->uPointingObjectID = 0; | 1227 pMouse->uPointingObjectID = 0; |
1251 uLastPointedObjectID = 1; | 1228 pFooterString[0] = 0; |
1229 bForceDrawFooter = 1; | |
1230 uLastPointedObjectID = 0; | |
1231 return; | |
1232 } | |
1233 if ( v18 >= (signed int)0x2000000u || pParty->pPickedItem.uItemID ) | |
1234 { | |
1235 GameUI_SetFooterString(pSpriteObjects[v19].stru_24.GetDisplayName()); | |
1252 if ( pMouse->uPointingObjectID == 0 ) | 1236 if ( pMouse->uPointingObjectID == 0 ) |
1253 { | 1237 { |
1254 if ( uLastPointedObjectID != 0 ) | 1238 if ( uLastPointedObjectID != 0 ) |
1255 { | 1239 { |
1256 pFooterString[0] = 0; | 1240 pFooterString[0] = 0; |
1258 } | 1242 } |
1259 } | 1243 } |
1260 uLastPointedObjectID = pMouse->uPointingObjectID; | 1244 uLastPointedObjectID = pMouse->uPointingObjectID; |
1261 return; | 1245 return; |
1262 } | 1246 } |
1263 if ( v18 >= (signed int)0x2000000u || pParty->pPickedItem.uItemID ) | 1247 v28 = pTmpBuf.data(); |
1264 { | 1248 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[470], pSpriteObjects[v19].stru_24.GetDisplayName());// "Get %s" |
1265 v22 = pSpriteObjects[v30].stru_24.GetDisplayName(); | 1249 } |
1266 GameUI_SetFooterString(v22); | 1250 //For Decorations---------------------------------- |
1251 if (PID_TYPE(v18) == OBJECT_Decoration) | |
1252 { | |
1253 if ( !pLevelDecorations[v19].uEventID ) | |
1254 { | |
1255 if ( pLevelDecorations[v19].IsInteractive() ) | |
1256 pText = pNPCTopics[stru_5E4C90._decor_events[pLevelDecorations[v19]._idx_in_stru123 - 75] + 379].pTopic; | |
1257 else | |
1258 pText = pDecorationList->pDecorations[pLevelDecorations[v19].uDecorationDescID].field_20; | |
1259 GameUI_SetFooterString(pText); | |
1267 if ( pMouse->uPointingObjectID == 0 ) | 1260 if ( pMouse->uPointingObjectID == 0 ) |
1268 { | 1261 { |
1269 if ( uLastPointedObjectID != 0 ) | 1262 if ( uLastPointedObjectID != 0 ) |
1270 { | 1263 { |
1271 pFooterString[0] = 0; | 1264 pFooterString[0] = 0; |
1273 } | 1266 } |
1274 } | 1267 } |
1275 uLastPointedObjectID = pMouse->uPointingObjectID; | 1268 uLastPointedObjectID = pMouse->uPointingObjectID; |
1276 return; | 1269 return; |
1277 } | 1270 } |
1278 v31 = pSpriteObjects[v30].stru_24.GetDisplayName(); | 1271 if ( !GetEventHintString(pLevelDecorations[v19].uEventID) ) |
1279 v28 = pTmpBuf.data(); | 1272 { |
1280 sprintfex(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[470], v31);// "Get %s" | 1273 if ( pMouse->uPointingObjectID == 0 ) |
1281 } | 1274 { |
1282 else | 1275 if ( uLastPointedObjectID != 0 ) |
1283 { | 1276 { |
1284 if (PID_TYPE(v18) != OBJECT_Actor) | 1277 pFooterString[0] = 0; |
1285 { | 1278 bForceDrawFooter = 1; |
1286 if (PID_TYPE(v18) == OBJECT_Decoration) | 1279 } |
1287 { | 1280 } |
1288 v23 = &pLevelDecorations[v19]; | 1281 uLastPointedObjectID = pMouse->uPointingObjectID; |
1289 v24 = v23; | 1282 return; |
1290 v25 = v23->field_16_event_id; | 1283 } |
1291 if ( !v25 ) | 1284 GameUI_SetFooterString(GetEventHintString(pLevelDecorations[v19].uEventID)); |
1292 { | 1285 if ( pMouse->uPointingObjectID == 0 ) |
1293 if ( v23->IsInteractive() ) | 1286 { |
1294 v26 = pNPCTopics[stru_5E4C90._decor_events[v24->_idx_in_stru123 - 75] + 379].pTopic; | 1287 if ( uLastPointedObjectID != 0 ) |
1295 else | 1288 { |
1296 v26 = pDecorationList->pDecorations[v24->uDecorationDescID].field_20; | 1289 pFooterString[0] = 0; |
1297 GameUI_SetFooterString(v26); | 1290 bForceDrawFooter = 1; |
1298 if ( pMouse->uPointingObjectID == 0 ) | 1291 } |
1299 { | 1292 } |
1300 if ( uLastPointedObjectID != 0 ) | 1293 uLastPointedObjectID = pMouse->uPointingObjectID; |
1301 { | 1294 return; |
1302 pFooterString[0] = 0; | 1295 } |
1303 bForceDrawFooter = 1; | 1296 //For 3D Model------------------------------------- |
1304 } | 1297 if (PID_TYPE(v18) == OBJECT_BModel) |
1305 } | 1298 { |
1306 uLastPointedObjectID = pMouse->uPointingObjectID; | 1299 if ( HIWORD(v18) < interaction_distance_limit ) |
1300 { | |
1301 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor) | |
1302 { | |
1303 v18b = (signed int)(unsigned __int16)v18 >> 9; | |
1304 if ( !pOutdoor->pBModels[v18b].pFaces[v19 & 0x3F].sCogTriggeredID | |
1305 || !GetEventHintString(pOutdoor->pBModels[v18b].pFaces[v19 & 0x3F].sCogTriggeredID) ) | |
1306 { | |
1307 pMouse->uPointingObjectID = 0; | |
1308 pFooterString[0] = 0; | |
1309 bForceDrawFooter = 1; | |
1310 uLastPointedObjectID = 0; | |
1307 return; | 1311 return; |
1308 } | 1312 } |
1309 v22 = GetEventHintString(v25); | 1313 GameUI_SetFooterString(GetEventHintString(pOutdoor->pBModels[v18b].pFaces[v19 & 0x3F].sCogTriggeredID)); |
1310 if ( !v22 ) | |
1311 { | |
1312 if ( pMouse->uPointingObjectID == 0 ) | |
1313 { | |
1314 if ( uLastPointedObjectID != 0 ) | |
1315 { | |
1316 pFooterString[0] = 0; | |
1317 bForceDrawFooter = 1; | |
1318 } | |
1319 } | |
1320 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1321 return; | |
1322 } | |
1323 GameUI_SetFooterString(v22); | |
1324 if ( pMouse->uPointingObjectID == 0 ) | 1314 if ( pMouse->uPointingObjectID == 0 ) |
1325 { | 1315 { |
1326 if ( uLastPointedObjectID != 0 ) | 1316 if ( uLastPointedObjectID != 0 ) |
1327 { | 1317 { |
1328 pFooterString[0] = 0; | 1318 pFooterString[0] = 0; |
1330 } | 1320 } |
1331 } | 1321 } |
1332 uLastPointedObjectID = pMouse->uPointingObjectID; | 1322 uLastPointedObjectID = pMouse->uPointingObjectID; |
1333 return; | 1323 return; |
1334 } | 1324 } |
1335 if (PID_TYPE(v18) == OBJECT_BModel) | 1325 pFace = &pIndoor->pFaces[v19]; |
1336 { | 1326 if ( BYTE3(pFace->uAttributes) & 6 ) |
1337 if ( HIWORD(v18) < 512) | 1327 { |
1338 { | 1328 if ( !pIndoor->pFaceExtras[pFace->uFaceExtraID].uEventID |
1339 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor) | 1329 || !GetEventHintString(pIndoor->pFaceExtras[pFace->uFaceExtraID].uEventID) ) |
1340 { | 1330 { |
1341 v18b = (signed int)(unsigned __int16)v18 >> 9; | 1331 pMouse->uPointingObjectID = 0; |
1342 v21 = pOutdoor->pBModels[v18b].pFaces[v19 & 0x3F].sCogTriggeredID; | 1332 pFooterString[0] = 0; |
1343 if ( !v21 || (v22 = GetEventHintString(v21)) == 0 ) | 1333 bForceDrawFooter = 1; |
1344 { | 1334 uLastPointedObjectID = 0; |
1345 pMouse->uPointingObjectID = 0; | 1335 return; |
1346 uLastPointedObjectID = 1; | 1336 } |
1347 if ( pMouse->uPointingObjectID == 0 ) | 1337 GameUI_SetFooterString(GetEventHintString(pIndoor->pFaceExtras[pFace->uFaceExtraID].uEventID)); |
1348 { | |
1349 if ( uLastPointedObjectID != 0 ) | |
1350 { | |
1351 pFooterString[0] = 0; | |
1352 bForceDrawFooter = 1; | |
1353 } | |
1354 } | |
1355 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1356 return; | |
1357 } | |
1358 GameUI_SetFooterString(v22); | |
1359 if ( pMouse->uPointingObjectID == 0 ) | |
1360 { | |
1361 if ( uLastPointedObjectID != 0 ) | |
1362 { | |
1363 pFooterString[0] = 0; | |
1364 bForceDrawFooter = 1; | |
1365 } | |
1366 } | |
1367 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1368 return; | |
1369 } | |
1370 pFace = &pIndoor->pFaces[v19]; | |
1371 if ( BYTE3(pFace->uAttributes) & 6 ) | |
1372 { | |
1373 v21 = pIndoor->pFaceExtras[pFace->uFaceExtraID].uEventID; | |
1374 if ( !v21 || (v22 = GetEventHintString(v21)) == 0 ) | |
1375 { | |
1376 pMouse->uPointingObjectID = 0; | |
1377 uLastPointedObjectID = 1; | |
1378 if ( pMouse->uPointingObjectID == 0 ) | |
1379 { | |
1380 if ( uLastPointedObjectID != 0 ) | |
1381 { | |
1382 pFooterString[0] = 0; | |
1383 bForceDrawFooter = 1; | |
1384 } | |
1385 } | |
1386 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1387 return; | |
1388 } | |
1389 GameUI_SetFooterString(v22); | |
1390 if ( pMouse->uPointingObjectID == 0 ) | |
1391 { | |
1392 if ( uLastPointedObjectID != 0 ) | |
1393 { | |
1394 pFooterString[0] = 0; | |
1395 bForceDrawFooter = 1; | |
1396 } | |
1397 } | |
1398 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1399 return; | |
1400 } | |
1401 } | |
1402 pMouse->uPointingObjectID = 0; | |
1403 uLastPointedObjectID = 1; | |
1404 if ( pMouse->uPointingObjectID == 0 ) | 1338 if ( pMouse->uPointingObjectID == 0 ) |
1405 { | 1339 { |
1406 if ( uLastPointedObjectID != 0 ) | 1340 if ( uLastPointedObjectID != 0 ) |
1407 { | 1341 { |
1408 pFooterString[0] = 0; | 1342 pFooterString[0] = 0; |
1410 } | 1344 } |
1411 } | 1345 } |
1412 uLastPointedObjectID = pMouse->uPointingObjectID; | 1346 uLastPointedObjectID = pMouse->uPointingObjectID; |
1413 return; | 1347 return; |
1414 } | 1348 } |
1349 } | |
1350 pMouse->uPointingObjectID = 0; | |
1351 pFooterString[0] = 0; | |
1352 bForceDrawFooter = 1; | |
1353 uLastPointedObjectID = 0; | |
1354 return; | |
1355 } | |
1356 else | |
1357 { | |
1358 if (PID_TYPE(v18) != OBJECT_Actor) | |
1359 { | |
1360 pMouse->uPointingObjectID = 0; | |
1361 if ( uLastPointedObjectID != 0 ) | |
1362 { | |
1363 pFooterString[0] = 0; | |
1364 bForceDrawFooter = 1; | |
1365 } | |
1366 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1367 return; | |
1368 } | |
1369 if ( v18 >= 335544320 ) | |
1370 { | |
1415 pMouse->uPointingObjectID = 0; | 1371 pMouse->uPointingObjectID = 0; |
1416 if ( pMouse->uPointingObjectID == 0 ) | 1372 if ( pMouse->uPointingObjectID == 0 ) |
1417 { | 1373 { |
1418 if ( uLastPointedObjectID != 0 ) | 1374 if ( uLastPointedObjectID != 0 ) |
1419 { | 1375 { |
1422 } | 1378 } |
1423 } | 1379 } |
1424 uLastPointedObjectID = pMouse->uPointingObjectID; | 1380 uLastPointedObjectID = pMouse->uPointingObjectID; |
1425 return; | 1381 return; |
1426 } | 1382 } |
1427 if ( v18 >= 335544320 ) | |
1428 { | |
1429 pMouse->uPointingObjectID = 0; | |
1430 if ( pMouse->uPointingObjectID == 0 ) | |
1431 { | |
1432 if ( uLastPointedObjectID != 0 ) | |
1433 { | |
1434 pFooterString[0] = 0; | |
1435 bForceDrawFooter = 1; | |
1436 } | |
1437 } | |
1438 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1439 return; | |
1440 } | |
1441 pActor = &pActors[v19]; | |
1442 v28 = pTmpBuf.data(); | 1383 v28 = pTmpBuf.data(); |
1443 v29 = pActor->dword_000334_unique_name; | 1384 if ( pActors[v19].dword_000334_unique_name ) |
1444 if ( v29 ) | 1385 pText = pMonsterStats->pPlaceStrings[pActors[v19].dword_000334_unique_name]; |
1445 v40 = pMonsterStats->pPlaceStrings[v29]; | |
1446 else | 1386 else |
1447 v40 = pMonsterStats->pInfos[pActor->pMonsterInfo.uID].pName; | 1387 pText = pMonsterStats->pInfos[pActors[v19].pMonsterInfo.uID].pName; |
1448 strncpy(pTmpBuf.data(), v40, 0x7D0u); | 1388 strncpy(pTmpBuf.data(), pText, 0x7D0u); |
1449 } | 1389 } |
1450 v26 = v28; | 1390 GameUI_SetFooterString(v28); |
1451 GameUI_SetFooterString(v26); | |
1452 if ( pMouse->uPointingObjectID == 0 ) | 1391 if ( pMouse->uPointingObjectID == 0 ) |
1453 { | 1392 { |
1454 if ( uLastPointedObjectID != 0 ) | 1393 if ( uLastPointedObjectID != 0 ) |
1455 { | 1394 { |
1456 pFooterString[0] = 0; | 1395 pFooterString[0] = 0; |
1485 pMessageType1 = (UIMessageType)pButton->field_1C; | 1424 pMessageType1 = (UIMessageType)pButton->field_1C; |
1486 if ( pMessageType1 ) | 1425 if ( pMessageType1 ) |
1487 { | 1426 { |
1488 pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0); | 1427 pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0); |
1489 } | 1428 } |
1490 v13 = pButton->pButtonName; | 1429 GameUI_SetFooterString(pButton->pButtonName); |
1491 GameUI_SetFooterString(v13); | |
1492 uLastPointedObjectID = 1; | 1430 uLastPointedObjectID = 1; |
1493 return; | 1431 return; |
1494 } | 1432 } |
1495 } | 1433 } |
1496 else | 1434 else |
1506 pMessageType1 = (UIMessageType)pButton->field_1C; | 1444 pMessageType1 = (UIMessageType)pButton->field_1C; |
1507 if ( pMessageType1 ) | 1445 if ( pMessageType1 ) |
1508 { | 1446 { |
1509 pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0); | 1447 pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0); |
1510 } | 1448 } |
1511 v13 = pButton->pButtonName; | 1449 GameUI_SetFooterString(pButton->pButtonName); |
1512 GameUI_SetFooterString(v13); | |
1513 uLastPointedObjectID = 1; | 1450 uLastPointedObjectID = 1; |
1514 return; | 1451 return; |
1515 //} | 1452 //} |
1516 } | 1453 } |
1517 } | 1454 } |
1518 } | 1455 } |
1519 else // click on skill | 1456 else // click on skill |
1520 { | 1457 { |
1521 if ( pButton->uButtonType == 3 | 1458 if ( pButton->uButtonType == 3 && pX >= pButton->uX && pX <= pButton->uZ && pY >= pButton->uY && pY <= pButton->uW ) |
1522 && (signed int)pX >= (signed int)pButton->uX | 1459 { |
1523 && (signed int)pX <= (signed int)pButton->uZ | 1460 v7 = (LOBYTE(pPlayers[uActiveCharacter]->pActiveSkills[pButton->msg_param]) & 0x3F) + 1; |
1524 && (signed int)pY >= (signed int)pButton->uY | 1461 if ( pPlayers[uActiveCharacter]->uSkillPoints < v7 ) |
1525 && (signed int)pY <= (signed int)pButton->uW ) | 1462 sprintf(Str1, pGlobalTXT_LocalizationStrings[469], v7 - pPlayers[uActiveCharacter]->uSkillPoints);// "You need %d more Skill Points to advance here" |
1526 { | 1463 else |
1527 pPlayer = pPlayers[uActiveCharacter]; | 1464 sprintf(Str1, pGlobalTXT_LocalizationStrings[468], v7);// "Clicking here will spend %d Skill Points" |
1528 v5 = LOBYTE(pPlayer->pActiveSkills[pButton->msg_param]); | 1465 GameUI_SetFooterString(Str1); |
1529 v6 = pPlayer->uSkillPoints; | 1466 uLastPointedObjectID = 1; |
1530 v7 = (v5 & 0x3F) + 1; | 1467 return; |
1531 if ( v6 < v7 ) | |
1532 { | |
1533 v41 = v7 - v6; | |
1534 v39 = pGlobalTXT_LocalizationStrings[469];// "You need %d more Skill Points to advance here" | |
1535 } | |
1536 else | |
1537 { | |
1538 v41 = v7; | |
1539 v39 = pGlobalTXT_LocalizationStrings[468];// "Clicking here will spend %d Skill Points" | |
1540 } | |
1541 sprintf(Str1, v39, v41); | |
1542 v13 = Str1; | |
1543 GameUI_SetFooterString(v13); | |
1544 uLastPointedObjectID = 1; | |
1545 return; | |
1546 } | 1468 } |
1547 } | 1469 } |
1548 } | 1470 } |
1549 } | 1471 } |
1550 } | 1472 } |
1589 } | 1511 } |
1590 uLastPointedObjectID = pMouse->uPointingObjectID; | 1512 uLastPointedObjectID = pMouse->uPointingObjectID; |
1591 return; | 1513 return; |
1592 } | 1514 } |
1593 pItemGen = (ItemGen *)((char *)&pParty->pPickedItem + 36 * (v16 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 4); | 1515 pItemGen = (ItemGen *)((char *)&pParty->pPickedItem + 36 * (v16 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 4); |
1594 v17 = pItemGen->GetDisplayName(); | 1516 GameUI_SetFooterString(pItemGen->GetDisplayName()); |
1595 GameUI_SetFooterString(v17); | |
1596 uLastPointedObjectID = 1; | 1517 uLastPointedObjectID = 1; |
1597 if ( pMouse->uPointingObjectID == 0 ) | 1518 if ( pMouse->uPointingObjectID == 0 ) |
1598 { | 1519 { |
1599 if ( uLastPointedObjectID != 0 ) | 1520 if ( uLastPointedObjectID != 0 ) |
1600 { | 1521 { |
1620 } | 1541 } |
1621 uLastPointedObjectID = pMouse->uPointingObjectID; | 1542 uLastPointedObjectID = pMouse->uPointingObjectID; |
1622 return; | 1543 return; |
1623 } | 1544 } |
1624 pItemGen = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItemList[v14-1]; | 1545 pItemGen = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItemList[v14-1]; |
1625 v17 = pItemGen->GetDisplayName(); | 1546 GameUI_SetFooterString(pItemGen->GetDisplayName()); |
1626 GameUI_SetFooterString(v17); | |
1627 uLastPointedObjectID = 1; | 1547 uLastPointedObjectID = 1; |
1628 if ( pMouse->uPointingObjectID == 0 ) | 1548 if ( pMouse->uPointingObjectID == 0 ) |
1629 { | 1549 { |
1630 if ( uLastPointedObjectID != 0 ) | 1550 if ( uLastPointedObjectID != 0 ) |
1631 { | 1551 { |
1652 && (signed int)pY <= (signed int)pButton->uW ) | 1572 && (signed int)pY <= (signed int)pButton->uW ) |
1653 { | 1573 { |
1654 pMessageType3 = (UIMessageType)pButton->field_1C; | 1574 pMessageType3 = (UIMessageType)pButton->field_1C; |
1655 if ( pMessageType3 == 0 ) // For books | 1575 if ( pMessageType3 == 0 ) // For books |
1656 { | 1576 { |
1657 v13 = pButton->pButtonName; | 1577 GameUI_SetFooterString(pButton->pButtonName); |
1658 GameUI_SetFooterString(v13); | |
1659 uLastPointedObjectID = 1; | 1578 uLastPointedObjectID = 1; |
1660 return; | 1579 return; |
1661 } | 1580 } |
1662 | 1581 |
1663 pMessageQueue_50CBD0->AddMessage(pMessageType3, pButton->msg_param, 0); | 1582 pMessageQueue_50CBD0->AddMessage(pMessageType3, pButton->msg_param, 0); |
1683 //{ | 1602 //{ |
1684 pMessageType2 = (UIMessageType)pButton->field_1C; | 1603 pMessageType2 = (UIMessageType)pButton->field_1C; |
1685 if ( pMessageType2 != 0 ) | 1604 if ( pMessageType2 != 0 ) |
1686 pMessageQueue_50CBD0->AddMessage(pMessageType2, pButton->msg_param, 0); | 1605 pMessageQueue_50CBD0->AddMessage(pMessageType2, pButton->msg_param, 0); |
1687 | 1606 |
1688 v13 = pButton->pButtonName; | 1607 GameUI_SetFooterString(pButton->pButtonName); |
1689 GameUI_SetFooterString(v13); | |
1690 uLastPointedObjectID = 1; | 1608 uLastPointedObjectID = 1; |
1691 return; | 1609 return; |
1692 //} | 1610 //} |
1693 } | 1611 } |
1694 } | 1612 } |
1695 } | 1613 } |
1696 else | 1614 else |
1697 { | 1615 { |
1698 if ( pButton->uButtonType == 3 | 1616 if ( pButton->uButtonType == 3 |
1699 && (signed int)pX >= (signed int)pButton->uX | 1617 && pX >= pButton->uX && pX <= pButton->uZ |
1700 && (signed int)pX <= (signed int)pButton->uZ | 1618 && pY >= pButton->uY && pY <= pButton->uW ) |
1701 && (signed int)pY >= (signed int)pButton->uY | |
1702 && (signed int)pY <= (signed int)pButton->uW ) | |
1703 { | 1619 { |
1704 pPlayer = pPlayers[uActiveCharacter]; | 1620 v7 = (LOBYTE(pPlayers[uActiveCharacter]->pActiveSkills[pButton->msg_param]) & 0x3F) + 1; |
1705 v5 = LOBYTE(pPlayer->pActiveSkills[pButton->msg_param]); | 1621 if ( pPlayers[uActiveCharacter]->uSkillPoints < v7 ) |
1706 v6 = pPlayer->uSkillPoints; | 1622 sprintf(Str1, pGlobalTXT_LocalizationStrings[469], v7 - pPlayers[uActiveCharacter]->uSkillPoints);// "You need %d more Skill Points to advance here" |
1707 v7 = (v5 & 0x3F) + 1; | |
1708 if ( v6 < v7 ) | |
1709 { | |
1710 v41 = v7 - v6; | |
1711 v39 = pGlobalTXT_LocalizationStrings[469];// "You need %d more Skill Points to advance here" | |
1712 } | |
1713 else | 1623 else |
1714 { | 1624 sprintf(Str1, pGlobalTXT_LocalizationStrings[468], v7);// "Clicking here will spend %d Skill Points" |
1715 v41 = v7; | 1625 GameUI_SetFooterString(Str1); |
1716 v39 = pGlobalTXT_LocalizationStrings[468];// "Clicking here will spend %d Skill Points" | |
1717 } | |
1718 sprintf(Str1, v39, v41); | |
1719 v13 = Str1; | |
1720 GameUI_SetFooterString(v13); | |
1721 uLastPointedObjectID = 1; | 1626 uLastPointedObjectID = 1; |
1722 return; | 1627 return; |
1723 } | 1628 } |
1724 } | 1629 } |
1725 } | 1630 } |
1748 } | 1653 } |
1749 | 1654 |
1750 //----- (0044162D) -------------------------------------------------------- | 1655 //----- (0044162D) -------------------------------------------------------- |
1751 void GameUI_DrawPartySpells() | 1656 void GameUI_DrawPartySpells() |
1752 { | 1657 { |
1753 unsigned int v0; // ebp@1 | 1658 unsigned int v0; // ebp@1 |
1754 Texture *v7; // [sp-4h] [bp-1Ch]@12 | 1659 Texture *v7; // [sp-4h] [bp-1Ch]@12 |
1755 Texture *v9; // [sp-4h] [bp-1Ch]@21 | 1660 Texture *v9; // [sp-4h] [bp-1Ch]@21 |
1756 | 1661 |
1757 v0 = (signed __int64)((double)GetTickCount() * 0.050000001); | 1662 v0 = (signed __int64)((double)GetTickCount() * 0.050000001); |
1758 //v1 = 0; | 1663 //v1 = 0; |
1759 for (uint i = 0; i < 14; ++i) | 1664 for (uint i = 0; i < 14; ++i) |
1760 { | 1665 { |
1761 //v2 = byte_4E5DD8[v1]; | 1666 //v2 = byte_4E5DD8[v1]; |
1762 if (pParty->pPartyBuffs[byte_4E5DD8[i]].uExpireTime) | 1667 if (pParty->pPartyBuffs[byte_4E5DD8[i]].uExpireTime) |
1763 { | 1668 { |
1764 auto tex = pIcons_LOD->GetTexture(pTextureIDs_PartyBuffIcons[i]); | 1669 auto tex = pIcons_LOD->GetTexture(pTextureIDs_PartyBuffIcons[i]); |
1765 //v3 = pTextureIDs_PartyBuffIcons[i]; | 1670 //v3 = pTextureIDs_PartyBuffIcons[i]; |
1766 pRenderer->_4A65CC(pPartySpellbuffsUI_XYs[i][0], | 1671 pRenderer->_4A65CC(pPartySpellbuffsUI_XYs[i][0], |
1767 pPartySpellbuffsUI_XYs[i][1], tex, tex, | 1672 pPartySpellbuffsUI_XYs[i][1], tex, tex, |
1768 v0 + 20 * pPartySpellbuffsUI_smthns[i], 0, 63); | 1673 v0 + 20 * pPartySpellbuffsUI_smthns[i], 0, 63); |
1769 } | 1674 } |
1770 //++v1; | 1675 //++v1; |
1771 } | 1676 } |
1772 //while ( v1 < 14 ); | 1677 //while ( v1 < 14 ); |
1773 | 1678 if (pCurrentScreen == SCREEN_GAME || pCurrentScreen == SCREEN_NPC_DIALOGUE) |
1774 if (pCurrentScreen == SCREEN_GAME || pCurrentScreen == SCREEN_NPC_DIALOGUE) | 1679 { |
1775 { | 1680 if (pParty->FlyActive()) |
1776 if (pParty->FlyActive()) | 1681 { |
1777 { | 1682 if ( pParty->bFlying ) |
1778 if ( pParty->bFlying ) | 1683 v7 = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_FlySpell, v0)->uTextureID); |
1779 v7 = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_FlySpell, v0)->uTextureID); | 1684 else |
1780 else | 1685 v7 = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_FlySpell, 0)->uTextureID); |
1781 v7 = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_FlySpell, 0)->uTextureID); | 1686 if ( pRenderer->pRenderD3D ) |
1782 if ( pRenderer->pRenderD3D ) | 1687 pRenderer->DrawTextureIndexed(8, 8, v7); |
1783 pRenderer->DrawTextureIndexed(8, 8, v7); | 1688 else |
1784 else | 1689 pRenderer->DrawTextureTransparent(8, 8, v7); |
1785 pRenderer->DrawTextureTransparent(8, 8, v7); | 1690 } |
1786 } | 1691 if ( pParty->WaterWalkActive() ) |
1787 if (pParty->WaterWalkActive()) | 1692 { |
1788 { | 1693 if ( pParty->uFlags & PARTY_FLAGS_1_STANDING_ON_WATER ) |
1789 if ( pParty->uFlags & PARTY_FLAGS_1_STANDING_ON_WATER) | 1694 v9 = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, v0)->uTextureID); |
1790 v9 = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, v0)->uTextureID); | 1695 else |
1791 else | 1696 v9 = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, 0)->uTextureID); |
1792 v9 = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, 0)->uTextureID); | 1697 if ( pRenderer->pRenderD3D ) |
1793 if ( pRenderer->pRenderD3D ) | 1698 pRenderer->DrawTextureIndexed(396, 8, v9); |
1794 pRenderer->DrawTextureIndexed(396u, 8u, v9); | 1699 else |
1795 else | 1700 pRenderer->DrawTextureTransparent(396, 8, v9); |
1796 pRenderer->DrawTextureTransparent(396u, 8u, v9); | 1701 } |
1797 } | 1702 } |
1798 } | 1703 for (uint i = 0; i < 4; ++i) |
1799 | 1704 { |
1800 for (uint i = 0; i < 4; ++i) | 1705 if ( pParty->pPlayers[i].pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].uExpireTime ) |
1801 { | 1706 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 427, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Hammerhands)); |
1802 auto player = pParty->pPlayers + i; | 1707 if ( pParty->pPlayers[i].pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime ) |
1803 | 1708 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 393, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Bless)); |
1804 if (player->pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].uExpireTime) | 1709 if ( pParty->pPlayers[i].pPlayerBuffs[PLAYER_BUFF_PRESERVATION].uExpireTime ) |
1805 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 427, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Hammerhands)); | 1710 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 410, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Preservation)); |
1806 if (player->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime) | 1711 if ( pParty->pPlayers[i].pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].uExpireTime ) |
1807 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 393, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Bless)); | 1712 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 444, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_PainReflection)); |
1808 if (player->pPlayerBuffs[PLAYER_BUFF_PRESERVATION].uExpireTime) | 1713 } |
1809 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 410, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Preservation)); | 1714 } |
1810 if (player->pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].uExpireTime) | |
1811 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 444, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_PainReflection)); | |
1812 } | |
1813 } | |
1814 | 1715 |
1815 //----- (004921C1) -------------------------------------------------------- | 1716 //----- (004921C1) -------------------------------------------------------- |
1816 void GameUI_DrawPortraits(unsigned int _this) | 1717 void GameUI_DrawPortraits(unsigned int _this) |
1817 { | 1718 { |
1818 Texture *pFace; // eax@10 | 1719 unsigned int face_expression_ID; // eax@17 |
1819 unsigned int v7; // eax@17 | |
1820 PlayerFrame *pFrame; // eax@21 | 1720 PlayerFrame *pFrame; // eax@21 |
1821 unsigned int v9; // eax@27 | 1721 int pTextureID; // eax@57 |
1822 bool v10; // eax@33 | |
1823 bool v11; // edi@40 | |
1824 bool v12; // edx@43 | |
1825 bool v13; // ecx@46 | |
1826 int v16; // eax@57 | |
1827 int v19; // eax@62 | |
1828 Texture *pPortrait; // [sp-4h] [bp-1Ch]@27 | 1722 Texture *pPortrait; // [sp-4h] [bp-1Ch]@27 |
1829 //unsigned int v22; // [sp+14h] [bp-4h]@1 | 1723 |
1830 | 1724 if ( qword_A750D8 ) |
1831 //v22 = _this; | 1725 { |
1832 if ( qword_A750D8 ) | 1726 qword_A750D8 -= (signed int)pMiscTimer->uTimeElapsed; |
1833 { | 1727 if ( qword_A750D8 <= 0 ) |
1834 qword_A750D8 -= (signed int)pMiscTimer->uTimeElapsed; | 1728 { |
1835 if ( qword_A750D8 <= 0 ) | 1729 if ( pPlayers[uSpeakingCharacter]->CanAct() ) |
1730 pPlayers[uSpeakingCharacter]->PlaySound(PlayerSpeechID, 0); | |
1731 qword_A750D8 = 0i64; | |
1732 } | |
1733 } | |
1734 | |
1735 for (uint i = 0; i < 4; ++i) | |
1736 { | |
1737 Player* pPlayer = &pParty->pPlayers[i]; | |
1738 if ( pPlayer->IsEradicated() ) | |
1739 { | |
1740 pPortrait = pTexture_PlayerFaceEradicated; | |
1741 if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime ) | |
1742 pRenderer->_4A6E7E(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 388, pPortrait); | |
1743 else | |
1744 pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1, 388, pPortrait); | |
1745 if ( pPlayer->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_7].uExpireTime | |
1746 | pPlayer->pPlayerBuffs[PLAYER_BUFF_8].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_13].uExpireTime | |
1747 | pPlayer->pPlayerBuffs[PLAYER_BUFF_14].uExpireTime ) | |
1748 sub_441A4E(i); | |
1749 continue; | |
1750 } | |
1751 if (pPlayer->IsDead()) | |
1752 { | |
1753 pPortrait = pTexture_PlayerFaceDead; | |
1754 if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime ) | |
1755 pRenderer->_4A6E7E(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 388, pPortrait); | |
1756 else | |
1757 pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1, 388, pPortrait); | |
1758 if ( pPlayer->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_7].uExpireTime | |
1759 | pPlayer->pPlayerBuffs[PLAYER_BUFF_8].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_13].uExpireTime | |
1760 | pPlayer->pPlayerBuffs[PLAYER_BUFF_14].uExpireTime ) | |
1761 sub_441A4E(i); | |
1762 continue; | |
1763 } | |
1764 face_expression_ID = 0; | |
1765 for ( uint j = 0; j < pPlayerFrameTable->uNumFrames; ++j ) | |
1766 if ( pPlayerFrameTable->pFrames[j].expression == pPlayer->expression ) | |
1767 { | |
1768 face_expression_ID = j; | |
1769 break; | |
1770 } | |
1771 if ( face_expression_ID == 0 ) | |
1772 face_expression_ID = 1; | |
1773 if (pPlayer->expression == CHARACTER_EXPRESSION_21) | |
1774 pFrame = pPlayerFrameTable->GetFrameBy_y(&pPlayer->_expression21_frameset, &pPlayer->_expression21_animtime, pMiscTimer->uTimeElapsed); | |
1775 else | |
1776 pFrame = pPlayerFrameTable->GetFrameBy_x(face_expression_ID, pPlayer->uExpressionTimePassed); | |
1777 if (pPlayer->field_1AA2 != pFrame->uTextureID - 1 || _this ) | |
1778 { | |
1779 pPlayer->field_1AA2 = pFrame->uTextureID - 1; | |
1780 pPortrait = (Texture *)pTextures_PlayerFaces[i][pPlayer->field_1AA2];//pFace = (Texture *)pTextures_PlayerFaces[i][pFrame->uTextureID]; | |
1781 if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime ) | |
1782 pRenderer->_4A6E7E(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i], 388, pPortrait); | |
1783 else | |
1784 pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 1, 388, pPortrait); | |
1785 if ( pPlayer->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_7].uExpireTime | |
1786 | pPlayer->pPlayerBuffs[PLAYER_BUFF_8].uExpireTime | pPlayer->pPlayerBuffs[PLAYER_BUFF_13].uExpireTime | |
1787 | pPlayer->pPlayerBuffs[PLAYER_BUFF_14].uExpireTime ) | |
1788 sub_441A4E(i); | |
1789 continue; | |
1790 } | |
1791 } | |
1792 if ( pParty->bTurnBasedModeOn == 1 ) | |
1793 { | |
1794 if ( pTurnEngine->turn_stage != 1 ) | |
1795 { | |
1796 if (PID_TYPE(pTurnEngine->pQueue[0].uPackedID) == OBJECT_Player) | |
1797 { | |
1798 if ( pTurnEngine->uActorQueueSize > 0 ) | |
1799 { | |
1800 for (uint i = 0; i < (uint)pTurnEngine->uActorQueueSize; ++i) | |
1801 { | |
1802 if (PID_TYPE(pTurnEngine->pQueue[i].uPackedID) != OBJECT_Player) | |
1803 break; | |
1804 pTextureID = dword_5079D0; | |
1805 if ( pParty->uFlags & 0x10 ) | |
1806 pTextureID = dword_5079CC; | |
1807 else | |
1836 { | 1808 { |
1837 if ( pPlayers[uSpeakingCharacter]->CanAct() ) | 1809 if ( pParty->uFlags & 0x20 ) |
1838 pPlayers[uSpeakingCharacter]->PlaySound(PlayerSpeechID, 0); | 1810 pTextureID = dword_5079C8; |
1839 qword_A750D8 = 0i64; | |
1840 } | 1811 } |
1841 } | 1812 pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[PID_ID(pTurnEngine->pQueue[i].uPackedID)] - 4, 385, pIcons_LOD->GetTexture(pTextureID)); |
1842 | 1813 } |
1814 } | |
1815 } | |
1816 } | |
1817 } | |
1818 else | |
1819 { | |
1843 for (uint i = 0; i < 4; ++i) | 1820 for (uint i = 0; i < 4; ++i) |
1844 { | 1821 { |
1845 Player* pPlayer = &pParty->pPlayers[i]; | 1822 if (pParty->pPlayers[i].CanAct() && !pParty->pPlayers[i].uTimeToRecovery) |
1846 | 1823 { |
1847 if (pPlayer->IsEradicated()) | 1824 pTextureID = dword_5079D0; |
1848 { | 1825 if ( pParty->uFlags & 0x10 ) |
1849 pFace = pTexture_PlayerFaceEradicated; | 1826 pTextureID = dword_5079CC; |
1850 pPortrait = pFace; | 1827 else |
1851 v9 = pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i]; | 1828 { |
1852 if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime ) | 1829 if ( pParty->uFlags & 0x20 ) |
1853 pRenderer->_4A6E7E(v9, 0x183u, pPortrait); | 1830 pTextureID = dword_5079C8; |
1854 else | 1831 } |
1855 pRenderer->DrawTextureTransparent(v9 + 1, 0x184u, pPortrait); | 1832 pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] - 4, 385, pIcons_LOD->GetTexture(pTextureID)); |
1856 auto _v1 = 0; | 1833 } |
1857 v10 = pPlayer->pPlayerBuffs[14].uExpireTime > 0; | 1834 } |
1858 if (pPlayer->pPlayerBuffs[1].uExpireTime > 0) | 1835 } |
1859 _v1 = 1; | 1836 } |
1860 v11 = pPlayer->pPlayerBuffs[8].uExpireTime > 0; | |
1861 v12 = pPlayer->pPlayerBuffs[7].uExpireTime > 0; | |
1862 v13 = pPlayer->pPlayerBuffs[13].uExpireTime > 0; | |
1863 if ( v13 | v12 | v11 | _v1 | v10 ) | |
1864 sub_441A4E(i); | |
1865 continue; | |
1866 } | |
1867 if (pPlayer->IsDead()) | |
1868 { | |
1869 pFace = pTexture_PlayerFaceDead; | |
1870 pPortrait = pFace; | |
1871 v9 = pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i]; | |
1872 if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime ) | |
1873 pRenderer->_4A6E7E(v9, 0x183u, pPortrait); | |
1874 else | |
1875 pRenderer->DrawTextureTransparent(v9 + 1, 0x184u, pPortrait); | |
1876 auto _v1 = 0; | |
1877 v10 = pPlayer->pPlayerBuffs[14].uExpireTime > 0; | |
1878 if (pPlayer->pPlayerBuffs[1].uExpireTime > 0) | |
1879 _v1 = 1; | |
1880 v11 = pPlayer->pPlayerBuffs[8].uExpireTime > 0; | |
1881 v12 = pPlayer->pPlayerBuffs[7].uExpireTime > 0; | |
1882 v13 = pPlayer->pPlayerBuffs[13].uExpireTime > 0; | |
1883 if ( v13 | v12 | v11 | _v1 | v10 ) | |
1884 sub_441A4E(i); | |
1885 continue; | |
1886 } | |
1887 v7 = 0; | |
1888 for (uint j = 0; j < pPlayerFrameTable->uNumFrames; ++j) | |
1889 if (pPlayerFrameTable->pFrames[j].expression == pPlayer->expression) | |
1890 { | |
1891 v7 = j; | |
1892 break; | |
1893 } | |
1894 if ( v7 == 0 ) | |
1895 v7 = 1; | |
1896 if (pPlayer->expression == CHARACTER_EXPRESSION_21) | |
1897 pFrame = pPlayerFrameTable->GetFrameBy_y(&pPlayer->_expression21_frameset, &pPlayer->_expression21_animtime, pMiscTimer->uTimeElapsed); | |
1898 else | |
1899 pFrame = pPlayerFrameTable->GetFrameBy_x(v7, pPlayer->uExpressionTimePassed); | |
1900 if (pPlayer->field_1AA2 != pFrame->uTextureID - 1 || _this ) | |
1901 { | |
1902 pPlayer->field_1AA2 = pFrame->uTextureID - 1; | |
1903 pFace = (Texture *)pTextures_PlayerFaces[i][pPlayer->field_1AA2];//pFace = (Texture *)pTextures_PlayerFaces[i][pFrame->uTextureID]; | |
1904 pPortrait = pFace; | |
1905 v9 = pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i]; | |
1906 if ( pParty->pPartyBuffs[PARTY_BUFF_INVISIBILITY].uExpireTime ) | |
1907 pRenderer->_4A6E7E(v9, 0x183u, pPortrait); | |
1908 else | |
1909 pRenderer->DrawTextureTransparent(v9 + 1, 0x184u, pPortrait); | |
1910 auto _v1 = 0; | |
1911 v10 = pPlayer->pPlayerBuffs[14].uExpireTime > 0; | |
1912 if (pPlayer->pPlayerBuffs[1].uExpireTime > 0) | |
1913 _v1 = 1; | |
1914 v11 = pPlayer->pPlayerBuffs[8].uExpireTime > 0; | |
1915 v12 = pPlayer->pPlayerBuffs[7].uExpireTime > 0; | |
1916 v13 = pPlayer->pPlayerBuffs[13].uExpireTime > 0; | |
1917 if ( v13 | v12 | v11 | _v1 | v10 ) | |
1918 sub_441A4E(i); | |
1919 continue; | |
1920 } | |
1921 } | |
1922 if ( pParty->bTurnBasedModeOn == 1 ) | |
1923 { | |
1924 if ( pTurnEngine->turn_stage != 1 ) | |
1925 { | |
1926 if (PID_TYPE(pTurnEngine->pQueue[0].uPackedID) == OBJECT_Player) | |
1927 { | |
1928 //v14 = 0; | |
1929 if ( pTurnEngine->uActorQueueSize > 0 ) | |
1930 { | |
1931 //v15 = (char *)pTurnEngine->pQueue; | |
1932 for (uint i = 0; i < pTurnEngine->uActorQueueSize; ++i) | |
1933 { | |
1934 auto pElem = pTurnEngine->pQueue + i; | |
1935 | |
1936 if (PID_TYPE(pElem->uPackedID) != OBJECT_Player) | |
1937 break; | |
1938 v16 = dword_5079D0; | |
1939 if ( pParty->uFlags & 0x10 ) | |
1940 { | |
1941 v16 = dword_5079CC; | |
1942 } | |
1943 else | |
1944 { | |
1945 if ( pParty->uFlags & 0x20 ) | |
1946 v16 = dword_5079C8; | |
1947 } | |
1948 pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[PID_ID(pElem->uPackedID)] - 4, 0x181u, pIcons_LOD->GetTexture(v16)); | |
1949 } | |
1950 } | |
1951 } | |
1952 } | |
1953 } | |
1954 else | |
1955 { | |
1956 for (uint i = 0; i < 4; ++i) | |
1957 { | |
1958 auto pPlayer = pParty->pPlayers + i; | |
1959 if (pPlayer->CanAct() && !pPlayer->uTimeToRecovery) | |
1960 { | |
1961 v19 = dword_5079D0; | |
1962 if ( pParty->uFlags & 0x10 ) | |
1963 { | |
1964 v19 = dword_5079CC; | |
1965 } | |
1966 else | |
1967 { | |
1968 if ( pParty->uFlags & 0x20 ) | |
1969 v19 = dword_5079C8; | |
1970 } | |
1971 pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] - 4, 0x181u, pIcons_LOD->GetTexture(v19)); | |
1972 } | |
1973 } | |
1974 } | |
1975 } | |
1976 | 1837 |
1977 //----- (00441D38) -------------------------------------------------------- | 1838 //----- (00441D38) -------------------------------------------------------- |
1978 void GameUI_DrawMinimap(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW, unsigned int uZoom, unsigned int bRedrawOdmMinimap) | 1839 void GameUI_DrawMinimap(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW, unsigned int uZoom, unsigned int bRedrawOdmMinimap) |
1979 { | 1840 { |
1980 int uHeight; // ebx@6 | 1841 int uHeight; // ebx@6 |
1981 unsigned int v14; // ebx@23 | 1842 unsigned int pW; // ebx@23 |
1982 int v15; // eax@23 | 1843 int v15; // eax@23 |
1983 __int16 v17; // di@30 | |
1984 double v20; // st7@30 | 1844 double v20; // st7@30 |
1985 signed int v27; // eax@37 | 1845 signed int v27; // eax@37 |
1986 unsigned __int16 *v28; // ecx@37 | 1846 unsigned __int16 *v28; // ecx@37 |
1987 signed int v29; // edi@40 | 1847 signed int v29; // edi@40 |
1988 int pObject_X; // edi@72 | 1848 int pPoint_X; // edi@72 |
1989 int pObject_Y; // ebx@72 | 1849 int pPoint_Y; // ebx@72 |
1990 int pActor_X; // edi@91 | |
1991 int pActor_Y; // ebx@91 | |
1992 int pDecoration_X; // edi@108 | |
1993 int pDecoration_Y; // eax@108 | |
1994 unsigned int lPitch; // [sp+20h] [bp-34h]@1 | 1850 unsigned int lPitch; // [sp+20h] [bp-34h]@1 |
1995 unsigned int lPitcha; // [sp+20h] [bp-34h]@23 | 1851 unsigned int pY; // [sp+20h] [bp-34h]@23 |
1996 unsigned int v69; // [sp+24h] [bp-30h]@23 | 1852 unsigned int pX; // [sp+24h] [bp-30h]@23 |
1997 signed int v70; // [sp+24h] [bp-30h]@37 | 1853 signed int v70; // [sp+24h] [bp-30h]@37 |
1998 signed int uBluea; // [sp+28h] [bp-2Ch]@37 | 1854 signed int uBluea; // [sp+28h] [bp-2Ch]@37 |
1999 int v73; // [sp+2Ch] [bp-28h]@30 | 1855 int v73; // [sp+2Ch] [bp-28h]@30 |
2000 signed int uCenterY; // [sp+48h] [bp-Ch]@1 | 1856 signed int uCenterY; // [sp+48h] [bp-Ch]@1 |
2001 signed int uCenterX; // [sp+4Ch] [bp-8h]@1 | 1857 signed int uCenterX; // [sp+4Ch] [bp-8h]@1 |
2002 signed int uWidth; // [sp+5Ch] [bp+8h]@30 | 1858 signed int uWidth; // [sp+5Ch] [bp+8h]@30 |
2003 unsigned int uWa; // [sp+60h] [bp+Ch]@23 | 1859 unsigned int pZ; // [sp+60h] [bp+Ch]@23 |
2004 float uWb; // [sp+60h] [bp+Ch]@30 | 1860 float uWb; // [sp+60h] [bp+Ch]@30 |
2005 unsigned int uWd; // [sp+60h] [bp+Ch]@95 | |
2006 unsigned int pColor; | 1861 unsigned int pColor; |
2007 | 1862 |
2008 uCenterX = (uX + uZ) / 2; | 1863 uCenterX = (uX + uZ) / 2; |
2009 uCenterY = (uY + uW) / 2; | 1864 uCenterY = (uY + uW) / 2; |
2010 lPitch = pRenderer->uTargetSurfacePitch; | 1865 lPitch = pRenderer->uTargetSurfacePitch; |
2025 uHeight = uW - uY; | 1880 uHeight = uW - uY; |
2026 uWidth = uZ - uX; | 1881 uWidth = uZ - uX; |
2027 | 1882 |
2028 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | 1883 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) |
2029 { | 1884 { |
2030 v17 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2; | |
2031 auto pMapLod0 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pLevelOfDetail0_prolly_alpha_mask; | 1885 auto pMapLod0 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pLevelOfDetail0_prolly_alpha_mask; |
2032 auto pPal = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pPalette16; | 1886 auto pPal = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pPalette16; |
2033 v73 = (1 << (v17 + 16)) / (signed int)uZoom; | 1887 v73 = (1 << (pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2 + 16)) / (signed int)uZoom; |
2034 v20 = (double)(pParty->vPosition.x + 32768) / (double)(1 << (16 - v17)); | 1888 v20 = (double)(pParty->vPosition.x + 32768) / (double)(1 << (16 - pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2)); |
2035 uWb = (double)(32768 - pParty->vPosition.y) / (double)(1 << (16 - v17)); | 1889 uWb = (double)(32768 - pParty->vPosition.y) / (double)(1 << (16 - pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2)); |
2036 switch (uZoom) | 1890 switch (uZoom) |
2037 { | 1891 { |
2038 case 512: | 1892 case 512: |
2039 { | 1893 { |
2040 v20 = v20 - (double)(uWidth / 2); | 1894 v20 = v20 - (double)(uWidth / 2); |
2098 else// uCurrentlyLoadedLevelType == LEVEL_Indoor | 1952 else// uCurrentlyLoadedLevelType == LEVEL_Indoor |
2099 { | 1953 { |
2100 pRenderer->FillRectFast(uX, uY, uZ - uX, uHeight, 0xF); | 1954 pRenderer->FillRectFast(uX, uY, uZ - uX, uHeight, 0xF); |
2101 uNumBlueFacesInBLVMinimap = 0; | 1955 uNumBlueFacesInBLVMinimap = 0; |
2102 | 1956 |
2103 for (uint i = 0; i < pIndoor->pMapOutlines->uNumOutlines; ++i) | 1957 for (uint i = 0; i < (uint)pIndoor->pMapOutlines->uNumOutlines; ++i) |
2104 { | 1958 { |
2105 auto pOutline = &pIndoor->pMapOutlines->pOutlines[i]; | 1959 auto pOutline = &pIndoor->pMapOutlines->pOutlines[i]; |
2106 auto pFace1 = pIndoor->pFaces + pOutline->uFace1ID; | 1960 auto pFace1 = pIndoor->pFaces + pOutline->uFace1ID; |
2107 auto pFace2 = pIndoor->pFaces + pOutline->uFace2ID; | 1961 auto pFace2 = pIndoor->pFaces + pOutline->uFace2ID; |
2108 //v9 = pIndoor->pFaces[pMapVertex->uFace1ID].uAttributes; | 1962 //v9 = pIndoor->pFaces[pMapVertex->uFace1ID].uAttributes; |
2109 //v10 = pIndoor->pFaces[pMapVertex->uFace2ID].uAttributes; | 1963 //v10 = pIndoor->pFaces[pMapVertex->uFace2ID].uAttributes; |
2110 if (pFace1->Visible() && pFace2->Visible()) | 1964 if (pFace1->Visible() && pFace2->Visible()) |
2111 { | 1965 { |
2112 //v11 = pOutline->uFlags; | |
2113 if ( pOutline->uFlags & 1 ) | 1966 if ( pOutline->uFlags & 1 ) |
2114 goto LABEL_15; | 1967 goto LABEL_15; |
2115 if (pFace1->uAttributes & 0x80 || pFace2->uAttributes & 0x80) | 1968 if (pFace1->uAttributes & 0x80 || pFace2->uAttributes & 0x80) |
2116 goto LABEL_ABC; | 1969 goto LABEL_ABC; |
2117 } | 1970 } |
2133 else | 1986 else |
2134 { | 1987 { |
2135 auto _a = (uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x); | 1988 auto _a = (uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x); |
2136 auto _b = ((unsigned int)((unsigned __int64)_a >> 16) << 16); | 1989 auto _b = ((unsigned int)((unsigned __int64)_a >> 16) << 16); |
2137 auto _c = ((signed int)(_b - uZoom * pParty->vPosition.x) >> 16); | 1990 auto _c = ((signed int)(_b - uZoom * pParty->vPosition.x) >> 16); |
2138 //v69 = uCenterX + _c; | 1991 pX = uCenterX + ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x) >> 16) << 16) - uZoom * pParty->vPosition.x) >> 16); |
2139 v69 = uCenterX + ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x) >> 16) << 16) - uZoom * pParty->vPosition.x) >> 16); | 1992 pY = uCenterY - ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].y) >> 16) << 16) - uZoom * pParty->vPosition.y) >> 16); |
2140 lPitcha = uCenterY - ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].y) >> 16) << 16) - uZoom * pParty->vPosition.y) >> 16); | 1993 pZ = uCenterX + ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].x) >> 16) << 16) - uZoom * pParty->vPosition.x) >> 16); |
2141 uWa = uCenterX + ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].x) >> 16) << 16) - uZoom * pParty->vPosition.x) >> 16); | 1994 pW = uCenterY - ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].y) >> 16) << 16) - uZoom * pParty->vPosition.y) >> 16); |
2142 v14 = uCenterY - ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].y) >> 16) << 16) - uZoom * pParty->vPosition.y) >> 16); | |
2143 v15 = abs(pOutline->sZ - pParty->vPosition.z) / 8; | 1995 v15 = abs(pOutline->sZ - pParty->vPosition.z) / 8; |
2144 if ( v15 > 100 ) | 1996 if ( v15 > 100 ) |
2145 v15 = 100; | 1997 v15 = 100; |
2146 pRenderer->RasterLine2D(v69, lPitcha, uWa, v14, viewparams->pPalette[-v15 + 200]); | 1998 pRenderer->RasterLine2D(pX, pY, pZ, pW, viewparams->pPalette[-v15 + 200]); |
2147 } | 1999 } |
2148 } | 2000 } |
2149 | 2001 |
2150 for (uint i = 0; i < uNumBlueFacesInBLVMinimap; ++i) | 2002 for (uint i = 0; i < uNumBlueFacesInBLVMinimap; ++i) |
2151 { | 2003 { |
2152 auto pOutline = &pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[i]]; | 2004 auto pOutline = &pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[i]]; |
2153 pRenderer->RasterLine2D(uCenterX + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x) >> 16) << 16) - uZoom * pParty->vPosition.x) >> 16), | 2005 pX = uCenterX + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x) >> 16) << 16) - uZoom * pParty->vPosition.x) >> 16); |
2154 uCenterY - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].y) >> 16) << 16) - uZoom * pParty->vPosition.y) >> 16), | 2006 pY = uCenterY - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].y) >> 16) << 16) - uZoom * pParty->vPosition.y) >> 16); |
2155 uCenterX + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].x) >> 16) << 16) - uZoom * pParty->vPosition.x) >> 16), | 2007 pZ = uCenterX + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].x) >> 16) << 16) - uZoom * pParty->vPosition.x) >> 16); |
2156 uCenterY - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].y) >> 16) << 16) - uZoom * pParty->vPosition.y) >> 16), | 2008 pW = uCenterY - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].y) >> 16) << 16) - uZoom * pParty->vPosition.y) >> 16); |
2157 ui_game_minimap_outline_color); | 2009 pRenderer->RasterLine2D(pX, pY, pZ, pW, ui_game_minimap_outline_color); |
2158 } | 2010 } |
2159 } | 2011 } |
2160 | 2012 |
2161 assert(pParty->sRotationY >= 0); | 2013 //draw arrow on the minimap(include. Ritor1) |
2162 float angle = (pParty->sRotationY % 2048) / 2048.0f; | 2014 uint arrow_idx; |
2163 const float two_pi = 2.0f * 3.14159f; | 2015 unsigned int rotate = pParty->sRotationY & stru_5C6E00->uDoublePiMask; |
2164 | 2016 if ( (signed int)rotate <= 1920 ) |
2165 uint arrow_idx = floorf(0.5f + 7 * angle); | 2017 arrow_idx = 6; |
2166 pRenderer->DrawTextureTransparent(uCenterX - 3, uCenterY - 3, pIcons_LOD->GetTexture(pTextureIDs_pMapDirs[arrow_idx])); | 2018 if ( (signed int)rotate < 1664 ) |
2167 | 2019 arrow_idx = 5; |
2020 if ( (signed int)rotate <= 1408 ) | |
2021 arrow_idx = 4; | |
2022 if ( (signed int)rotate < 1152 ) | |
2023 arrow_idx = 3; | |
2024 if ( (signed int)rotate <= 896 ) | |
2025 arrow_idx = 2; | |
2026 if ( (signed int)rotate < 640 ) | |
2027 arrow_idx = 1; | |
2028 if ( (signed int)rotate <= 384 ) | |
2029 arrow_idx = 0; | |
2030 if ( (signed int)rotate < 128 || (signed int)rotate > 1920 ) | |
2031 arrow_idx = 7; | |
2032 pRenderer->DrawTextureTransparent(uCenterX - 3, uCenterY - 3, pIcons_LOD->GetTexture(pTextureIDs_pMapDirs[arrow_idx]));// | |
2033 | |
2034 //draw objects on the minimap | |
2168 if ( bWizardEyeActive ) | 2035 if ( bWizardEyeActive ) |
2169 { | 2036 { |
2170 if ( uWizardEyeSkillLevel >= 2 ) | 2037 if ( uWizardEyeSkillLevel >= 2 ) |
2171 { | 2038 { |
2172 for ( uint i = 0; i < uNumSpriteObjects; ++i ) | 2039 for ( uint i = 0; i < uNumSpriteObjects; ++i ) |
2173 { | 2040 { |
2174 if ( !pSpriteObjects[i].uType || !pSpriteObjects[i].uObjectDescID ) | 2041 if ( !pSpriteObjects[i].uType || !pSpriteObjects[i].uObjectDescID ) |
2175 continue; | 2042 continue; |
2176 //if (uWizardEyeSkillLevel == 1 | 2043 //if (uWizardEyeSkillLevel == 1 |
2177 pObject_X = uCenterX + ((unsigned __int64)((pSpriteObjects[i].vPosition.x - pParty->vPosition.x) * (signed __int64)uZoom) >> 16); | 2044 pPoint_X = uCenterX + ((unsigned __int64)((pSpriteObjects[i].vPosition.x - pParty->vPosition.x) * (signed __int64)uZoom) >> 16); |
2178 pObject_Y = uCenterY - ((signed __int64)((pSpriteObjects[i].vPosition.y - pParty->vPosition.y) * (signed __int64)uZoom) >> 16); | 2045 pPoint_Y = uCenterY - ((signed __int64)((pSpriteObjects[i].vPosition.y - pParty->vPosition.y) * (signed __int64)uZoom) >> 16); |
2179 if ( pObject_X >= pRenderer->raster_clip_x && pObject_X <= pRenderer->raster_clip_z && | 2046 if ( pPoint_X >= pRenderer->raster_clip_x && pPoint_X <= pRenderer->raster_clip_z && |
2180 pObject_Y >= pRenderer->raster_clip_y && pObject_Y <= pRenderer->raster_clip_w) | 2047 pPoint_Y >= pRenderer->raster_clip_y && pPoint_Y <= pRenderer->raster_clip_w) |
2181 { | 2048 { |
2182 if (pObjectList->pObjects[pSpriteObjects[i].uObjectDescID].uFlags & OBJECT_DESC_UNPICKABLE) | 2049 if (pObjectList->pObjects[pSpriteObjects[i].uObjectDescID].uFlags & OBJECT_DESC_UNPICKABLE) |
2183 { | 2050 { |
2184 pRenderer->RasterLine2D(pObject_X, pObject_Y, pObject_X, pObject_Y, ui_game_minimap_projectile_color); | 2051 pRenderer->RasterLine2D(pPoint_X, pPoint_Y, pPoint_X, pPoint_Y, ui_game_minimap_projectile_color); |
2185 } | 2052 } |
2186 else if ( uZoom > 512 ) | 2053 else if ( uZoom > 512 ) |
2187 { | 2054 { |
2188 pRenderer->RasterLine2D(pObject_X - 2, pObject_Y, pObject_X - 2, pObject_Y + 1, ui_game_minimap_treasure_color); | 2055 pRenderer->RasterLine2D(pPoint_X - 2, pPoint_Y, pPoint_X - 2, pPoint_Y + 1, ui_game_minimap_treasure_color); |
2189 pRenderer->RasterLine2D(pObject_X - 1, pObject_Y - 1, pObject_X - 1, pObject_Y + 1, ui_game_minimap_treasure_color); | 2056 pRenderer->RasterLine2D(pPoint_X - 1, pPoint_Y - 1, pPoint_X - 1, pPoint_Y + 1, ui_game_minimap_treasure_color); |
2190 pRenderer->RasterLine2D(pObject_X, pObject_Y - 2, pObject_X, pObject_Y + 1, ui_game_minimap_treasure_color); | 2057 pRenderer->RasterLine2D(pPoint_X, pPoint_Y - 2, pPoint_X, pPoint_Y + 1, ui_game_minimap_treasure_color); |
2191 pRenderer->RasterLine2D(pObject_X + 1, pObject_Y - 1, pObject_X + 1, pObject_Y + 1, ui_game_minimap_treasure_color); | 2058 pRenderer->RasterLine2D(pPoint_X + 1, pPoint_Y - 1, pPoint_X + 1, pPoint_Y + 1, ui_game_minimap_treasure_color); |
2192 pRenderer->RasterLine2D(pObject_X + 2, pObject_Y, pObject_X + 2, pObject_Y + 1, ui_game_minimap_treasure_color); | 2059 pRenderer->RasterLine2D(pPoint_X + 2, pPoint_Y, pPoint_X + 2, pPoint_Y + 1, ui_game_minimap_treasure_color); |
2193 } | 2060 } |
2194 else | 2061 else |
2195 { | 2062 { |
2196 pRenderer->RasterLine2D(pObject_X - 1, pObject_Y - 1, pObject_X - 1, pObject_Y, ui_game_minimap_treasure_color); | 2063 pRenderer->RasterLine2D(pPoint_X - 1, pPoint_Y - 1, pPoint_X - 1, pPoint_Y, ui_game_minimap_treasure_color); |
2197 pRenderer->RasterLine2D(pObject_X, pObject_Y - 1, pObject_X, pObject_Y, ui_game_minimap_treasure_color); | 2064 pRenderer->RasterLine2D(pPoint_X, pPoint_Y - 1, pPoint_X, pPoint_Y, ui_game_minimap_treasure_color); |
2198 } | 2065 } |
2199 } | 2066 } |
2200 } | 2067 } |
2201 } | 2068 } |
2202 for ( uint i = 0; i < uNumActors; ++i )//draw actors( ) | 2069 for ( uint i = 0; i < uNumActors; ++i )//draw actors( ) |
2203 { | 2070 { |
2204 if ( pActors[i].uAIState != Removed && pActors[i].uAIState != Disabled | 2071 if ( pActors[i].uAIState != Removed && pActors[i].uAIState != Disabled |
2205 && (pActors[i].uAIState == Dead || BYTE1(pActors[i].uAttributes) & 0x80) ) | 2072 && (pActors[i].uAIState == Dead || BYTE1(pActors[i].uAttributes) & 0x80) ) |
2206 { | 2073 { |
2207 pActor_X = uCenterX + ((unsigned __int64)(( pActors[i].vPosition.x - pParty->vPosition.x) * (signed __int64)(signed int)uZoom) >> 16); | 2074 pPoint_X = uCenterX + ((unsigned __int64)(( pActors[i].vPosition.x - pParty->vPosition.x) * (signed __int64)(signed int)uZoom) >> 16); |
2208 pActor_Y = uCenterY - ((unsigned __int64)(( pActors[i].vPosition.y - pParty->vPosition.y) * (signed __int64)(signed int)uZoom) >> 16); | 2075 pPoint_Y = uCenterY - ((unsigned __int64)(( pActors[i].vPosition.y - pParty->vPosition.y) * (signed __int64)(signed int)uZoom) >> 16); |
2209 if ( pActor_X >= pRenderer->raster_clip_x && pActor_X <= pRenderer->raster_clip_z | 2076 if ( pPoint_X >= pRenderer->raster_clip_x && pPoint_X <= pRenderer->raster_clip_z |
2210 && pActor_Y >= pRenderer->raster_clip_y && pActor_Y <= pRenderer->raster_clip_w ) | 2077 && pPoint_Y >= pRenderer->raster_clip_y && pPoint_Y <= pRenderer->raster_clip_w ) |
2211 { | 2078 { |
2212 pColor = ui_game_minimap_actor_friendly_color; | 2079 pColor = ui_game_minimap_actor_friendly_color; |
2213 if ( BYTE3(pActors[i].uAttributes) & 1 ) | 2080 if ( BYTE3(pActors[i].uAttributes) & 1 ) |
2214 pColor = ui_game_minimap_actor_hostile_color; | 2081 pColor = ui_game_minimap_actor_hostile_color; |
2215 if ( pActors[i].uAIState == Dead) | 2082 if ( pActors[i].uAIState == Dead) |
2216 pColor = ui_game_minimap_actor_corpse_color; | 2083 pColor = ui_game_minimap_actor_corpse_color; |
2217 if ( uZoom > 1024 ) | 2084 if ( uZoom > 1024 ) |
2218 { | 2085 { |
2219 pRenderer->RasterLine2D(pActor_X - 2, pActor_Y - 1, pActor_X - 2, pActor_Y + 1, pColor); | 2086 pRenderer->RasterLine2D(pPoint_X - 2, pPoint_Y - 1, pPoint_X - 2, pPoint_Y + 1, pColor); |
2220 pRenderer->RasterLine2D(pActor_X - 1, pActor_Y - 2, pActor_X - 1, pActor_Y + 2, pColor); | 2087 pRenderer->RasterLine2D(pPoint_X - 1, pPoint_Y - 2, pPoint_X - 1, pPoint_Y + 2, pColor); |
2221 pRenderer->RasterLine2D(pActor_X, pActor_Y - 2, pActor_X, pActor_Y + 2, pColor); | 2088 pRenderer->RasterLine2D(pPoint_X, pPoint_Y - 2, pPoint_X, pPoint_Y + 2, pColor); |
2222 pRenderer->RasterLine2D(pActor_X + 1, pActor_Y - 2, pActor_X + 1, pActor_Y + 2, pColor); | 2089 pRenderer->RasterLine2D(pPoint_X + 1, pPoint_Y - 2, pPoint_X + 1, pPoint_Y + 2, pColor); |
2223 pRenderer->RasterLine2D(pActor_X + 2, pActor_Y - 1, pActor_X + 2, pActor_Y + 1, pColor); | 2090 pRenderer->RasterLine2D(pPoint_X + 2, pPoint_Y - 1, pPoint_X + 2, pPoint_Y + 1, pColor); |
2224 } | 2091 } |
2225 else | 2092 else |
2226 { | 2093 { |
2227 pRenderer->RasterLine2D(pActor_X - 1, pActor_Y - 1, pActor_X - 1, pActor_Y, pColor); | 2094 pRenderer->RasterLine2D(pPoint_X - 1, pPoint_Y - 1, pPoint_X - 1, pPoint_Y, pColor); |
2228 pRenderer->RasterLine2D(pActor_X, pActor_Y - 1, pActor_X, pActor_Y, pColor); | 2095 pRenderer->RasterLine2D(pPoint_X, pPoint_Y - 1, pPoint_X, pPoint_Y, pColor); |
2229 } | 2096 } |
2230 } | 2097 } |
2231 } | 2098 } |
2232 } | 2099 } |
2233 for ( uint i = 0; i < (signed int)uNumLevelDecorations; ++i )//draw items( ) | 2100 for ( uint i = 0; i < (signed int)uNumLevelDecorations; ++i )//draw items( ) |
2234 { | 2101 { |
2235 if ( pLevelDecorations[i].uFlags & 8 ) | 2102 if ( pLevelDecorations[i].uFlags & 8 ) |
2236 { | 2103 { |
2237 pDecoration_X = uCenterX + ((unsigned __int64)((pLevelDecorations[i].vPosition.x - pParty->vPosition.x) * (signed __int64)(signed int)uZoom) >> 16); | 2104 pPoint_X = uCenterX + ((unsigned __int64)((pLevelDecorations[i].vPosition.x - pParty->vPosition.x) * (signed __int64)(signed int)uZoom) >> 16); |
2238 pDecoration_Y = uCenterY - ((unsigned __int64)((pLevelDecorations[i].vPosition.y - pParty->vPosition.y) * (signed __int64)(signed int)uZoom) >> 16); | 2105 pPoint_Y = uCenterY - ((unsigned __int64)((pLevelDecorations[i].vPosition.y - pParty->vPosition.y) * (signed __int64)(signed int)uZoom) >> 16); |
2239 if ( pDecoration_X >= pRenderer->raster_clip_x && pDecoration_X <= pRenderer->raster_clip_z | 2106 if ( pPoint_X >= pRenderer->raster_clip_x && pPoint_X <= pRenderer->raster_clip_z |
2240 && pDecoration_Y >= pRenderer->raster_clip_y && pDecoration_Y <= pRenderer->raster_clip_w ) | 2107 && pPoint_Y >= pRenderer->raster_clip_y && pPoint_Y <= pRenderer->raster_clip_w ) |
2241 { | 2108 { |
2242 if ( (signed int)uZoom > 512 ) | 2109 if ( (signed int)uZoom > 512 ) |
2243 { | 2110 { |
2244 pRenderer->RasterLine2D(pDecoration_X - 1, pDecoration_Y - 1, pDecoration_X - 1, pDecoration_Y + 1, ui_game_minimap_decoration_color_1); | 2111 pRenderer->RasterLine2D(pPoint_X - 1, pPoint_Y - 1, pPoint_X - 1, pPoint_Y + 1, ui_game_minimap_decoration_color_1); |
2245 pRenderer->RasterLine2D(pDecoration_X, pDecoration_Y - 1, pDecoration_X, pDecoration_Y + 1, ui_game_minimap_decoration_color_1); | 2112 pRenderer->RasterLine2D(pPoint_X, pPoint_Y - 1, pPoint_X, pPoint_Y + 1, ui_game_minimap_decoration_color_1); |
2246 pRenderer->RasterLine2D(pDecoration_X + 1, pDecoration_Y - 1, pDecoration_X + 1, pDecoration_Y + 1, ui_game_minimap_decoration_color_1); | 2113 pRenderer->RasterLine2D(pPoint_X + 1, pPoint_Y - 1, pPoint_X + 1, pPoint_Y + 1, ui_game_minimap_decoration_color_1); |
2247 } | 2114 } |
2248 else | 2115 else |
2249 pRenderer->RasterLine2D(pDecoration_X, pDecoration_Y, pDecoration_X, pDecoration_Y, ui_game_minimap_decoration_color_1); | 2116 pRenderer->RasterLine2D(pPoint_X, pPoint_Y, pPoint_X, pPoint_Y, ui_game_minimap_decoration_color_1); |
2250 } | 2117 } |
2251 } | 2118 } |
2252 } | 2119 } |
2253 } | 2120 } |
2254 pRenderer->DrawTextureTransparent(468, 0, pIcons_LOD->GetTexture(uTextureID_Minimap_Loop));//draw minimap_loop | 2121 pRenderer->DrawTextureTransparent(468, 0, pIcons_LOD->GetTexture(uTextureID_Minimap_Loop));//draw minimap_loop |