Mercurial > mm7
annotate UiGame.cpp @ 1004:eac5af72b614
UI cleans
author | Nomad |
---|---|
date | Thu, 16 May 2013 15:14:58 +0200 |
parents | 5876a9cafa3e |
children | 9ac94d00012e |
rev | line source |
---|---|
706 | 1 #include <assert.h> |
2 | |
3 #include "MM7.h" | |
4 | |
5 #include "MapInfo.h" | |
6 #include "Game.h" | |
7 #include "GUIWindow.h" | |
8 #include "GUIFont.h" | |
9 #include "GUIProgressBar.h" | |
10 #include "Party.h" | |
11 #include "AudioPlayer.h" | |
12 #include "Outdoor.h" | |
13 #include "IndoorCamera.h" | |
14 #include "Overlays.h" | |
15 #include "Monsters.h" | |
16 #include "Arcomage.h" | |
17 #include "LOD.h" | |
18 #include "Actor.h" | |
19 #include "Allocator.h" | |
20 #include "Events.h" | |
21 #include "Viewport.h" | |
22 #include "FrameTableInc.h" | |
23 #include "Math.h" | |
24 #include "SpriteObject.h" | |
25 #include "ObjectList.h" | |
26 #include "Chest.h" | |
27 #include "PaletteManager.h" | |
28 #include "DecorationList.h" | |
29 #include "PlayerFrameTable.h" | |
30 #include "SaveLoad.h" | |
31 #include "stru123.h" | |
32 #include "Time.h" | |
33 #include "IconFrameTable.h" | |
34 #include "Awards.h" | |
35 #include "Autonotes.h" | |
36 #include "stru160.h" | |
37 #include "TurnEngine.h" | |
924 | 38 #include "CastSpellInfo.h" |
706 | 39 #include "Weather.h" |
40 #include "stru298.h" | |
41 #include "StorylineTextTable.h" | |
42 #include "Events2D.h" | |
43 #include "texts.h" | |
747 | 44 #include "UIHouses.h" |
706 | 45 |
46 #include "mm7_data.h" | |
47 | |
48 | |
49 | |
50 | |
995 | 51 int uTextureID_GameUI_CharSelectionFrame; // 50C98C |
52 | |
991 | 53 |
1004 | 54 //----- (0041D3B7) -------------------------------------------------------- |
55 void GameUI_CharacterQuickRecord_Draw(GUIWindow *window, Player *player) | |
56 { | |
57 //Player *pPlayer; // esi@1 | |
58 int v6; // eax@5 | |
59 int v7; // ebx@5 | |
60 //unsigned int v8; // ecx@5 | |
61 int v9; // ebx@5 | |
62 //unsigned int v10; // eax@5 | |
63 //int v11; // eax@5 | |
64 //unsigned int v12; // ecx@5 | |
65 Texture *v13; // eax@6 | |
66 unsigned int v14; // eax@12 | |
67 PlayerFrame *v15; // eax@12 | |
68 //unsigned int v16; // eax@15 | |
69 unsigned int v20; // eax@15 | |
70 unsigned int v24; // eax@15 | |
71 unsigned int v25; // eax@15 | |
72 unsigned __int8 v28; // al@15 | |
73 char *v29; // eax@16 | |
74 __int64 v35; // ST38_8@22 | |
75 int v36; // esi@22 | |
76 unsigned int v38; // eax@22 | |
77 char *v39; // eax@24 | |
78 signed int uFramesetID; // [sp+20h] [bp-8h]@9 | |
79 int uFramesetIDa; // [sp+20h] [bp-8h]@18 | |
80 | |
81 uint numActivePlayerBuffs = 0; | |
82 for (uint i = 0; i < 24; ++i) | |
83 if (player->pPlayerBuffs[i].uExpireTime > 0) | |
84 ++numActivePlayerBuffs; | |
85 | |
86 v6 = pFontArrus->uFontHeight + 162; | |
87 v7 = (numActivePlayerBuffs - 1) * pFontArrus->uFontHeight; | |
88 v9 = v6 + v7; | |
89 window->uFrameHeight = v9; | |
90 window->uFrameZ = window->uFrameWidth + window->uFrameX - 1; | |
91 window->uFrameW = v9 + window->uFrameY - 1; | |
92 window->DrawMessageBox(0); | |
93 | |
94 if (player->Eradicated()) | |
95 v13 = pTexture_PlayerFaceEradicated; | |
96 else if (player->Dead()) | |
97 v13 = pTexture_PlayerFaceDead; | |
98 else | |
99 { | |
100 uFramesetID = pPlayerFrameTable->GetFrameIdByExpression(player->expression); | |
101 if ( !uFramesetID ) | |
102 uFramesetID = 1; | |
103 if ( player->expression == CHARACTER_EXPRESSION_21) | |
104 { | |
105 v15 = pPlayerFrameTable->GetFrameBy_y(&player->_expression21_frameset, &player->_expression21_animtime, pMiscTimer->uTimeElapsed); | |
106 } | |
107 else | |
108 { | |
109 v14 = pMiscTimer->Time(); | |
110 v15 = pPlayerFrameTable->GetFrameBy_x(uFramesetID, v14); | |
111 } | |
112 player->field_1AA2 = v15->uTextureID - 1; | |
113 v13 = pTextures_PlayerFaces[(unsigned int)window->ptr_1C][v15->uTextureID - 1]; | |
114 } | |
115 | |
116 pRenderer->DrawTextureTransparent(window->uFrameX + 24, window->uFrameY + 24, v13); | |
117 | |
118 sprintfex(pTmpBuf, "\f%05d", ui_character_header_text_color); | |
119 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[429], player->pName, pClassNames[player->classType]); // "%s the %s" | |
120 strcat(pTmpBuf, pTmpBuf2); | |
121 strcat(pTmpBuf, "\f00000\n"); | |
122 | |
123 v20 = UI_GetHealthManaStringColor(player->sHealth, player->GetMaxHealth()); | |
124 sprintf(pTmpBuf2, "%s : \f%05u%d\f00000 / %d\n", | |
125 pGlobalTXT_LocalizationStrings[108], // "Hit Points" | |
126 v20, player->sHealth, player->GetMaxHealth()); | |
127 strcat(pTmpBuf, pTmpBuf2); | |
128 | |
129 v24 = UI_GetHealthManaStringColor(player->sMana, player->GetMaxMana()); | |
130 sprintf(pTmpBuf2, "%s : \f%05u%d\f00000 / %d\n", | |
131 pGlobalTXT_LocalizationStrings[212], // "Spell Points" | |
132 v24, player->sMana, player->GetMaxMana()); | |
133 strcat(pTmpBuf, pTmpBuf2); | |
134 | |
135 v25 = player->GetMajorConditionIdx(); | |
136 sprintf(pTmpBuf2, "%s: \f%05d%s\f00000\n", | |
137 pGlobalTXT_LocalizationStrings[47], // "Condition | |
138 GetConditionDrawColor(v25), aCharacterConditionNames[v25]); | |
139 strcat(pTmpBuf, pTmpBuf2); | |
140 | |
141 v28 = player->uQuickSpell; | |
142 if ( v28 ) | |
143 v29 = pSpellStats->pInfos[v28].pShortName; | |
144 else | |
145 v29 = pGlobalTXT_LocalizationStrings[153]; | |
146 sprintfex(pTmpBuf2, "%s: %s", pGlobalTXT_LocalizationStrings[172], v29); // "Quick Spell" | |
147 strcat(pTmpBuf, pTmpBuf2); | |
148 | |
149 window->DrawText(pFontArrus, 120, 22, 0, pTmpBuf, 0, 0, 0); | |
150 | |
151 uFramesetIDa = 0; | |
152 for (uint i = 0; i < 24; ++i) | |
153 { | |
154 auto buff = player->pPlayerBuffs + i; | |
155 if (buff->uExpireTime > 0) | |
156 { | |
157 v35 = buff->uExpireTime - pParty->uTimePlayed; | |
158 v36 = uFramesetIDa++ * pFontComic->uFontHeight + 134; | |
159 v38 = ui_game_character_record_playerbuff_colors[i]; | |
160 window->DrawText(pFontComic, 52, v36, v38, aSpellNames[20 + i], 0, 0, 0); | |
161 sub_41D20D_buff_remaining_time_string(v36, window, v35, pFontComic); | |
162 } | |
163 } | |
164 | |
165 v39 = ""; | |
166 if ( uFramesetIDa == 0 ) | |
167 v39 = pGlobalTXT_LocalizationStrings[153]; // "None" | |
168 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[450], v39); // "Active Spells: %s" | |
169 window->DrawText(pFontArrus, 14, 114, 0, pTmpBuf, 0, 0, 0); | |
170 } | |
171 | |
172 | |
173 | |
991 | 174 //----- (0041A57E) -------------------------------------------------------- |
175 void GameUI_QuickRef_Draw() | |
176 { | |
994 | 177 //unsigned int v0; // ebx@1 |
991 | 178 //unsigned int v1; // eax@1 |
994 | 179 //Player *pPlayer; // ebp@2 |
180 //int v3; // eax@6 | |
181 //int v4; // edi@6 | |
991 | 182 unsigned int v5; // eax@7 |
183 unsigned int v6; // edi@9 | |
184 unsigned int v7; // edi@11 | |
994 | 185 //signed int v8; // eax@13 |
991 | 186 unsigned int v9; // eax@13 |
187 unsigned int v10; // edi@13 | |
994 | 188 //int v11; // eax@15 |
991 | 189 unsigned int v12; // eax@15 |
190 unsigned int v13; // edi@15 | |
994 | 191 //int v14; // eax@17 |
192 //int v15; // ST18_4@17 | |
193 //int v16; // ebx@17 | |
194 //int v17; // eax@17 | |
991 | 195 unsigned int v18; // eax@17 |
196 unsigned int v19; // edi@17 | |
994 | 197 //int v20; // eax@19 |
991 | 198 unsigned int v21; // edi@19 |
199 char *v22; // eax@21 | |
200 unsigned int v23; // edi@21 | |
994 | 201 //int v24; // eax@23 |
991 | 202 unsigned int v25; // edi@23 |
203 char *v26; // eax@25 | |
204 unsigned int v27; // edi@25 | |
205 int v28; // ecx@27 | |
206 char *v29; // eax@27 | |
207 signed int v30; // edx@27 | |
208 unsigned int v31; // edi@31 | |
209 unsigned int v32; // edi@33 | |
210 const char *v33; // ST10_4@35 | |
211 unsigned int v34; // eax@35 | |
212 unsigned int v35; // edi@35 | |
994 | 213 //unsigned __int8 v36; // al@37 |
991 | 214 char *v37; // eax@38 |
215 int v38; // eax@41 | |
216 signed int v39; // edi@42 | |
994 | 217 //char *v40; // eax@45 |
218 //unsigned int v41; // eax@45 | |
991 | 219 signed int v43; // [sp+10h] [bp-1Ch]@1 |
220 unsigned int v44; // [sp+14h] [bp-18h]@2 | |
221 int v45; // [sp+18h] [bp-14h]@1 | |
994 | 222 //unsigned int v46; // [sp+1Ch] [bp-10h]@1 |
223 //unsigned int v47; // [sp+20h] [bp-Ch]@1 | |
991 | 224 unsigned int v48; // [sp+24h] [bp-8h]@33 |
225 //unsigned int v49; // [sp+28h] [bp-4h]@1 | |
226 | |
994 | 227 //v0 = 0; |
228 //v47 = TargetColor(0xFFu, 0xFFu, 0x9Bu); | |
991 | 229 //v49 = TargetColor(0xFFu, 0, 0); |
994 | 230 //v46 = TargetColor(0, 0xFFu, 0); |
991 | 231 //v1 = pIcons_LOD->LoadTexture("quikref", TEXTURE_16BIT_PALETTE); |
994 | 232 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->LoadTexturePtr("quikref", TEXTURE_16BIT_PALETTE)); |
991 | 233 v43 = 0; |
234 v45 = LOBYTE(pFontArrus->uFontHeight) + 1; | |
235 do | |
994 | 236 { |
237 auto player = &pParty->pPlayers[v43]; | |
991 | 238 v44 = 94 * v43 + 89; |
994 | 239 if ( v43 == 0 ) |
240 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, 0x12u, 0, pGlobalTXT_LocalizationStrings[149], 60, 0);//Name | |
995 | 241 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 94 * v43 + 89, 0x12u, ui_character_header_text_color, player->pName, 84, 0); |
994 | 242 if ( v43 == 0 ) |
243 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, 0x2Fu, 0, pGlobalTXT_LocalizationStrings[131], 60, 0); //Óðîâ. | |
244 sprintf(pTmpBuf, "%lu", player->GetActualLevel()); | |
245 if ( player->GetActualLevel() <= player->GetBaseLevel()) | |
246 v5 = player->GetExperienceDisplayColor(); | |
991 | 247 else |
995 | 248 v5 = ui_character_bonus_text_color; |
994 | 249 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, 0x2Fu, v5, pTmpBuf, 84, 0); |
991 | 250 v6 = v45 + 47; |
994 | 251 if ( v43 == 0 ) |
252 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v45 + 47, 0, pGlobalTXT_LocalizationStrings[41], 60, 0);//Êëàññ | |
253 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v6, 0, pClassNames[player->classType], 84, 0); | |
991 | 254 v7 = v45 + v6; |
994 | 255 if ( v43 == 0 ) |
256 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v7, 0, pGlobalTXT_LocalizationStrings[107], 60, 0);//Çäîð. | |
257 sprintf(pTmpBuf, "%d", player->sHealth); | |
258 v9 = UI_GetHealthManaStringColor(player->sHealth, player->GetMaxHealth()); | |
259 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v7, v9, pTmpBuf, 84, 0); | |
991 | 260 v10 = v45 + v7; |
994 | 261 if ( v43 == 0 ) |
262 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v10, 0, pGlobalTXT_LocalizationStrings[209], 60, 0);//Ìàíà | |
263 sprintf(pTmpBuf, "%d", player->sMana); | |
264 v12 = UI_GetHealthManaStringColor(player->sMana, player->GetMaxMana()); | |
265 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v10, v12, pTmpBuf, 84, 0); | |
991 | 266 v13 = v45 + v10; |
994 | 267 if ( v43 == 0 ) |
268 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v13, 0, pGlobalTXT_LocalizationStrings[0], 60, 0);//Êëàññ áðîíè | |
269 sprintf(pTmpBuf, "%d", player->GetActualAC()); | |
270 v18 = UI_GetHealthManaStringColor(player->GetActualAC(), player->GetBaseAC()); | |
271 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v13, v18, pTmpBuf, 84, 0); | |
991 | 272 v19 = v45 + v13; |
273 if ( !v43 ) | |
274 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v19, 0, pGlobalTXT_LocalizationStrings[18], 60, 0);//Àòàêà | |
994 | 275 sprintf(pTmpBuf, "%+d", player->GetActualAttack(0)); |
991 | 276 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v19, 0, pTmpBuf, 84, 0); |
277 v21 = v45 + v19; | |
278 if ( !v43 ) | |
279 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v21, 0, pGlobalTXT_LocalizationStrings[66], 60, 0);//Ïîâð. | |
994 | 280 v22 = player->GetMeleeDamageString(); |
991 | 281 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v21, 0, v22, 84, 0); |
282 v23 = v45 + v21; | |
283 if ( !v43 ) | |
284 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v23, 0, pGlobalTXT_LocalizationStrings[203], 60, 0);// Ñòðåëÿòü | |
994 | 285 sprintf(pTmpBuf, "%+d", player->GetRangedAttack()); |
991 | 286 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v23, 0, pTmpBuf, 84, 0); |
287 v25 = v45 + v23; | |
288 if ( !v43 ) | |
289 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v25, 0, pGlobalTXT_LocalizationStrings[66], 60, 0);//Ïîâð. | |
994 | 290 v26 = player->GetRangedDamageString(); |
991 | 291 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v25, 0, v26, 84, 0); |
292 v27 = v45 + v25; | |
293 if ( !v43 ) | |
294 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v27, 0, pGlobalTXT_LocalizationStrings[205], 60, 0);//Íàâûêè | |
295 v28 = 0; | |
994 | 296 v29 = (char *)player->pActiveSkills; |
991 | 297 v30 = 36; |
298 do | |
299 { | |
300 if ( *(short *)v29 ) | |
301 ++v28; | |
302 v29 += 2; | |
303 --v30; | |
304 } | |
305 while ( v30 ); | |
306 sprintf(pTmpBuf, "%lu", v28); | |
307 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v27, 0, pTmpBuf, 84, 0); | |
308 v31 = v45 + v27; | |
309 if ( !v43 ) | |
310 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v31, 0, pGlobalTXT_LocalizationStrings[168], 60, 0);//Î÷êè | |
994 | 311 sprintf(pTmpBuf, "%lu", player->uSkillPoints); |
995 | 312 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v31, player->uSkillPoints ? ui_character_bonus_text_color : ui_character_default_text_color, pTmpBuf, 84, 0); |
991 | 313 v32 = v45 + v31; |
994 | 314 v48 = player->GetMajorConditionIdx(); |
991 | 315 if ( !v43 ) |
316 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v32, 0, pGlobalTXT_LocalizationStrings[45], 60, 0);//Ñîñò. | |
317 v33 = aCharacterConditionNames[v48]; | |
318 v34 = GetConditionDrawColor(v48); | |
319 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v32, v34, v33, 84, 0); | |
320 v35 = v45 + v32; | |
321 if ( !v43 ) | |
322 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v35, 0, pGlobalTXT_LocalizationStrings[170], 60, 0);//Á.Ïðèì. | |
994 | 323 if (player->uQuickSpell) |
324 v37 = pSpellStats->pInfos[player->uQuickSpell].pShortName; | |
991 | 325 else |
326 v37 = pGlobalTXT_LocalizationStrings[153];//Íåò | |
327 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v35, 0, v37, 84, 0); | |
328 ++v43; | |
329 } | |
330 while ( v43 < 4 ); | |
331 | |
332 v38 = GetPartyReputation(); | |
333 if ( v38 >= 0 ) | |
334 { | |
335 if ( v38 <= 5 ) | |
995 | 336 v39 = ui_character_default_text_color; |
991 | 337 else |
995 | 338 v39 = ui_character_bonus_text_color_neg; |
991 | 339 } |
340 else | |
995 | 341 v39 = ui_character_bonus_text_color; |
991 | 342 |
994 | 343 sprintf(pTmpBuf, "%s: \f%05d%s\f00000", pGlobalTXT_LocalizationStrings[180], v39, GetReputationString(v38));//Reputation |
991 | 344 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 22, 323, 0, pTmpBuf, 0, 0, 0); |
994 | 345 |
346 sprintf(pTmpBuf, "\r261%s: %d", pGlobalTXT_LocalizationStrings[84], pParty->GetPartyFame());// Fame Ñëàâà | |
991 | 347 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 0, 323, 0, pTmpBuf, 0, 0, 0); |
994 | 348 } |
349 | |
350 | |
991 | 351 |
706 | 352 //----- (0041AD6E) -------------------------------------------------------- |
994 | 353 void GameUI_DrawRightPanelItems() |
706 | 354 { |
355 if (GameUI_RightPanel_BookFlashTimer > pParty->uTimePlayed) | |
356 GameUI_RightPanel_BookFlashTimer = 0; | |
357 | |
358 if (pParty->uTimePlayed - GameUI_RightPanel_BookFlashTimer > 128) | |
359 { | |
360 GameUI_RightPanel_BookFlashTimer = pParty->uTimePlayed; | |
994 | 361 |
362 static bool byte_50697C = false; // 50697C | |
363 byte_50697C = !byte_50697C; | |
706 | 364 if ( byte_50697C && pCurrentScreen != SCREEN_REST ) |
365 { | |
994 | 366 if (bFlashQuestBook) pRenderer->DrawTextureTransparent(493, 355, pIcons_LOD->GetTexture(uTextureID_ib_td1_A)); |
367 if (bFlashAutonotesBook) pRenderer->DrawTextureTransparent(527, 353, pIcons_LOD->GetTexture(uTextureID_ib_td2_A)); | |
368 if (bFlashHistoryBook) pRenderer->DrawTextureTransparent(600, 361, pIcons_LOD->GetTexture(uTextureID_ib_td5_A)); | |
706 | 369 } |
370 else | |
371 { | |
994 | 372 pRenderer->DrawTextureRGB(468, 0, pTexture_RightFrame); |
373 GameUI_DrawHiredNPCs(); | |
706 | 374 } |
375 } | |
376 } | |
377 | |
378 //----- (0041AEBB) -------------------------------------------------------- | |
994 | 379 void GameUI_DrawFoodAndGold() |
706 | 380 { |
381 int v2; // esi@2 | |
382 | |
383 if ( uGameState != GAME_STATE_FINAL_WINDOW ) | |
384 { | |
385 v2 = sub_44100D() != 0 ? 381 : 322; | |
386 sprintf(pTmpBuf, "\r087%lu", pParty->uNumFoodRations); | |
387 pPrimaryWindow->DrawText(pFontSmallnum, 0, v2, uGameUIFontMain, pTmpBuf, 0, 0, uGameUIFontShadow); | |
388 sprintf(pTmpBuf, "\r028%lu", pParty->uNumGold); | |
389 pPrimaryWindow->DrawText(pFontSmallnum, 0, v2, uGameUIFontMain, pTmpBuf, 0, 0, uGameUIFontShadow); | |
390 } | |
391 } | |
392 | |
393 | |
394 //----- (0041B0C9) -------------------------------------------------------- | |
994 | 395 void GameUI_DrawLifeManaBars() |
706 | 396 { |
397 double v3; // st7@3 | |
398 double v7; // st7@25 | |
399 Texture *v9; // [sp-4h] [bp-30h]@10 | |
400 Texture *v10; // [sp+Ch] [bp-20h]@1 | |
994 | 401 |
402 | |
403 v10 = pIcons_LOD->GetTexture(uTextureID_BarBlue); | |
706 | 404 |
994 | 405 for (uint i = 0; i < 4; ++i) |
706 | 406 { |
994 | 407 auto player = pParty->pPlayers + i; |
408 | |
409 if (player->sHealth > 0) | |
706 | 410 { |
994 | 411 int v17 = 0; |
412 if (i == 2 || i == 3) | |
413 v17 = 2; | |
414 | |
415 v3 = (double)player->sHealth / (double)player->GetMaxHealth(); | |
416 if( v3 > 0.5 ) | |
417 { | |
418 if ( v3 > 1.0 ) | |
419 v3 = 1.0; | |
420 v9 = pIcons_LOD->GetTexture(uTextureID_BarGreen); | |
421 } | |
422 else if ( v3 > 0.25 ) | |
423 v9 = pIcons_LOD->GetTexture(uTextureID_BarYellow); | |
424 else if ( v3 > 0.0 ) | |
425 v9 = pIcons_LOD->GetTexture(uTextureID_BarRed); | |
426 | |
427 | |
706 | 428 if( v3 > 0.0 ) |
429 { | |
994 | 430 pRenderer->SetTextureClipRect(v17 + pHealthBarPos[i], |
431 (signed __int64)((1.0 - v3) * v9->uTextureHeight) + 402, | |
432 v17 + pHealthBarPos[i] + v9->uTextureWidth, | |
433 v9->uTextureHeight + 402); | |
434 | |
435 pRenderer->DrawTextureIndexed(v17 + pHealthBarPos[i], 402, v9); | |
727 | 436 pRenderer->ResetTextureClipRect(); |
706 | 437 } |
438 } | |
994 | 439 |
440 | |
441 if (player->sMana > 0) | |
706 | 442 { |
994 | 443 v7 = player->sMana / (double)player->GetMaxMana(); |
706 | 444 if ( v7 > 1.0 ) |
445 v7 = 1.0; | |
994 | 446 |
447 int v17 = 0; | |
448 if (i == 2) | |
449 v17 = 1; | |
450 | |
451 pRenderer->SetTextureClipRect(v17 + pManaBarPos[i], | |
452 (signed __int64)((1.0 - v7) * v10->uTextureHeight) + 402, | |
453 v17 + pManaBarPos[i] + v10->uTextureWidth, | |
454 v10->uTextureHeight + 402); | |
455 pRenderer->DrawTextureIndexed(v17 + pManaBarPos[i], 402, v10); | |
727 | 456 pRenderer->ResetTextureClipRect(); |
706 | 457 } |
458 } | |
459 } | |
460 | |
461 //----- (0041B3B6) -------------------------------------------------------- | |
994 | 462 void GameUI_DrawRightPanel() |
706 | 463 { |
994 | 464 pRenderer->DrawTextureTransparent(pViewport->uViewportBR_X, 0, |
465 pIcons_LOD->GetTexture(uTextureID_right_panel)); | |
706 | 466 } |
467 | |
468 //----- (0041B3E2) -------------------------------------------------------- | |
994 | 469 void GameUI_DrawRightPanelFrames() |
706 | 470 { |
994 | 471 pRenderer->DrawTextureRGB(0, 0, pTexture_TopFrame); |
472 pRenderer->DrawTextureRGB(0, 8, pTexture_LeftFrame); | |
473 pRenderer->DrawTextureRGB(468, 0, pTexture_RightFrame); | |
474 pRenderer->DrawTextureRGB(0, 352, pTexture_BottomFrame); | |
706 | 475 GameUI_DrawFoodAndGold(); |
476 GameUI_DrawRightPanelItems(); | |
477 } | |
478 | |
994 | 479 |
480 //----- (0041C047) -------------------------------------------------------- | |
481 void GameUI_Footer_2() | |
706 | 482 { |
994 | 483 char *v1; // edx@2 |
484 int v5; // eax@5 | |
706 | 485 |
994 | 486 pRenderer->DrawTextureRGB(0, 352, pTexture_StatusBar); |
487 if (GameUI_Footer_TimeLeft) | |
488 v1 = GameUI_Footer_TimedString; | |
489 else | |
706 | 490 { |
994 | 491 if (!pFooterString[0]) |
492 return; | |
493 v1 = pFooterString; | |
706 | 494 } |
994 | 495 |
496 v5 = pFontLucida->AlignText_Center(450, v1); | |
497 pPrimaryWindow->DrawText(pFontLucida, v5 + 11, 357, uGameUIFontMain, v1, 0, 0, uGameUIFontShadow); | |
706 | 498 } |
499 | |
500 //----- (0041C0B8) -------------------------------------------------------- | |
994 | 501 void GameUI_SetFooterString(const char *pStr) |
502 { | |
706 | 503 const char *v1; // esi@1 |
504 int i; // eax@7 | |
505 int j; // eax@11 | |
506 | |
507 v1 = pStr; | |
994 | 508 if ( pStr && strcmp(pStr, "test") && !IsBadStringPtrA(v1, 1) && (*v1 || GameUI_Footer_TimeLeft) ) |
706 | 509 { |
783 | 510 if ( GameUI_Footer_TimeLeft ) |
706 | 511 { |
783 | 512 for ( i = pFontLucida->GetLineWidth(GameUI_Footer_TimedString); |
706 | 513 i > 450; |
783 | 514 i = pFontLucida->GetLineWidth(GameUI_Footer_TimedString) ) |
515 byte_5C3427[strlen(GameUI_Footer_TimedString)] = 0; | |
706 | 516 } |
517 else | |
518 { | |
783 | 519 strcpy(pFooterString, v1); |
520 for ( j = pFontLucida->GetLineWidth(pFooterString); | |
706 | 521 j > 450; |
783 | 522 j = pFontLucida->GetLineWidth(pFooterString) ) |
523 GameUI_Footer_TimedString[strlen(pFooterString) + 199] = 0; | |
706 | 524 } |
525 } | |
526 } | |
527 | |
528 //----- (0041C179) -------------------------------------------------------- | |
783 | 529 void GameUI_Footer() |
530 { | |
994 | 531 //unsigned int v0; // ebp@1 |
706 | 532 char *v1; // edi@5 |
533 int v2; // eax@5 | |
534 unsigned int v3; // esi@5 | |
535 size_t v4; // eax@6 | |
536 GUIFont *v5; // ecx@6 | |
537 int v6; // eax@9 | |
538 size_t v7; // eax@10 | |
539 GUIFont *v8; // ecx@10 | |
540 char v9; // zf@12 | |
994 | 541 //unsigned int v10; // ST08_4@13 |
706 | 542 int v11; // eax@13 |
543 | |
783 | 544 if ( pFooterString[0] || GameUI_Footer_TimeLeft || bForceDrawFooter ) |
706 | 545 { |
546 pRenderer->DrawTextureRGB(0, 352u, pTexture_StatusBar); | |
783 | 547 if ( GameUI_Footer_TimeLeft ) |
706 | 548 { |
783 | 549 v1 = GameUI_Footer_TimedString; |
550 v2 = pFontLucida->GetLineWidth(GameUI_Footer_TimedString); | |
706 | 551 v3 = 450; |
552 while ( v2 > 450 ) | |
553 { | |
783 | 554 v4 = strlen(GameUI_Footer_TimedString); |
706 | 555 v5 = pFontLucida; |
556 byte_5C3427[v4] = 0; | |
783 | 557 v2 = pFontLucida->GetLineWidth(GameUI_Footer_TimedString); |
706 | 558 } |
559 } | |
560 else | |
561 { | |
783 | 562 v1 = pFooterString; |
563 v6 = pFontLucida->GetLineWidth(pFooterString); | |
706 | 564 v3 = 450; |
565 while ( v6 > 450 ) | |
566 { | |
783 | 567 v7 = strlen(pFooterString); |
706 | 568 v8 = pFontLucida; |
783 | 569 GameUI_Footer_TimedString[v7 + 199] = 0; |
570 v6 = pFontLucida->GetLineWidth(pFooterString); | |
706 | 571 } |
572 } | |
573 v9 = *v1 == 0; | |
783 | 574 bForceDrawFooter = 0; |
706 | 575 if ( !v9 ) |
576 { | |
577 v11 = pFontLucida->AlignText_Center(v3, v1); | |
994 | 578 pPrimaryWindow->DrawText(pFontLucida, v11 + 11, 357, uGameUIFontMain, v1, 0, 0, uGameUIFontShadow); |
706 | 579 } |
580 } | |
581 } | |
783 | 582 // 5C35BC: using guessed type int bForceDrawFooter; |
706 | 583 |
584 | |
585 //----- (00420EFF) -------------------------------------------------------- | |
586 void __cdecl GameUI_WritePointedObjectStatusString() | |
587 { | |
588 int v1; // ebx@6 | |
589 GUIWindow *pWindow; // edi@7 | |
590 GUIButton *pButton; // ecx@11 | |
591 Player *pPlayer; // eax@19 | |
592 char v5; // cl@19 | |
593 unsigned int v6; // eax@19 | |
594 int v7; // ecx@19 | |
595 __int16 v8; // fps@23 | |
596 unsigned __int8 v9; // c0@23 | |
597 unsigned __int8 v10; // c3@23 | |
598 enum UIMessageType pMessageType1; // esi@24 | |
832 | 599 //int v12; // edx@25 |
706 | 600 char *v13; // ecx@28 |
601 int v14; // eax@41 | |
602 ItemGen *pItemGen; // ecx@44 | |
603 int v16; // ecx@46 | |
604 const char *v17; // eax@49 | |
605 signed int v18; // eax@55 | |
867 | 606 signed int v18b; |
706 | 607 signed int v19; // ecx@63 |
608 BLVFace *pFace; // eax@69 | |
609 __int16 v21; // ax@70 | |
610 const char *v22; // eax@72 | |
611 LevelDecoration *v23; // ecx@75 | |
612 LevelDecoration *v24; // esi@75 | |
613 __int16 v25; // ax@75 | |
614 const char *v26; // ecx@79 | |
615 Actor *pActor; // ecx@82 | |
616 char *v28; // esi@82 | |
617 int v29; // eax@82 | |
618 signed int v30; // ecx@88 | |
619 const char *v31; // eax@91 | |
620 __int16 v32; // fps@109 | |
621 //unsigned __int8 v33; // c0@109 | |
622 //unsigned __int8 v34; // c3@109 | |
623 enum UIMessageType pMessageType2; // esi@110 | |
832 | 624 //int v36; // edx@111 |
706 | 625 enum UIMessageType pMessageType3; // edx@117 |
832 | 626 //int v38; // ecx@118 |
706 | 627 const char *v39; // [sp-8h] [bp-E8h]@20 |
628 char *v40; // [sp-8h] [bp-E8h]@83 | |
629 int v41; // [sp-4h] [bp-E4h]@20 | |
630 char Str1[200]; // [sp+Ch] [bp-D4h]@129 | |
631 unsigned int pX; // [sp+D4h] [bp-Ch]@1 | |
632 unsigned int pY; // [sp+D8h] [bp-8h]@1 | |
633 unsigned int v45; // [sp+DCh] [bp-4h]@21 | |
634 | |
635 v13 = nullptr; | |
636 | |
637 pMouse->uPointingObjectID = 0; | |
638 pMouse->GetClickPos(&pX, &pY); | |
639 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 ) | |
640 return; | |
641 if (pCurrentScreen == SCREEN_GAME) | |
642 { | |
643 if ( (signed int)pX > 467 || (signed int)pY > 351 ) | |
644 goto _click_on_game_ui; | |
871 | 645 if ( pRenderer->pRenderD3D ) // inlined mm8::4C1E01 |
706 | 646 { |
647 v18 = pGame->pVisInstance->get_picked_object_zbuf_val(); | |
648 if ( (signed int)pX < (signed int)pViewport->uScreen_TL_X | |
649 || (signed int)pX > (signed int)pViewport->uScreen_BR_X | |
650 || (signed int)pY < (signed int)pViewport->uScreen_TL_Y | |
651 || (signed int)pY > (signed int)pViewport->uScreen_BR_Y ) | |
652 v18 = -1; | |
653 if ( v18 == -1 ) | |
654 //goto LABEL_61; | |
655 { | |
656 pMouse->uPointingObjectID = 0; | |
657 if ( pMouse->uPointingObjectID == 0 ) | |
658 { | |
659 if ( uLastPointedObjectID != 0 ) | |
660 { | |
783 | 661 pFooterString[0] = 0; |
662 bForceDrawFooter = 1; | |
706 | 663 } |
664 } | |
665 uLastPointedObjectID = pMouse->uPointingObjectID; | |
666 return; | |
667 } | |
668 } | |
669 else | |
670 { | |
671 v18 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; | |
672 } | |
673 pMouse->uPointingObjectID = (unsigned __int16)v18; | |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
809
diff
changeset
|
674 v19 = (signed)PID_ID(v18); |
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
809
diff
changeset
|
675 if (PID_TYPE(v18) == OBJECT_Item) |
706 | 676 { |
677 v30 = v19; | |
678 if ( pObjectList->pObjects[pSpriteObjects[v30].uObjectDescID].uFlags & 0x10 ) | |
679 //goto LABEL_73; | |
680 { | |
681 pMouse->uPointingObjectID = 0; | |
682 //goto LABEL_50; | |
683 uLastPointedObjectID = 1; | |
684 if ( pMouse->uPointingObjectID == 0 ) | |
685 { | |
686 if ( uLastPointedObjectID != 0 ) | |
687 { | |
783 | 688 pFooterString[0] = 0; |
689 bForceDrawFooter = 1; | |
706 | 690 } |
691 } | |
692 uLastPointedObjectID = pMouse->uPointingObjectID; | |
693 return; | |
694 } | |
695 if ( v18 >= (signed int)0x2000000u || pParty->pPickedItem.uItemID ) | |
696 { | |
697 v22 = pSpriteObjects[v30].stru_24.GetDisplayName(); | |
698 //LABEL_93: | |
699 v26 = v22; | |
700 //goto LABEL_87; | |
994 | 701 GameUI_SetFooterString(v26); |
706 | 702 if ( pMouse->uPointingObjectID == 0 ) |
703 { | |
704 if ( uLastPointedObjectID != 0 ) | |
705 { | |
783 | 706 pFooterString[0] = 0; |
707 bForceDrawFooter = 1; | |
706 | 708 } |
709 } | |
710 uLastPointedObjectID = pMouse->uPointingObjectID; | |
711 return; | |
712 } | |
713 v31 = pSpriteObjects[v30].stru_24.GetDisplayName(); | |
714 v28 = pTmpBuf; | |
809 | 715 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[470], v31);// "Get %s" |
706 | 716 } |
717 else | |
718 { | |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
809
diff
changeset
|
719 if (PID_TYPE(v18) != OBJECT_Actor) |
706 | 720 { |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
809
diff
changeset
|
721 if (PID_TYPE(v18) == OBJECT_Decoration) |
706 | 722 { |
723 v23 = &pLevelDecorations[v19]; | |
724 v24 = v23; | |
725 v25 = v23->field_16_event_id; | |
726 if ( !v25 ) | |
727 { | |
728 if ( v23->IsInteractive() ) | |
729 v26 = pNPCTopics[stru_5E4C90._decor_events[v24->_idx_in_stru123 - 75] + 379].pTopic; | |
730 else | |
731 v26 = pDecorationList->pDecorations[v24->uDecorationDescID].field_20; | |
732 //goto LABEL_87; | |
994 | 733 GameUI_SetFooterString(v26); |
706 | 734 if ( pMouse->uPointingObjectID == 0 ) |
735 { | |
736 if ( uLastPointedObjectID != 0 ) | |
737 { | |
783 | 738 pFooterString[0] = 0; |
739 bForceDrawFooter = 1; | |
706 | 740 } |
741 } | |
742 uLastPointedObjectID = pMouse->uPointingObjectID; | |
743 return; | |
744 } | |
745 v22 = GetEventHintString(v25); | |
746 if ( !v22 ) | |
747 //goto _return; | |
748 { | |
749 if ( pMouse->uPointingObjectID == 0 ) | |
750 { | |
751 if ( uLastPointedObjectID != 0 ) | |
752 { | |
783 | 753 pFooterString[0] = 0; |
754 bForceDrawFooter = 1; | |
706 | 755 } |
756 } | |
757 uLastPointedObjectID = pMouse->uPointingObjectID; | |
758 return; | |
759 } | |
760 //goto LABEL_93; | |
761 v26 = v22; | |
762 //goto LABEL_87; | |
994 | 763 GameUI_SetFooterString(v26); |
706 | 764 if ( pMouse->uPointingObjectID == 0 ) |
765 { | |
766 if ( uLastPointedObjectID != 0 ) | |
767 { | |
783 | 768 pFooterString[0] = 0; |
769 bForceDrawFooter = 1; | |
706 | 770 } |
771 } | |
772 uLastPointedObjectID = pMouse->uPointingObjectID; | |
773 return; | |
774 } | |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
809
diff
changeset
|
775 if (PID_TYPE(v18) == OBJECT_BModel) |
706 | 776 { |
777 if ( v18 < (signed int)0x2000000u ) | |
778 { | |
779 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor) | |
780 { | |
867 | 781 v18b = (signed int)(unsigned __int16)v18 >> 9; |
782 v21 = pOutdoor->pBModels[v18b].pFaces[v19 & 0x3F].sCogTriggeredID; | |
706 | 783 //goto LABEL_71; |
784 if ( !v21 || (v22 = GetEventHintString(v21)) == 0 ) | |
785 //goto LABEL_73; | |
786 { | |
787 pMouse->uPointingObjectID = 0; | |
788 //goto LABEL_50; | |
789 uLastPointedObjectID = 1; | |
790 if ( pMouse->uPointingObjectID == 0 ) | |
791 { | |
792 if ( uLastPointedObjectID != 0 ) | |
793 { | |
783 | 794 pFooterString[0] = 0; |
795 bForceDrawFooter = 1; | |
706 | 796 } |
797 } | |
798 uLastPointedObjectID = pMouse->uPointingObjectID; | |
799 return; | |
800 } | |
801 //goto LABEL_93; | |
802 v26 = v22; | |
803 //goto LABEL_87; | |
994 | 804 GameUI_SetFooterString(v26); |
706 | 805 if ( pMouse->uPointingObjectID == 0 ) |
806 { | |
807 if ( uLastPointedObjectID != 0 ) | |
808 { | |
783 | 809 pFooterString[0] = 0; |
810 bForceDrawFooter = 1; | |
706 | 811 } |
812 } | |
813 uLastPointedObjectID = pMouse->uPointingObjectID; | |
814 return; | |
815 } | |
816 pFace = &pIndoor->pFaces[v19]; | |
817 if ( BYTE3(pFace->uAttributes) & 6 ) | |
818 { | |
819 v21 = pIndoor->pFaceExtras[pFace->uFaceExtraID].uEventID; | |
820 //LABEL_71: | |
821 if ( !v21 || (v22 = GetEventHintString(v21)) == 0 ) | |
822 //goto LABEL_73; | |
823 { | |
824 pMouse->uPointingObjectID = 0; | |
825 //goto LABEL_50; | |
826 uLastPointedObjectID = 1; | |
827 if ( pMouse->uPointingObjectID == 0 ) | |
828 { | |
829 if ( uLastPointedObjectID != 0 ) | |
830 { | |
783 | 831 pFooterString[0] = 0; |
832 bForceDrawFooter = 1; | |
706 | 833 } |
834 } | |
835 uLastPointedObjectID = pMouse->uPointingObjectID; | |
836 return; | |
837 } | |
838 //goto LABEL_93; | |
839 v26 = v22; | |
840 //goto LABEL_87; | |
994 | 841 GameUI_SetFooterString(v26); |
706 | 842 if ( pMouse->uPointingObjectID == 0 ) |
843 { | |
844 if ( uLastPointedObjectID != 0 ) | |
845 { | |
783 | 846 pFooterString[0] = 0; |
847 bForceDrawFooter = 1; | |
706 | 848 } |
849 } | |
850 uLastPointedObjectID = pMouse->uPointingObjectID; | |
851 return; | |
852 } | |
853 } | |
854 //LABEL_73: | |
855 pMouse->uPointingObjectID = 0; | |
856 //goto LABEL_50; | |
857 uLastPointedObjectID = 1; | |
858 if ( pMouse->uPointingObjectID == 0 ) | |
859 { | |
860 if ( uLastPointedObjectID != 0 ) | |
861 { | |
783 | 862 pFooterString[0] = 0; |
863 bForceDrawFooter = 1; | |
706 | 864 } |
865 } | |
866 uLastPointedObjectID = pMouse->uPointingObjectID; | |
867 return; | |
868 } | |
869 //LABEL_61: | |
870 pMouse->uPointingObjectID = 0; | |
871 //goto _return; | |
872 if ( pMouse->uPointingObjectID == 0 ) | |
873 { | |
874 if ( uLastPointedObjectID != 0 ) | |
875 { | |
783 | 876 pFooterString[0] = 0; |
877 bForceDrawFooter = 1; | |
706 | 878 } |
879 } | |
880 uLastPointedObjectID = pMouse->uPointingObjectID; | |
881 return; | |
882 } | |
883 if ( v18 >= 335544320 ) | |
884 //goto LABEL_61; | |
885 { | |
886 pMouse->uPointingObjectID = 0; | |
887 if ( pMouse->uPointingObjectID == 0 ) | |
888 { | |
889 if ( uLastPointedObjectID != 0 ) | |
890 { | |
783 | 891 pFooterString[0] = 0; |
892 bForceDrawFooter = 1; | |
706 | 893 } |
894 } | |
895 uLastPointedObjectID = pMouse->uPointingObjectID; | |
896 return; | |
897 } | |
898 pActor = &pActors[v19]; | |
899 v28 = pTmpBuf; | |
900 v29 = pActor->dword_000334_unique_name; | |
901 if ( v29 ) | |
902 v40 = pMonsterStats->pPlaceStrings[v29]; | |
903 else | |
904 v40 = pMonsterStats->pInfos[pActor->pMonsterInfo.uID].pName; | |
905 strncpy(pTmpBuf, v40, 0x7D0u); | |
906 } | |
907 v26 = v28; | |
908 //LABEL_87: | |
994 | 909 GameUI_SetFooterString(v26); |
706 | 910 //goto _return; |
911 if ( pMouse->uPointingObjectID == 0 ) | |
912 { | |
913 if ( uLastPointedObjectID != 0 ) | |
914 { | |
783 | 915 pFooterString[0] = 0; |
916 bForceDrawFooter = 1; | |
706 | 917 } |
918 } | |
919 uLastPointedObjectID = pMouse->uPointingObjectID; | |
920 return; | |
921 } | |
922 v1 = uNumVisibleWindows; | |
923 if ( uNumVisibleWindows > 0 ) | |
924 { | |
925 while ( 1 ) // some other fullscreen ui | |
926 { | |
927 pWindow = &pWindowList[pVisibleWindowsIdxs[v1] - 1]; | |
928 if ( (signed int)pX >= (signed int)pWindow->uFrameX | |
929 && (signed int)pX <= (signed int)pWindow->uFrameZ | |
930 && (signed int)pY >= (signed int)pWindow->uFrameY | |
931 && (signed int)pY <= (signed int)pWindow->uFrameW ) | |
932 { | |
933 for ( pButton = pWindow->pControlsHead; ; pButton = pButton->pNext ) | |
934 { | |
935 if ( !pButton ) | |
936 break; | |
937 if ( pButton->uButtonType == 1 ) | |
938 { | |
939 if ( (signed int)pX >= (signed int)pButton->uX | |
940 && (signed int)pX <= (signed int)pButton->uZ | |
941 && (signed int)pY >= (signed int)pButton->uY | |
942 && (signed int)pY <= (signed int)pButton->uW ) | |
943 { | |
944 //LABEL_24: | |
945 pMessageType1 = (UIMessageType)pButton->field_1C; | |
946 if ( pMessageType1 ) | |
947 { | |
832 | 948 pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0); |
706 | 949 } |
950 //LABEL_28: | |
951 v13 = pButton->pButtonName; | |
952 //_set_status_and_ret: | |
994 | 953 GameUI_SetFooterString(v13); |
706 | 954 //LABEL_131: |
955 uLastPointedObjectID = 1; | |
956 return; | |
957 } | |
958 } | |
959 else | |
960 { | |
961 if ( pButton->uButtonType == 2 ) | |
962 { | |
963 v45 = pX - pButton->uX; | |
964 v45 = pY - pButton->uY; | |
965 if ( (double)(signed int)pButton->uWidth != 0.0 ) | |
966 { | |
967 if ( (double)(signed int)pButton->uHeight != 0.0 ) | |
968 { | |
969 pMessageType1 = (UIMessageType)pButton->field_1C; | |
970 if ( pMessageType1 ) | |
971 { | |
832 | 972 pMessageQueue_50CBD0->AddMessage(pMessageType1, pButton->msg_param, 0); |
706 | 973 } |
974 v13 = pButton->pButtonName; | |
994 | 975 GameUI_SetFooterString(v13); |
706 | 976 uLastPointedObjectID = 1; |
977 return; | |
978 //} | |
979 } | |
980 } | |
981 } | |
982 else // click on skill | |
983 { | |
984 if ( pButton->uButtonType == 3 | |
985 && (signed int)pX >= (signed int)pButton->uX | |
986 && (signed int)pX <= (signed int)pButton->uZ | |
987 && (signed int)pY >= (signed int)pButton->uY | |
988 && (signed int)pY <= (signed int)pButton->uW ) | |
989 { | |
990 //LABEL_19: | |
991 pPlayer = pPlayers[uActiveCharacter]; | |
832 | 992 v5 = LOBYTE(pPlayer->pActiveSkills[pButton->msg_param]); |
706 | 993 v6 = pPlayer->uSkillPoints; |
994 v7 = (v5 & 0x3F) + 1; | |
995 if ( v6 < v7 ) | |
996 { | |
997 v41 = v7 - v6; | |
998 v39 = pGlobalTXT_LocalizationStrings[469];// "You need %d more Skill Points to advance here" | |
999 } | |
1000 else | |
1001 { | |
1002 v41 = v7; | |
1003 v39 = pGlobalTXT_LocalizationStrings[468];// "Clicking here will spend %d Skill Points" | |
1004 } | |
1005 sprintf(Str1, v39, v41); | |
1006 v13 = Str1; | |
1007 //goto _set_status_and_ret; | |
994 | 1008 GameUI_SetFooterString(v13); |
706 | 1009 uLastPointedObjectID = 1; |
1010 return; | |
1011 } | |
1012 } | |
1013 } | |
1014 } | |
1015 } | |
1016 if ( pWindow->uFrameHeight == 480 ) | |
1017 break; | |
1018 --v1; | |
1019 if ( v1 <= 0 ) | |
1020 { | |
1021 break; | |
1022 } | |
1023 } | |
1024 } | |
1025 if ( uNumVisibleWindows <= 0 || (uNumVisibleWindows > 0 && pWindow->uFrameHeight != 480 && v1 <= 0)) | |
1026 { | |
1027 if ( pCurrentScreen == SCREEN_CHEST ) | |
1028 { | |
1029 sub_42038D(); | |
1030 //goto _return; | |
1031 if ( pMouse->uPointingObjectID == 0 ) | |
1032 { | |
1033 if ( uLastPointedObjectID != 0 ) | |
1034 { | |
783 | 1035 pFooterString[0] = 0; |
1036 bForceDrawFooter = 1; | |
706 | 1037 } |
1038 } | |
1039 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1040 return; | |
1041 } | |
1042 if ( pCurrentScreen == SCREEN_HOUSE ) | |
1043 { | |
747 | 1044 if ( dialog_menu_id != HOUSE_DIALOGUE_SHOP_BUY_STANDARD |
706 | 1045 || (v16 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]], v16 == 0) |
1046 || v16 == -65536 ) | |
1047 //goto _return; | |
1048 { | |
1049 if ( pMouse->uPointingObjectID == 0 ) | |
1050 { | |
1051 if ( uLastPointedObjectID != 0 ) | |
1052 { | |
783 | 1053 pFooterString[0] = 0; |
1054 bForceDrawFooter = 1; | |
706 | 1055 } |
1056 } | |
1057 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1058 return; | |
1059 } | |
1060 pItemGen = (ItemGen *)((char *)&pParty->pPickedItem + 36 * (v16 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 4); | |
1061 //LABEL_49: | |
1062 v17 = pItemGen->GetDisplayName(); | |
994 | 1063 GameUI_SetFooterString(v17); |
706 | 1064 //LABEL_50: |
1065 uLastPointedObjectID = 1; | |
1066 //_return: | |
1067 if ( pMouse->uPointingObjectID == 0 ) | |
1068 { | |
1069 if ( uLastPointedObjectID != 0 ) | |
1070 { | |
783 | 1071 pFooterString[0] = 0; |
1072 bForceDrawFooter = 1; | |
706 | 1073 } |
1074 } | |
1075 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1076 return; | |
1077 } | |
1078 if ( (signed int)pY < 350 ) | |
1079 { | |
1080 v14 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; | |
1081 if ( v14 == 0 || v14 == -65536 || (unsigned int)v14 >= 0x1388 ) | |
1082 //goto _return; | |
1083 { | |
1084 if ( pMouse->uPointingObjectID == 0 ) | |
1085 { | |
1086 if ( uLastPointedObjectID != 0 ) | |
1087 { | |
783 | 1088 pFooterString[0] = 0; |
1089 bForceDrawFooter = 1; | |
706 | 1090 } |
1091 } | |
1092 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1093 return; | |
1094 } | |
1095 pItemGen = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItems[v14-1]; | |
1096 //goto LABEL_49; | |
1097 v17 = pItemGen->GetDisplayName(); | |
994 | 1098 GameUI_SetFooterString(v17); |
706 | 1099 uLastPointedObjectID = 1; |
1100 if ( pMouse->uPointingObjectID == 0 ) | |
1101 { | |
1102 if ( uLastPointedObjectID != 0 ) | |
1103 { | |
783 | 1104 pFooterString[0] = 0; |
1105 bForceDrawFooter = 1; | |
706 | 1106 } |
1107 } | |
1108 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1109 return; | |
1110 } | |
1111 _click_on_game_ui: | |
1112 if ( (signed int)pX >= (signed int)pWindowList[0].uFrameX | |
1113 && (signed int)pX <= (signed int)pWindowList[0].uFrameZ | |
1114 && (signed int)pY >= (signed int)pWindowList[0].uFrameY | |
1115 && (signed int)pY <= (signed int)pWindowList[0].uFrameW ) | |
1116 { | |
1117 for ( pButton = pWindowList[0].pControlsHead; pButton != (GUIButton *)0; pButton = pButton->pNext ) | |
1118 { | |
1119 if ( pButton->uButtonType == 1 ) | |
1120 { | |
1121 if ( (signed int)pX >= (signed int)pButton->uX | |
1122 && (signed int)pX <= (signed int)pButton->uZ | |
1123 && (signed int)pY >= (signed int)pButton->uY | |
1124 && (signed int)pY <= (signed int)pButton->uW ) | |
1125 { | |
1126 pMessageType3 = (UIMessageType)pButton->field_1C; | |
1127 if ( pMessageType3 == 0 ) // For books | |
1128 //goto LABEL_28; | |
1129 { | |
1130 v13 = pButton->pButtonName; | |
994 | 1131 GameUI_SetFooterString(v13); |
706 | 1132 uLastPointedObjectID = 1; |
1133 return; | |
1134 } | |
832 | 1135 |
1136 pMessageQueue_50CBD0->AddMessage(pMessageType3, pButton->msg_param, 0); | |
706 | 1137 //goto LABEL_131; |
1138 uLastPointedObjectID = 1; | |
1139 return; | |
1140 } | |
1141 } | |
1142 else | |
1143 { | |
1144 if ( pButton->uButtonType == 2 ) | |
1145 { | |
1146 v45 = pX - pButton->uX; | |
1147 v45 = pY - pButton->uY; | |
1148 | |
1149 if (pX >= pButton->uX && pX <= pButton->uZ && | |
1150 pY >= pButton->uY && pY <= pButton->uW) | |
1151 if ( (double)(signed int)pButton->uWidth != 0.0 ) | |
1152 { | |
1153 if ( (double)(signed int)pButton->uHeight != 0.0 ) | |
1154 { | |
1155 //UNDEF(v32); | |
1156 //if ( v33 | v34 ) | |
1157 //{ | |
1158 pMessageType2 = (UIMessageType)pButton->field_1C; | |
1159 if ( pMessageType2 != 0 ) | |
832 | 1160 pMessageQueue_50CBD0->AddMessage(pMessageType2, pButton->msg_param, 0); |
1161 | |
706 | 1162 //goto LABEL_28; |
1163 v13 = pButton->pButtonName; | |
994 | 1164 GameUI_SetFooterString(v13); |
706 | 1165 uLastPointedObjectID = 1; |
1166 return; | |
1167 //} | |
1168 } | |
1169 } | |
1170 } | |
1171 else | |
1172 { | |
1173 if ( pButton->uButtonType == 3 | |
1174 && (signed int)pX >= (signed int)pButton->uX | |
1175 && (signed int)pX <= (signed int)pButton->uZ | |
1176 && (signed int)pY >= (signed int)pButton->uY | |
1177 && (signed int)pY <= (signed int)pButton->uW ) | |
1178 //goto LABEL_19; | |
1179 { | |
1180 pPlayer = pPlayers[uActiveCharacter]; | |
832 | 1181 v5 = LOBYTE(pPlayer->pActiveSkills[pButton->msg_param]); |
706 | 1182 v6 = pPlayer->uSkillPoints; |
1183 v7 = (v5 & 0x3F) + 1; | |
1184 if ( v6 < v7 ) | |
1185 { | |
1186 v41 = v7 - v6; | |
1187 v39 = pGlobalTXT_LocalizationStrings[469];// "You need %d more Skill Points to advance here" | |
1188 } | |
1189 else | |
1190 { | |
1191 v41 = v7; | |
1192 v39 = pGlobalTXT_LocalizationStrings[468];// "Clicking here will spend %d Skill Points" | |
1193 } | |
1194 sprintf(Str1, v39, v41); | |
1195 v13 = Str1; | |
1196 //goto _set_status_and_ret; | |
994 | 1197 GameUI_SetFooterString(v13); |
706 | 1198 uLastPointedObjectID = 1; |
1199 return; | |
1200 } | |
1201 } | |
1202 } | |
1203 } | |
1204 } | |
1205 pMouse->uPointingObjectID = sub_46A99B(); | |
1206 //goto _return; | |
1207 if ( pMouse->uPointingObjectID == 0 ) | |
1208 { | |
1209 if ( uLastPointedObjectID != 0 ) | |
1210 { | |
783 | 1211 pFooterString[0] = 0; |
1212 bForceDrawFooter = 1; | |
706 | 1213 } |
1214 } | |
1215 uLastPointedObjectID = pMouse->uPointingObjectID; | |
1216 return; | |
1217 } | |
1218 } | |
1219 | |
1220 | |
1221 //----- (0044158F) -------------------------------------------------------- | |
995 | 1222 void GameUI_DrawCharacterSelectionFrame() |
920 | 1223 { |
1224 if ( uActiveCharacter ) | |
995 | 1225 pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[uActiveCharacter - 1] - 9, 380, |
1226 pIcons_LOD->GetTexture(uTextureID_GameUI_CharSelectionFrame)); | |
920 | 1227 } |
706 | 1228 |
1229 | |
1230 | |
1231 //----- (0044162D) -------------------------------------------------------- | |
995 | 1232 void GameUI_DrawPartySpells() |
1233 { | |
706 | 1234 unsigned int v0; // ebp@1 |
1235 //signed int v1; // edi@1 | |
1236 //int v2; // eax@2 | |
1237 //int v3; // ecx@5 | |
1238 //__int16 *v4; // ebx@25 | |
1239 //Player *v5; // edi@26 | |
1240 //unsigned int v6; // [sp-4h] [bp-1Ch]@11 | |
1241 Texture *v7; // [sp-4h] [bp-1Ch]@12 | |
1242 //unsigned int v8; // [sp-4h] [bp-1Ch]@20 | |
1243 Texture *v9; // [sp-4h] [bp-1Ch]@21 | |
1244 //Player **v10; // [sp+10h] [bp-8h]@25 | |
1245 | |
1246 v0 = (signed __int64)((double)GetTickCount() * 0.050000001); | |
1247 //v1 = 0; | |
1248 for (uint i = 0; i < 14; ++i) | |
1249 { | |
1250 //v2 = byte_4E5DD8[v1]; | |
1251 if (pParty->pPartyBuffs[byte_4E5DD8[i]].uExpireTime) | |
1252 { | |
1253 auto tex = pIcons_LOD->GetTexture(pTextureIDs_PartyBuffIcons[i]); | |
1254 //v3 = pTextureIDs_PartyBuffIcons[i]; | |
1255 pRenderer->_4A65CC(pPartySpellbuffsUI_XYs[i][0], | |
1256 pPartySpellbuffsUI_XYs[i][1], tex, tex, | |
1257 v0 + 20 * pPartySpellbuffsUI_smthns[i], 0, 63); | |
1258 } | |
1259 //++v1; | |
1260 } | |
1261 //while ( v1 < 14 ); | |
1262 | |
1263 if (pCurrentScreen == SCREEN_GAME || pCurrentScreen == SCREEN_NPC_DIALOGUE) | |
1264 { | |
1265 if (pParty->FlyActive()) | |
1266 { | |
1267 if ( pParty->bFlying ) | |
995 | 1268 v7 = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_FlySpell, v0)->uTextureID); |
706 | 1269 else |
995 | 1270 v7 = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_FlySpell, 0)->uTextureID); |
706 | 1271 if ( pRenderer->pRenderD3D ) |
995 | 1272 pRenderer->DrawTextureIndexed(8, 8, v7); |
706 | 1273 else |
995 | 1274 pRenderer->DrawTextureTransparent(8, 8, v7); |
706 | 1275 } |
1276 if (pParty->WaterWalkActive()) | |
1277 { | |
1278 if ( pParty->uFlags & PARTY_FLAGS_1_STANDING_ON_WATER) | |
995 | 1279 v9 = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, v0)->uTextureID); |
706 | 1280 else |
995 | 1281 v9 = pIcons_LOD->GetTexture(pIconsFrameTable->GetFrame(uIconIdx_WaterWalk, 0)->uTextureID); |
706 | 1282 if ( pRenderer->pRenderD3D ) |
1283 pRenderer->DrawTextureIndexed(396u, 8u, v9); | |
1284 else | |
1285 pRenderer->DrawTextureTransparent(396u, 8u, v9); | |
1286 } | |
1287 } | |
1288 | |
1289 for (uint i = 0; i < 4; ++i) | |
1290 { | |
1291 auto player = pParty->pPlayers + i; | |
1292 | |
1293 if (player->pPlayerBuffs[PLAYER_BUFF_HAMMERHANDS].uExpireTime) | |
1294 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 427, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Hammerhands)); | |
1295 if (player->pPlayerBuffs[PLAYER_BUFF_BLESS].uExpireTime) | |
1296 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 393, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Bless)); | |
1297 if (player->pPlayerBuffs[PLAYER_BUFF_PRESERVATION].uExpireTime) | |
1298 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 410, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_Preservation)); | |
1299 if (player->pPlayerBuffs[PLAYER_BUFF_PAIN_REFLECTION].uExpireTime) | |
1300 pRenderer->DrawTextureIndexed(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] + 72, 444, pIcons_LOD->GetTexture(uTextureID_PlayerBuff_PainReflection)); | |
1301 } | |
1302 } | |
1303 | |
1304 | |
1305 | |
1306 //----- (004921C1) -------------------------------------------------------- | |
1307 void GameUI_DrawPortraits(unsigned int _this) | |
832 | 1308 { |
706 | 1309 Texture *pFace; // eax@10 |
1310 unsigned int v7; // eax@17 | |
1311 PlayerFrame *pFrame; // eax@21 | |
1312 unsigned int v9; // eax@27 | |
1313 bool v10; // eax@33 | |
1314 bool v11; // edi@40 | |
1315 bool v12; // edx@43 | |
1316 bool v13; // ecx@46 | |
1317 int v16; // eax@57 | |
1318 int v19; // eax@62 | |
1319 Texture *pPortrait; // [sp-4h] [bp-1Ch]@27 | |
1320 unsigned int v22; // [sp+14h] [bp-4h]@1 | |
1321 | |
1322 v22 = _this; | |
1323 if ( qword_A750D8 ) | |
1324 { | |
1325 qword_A750D8 -= (signed int)pMiscTimer->uTimeElapsed; | |
1326 if ( qword_A750D8 <= 0 ) | |
1327 { | |
1328 if ( pPlayers[word_A750E2]->CanAct() ) | |
1329 pPlayers[word_A750E2]->PlaySound((PlayerSpeech)word_A750E0, 0); | |
1330 qword_A750D8 = 0i64; | |
1331 } | |
1332 } | |
1333 | |
1334 for (uint i = 0; i < 4; ++i) | |
1335 { | |
1336 auto pPlayer = pParty->pPlayers + i; | |
1337 | |
1338 if (pPlayer->Eradicated()) | |
1339 { | |
1340 pFace = pTexture_PlayerFaceEradicated; | |
1341 pPortrait = pFace; | |
1342 v9 = pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i]; | |
1343 if ( pParty->pPartyBuffs[11].uExpireTime ) | |
1344 pRenderer->_4A6E7E(v9, 0x183u, pPortrait); | |
1345 else | |
1346 pRenderer->DrawTextureTransparent(v9 + 1, 0x184u, pPortrait); | |
1347 auto _v1 = 0; | |
1348 v10 = pPlayer->pPlayerBuffs[14].uExpireTime > 0; | |
1349 if (pPlayer->pPlayerBuffs[1].uExpireTime > 0) | |
1350 _v1 = 1; | |
1351 v11 = pPlayer->pPlayerBuffs[8].uExpireTime > 0; | |
1352 v12 = pPlayer->pPlayerBuffs[7].uExpireTime > 0; | |
1353 v13 = pPlayer->pPlayerBuffs[13].uExpireTime > 0; | |
1354 if ( v13 | v12 | v11 | _v1 | v10 ) | |
1355 sub_441A4E(i); | |
1356 continue; | |
1357 } | |
1358 if (pPlayer->Dead()) | |
1359 { | |
1360 pFace = pTexture_PlayerFaceDead; | |
1361 pPortrait = pFace; | |
1362 v9 = pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i]; | |
1363 if ( pParty->pPartyBuffs[11].uExpireTime ) | |
1364 pRenderer->_4A6E7E(v9, 0x183u, pPortrait); | |
1365 else | |
1366 pRenderer->DrawTextureTransparent(v9 + 1, 0x184u, pPortrait); | |
1367 auto _v1 = 0; | |
1368 v10 = pPlayer->pPlayerBuffs[14].uExpireTime > 0; | |
1369 if (pPlayer->pPlayerBuffs[1].uExpireTime > 0) | |
1370 _v1 = 1; | |
1371 v11 = pPlayer->pPlayerBuffs[8].uExpireTime > 0; | |
1372 v12 = pPlayer->pPlayerBuffs[7].uExpireTime > 0; | |
1373 v13 = pPlayer->pPlayerBuffs[13].uExpireTime > 0; | |
1374 if ( v13 | v12 | v11 | _v1 | v10 ) | |
1375 sub_441A4E(i); | |
1376 continue; | |
1377 } | |
1378 v7 = 0; | |
1379 for (uint j = 0; j < pPlayerFrameTable->uNumFrames; ++j) | |
1380 if (pPlayerFrameTable->pFrames[j].expression == pPlayer->expression) | |
1381 { | |
1382 v7 = j; | |
1383 break; | |
1384 } | |
1385 if ( v7 == 0 ) | |
1386 v7 = 1; | |
1387 if (pPlayer->expression == CHARACTER_EXPRESSION_21) | |
1388 pFrame = pPlayerFrameTable->GetFrameBy_y(&pPlayer->_expression21_frameset, &pPlayer->_expression21_animtime, pMiscTimer->uTimeElapsed); | |
1389 else | |
1390 pFrame = pPlayerFrameTable->GetFrameBy_x(v7, pPlayer->uExpressionTimePassed); | |
1391 if (pPlayer->field_1AA2 != pFrame->uTextureID - 1 || v22 ) | |
1392 { | |
1393 pPlayer->field_1AA2 = pFrame->uTextureID - 1; | |
1394 pFace = (Texture *)pTextures_PlayerFaces[i][pPlayer->field_1AA2];//pFace = (Texture *)pTextures_PlayerFaces[i][pFrame->uTextureID]; | |
1395 pPortrait = pFace; | |
1396 v9 = pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i]; | |
1397 if ( pParty->pPartyBuffs[11].uExpireTime ) | |
1398 pRenderer->_4A6E7E(v9, 0x183u, pPortrait); | |
1399 else | |
1400 pRenderer->DrawTextureTransparent(v9 + 1, 0x184u, pPortrait); | |
1401 auto _v1 = 0; | |
1402 v10 = pPlayer->pPlayerBuffs[14].uExpireTime > 0; | |
1403 if (pPlayer->pPlayerBuffs[1].uExpireTime > 0) | |
1404 _v1 = 1; | |
1405 v11 = pPlayer->pPlayerBuffs[8].uExpireTime > 0; | |
1406 v12 = pPlayer->pPlayerBuffs[7].uExpireTime > 0; | |
1407 v13 = pPlayer->pPlayerBuffs[13].uExpireTime > 0; | |
1408 if ( v13 | v12 | v11 | _v1 | v10 ) | |
1409 sub_441A4E(i); | |
1410 continue; | |
1411 } | |
1412 } | |
1413 if ( pParty->bTurnBasedModeOn == 1 ) | |
1414 { | |
1415 if ( pTurnEngine->field_4 != 1 ) | |
1416 { | |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
809
diff
changeset
|
1417 if (PID_TYPE(pTurnEngine->pQueue[0].uPackedID) == OBJECT_Player) |
706 | 1418 { |
1419 //v14 = 0; | |
1420 if ( pTurnEngine->uActorQueueSize > 0 ) | |
1421 { | |
1422 //v15 = (char *)pTurnEngine->pQueue; | |
1423 for (uint i = 0; i < pTurnEngine->uActorQueueSize; ++i) | |
1424 { | |
1425 auto pElem = pTurnEngine->pQueue + i; | |
1426 | |
828
0f56abdcce94
Massive refactors of spells + PID (packed id) macros introduced.
Nomad
parents:
809
diff
changeset
|
1427 if (PID_TYPE(pElem->uPackedID) != OBJECT_Player) |
706 | 1428 break; |
1429 v16 = dword_5079D0; | |
1430 if ( pParty->uFlags & 0x10 ) | |
1431 { | |
1432 v16 = dword_5079CC; | |
1433 } | |
1434 else | |
1435 { | |
1436 if ( pParty->uFlags & 0x20 ) | |
1437 v16 = dword_5079C8; | |
1438 } | |
948 | 1439 pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[PID_ID(pElem->uPackedID)] - 4, 0x181u, pIcons_LOD->GetTexture(v16)); |
706 | 1440 } |
1441 } | |
1442 } | |
1443 } | |
1444 } | |
1445 else | |
1446 { | |
1447 for (uint i = 0; i < 4; ++i) | |
1448 { | |
1449 auto pPlayer = pParty->pPlayers + i; | |
1450 if (pPlayer->CanAct() && !pPlayer->uTimeToRecovery) | |
1451 { | |
1452 v19 = dword_5079D0; | |
1453 if ( pParty->uFlags & 0x10 ) | |
1454 { | |
1455 v19 = dword_5079CC; | |
1456 } | |
1457 else | |
1458 { | |
1459 if ( pParty->uFlags & 0x20 ) | |
1460 v19 = dword_5079C8; | |
1461 } | |
948 | 1462 pRenderer->DrawTextureTransparent(pPlayerPortraitsXCoords_For_PlayerBuffAnimsDrawing[i] - 4, 0x181u, pIcons_LOD->GetTexture(v19)); |
706 | 1463 } |
1464 } | |
1465 } | |
1466 } | |
1467 | |
709 | 1468 //----- (00441D38) -------------------------------------------------------- |
706 | 1469 void GameUI_DrawMinimap(unsigned int uX, unsigned int uY, unsigned int uZ, unsigned int uW, unsigned int uZoom, unsigned int bRedrawOdmMinimap) |
1470 { | |
1471 int uHeight; // ebx@6 | |
1472 __int16 v11; // cx@11 | |
1473 unsigned int v14; // ebx@23 | |
1474 int v15; // eax@23 | |
1475 __int16 v17; // di@30 | |
1476 double v18; // st7@30 | |
1477 float v19; // ST38_4@30 | |
1478 double v20; // st7@30 | |
1479 double v21; // st6@30 | |
1480 double v22; // st5@33 | |
1481 signed int v27; // eax@37 | |
1482 unsigned __int16 *v28; // ecx@37 | |
1483 signed int v29; // edi@40 | |
1484 //signed int v33; // ebx@50 | |
1485 //unsigned int v34; // eax@50 | |
1486 //signed int v35; // ecx@50 | |
1487 //unsigned __int16 v36; // di@66 | |
1488 int v37; // edi@72 | |
1489 int v38; // ebx@72 | |
1490 __int16 v39; // ax@87 | |
1491 int v40; // edi@91 | |
1492 int v41; // ebx@91 | |
1493 unsigned int v42; // eax@101 | |
1494 unsigned int v43; // ebx@101 | |
1495 unsigned int v44; // ST30_4@101 | |
1496 char *v45; // ebx@106 | |
1497 int v46; // edi@108 | |
1498 int v47; // eax@108 | |
1499 unsigned int v48; // ebx@114 | |
1500 unsigned int v49; // ST64_4@114 | |
709 | 1501 //unsigned int v51; // [sp-10h] [bp-64h]@79 |
706 | 1502 unsigned int v52; // [sp-10h] [bp-64h]@100 |
709 | 1503 //unsigned int v53; // [sp-Ch] [bp-60h]@79 |
706 | 1504 unsigned int v54; // [sp-Ch] [bp-60h]@100 |
709 | 1505 //unsigned int v55; // [sp-8h] [bp-5Ch]@77 |
706 | 1506 unsigned int v56; // [sp-8h] [bp-5Ch]@100 |
1507 //signed int v57; // [sp-4h] [bp-58h]@54 | |
709 | 1508 //unsigned __int16 v58; // [sp-4h] [bp-58h]@77 |
706 | 1509 unsigned __int16 v59; // [sp-4h] [bp-58h]@100 |
995 | 1510 //unsigned __int16 v60; // [sp+10h] [bp-44h]@66 |
1511 //unsigned int v61; // [sp+10h] [bp-44h]@85 | |
1512 //unsigned int v63; // [sp+14h] [bp-40h]@85 | |
1513 //unsigned int v65; // [sp+18h] [bp-3Ch]@85 | |
706 | 1514 unsigned int lPitch; // [sp+20h] [bp-34h]@1 |
1515 unsigned int lPitcha; // [sp+20h] [bp-34h]@23 | |
1516 char *lPitchb; // [sp+20h] [bp-34h]@106 | |
1517 unsigned int v69; // [sp+24h] [bp-30h]@23 | |
1518 signed int v70; // [sp+24h] [bp-30h]@37 | |
995 | 1519 //unsigned __int16 uBlue; // [sp+28h] [bp-2Ch]@1 |
706 | 1520 signed int uBluea; // [sp+28h] [bp-2Ch]@37 |
1521 int v73; // [sp+2Ch] [bp-28h]@30 | |
1522 int v76; // [sp+34h] [bp-20h]@91 | |
1523 int v77; // [sp+34h] [bp-20h]@108 | |
709 | 1524 //int v79; // [sp+38h] [bp-1Ch]@72 |
1525 //char *a2c; // [sp+40h] [bp-14h]@68 | |
706 | 1526 signed int uCenterY; // [sp+48h] [bp-Ch]@1 |
1527 signed int uCenterX; // [sp+4Ch] [bp-8h]@1 | |
1528 signed int uWidth; // [sp+5Ch] [bp+8h]@30 | |
709 | 1529 //signed int uZe; // [sp+5Ch] [bp+8h]@67 |
706 | 1530 signed int uZf; // [sp+5Ch] [bp+8h]@85 |
1531 signed int uZg; // [sp+5Ch] [bp+8h]@105 | |
1532 unsigned int uWa; // [sp+60h] [bp+Ch]@23 | |
1533 float uWb; // [sp+60h] [bp+Ch]@30 | |
1534 unsigned int uWd; // [sp+60h] [bp+Ch]@95 | |
1535 float uZooma; // [sp+64h] [bp+10h]@117 | |
995 | 1536 //unsigned int flagsb; // [sp+68h] [bp+14h]@66 |
706 | 1537 Actor *flagsc; // [sp+68h] [bp+14h]@86 |
995 | 1538 //unsigned int flagsd; // [sp+68h] [bp+14h]@105 |
706 | 1539 |
1540 uCenterX = (uX + uZ) / 2; | |
1541 uCenterY = (uY + uW) / 2; | |
1542 lPitch = pRenderer->uTargetSurfacePitch; | |
995 | 1543 //TargetColor(0, 0, 0); |
1544 //uBlue = TargetColor(0, 0, 0xFFu); | |
706 | 1545 auto bWizardEyeActive = pParty->WizardEyeActive(); |
1546 auto uWizardEyeSkillLevel = pParty->WizardEyeSkillLevel(); | |
1547 if (CheckHiredNPCSpeciality(Cartographer)) | |
1548 { | |
1549 bWizardEyeActive = true; | |
1550 uWizardEyeSkillLevel = 2; | |
1551 } | |
709 | 1552 bWizardEyeActive = true; |
1553 uWizardEyeSkillLevel = 3; | |
1554 pRenderer->SetRasterClipRect(uX, uY, uZ - 1, uW - 1); | |
706 | 1555 uHeight = uW - uY; |
1556 uWidth = uZ - uX; | |
1557 | |
1558 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor) | |
1559 { | |
1560 v17 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uWidthLn2; | |
710 | 1561 auto pMapLod0 = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pLevelOfDetail0_prolly_alpha_mask; |
706 | 1562 auto pPal = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].pPalette16; |
1563 v73 = (1 << (v17 + 16)) / (signed int)uZoom; | |
1564 v18 = (double)(1 << (16 - v17)); | |
1565 v19 = v18; | |
1566 v20 = (double)(pParty->vPosition.x + 32768) / v18; | |
1567 v21 = (double)(32768 - pParty->vPosition.y) / v19; | |
1568 uWb = v21; | |
1569 switch (uZoom) | |
1570 { | |
1571 case 512: | |
1572 { | |
1573 v20 = v20 - (double)(uWidth / 2); | |
1574 v22 = (double)(uHeight / 2); | |
1575 uWb = v21 - v22; | |
1576 } | |
1577 break; | |
1578 | |
1579 case 1024: | |
1580 { | |
1581 v20 = v20 - (double)(uWidth / 4); | |
1582 v22 = (double)(uHeight / 4); | |
1583 uWb = v21 - v22; | |
1584 } | |
1585 break; | |
1586 | |
1587 case 2048: | |
1588 { | |
1589 v20 = v20 - (double)(uWidth / 8); | |
1590 v22 = (double)(uHeight / 8); | |
1591 uWb = v21 - v22; | |
1592 } | |
1593 break; | |
1594 | |
1595 default: assert(false); | |
1596 } | |
1597 assert(sizeof(pOdmMinimap) == 137 * 117 * sizeof(short)); | |
1598 | |
1599 v70 = floorf(v20 * 65536.0 + 0.5f);//LODWORD(v24); | |
1600 uBluea = floorf(uWb * 65536.0 + 0.5f);//LODWORD(v25); | |
1601 v27 = uBluea >> 16; | |
1602 v28 = &pRenderer->pTargetSurface[uX + uY * lPitch]; | |
1603 if (pMapLod0 && bRedrawOdmMinimap) | |
1604 { | |
1605 assert(uWidth == 137 && uHeight == 117); | |
1606 //auto pMinimap = (unsigned __int16 *)pOdmMinimap; | |
1607 | |
1608 auto mapWidth = pIcons_LOD->pTextures[viewparams->uTextureID_LocationMap].uTextureWidth; | |
1609 | |
1610 v29 = v70 >> 16; | |
1611 | |
1612 for (int y = 0; y < uHeight; ++y) | |
1613 { | |
1614 auto pMapLod0Line = &pMapLod0[v27 * mapWidth]; | |
1615 for (int x = 0; x < uWidth; ++x) | |
1616 { | |
1617 //*pMinimap++ = pPal[pMapLod0Line[v29]]; | |
1618 pOdmMinimap[y][x] = pPal[pMapLod0Line[v29]]; | |
1619 v29 = (v70 + x * v73) >> 16; | |
1620 } | |
1621 | |
1622 v29 = v70 >> 16; | |
1623 v28 += 137 - uWidth; | |
1624 uBluea += v73; | |
1625 v27 = uBluea >> 16; | |
1626 } | |
1627 } | |
1628 | |
1629 for (int y = 0; y < 117; ++y) | |
1630 { | |
1631 for (int x = 0; x < 137; ++x) | |
1632 { | |
1633 *v28++ = pOdmMinimap[y][x]; | |
1634 } | |
1635 v28 += lPitch - 137; | |
1636 } | |
1637 uNumBlueFacesInBLVMinimap = 0; | |
1638 } | |
1639 else | |
1640 { | |
1641 pRenderer->FillRectFast(uX, uY, uZ - uX, uHeight, 0xF); | |
1642 uNumBlueFacesInBLVMinimap = 0; | |
1643 | |
1644 for (uint i = 0; i < pIndoor->pMapOutlines->uNumOutlines; ++i) | |
1645 { | |
1646 auto pOutline = &pIndoor->pMapOutlines->pOutlines[i]; | |
1647 | |
1648 auto pFace1 = pIndoor->pFaces + pOutline->uFace1ID; | |
1649 auto pFace2 = pIndoor->pFaces + pOutline->uFace2ID; | |
1650 //v9 = pIndoor->pFaces[pMapVertex->uFace1ID].uAttributes; | |
1651 //v10 = pIndoor->pFaces[pMapVertex->uFace2ID].uAttributes; | |
1652 if (pFace1->Visible() && pFace2->Visible()) | |
1653 { | |
1654 v11 = pOutline->uFlags; | |
1655 if ( v11 & 1 ) | |
1656 goto LABEL_15; | |
1657 if (pFace1->uAttributes & 0x80 || pFace2->uAttributes & 0x80u != 0 ) | |
1658 goto LABEL_ABC; | |
1659 | |
1660 } | |
1661 continue; | |
1662 | |
1663 LABEL_ABC: | |
1664 pOutline->uFlags = v11 | 1; | |
1665 pIndoor->_visible_outlines[i >> 3] |= 1 << (7 - i % 8); | |
1666 | |
1667 LABEL_15: | |
1668 //v12 = &pIndoor->pFaces[pOutline->uFace1ID]; | |
1669 if (bWizardEyeActive && uWizardEyeSkillLevel >= 3 && | |
1670 (pFace1->uAttributes & 0x2000000 || pFace2->uAttributes & 0x2000000) && | |
1671 (pIndoor->pFaceExtras[pFace1->uFaceExtraID].uEventID || pIndoor->pFaceExtras[pFace2->uFaceExtraID].uEventID)) | |
1672 { | |
1673 if (uNumBlueFacesInBLVMinimap < 49) | |
1674 pBlueFacesInBLVMinimapIDs[uNumBlueFacesInBLVMinimap++] = i; | |
1675 } | |
1676 else | |
1677 { | |
1678 auto _a = (uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x); | |
1679 auto _b = ((unsigned int)((unsigned __int64)_a >> 16) << 16); | |
1680 auto _c = ((signed int)(_b - uZoom * pParty->vPosition.x) >> 16); | |
1681 v69 = uCenterX + _c; | |
1682 v69 = uCenterX + ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x) >> 16) << 16) - uZoom * pParty->vPosition.x) >> 16); | |
1683 lPitcha = uCenterY - ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].y) >> 16) << 16) - uZoom * pParty->vPosition.y) >> 16); | |
1684 uWa = uCenterX + ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].x) >> 16) << 16) - uZoom * pParty->vPosition.x) >> 16); | |
1685 v14 = uCenterY - ((signed int)(((unsigned int)((unsigned __int64)(uZoom * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].y) >> 16) << 16) - uZoom * pParty->vPosition.y) >> 16); | |
1686 v15 = abs(pOutline->sZ - pParty->vPosition.z) / 8; | |
1687 if ( v15 > 100 ) | |
1688 v15 = 100; | |
709 | 1689 pRenderer->RasterLine2D(v69, lPitcha, uWa, v14, viewparams->pPalette[-v15 + 200]); |
706 | 1690 } |
1691 } | |
1692 | |
1693 | |
1694 for (uint i = 0; i < uNumBlueFacesInBLVMinimap; ++i) | |
1695 { | |
1696 //v16 = (uint *)&pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[uZb]]; | |
1697 auto pOutline = &pIndoor->pMapOutlines->pOutlines[pBlueFacesInBLVMinimapIDs[i]]; | |
709 | 1698 pRenderer->RasterLine2D(uCenterX + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom |
706 | 1699 * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].x) >> 16) << 16) |
1700 - uZoom * pParty->vPosition.x) >> 16), | |
1701 uCenterY | |
1702 - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom | |
1703 * (signed __int64)pIndoor->pVertices[pOutline->uVertex1ID].y) >> 16) << 16) | |
1704 - uZoom * pParty->vPosition.y) >> 16), | |
1705 uCenterX | |
1706 + ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom | |
1707 * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].x) >> 16) << 16) | |
1708 - uZoom * pParty->vPosition.x) >> 16), | |
1709 uCenterY | |
1710 - ((signed int)(((unsigned int)((unsigned __int64)((signed int)uZoom | |
1711 * (signed __int64)pIndoor->pVertices[pOutline->uVertex2ID].y) >> 16) << 16) | |
1712 - uZoom * pParty->vPosition.y) >> 16), | |
995 | 1713 ui_game_minimap_outline_color); |
706 | 1714 } |
1715 } | |
1716 | |
1717 | |
1718 assert(pParty->sRotationY >= 0); | |
1719 float angle = (pParty->sRotationY % 2048) / 2048.0f; | |
1720 const float two_pi = 2.0f * 3.14159f; | |
1721 | |
1722 uint arrow_idx = floorf(0.5f + 7 * angle); | |
1723 pRenderer->DrawTextureTransparent(uCenterX - 3, uCenterY - 3, pIcons_LOD->GetTexture(pTextureIDs_pMapDirs[arrow_idx])); | |
1724 | |
995 | 1725 //flagsb = TargetColor(0, 0, 255); |
1726 //v60 = TargetColor(255, 0, 0); | |
706 | 1727 if (bWizardEyeActive) |
1728 { | |
709 | 1729 //uZe = 0; |
1730 if (uWizardEyeSkillLevel >= 2) | |
1731 for (uint i = 0; i < uNumSpriteObjects; ++i) | |
1732 //if (uNumSpriteObjects > 0) | |
1733 { | |
1734 auto object = pSpriteObjects + i; | |
1735 | |
1736 //a2c = (char *)&pSpriteObjects[0].uObjectDescID; | |
1737 //while ( 1 ) | |
1738 //{ | |
1739 if (!object->uType || !object->uObjectDescID) | |
1740 continue; | |
1741 //if (uWizardEyeSkillLevel == 1 | |
1742 v37 = uCenterX + ((unsigned __int64)((object->vPosition.x - pParty->vPosition.x) * (signed __int64)uZoom) >> 16); | |
1743 //v79 = (unsigned __int64)((object->vPosition.y - pParty->vPosition.y) * (signed __int64)(signed int)uZoom) >> 16; | |
1744 //v38 = uCenterY - v79; | |
1745 v38 = uCenterY - ((signed __int64)((object->vPosition.y - pParty->vPosition.y) * (signed __int64)uZoom) >> 16); | |
1746 if (v37 < pRenderer->raster_clip_x || v37 > pRenderer->raster_clip_z || | |
1747 v38 < pRenderer->raster_clip_y || v38 > pRenderer->raster_clip_w) | |
1748 continue; | |
1749 | |
1750 assert(uZoom >= 512); | |
1751 if (pObjectList->pObjects[object->uObjectDescID].uFlags & OBJECT_DESC_UNPICKABLE) | |
706 | 1752 { |
995 | 1753 pRenderer->RasterLine2D(v37, v38, v37, v38, ui_game_minimap_projectile_color); |
709 | 1754 } |
1755 else if (uZoom > 512) | |
1756 { | |
995 | 1757 pRenderer->RasterLine2D(v37 - 1, v38 - 1, v37 - 1, v38 + 1, ui_game_minimap_treasure_color); |
1758 pRenderer->RasterLine2D(v37, v38 - 2, v37, v38 + 1, ui_game_minimap_treasure_color); | |
1759 pRenderer->RasterLine2D(v37 + 1, v38 - 1, v37 + 1, v38 + 1, ui_game_minimap_treasure_color); | |
1760 pRenderer->RasterLine2D(v37 - 2, v38, v37 - 2, v38 + 1, ui_game_minimap_treasure_color); | |
709 | 1761 pRenderer->RasterLine2D(v37 + 2, v38, |
995 | 1762 v37 + 2, v38 + 1, ui_game_minimap_treasure_color); |
706 | 1763 } |
709 | 1764 else |
1765 { | |
1766 pRenderer->RasterLine2D(v37 - 1, v38 - 1, | |
995 | 1767 v37 - 1, v38, ui_game_minimap_treasure_color); |
709 | 1768 pRenderer->RasterLine2D(v37, v38 - 1, |
995 | 1769 v37, v38, ui_game_minimap_treasure_color); |
709 | 1770 } |
1771 //LABEL_82: | |
1772 //LABEL_83: | |
1773 //++uZe; | |
1774 //a2c += 112; | |
1775 //if ( uZe >= (signed int)uNumSpriteObjects ) | |
1776 //{ | |
1777 //goto LABEL_85; | |
1778 //} | |
1779 //} | |
706 | 1780 } |
709 | 1781 |
1782 | |
706 | 1783 LABEL_85: |
995 | 1784 //v63 = TargetColor(255, 0, 0); |
1785 //v61 = TargetColor(0, 255, 0); | |
1786 //v65 = TargetColor(255, 255, 0); | |
706 | 1787 uZf = 0; |
1788 if ( (signed int)uNumActors > 0 ) | |
1789 { | |
1790 flagsc = pActors;//[0].uAIState; | |
1791 do | |
1792 { | |
1793 v39 = flagsc->uAIState; | |
1794 if ( flagsc->uAIState != 11 && v39 != 19 && (v39 == 5 || BYTE1(flagsc->uAttributes) & 0x80) ) | |
1795 { | |
1796 v40 = ((unsigned __int64)(( flagsc->vPosition.x - pParty->vPosition.x) | |
1797 * (signed __int64)(signed int)uZoom) >> 16) | |
1798 + uCenterX; | |
1799 v76 = (unsigned __int64)(( flagsc->vPosition.y - pParty->vPosition.y) | |
1800 * (signed __int64)(signed int)uZoom) >> 16; | |
1801 v41 = uCenterY - v76; | |
709 | 1802 if ( v40 >= pRenderer->raster_clip_x ) |
706 | 1803 { |
709 | 1804 if ( v40 <= pRenderer->raster_clip_z && v41 >= pRenderer->raster_clip_y && v41 <= pRenderer->raster_clip_w ) |
706 | 1805 { |
995 | 1806 uWd = ui_game_minimap_actor_friendly_color; |
706 | 1807 if ( BYTE3(flagsc->uAttributes) & 1 ) |
995 | 1808 uWd = ui_game_minimap_actor_hostile_color; |
1809 if ( flagsc->uAIState == Dead) | |
1810 uWd = ui_game_minimap_actor_corpse_color; | |
706 | 1811 if ( (signed int)uZoom > 1024 ) |
1812 { | |
709 | 1813 pRenderer->RasterLine2D(v40 - 1, v41 - 2, v40 - 1, v41 + 2, uWd); |
1814 pRenderer->RasterLine2D(v40, v41 - 2, v40, v41 + 2, uWd); | |
1815 pRenderer->RasterLine2D(v40 + 1, v41 - 2, v40 + 1, v41 + 2, uWd); | |
706 | 1816 v42 = v41 + 1; |
1817 v43 = v41 - 1; | |
1818 v44 = v42; | |
709 | 1819 pRenderer->RasterLine2D(v40 - 2, v43, v40 - 2, v42, uWd); |
706 | 1820 v40 += 2; |
1821 v59 = uWd; | |
1822 v56 = v44; | |
1823 v54 = v40; | |
1824 v52 = v43; | |
1825 } | |
1826 else | |
1827 { | |
709 | 1828 pRenderer->RasterLine2D(v40 - 1, v41 - 1, v40 - 1, uCenterY - v76, uWd); |
706 | 1829 v59 = uWd; |
1830 v56 = uCenterY - v76; | |
1831 v54 = v40; | |
1832 v52 = v41 - 1; | |
1833 } | |
709 | 1834 pRenderer->RasterLine2D(v40, v52, v54, v56, v59); |
706 | 1835 } |
1836 } | |
1837 } | |
1838 ++uZf; | |
1839 ++flagsc; | |
1840 } | |
1841 while ( uZf < (signed int)uNumActors ); | |
1842 } | |
1843 } | |
709 | 1844 |
1845 | |
995 | 1846 //flagsd = TargetColor(255, 255, 255); |
706 | 1847 uZg = 0; |
1848 if ( (signed int)uNumLevelDecorations > 0 ) | |
1849 { | |
1850 v45 = (char *)&pLevelDecorations[0].vPosition; | |
1851 lPitchb = (char *)&pLevelDecorations[0].vPosition; | |
1852 do | |
1853 { | |
1854 if ( *(v45 - 2) & 8 ) | |
1855 { | |
1856 v46 = ((unsigned __int64)((*(int *)v45 - pParty->vPosition.x) * (signed __int64)(signed int)uZoom) >> 16) | |
1857 + uCenterX; | |
1858 v77 = (unsigned __int64)((*((int *)v45 + 1) - pParty->vPosition.y) * (signed __int64)(signed int)uZoom) >> 16; | |
1859 v47 = uCenterY - v77; | |
709 | 1860 if ( v46 >= pRenderer->raster_clip_x ) |
706 | 1861 { |
709 | 1862 if ( v46 <= pRenderer->raster_clip_z && v47 >= pRenderer->raster_clip_y && v47 <= pRenderer->raster_clip_w ) |
706 | 1863 { |
1864 if ( (signed int)uZoom > 512 ) | |
1865 { | |
1866 v48 = v47 + 1; | |
1867 v49 = v47 - 1; | |
995 | 1868 pRenderer->RasterLine2D(v46 - 1, v47 - 1, v46 - 1, v47 + 1, ui_game_minimap_decoration_color_1); |
1869 pRenderer->RasterLine2D(v46, v49, v46, v48, ui_game_minimap_decoration_color_1); | |
1870 pRenderer->RasterLine2D(v46 + 1, v49, v46 + 1, v48, ui_game_minimap_decoration_color_1); | |
706 | 1871 v45 = lPitchb; |
1872 } | |
1873 else | |
1874 { | |
995 | 1875 pRenderer->RasterLine2D(v46, uCenterY - v77, v46, uCenterY - v77, ui_game_minimap_decoration_color_1); |
706 | 1876 } |
1877 } | |
1878 } | |
1879 } | |
1880 ++uZg; | |
1881 v45 += 32; | |
1882 lPitchb = v45; | |
1883 } | |
1884 while ( uZg < (signed int)uNumLevelDecorations ); | |
1885 } | |
948 | 1886 pRenderer->DrawTextureTransparent(0x1D4u, 0, pIcons_LOD->GetTexture(dword_5079D8)); |
706 | 1887 uZooma = (double)pParty->sRotationY * 0.1171875; |
1888 //v50 = uZooma + 6.7553994e15; | |
727 | 1889 pRenderer->SetTextureClipRect(541, 0, 567, 480); |
948 | 1890 pRenderer->DrawTextureIndexed(floorf(uZooma + 0.5f) + 285, 136, pIcons_LOD->GetTexture(dword_5079B4)); |
727 | 1891 pRenderer->ResetTextureClipRect(); |
706 | 1892 } |
1893 | |
1894 //----- (00441498) -------------------------------------------------------- | |
1895 void __cdecl GameUI_DrawTorchlightAndWizardEye() | |
1896 { | |
1897 if (pCurrentScreen == SCREEN_GAME | |
1898 || pCurrentScreen == SCREEN_MENU | |
1899 || pCurrentScreen == SCREEN_OPTIONS | |
1900 || pCurrentScreen == SCREEN_REST | |
1901 || pCurrentScreen == SCREEN_SPELL_BOOK | |
1902 || pCurrentScreen == SCREEN_CHEST | |
1903 || pCurrentScreen == SCREEN_SAVEGAME | |
1904 || pCurrentScreen == SCREEN_LOADGAME | |
987 | 1905 || pCurrentScreen == SCREEN_CHEST_INVENTORY |
706 | 1906 || pCurrentScreen == SCREEN_BOOKS |
1907 || pCurrentScreen == SCREEN_BRANCHLESS_NPC_DIALOG ) | |
1908 { | |
1909 if (pParty->TorchlightActive()) | |
1910 { | |
1911 auto icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnum_Torchlight->uIconID, pEventTimer->Time()); | |
1912 pRenderer->DrawTextureTransparent(pUIAnum_Torchlight->x, pUIAnum_Torchlight->y, pIcons_LOD->GetTexture(icon->uTextureID)); | |
1913 } | |
1914 if (pParty->WizardEyeActive()) | |
1915 { | |
1916 auto icon = pIconsFrameTable->GetFrame((signed __int16)pUIAnim_WizardEye->uIconID, pEventTimer->Time()); | |
1917 pRenderer->DrawTextureTransparent(pUIAnim_WizardEye->x, pUIAnim_WizardEye->y, pIcons_LOD->GetTexture(icon->uTextureID)); | |
1918 } | |
1919 } | |
1920 } | |
1921 // 4E28F8: using guessed type int pCurrentScreen; | |
1922 | |
1923 | |
1924 //----- (00491F87) -------------------------------------------------------- | |
994 | 1925 void GameUI_DrawHiredNPCs() |
706 | 1926 { |
1927 //int v6; // eax@15 | |
1928 char v7; // al@17 | |
1929 unsigned int v8; // eax@18 | |
1930 int v9; // esi@18 | |
1931 int v10; // eax@18 | |
1932 unsigned int v11; // eax@19 | |
1933 unsigned int v12; // esi@19 | |
1934 unsigned int v13; // eax@23 | |
1935 IconFrame *v14; // eax@24 | |
1936 unsigned int v15; // eax@26 | |
1937 char pContainer[20]; // [sp+Ch] [bp-30h]@18 | |
1938 unsigned int v17; // [sp+20h] [bp-1Ch]@19 | |
1939 signed int uFrameID; // [sp+24h] [bp-18h]@19 | |
1940 //int i; // [sp+28h] [bp-14h]@15 | |
1941 unsigned int v20; // [sp+2Ch] [bp-10h]@20 | |
1942 unsigned int v21; // [sp+30h] [bp-Ch]@19 | |
1943 int v22; // [sp+34h] [bp-8h]@2 | |
1944 unsigned __int8 v23; // [sp+3Bh] [bp-1h]@2 | |
1945 | |
1946 if ( bNoNPCHiring != 1 ) | |
1947 { | |
1948 v23 = 0; | |
1949 v22 = 0; | |
1950 /*for (uint i = 0; i < 2; ++i) | |
1951 { | |
1952 if (pParty->pHirelings[i].pName) | |
1953 pTmpBuf[v22++] = i; | |
1954 }*/ | |
1955 if (pParty->pHirelings[0].pName) | |
1956 pTmpBuf[v22++] = 0; | |
1957 if (pParty->pHirelings[1].pName) | |
1958 pTmpBuf[v22++] = 1; | |
1959 | |
1960 for (uint i = 0; i < pNPCStats->uNumNewNPCs; ++i) | |
1961 { | |
1962 if (pNPCStats->pNewNPCData[i].uFlags & 128) | |
1963 { | |
1964 if (!pParty->pHirelings[0].pName || strcmp(pNPCStats->pNewNPCData[i].pName, pParty->pHirelings[0].pName)) | |
1965 { | |
1966 if (!pParty->pHirelings[1].pName || strcmp(pNPCStats->pNewNPCData[i].pName, pParty->pHirelings[1].pName)) | |
1967 pTmpBuf[v22++] = i + 2; | |
1968 } | |
1969 } | |
1970 } | |
1971 | |
1972 //v6 = (unsigned __int8)pParty->field_709; | |
1973 for ( int i = (unsigned __int8)pParty->field_709; i < v22 && v23 < 2; i++ ) | |
1974 { | |
1975 v7 = pTmpBuf[i]; | |
1976 if ( (unsigned __int8)v7 >= 2 ) | |
1977 { | |
1978 sprintf(pContainer, "NPC%03d", pNPCStats->pNPCData[(unsigned __int8)v7 + 499].uPortraitID); | |
1979 v15 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
948 | 1980 pRenderer->DrawTextureIndexed(pHiredNPCsIconsOffsetsX[v23], pHiredNPCsIconsOffsetsY[v23], pIcons_LOD->GetTexture(v15)); |
706 | 1981 } |
1982 else | |
1983 { | |
1984 sprintf(pContainer, "NPC%03d", pParty->pHirelings[(unsigned __int8)v7].uPortraitID); | |
1985 v8 = pIcons_LOD->LoadTexture(pContainer, TEXTURE_16BIT_PALETTE); | |
1986 v9 = v23; | |
948 | 1987 pRenderer->DrawTextureIndexed(pHiredNPCsIconsOffsetsX[v9], pHiredNPCsIconsOffsetsY[v9], pIcons_LOD->GetTexture(v8)); |
706 | 1988 v10 = (unsigned __int8)pTmpBuf[i]; |
1989 if ( pParty->pHirelings[v10].evt_A == 1 ) | |
1990 { | |
1991 uFrameID = pParty->pHirelings[v10].evt_B; | |
1992 v11 = pHiredNPCsIconsOffsetsX[v9]; | |
1993 v12 = pHiredNPCsIconsOffsetsY[v9]; | |
1994 v17 = v11; | |
1995 v21 = 0; | |
1996 if ( (signed int)pIconsFrameTable->uNumIcons <= 0 ) | |
1997 { | |
1998 LABEL_23: | |
1999 v13 = 0; | |
2000 } | |
2001 else | |
2002 { | |
2003 v20 = 0; | |
2004 while ( _strcmpi("spell96", pIconsFrameTable->pIcons[v20 / 0x20].pAnimationName) ) | |
2005 { | |
2006 ++v21; | |
2007 v20 += 32; | |
2008 if ( (signed int)v21 >= (signed int)pIconsFrameTable->uNumIcons ) | |
2009 goto LABEL_23; | |
2010 } | |
2011 v13 = v21; | |
2012 } | |
2013 v14 = pIconsFrameTable->GetFrame(v13, uFrameID); | |
2014 pRenderer->DrawTextureTransparent(v17, v12, &pIcons_LOD->pTextures[v14->uTextureID]); | |
2015 } | |
2016 } | |
2017 ++v23; | |
2018 } | |
2019 } | |
2020 } | |
2021 // 6BE3C5: using guessed type char bNoNPCHiring; | |
2022 |