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