comparison UI/UiGame.cpp @ 1523:53265d238d94

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