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