Mercurial > mm7
annotate mm7_1.cpp @ 569:f451efdb7c8b
* Party buff icons drawing (right panel)
* Water Walk works & draws
* Fly works & draws
* Invisibility sfx works
* Some player buff icons draw
author | Nomad |
---|---|
date | Tue, 05 Mar 2013 16:14:22 +0200 |
parents | fcbb3c281217 |
children | f54481c85df8 |
rev | line source |
---|---|
0 | 1 /* This file has been generated by the Hex-Rays decompiler. |
2 Copyright (c) 2007-2011 Hex-Rays <info@hex-rays.com> | |
3 | |
4 Detected compiler: Visual C++ | |
5 */ | |
6 | |
7 //#include <defs.h> | |
373 | 8 #include <assert.h> |
9 | |
0 | 10 #include "MM7.h" |
11 | |
12 #include "MapInfo.h" | |
13 #include "Game.h" | |
14 #include "GUIWindow.h" | |
15 #include "GUIFont.h" | |
16 #include "GUIButton.h" | |
17 #include "GUIProgressBar.h" | |
18 #include "Party.h" | |
19 #include "AudioPlayer.h" | |
20 #include "Outdoor.h" | |
21 #include "IndoorCamera.h" | |
22 #include "Overlays.h" | |
23 #include "Monsters.h" | |
24 #include "Arcomage.h" | |
25 #include "LOD.h" | |
26 #include "Actor.h" | |
27 #include "Allocator.h" | |
28 #include "Events.h" | |
29 #include "Viewport.h" | |
30 #include "FrameTableInc.h" | |
31 #include "Math.h" | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
32 #include "SpriteObject.h" |
0 | 33 #include "ObjectList.h" |
34 #include "Chest.h" | |
35 #include "PaletteManager.h" | |
36 #include "DecorationList.h" | |
37 #include "SaveLoad.h" | |
38 #include "stru123.h" | |
39 #include "Time.h" | |
40 #include "IconFrameTable.h" | |
41 #include "Awards.h" | |
42 #include "Autonotes.h" | |
43 #include "stru160.h" | |
44 #include "stru279.h" | |
45 #include "TurnEngine.h" | |
46 #include "stru277.h" | |
47 #include "Weather.h" | |
48 #include "stru272.h" | |
49 #include "stru298.h" | |
50 #include "StorylineTextTable.h" | |
51 #include "Events2D.h" | |
189 | 52 #include "texts.h" |
351 | 53 #include "stru351.h" |
0 | 54 |
55 #include "mm7_data.h" | |
56 | |
57 | |
58 | |
59 | |
60 int __stdcall aWinProc(HWND hWnd, UINT Msg, WPARAM wParam, unsigned int lParam); | |
61 int __stdcall InsertMM7CDDialogFunc(HWND hDlg, int a2, __int16 a3, int a4); | |
62 bool __fastcall FindMM7CD(HWND hWnd, char *pCDDrive); | |
63 bool __fastcall Initialize(HINSTANCE hInst, char *pCmdLine); | |
64 | |
65 | |
66 | |
67 | |
68 | |
69 | |
70 void __cdecl FreeSavegameThumbnails() | |
71 { | |
72 for (int i = 0; i < 40; ++i) | |
73 //pAllocator->FreeChunk(pSavegameThumbnails[i].pPixels); | |
74 pSavegameThumbnails[i].Release(); | |
75 } | |
76 | |
77 | |
78 //----- (004196A0) -------------------------------------------------------- | |
79 void __cdecl sub_4196A0() | |
80 { | |
81 GUIButton *i; // esi@2 | |
82 GUIButton *j; // esi@7 | |
83 | |
84 if ( dword_507CC0 ) | |
85 { | |
86 dword_507CC0 = 0; | |
87 for ( i = pGUIWindow_CurrentMenu->pControlsHead; i; i = i->pNext ) | |
88 { | |
89 if ( BYTE1(i->field_1C) & 0x80 ) | |
90 GUIButton::_41D0D8(i); | |
91 } | |
92 for ( j = pGUIWindow_CurrentMenu->pControlsHead; j; j = j->pNext ) | |
93 { | |
94 if ( j->uControlID == 120 ) | |
95 { | |
96 j->uX = dword_50698C; | |
97 j->uY = dword_506988; | |
98 j->uZ = dword_506984; | |
99 j->uW = dword_506980; | |
100 pGUIWindow_CurrentMenu->_41D08F(1, 0, 0, 0); | |
101 } | |
102 } | |
103 } | |
104 } | |
105 // 506980: using guessed type int dword_506980; | |
106 // 506984: using guessed type int dword_506984; | |
107 // 506988: using guessed type int dword_506988; | |
108 // 50698C: using guessed type int dword_50698C; | |
109 // 507CC0: using guessed type int dword_507CC0; | |
110 | |
111 //----- (00419719) -------------------------------------------------------- | |
112 char __fastcall CharacterUI_SkillsTab_Draw(unsigned int uPlayerID) | |
113 { | |
114 unsigned int v1; // esi@1 | |
115 Player *pPlayer; // ebp@1 | |
116 unsigned int v3; // eax@1 | |
117 signed int v4; // ecx@1 | |
118 int v5; // edi@3 | |
119 GUIWindow *v6; // ecx@3 | |
120 int v7; // eax@4 | |
121 GUIButton *v8; // edx@5 | |
122 int v9; // eax@7 | |
123 unsigned int v10; // ecx@9 | |
124 unsigned __int16 v11; // ax@9 | |
125 int v12; // eax@9 | |
126 unsigned __int8 v13; // cf@12 | |
127 unsigned __int8 v14; // zf@12 | |
128 unsigned int v15; // eax@12 | |
129 char *v16; // ecx@22 | |
130 GUIWindow *v17; // ecx@33 | |
131 int v18; // edx@34 | |
132 GUIButton *v19; // eax@35 | |
133 int v20; // edx@37 | |
134 unsigned __int16 v21; // cx@39 | |
135 unsigned int v22; // eax@39 | |
136 int v23; // edi@39 | |
137 unsigned int v24; // eax@42 | |
138 char v25; // sf@52 | |
139 char *v26; // ecx@52 | |
140 int v27; // edi@63 | |
141 GUIWindow *v28; // ecx@63 | |
142 int v29; // edx@64 | |
143 GUIButton *v30; // eax@65 | |
144 int v31; // edx@67 | |
145 unsigned int v32; // ecx@69 | |
146 int v33; // eax@69 | |
147 unsigned int v34; // eax@72 | |
148 char *v35; // ecx@82 | |
149 GUIWindow *v36; // ecx@93 | |
150 int v37; // edx@94 | |
151 GUIButton *v38; // eax@94 | |
152 int v39; // edx@97 | |
153 unsigned __int16 v40; // cx@99 | |
154 unsigned int v41; // eax@99 | |
155 int v42; // edi@99 | |
156 unsigned int v43; // eax@102 | |
157 char *v44; // ecx@112 | |
158 char *v46; // [sp-Ch] [bp-4Ch]@19 | |
159 char *v47; // [sp-Ch] [bp-4Ch]@49 | |
160 char *v48; // [sp-Ch] [bp-4Ch]@79 | |
161 char *v49; // [sp-Ch] [bp-4Ch]@109 | |
162 unsigned int v50; // [sp-8h] [bp-48h]@19 | |
163 unsigned int v51; // [sp-8h] [bp-48h]@49 | |
164 unsigned int v52; // [sp-8h] [bp-48h]@79 | |
165 unsigned int v53; // [sp-8h] [bp-48h]@109 | |
166 int v54; // [sp-4h] [bp-44h]@19 | |
167 int v55; // [sp-4h] [bp-44h]@49 | |
168 int v56; // [sp-4h] [bp-44h]@79 | |
169 int v57; // [sp-4h] [bp-44h]@109 | |
170 unsigned int v58; // [sp+10h] [bp-30h]@9 | |
171 unsigned int v59; // [sp+10h] [bp-30h]@39 | |
172 unsigned int v60; // [sp+10h] [bp-30h]@69 | |
173 unsigned int v61; // [sp+10h] [bp-30h]@99 | |
174 int v62; // [sp+14h] [bp-2Ch]@4 | |
175 int v63; // [sp+14h] [bp-2Ch]@34 | |
176 int v64; // [sp+14h] [bp-2Ch]@64 | |
177 int v65; // [sp+14h] [bp-2Ch]@94 | |
178 signed int i; // [sp+18h] [bp-28h]@4 | |
179 signed int v67; // [sp+18h] [bp-28h]@34 | |
180 signed int v68; // [sp+18h] [bp-28h]@64 | |
181 signed int v69; // [sp+18h] [bp-28h]@94 | |
182 int v70; // [sp+1Ch] [bp-24h]@3 | |
183 int v71; // [sp+1Ch] [bp-24h]@33 | |
184 int v72; // [sp+1Ch] [bp-24h]@63 | |
185 int v73; // [sp+1Ch] [bp-24h]@93 | |
186 int uY; // [sp+20h] [bp-20h]@9 | |
187 int uYa; // [sp+20h] [bp-20h]@33 | |
188 int uYb; // [sp+20h] [bp-20h]@69 | |
189 int uYc; // [sp+20h] [bp-20h]@93 | |
190 unsigned int a5; // [sp+24h] [bp-1Ch]@1 | |
191 unsigned int v79; // [sp+28h] [bp-18h]@1 | |
192 int *v80; // [sp+2Ch] [bp-14h]@3 | |
193 int *v81; // [sp+2Ch] [bp-14h]@33 | |
194 int *v82; // [sp+2Ch] [bp-14h]@63 | |
195 int *v83; // [sp+2Ch] [bp-14h]@93 | |
196 unsigned int v84; // [sp+30h] [bp-10h]@1 | |
197 int v85; // [sp+34h] [bp-Ch]@1 | |
198 unsigned int v86; // [sp+38h] [bp-8h]@1 | |
199 unsigned __int16 v87; // [sp+3Ch] [bp-4h]@9 | |
200 char *v88; // [sp+3Ch] [bp-4h]@24 | |
201 char *v89; // [sp+3Ch] [bp-4h]@54 | |
202 unsigned __int16 v90; // [sp+3Ch] [bp-4h]@69 | |
203 char *v91; // [sp+3Ch] [bp-4h]@84 | |
204 char *v92; // [sp+3Ch] [bp-4h]@114 | |
205 | |
206 v1 = uPlayerID; | |
207 a5 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); | |
208 v84 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xAFu, 0xFFu); | |
209 v85 = pGUIWindow_CurrentMenu->pCurrentPosActiveItem; | |
210 v86 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0, 0); | |
211 v79 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0); | |
243 | 212 pPlayer = &pParty->pPlayers[v1-1]; |
0 | 213 v3 = pIcons_LOD->LoadTexture("fr_skill", TEXTURE_16BIT_PALETTE); |
214 pRenderer->DrawTextureIndexed(8u, 8u, (Texture *)(v3 != -1 ? (int)&pIcons_LOD->pTextures[v3] : 0)); | |
215 v4 = v79; | |
216 if ( !pPlayer->uSkillPoints ) | |
217 v4 = 65535; | |
218 sprintf( | |
219 pTmpBuf, | |
41 | 220 "%s \f%05d%s\f00000\r177%s: \f%05d%d\f00000", |
0 | 221 pGlobalTXT_LocalizationStrings[206], // Skills for |
222 a5, | |
223 pPlayer->pName, | |
224 pGlobalTXT_LocalizationStrings[207], // Skill Points | |
225 v4, | |
226 pPlayer->uSkillPoints); | |
227 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, 18, 0, pTmpBuf, 0, 0, 0); | |
228 v5 = 2 * LOBYTE(pFontLucida->uFontHeight) + 13;// Weapons, Level | |
229 sprintf(pTmpBuf, "%s\r400%s", pGlobalTXT_LocalizationStrings[242], pGlobalTXT_LocalizationStrings[131]); | |
230 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, v5, a5, pTmpBuf, 0, 0, 0); | |
231 v6 = pGUIWindow_CurrentMenu; | |
232 v70 = 0; | |
69 | 233 v80 = pWeaponSkills; |
0 | 234 do |
235 { | |
236 v62 = *v80; | |
237 v7 = 0; | |
238 for ( i = 0; i < (signed int)v6->uNumControls; v7 = i++ + 1 ) | |
239 { | |
240 v8 = v6->pControlsHead; | |
241 if ( v7 > 0 ) | |
242 { | |
243 do | |
244 { | |
245 v8 = v8->pNext; | |
246 --v7; | |
247 } | |
248 while ( v7 ); | |
249 } | |
250 v9 = v8->field_1C; | |
251 if ( SBYTE1(v9) >= 0 ) | |
252 continue; | |
253 BYTE1(v9) &= 0x7Fu; | |
254 if ( v9 != v62 ) | |
255 continue; | |
256 v5 = v8->uY; | |
257 v10 = pPlayer->uSkillPoints; | |
258 ++v70; | |
259 v11 = pPlayer->pActiveSkills[v62]; | |
260 v87 = pPlayer->pActiveSkills[v62]; | |
261 v12 = v11 & 0x3F; | |
262 v58 = 0; | |
263 uY = v12; | |
264 if ( v10 >= v12 + 1 ) | |
265 v58 = v84; | |
266 if ( v85 == i ) | |
267 { | |
268 v13 = v10 < v12; | |
269 v14 = v10 == v12; | |
270 v15 = v86; | |
271 if ( !(v13 | v14) ) | |
272 v15 = v79; | |
273 v58 = v15; | |
274 } | |
275 else | |
276 { | |
277 v15 = v58; | |
278 } | |
279 if ( HIBYTE(v87) & 1 ) | |
280 { | |
281 if ( !v15 ) | |
282 v15 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); | |
283 v54 = uY; | |
284 v50 = v58; | |
285 v46 = pGlobalTXT_LocalizationStrings[96]; | |
286 } | |
287 else | |
288 { | |
289 if ( !(v87 & 0xC0) ) | |
290 { | |
291 sprintf(pTmpBuf, "%s\r400%2d", pSkillNames[v62], uY); | |
69 | 292 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 24, v5, v58, pTmpBuf, 0, 0, 0); |
293 v6 = pGUIWindow_CurrentMenu; | |
294 continue; | |
0 | 295 } |
296 v16 = pGlobalTXT_LocalizationStrings[432]; | |
297 if ( (v87 & 0x80u) == 0 ) | |
298 v16 = pGlobalTXT_LocalizationStrings[433]; | |
299 v88 = v16; | |
300 if ( !v15 ) | |
301 v15 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); | |
302 v54 = uY; | |
303 v50 = v58; | |
304 v46 = v88; | |
305 } | |
306 sprintf(pTmpBuf, "%s ", pSkillNames[v62], v15, v46, v50, v54); | |
307 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 24, v5, v58, pTmpBuf, 0, 0, 0); | |
308 v6 = pGUIWindow_CurrentMenu; | |
309 } | |
310 ++v80; | |
311 } | |
69 | 312 while ( v80 <= &pWeaponSkills[8]); |
0 | 313 if ( !v70 ) |
314 { | |
315 v5 = v5 + LOBYTE(pFontLucida->uFontHeight) - 3; | |
316 v6->DrawText(pFontLucida, 24, v5, 0, pGlobalTXT_LocalizationStrings[153], 0, 0, 0); | |
317 } | |
318 uYa = v5 + 2 * LOBYTE(pFontLucida->uFontHeight) - 10; | |
319 sprintf(pTmpBuf, "%s\r400%s", pGlobalTXT_LocalizationStrings[138], pGlobalTXT_LocalizationStrings[131]); | |
320 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, uYa, a5, pTmpBuf, 0, 0, 0); | |
321 v17 = pGUIWindow_CurrentMenu; | |
322 v71 = 0; | |
69 | 323 v81 = pMagicSkills; |
0 | 324 do |
325 { | |
326 v18 = 0; | |
327 v67 = 0; | |
328 v63 = *v81; | |
329 while ( v67 < (signed int)v17->uNumControls ) | |
330 { | |
331 v19 = v17->pControlsHead; | |
332 if ( v18 > 0 ) | |
333 { | |
334 do | |
335 { | |
336 v19 = v19->pNext; | |
337 --v18; | |
338 } | |
339 while ( v18 ); | |
340 } | |
341 v20 = v19->field_1C; | |
342 if ( SBYTE1(v20) >= 0 || (BYTE1(v20) &= 0x7Fu, v20 != v63) ) | |
69 | 343 { |
344 v18 = v67++ + 1; | |
345 continue; | |
346 } | |
0 | 347 ++v71; |
348 uYa = v19->uY; | |
349 v21 = pPlayer->pActiveSkills[v63]; | |
350 v22 = pPlayer->uSkillPoints; | |
351 v23 = pPlayer->pActiveSkills[v63] & 0x3F; | |
352 v59 = 0; | |
353 if ( v22 >= v23 + 1 ) | |
354 v59 = v84; | |
355 if ( v85 == v67 ) | |
356 { | |
357 v13 = v22 < v23; | |
358 v14 = v22 == v23; | |
359 v24 = v86; | |
360 if ( !(v13 | v14) ) | |
361 v24 = v79; | |
362 v59 = v24; | |
363 } | |
364 else | |
365 { | |
366 v24 = v59; | |
367 } | |
368 if ( HIBYTE(v21) & 1 ) | |
369 { | |
370 if ( !v24 ) | |
371 v24 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); | |
372 v55 = v23; | |
373 v51 = v59; | |
374 v47 = pGlobalTXT_LocalizationStrings[96]; | |
375 } | |
376 else | |
377 { | |
378 if ( !(v21 & 0xC0) ) | |
379 { | |
380 sprintf(pTmpBuf, "%s\r400%2d", pSkillNames[v63], v23); | |
69 | 381 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 24, uYa, v59, pTmpBuf, 0, 0, 0); |
382 v17 = pGUIWindow_CurrentMenu; | |
383 v18 = v67++ + 1; | |
384 continue; | |
0 | 385 } |
386 v25 = (v21 & 0x80u) != 0; | |
387 v26 = pGlobalTXT_LocalizationStrings[432]; | |
388 if ( !v25 ) | |
389 v26 = pGlobalTXT_LocalizationStrings[433]; | |
390 v89 = v26; | |
391 if ( !v24 ) | |
392 v24 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); | |
393 v55 = v23; | |
394 v51 = v59; | |
395 v47 = v89; | |
396 } | |
397 sprintf(pTmpBuf, "%s ", pSkillNames[v63], v24, v47, v51, v55); | |
69 | 398 //LABEL_58: |
0 | 399 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 24, uYa, v59, pTmpBuf, 0, 0, 0); |
400 v17 = pGUIWindow_CurrentMenu; | |
69 | 401 //LABEL_59: |
0 | 402 v18 = v67++ + 1; |
403 } | |
404 ++v81; | |
405 } | |
69 | 406 while ( v81 <= &pMagicSkills[8]); |
0 | 407 if ( !v71 ) |
408 v17->DrawText( | |
409 pFontLucida, | |
410 24, | |
411 LOBYTE(pFontLucida->uFontHeight) + uYa - 3, | |
412 0, | |
413 pGlobalTXT_LocalizationStrings[153], | |
414 0, | |
415 0, | |
416 0); | |
417 v27 = 2 * LOBYTE(pFontLucida->uFontHeight) + 13; | |
418 sprintf(pTmpBuf, "%s\r177%s", pGlobalTXT_LocalizationStrings[11], pGlobalTXT_LocalizationStrings[131]); | |
419 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 248, v27, a5, pTmpBuf, 0, 0, 0); | |
420 v28 = pGUIWindow_CurrentMenu; | |
421 v72 = 0; | |
41 | 422 v82 = pArmorSkills; |
0 | 423 do |
424 { | |
425 v29 = 0; | |
426 v68 = 0; | |
427 v64 = *v82; | |
428 while ( v68 < (signed int)v28->uNumControls ) | |
429 { | |
430 v30 = v28->pControlsHead; | |
431 if ( v29 > 0 ) | |
432 { | |
433 do | |
434 { | |
435 v30 = v30->pNext; | |
436 --v29; | |
437 } | |
438 while ( v29 ); | |
439 } | |
440 v31 = v30->field_1C; | |
441 if ( SBYTE1(v31) >= 0 || (BYTE1(v31) &= 0x7Fu, v31 != v64) ) | |
69 | 442 { |
443 v29 = v68++ + 1; | |
444 continue; | |
445 } | |
0 | 446 v27 = v30->uY; |
447 ++v72; | |
448 v60 = 0; | |
449 v90 = pPlayer->pActiveSkills[v64]; | |
450 v32 = pPlayer->uSkillPoints; | |
451 v33 = pPlayer->pActiveSkills[v64] & 0x3F; | |
452 uYb = v33; | |
453 if ( v32 >= v33 + 1 ) | |
454 v60 = v84; | |
455 if ( v85 == v68 ) | |
456 { | |
457 v13 = v32 < v33; | |
458 v14 = v32 == v33; | |
459 v34 = v86; | |
460 if ( !(v13 | v14) ) | |
461 v34 = v79; | |
462 v60 = v34; | |
463 } | |
464 else | |
465 { | |
466 v34 = v60; | |
467 } | |
468 if ( (pPlayer->pActiveSkills[v64] >> 8) & 1 ) | |
469 { | |
470 if ( !v34 ) | |
471 v34 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); | |
472 v56 = uYb; | |
473 v52 = v60; | |
474 v48 = pGlobalTXT_LocalizationStrings[96]; | |
475 } | |
476 else | |
477 { | |
478 if ( !(v90 & 0xC0) ) | |
479 { | |
480 sprintf(pTmpBuf, "%s\r177%2d", pSkillNames[v64], uYb); | |
69 | 481 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 248, v27, v60, pTmpBuf, 0, 0, 0); |
482 v28 = pGUIWindow_CurrentMenu; | |
483 v29 = v68++ + 1; | |
484 continue; | |
0 | 485 } |
486 v35 = pGlobalTXT_LocalizationStrings[432]; | |
487 if ( (v90 & 0x80u) == 0 ) | |
488 v35 = pGlobalTXT_LocalizationStrings[433]; | |
489 v91 = v35; | |
490 if ( !v34 ) | |
491 v34 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); | |
492 v56 = uYb; | |
493 v52 = v60; | |
494 v48 = v91; | |
495 } | |
496 sprintf(pTmpBuf, "%s ", pSkillNames[v64], v34, v48, v52, v56); | |
69 | 497 //LABEL_88: |
0 | 498 pGUIWindow_CurrentMenu->DrawText(pFontLucida, 248, v27, v60, pTmpBuf, 0, 0, 0); |
499 v28 = pGUIWindow_CurrentMenu; | |
69 | 500 //LABEL_89: |
0 | 501 v29 = v68++ + 1; |
502 } | |
503 ++v82; | |
504 } | |
69 | 505 while ( v82 <= &pArmorSkills[4]); |
0 | 506 if ( !v72 ) |
507 { | |
508 v27 = v27 + LOBYTE(pFontLucida->uFontHeight) - 3; | |
509 v28->DrawText(pFontLucida, 248, v27, 0, pGlobalTXT_LocalizationStrings[153], 0, 0, 0); | |
510 } | |
511 uYc = v27 + 2 * LOBYTE(pFontLucida->uFontHeight) - 10; | |
512 sprintf(pTmpBuf, "%s\r177%s", pGlobalTXT_LocalizationStrings[143], pGlobalTXT_LocalizationStrings[131]); | |
513 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 248, uYc, a5, pTmpBuf, 0, 0, 0); | |
514 v36 = pGUIWindow_CurrentMenu; | |
515 v73 = 0; | |
69 | 516 v83 = pMiscSkills; |
0 | 517 do |
518 { | |
519 v37 = 0; | |
520 v69 = 0; | |
521 v38 = (GUIButton *)*v83; | |
522 v65 = *v83; | |
523 while ( v69 < (signed int)v36->uNumControls ) | |
524 { | |
525 v38 = v36->pControlsHead; | |
526 if ( v37 > 0 ) | |
527 { | |
528 do | |
529 { | |
530 v38 = v38->pNext; | |
531 --v37; | |
532 } | |
533 while ( v37 ); | |
534 } | |
535 v39 = v38->field_1C; | |
536 if ( SBYTE1(v39) >= 0 || (BYTE1(v39) &= 0x7Fu, v39 != v65) ) | |
69 | 537 { |
538 //goto LABEL_119; | |
539 v37 = v69++ + 1; | |
540 continue; | |
541 } | |
0 | 542 ++v73; |
543 uYc = v38->uY; | |
544 v40 = pPlayer->pActiveSkills[v65]; | |
545 v41 = pPlayer->uSkillPoints; | |
546 v42 = pPlayer->pActiveSkills[v65] & 0x3F; | |
547 v61 = 0; | |
548 if ( v41 >= v42 + 1 ) | |
549 v61 = v84; | |
550 if ( v85 == v69 ) | |
551 { | |
552 v13 = v41 < v42; | |
553 v14 = v41 == v42; | |
554 v43 = v86; | |
555 if ( !(v13 | v14) ) | |
556 v43 = v79; | |
557 v61 = v43; | |
558 } | |
559 else | |
560 { | |
561 v43 = v61; | |
562 } | |
563 if ( HIBYTE(v40) & 1 ) | |
564 { | |
565 if ( !v43 ) | |
566 v43 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); | |
567 v57 = v42; | |
568 v53 = v61; | |
569 v49 = pGlobalTXT_LocalizationStrings[96]; | |
570 } | |
571 else | |
572 { | |
573 if ( !(v40 & 0xC0) ) | |
574 { | |
575 sprintf(pTmpBuf, "%s\r177%2d", pSkillNames[v65], v42); | |
69 | 576 LOBYTE(v38) = pGUIWindow_CurrentMenu->DrawText(pFontLucida, 248, uYc, v61, pTmpBuf, 0, 0, 0); |
577 v36 = pGUIWindow_CurrentMenu; | |
578 v37 = v69++ + 1; | |
579 continue; | |
0 | 580 } |
581 v25 = (v40 & 0x80u) != 0; | |
582 v44 = pGlobalTXT_LocalizationStrings[432]; | |
583 if ( !v25 ) | |
584 v44 = pGlobalTXT_LocalizationStrings[433]; | |
585 v92 = v44; | |
586 if ( !v43 ) | |
587 v43 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); | |
588 v57 = v42; | |
589 v53 = v61; | |
590 v49 = v92; | |
591 } | |
592 sprintf(pTmpBuf, "%s ", pSkillNames[v65], v43, v49, v53, v57); | |
593 LOBYTE(v38) = pGUIWindow_CurrentMenu->DrawText(pFontLucida, 248, uYc, v61, pTmpBuf, 0, 0, 0); | |
594 v36 = pGUIWindow_CurrentMenu; | |
595 v37 = v69++ + 1; | |
596 } | |
597 ++v83; | |
598 } | |
69 | 599 while ( v83 <= &pMiscSkills[11]); |
0 | 600 if ( !v73 ) |
601 LOBYTE(v38) = v36->DrawText( | |
602 pFontLucida, | |
603 248, | |
604 LOBYTE(pFontLucida->uFontHeight) + uYc - 3, | |
605 0, | |
606 pGlobalTXT_LocalizationStrings[153], | |
607 0, | |
608 0, | |
609 0); | |
610 return (char)v38; | |
611 } | |
612 | |
613 //----- (0041A000) -------------------------------------------------------- | |
521 | 614 void CharacterUI_AwardsTab_Draw( unsigned int uPlayerID ) |
615 { | |
255 | 616 //unsigned int v1; // esi@1 |
0 | 617 unsigned int v2; // ebx@1 |
521 | 618 unsigned int award_texture_id; // eax@1 |
0 | 619 unsigned int result; // eax@1 |
620 int v5; // eax@15 | |
621 char *v6; // ebx@15 | |
622 int v7; // eax@23 | |
623 int v8; // eax@24 | |
624 int v9; // eax@25 | |
625 int v10; // eax@27 | |
626 int v11; // eax@32 | |
627 int v12; // eax@33 | |
628 int v13; // eax@34 | |
629 signed int v14; // eax@43 | |
630 unsigned int v15; // eax@43 | |
631 int v16; // eax@43 | |
632 int v17; // [sp-4h] [bp-D4h]@16 | |
633 char Source[100]; // [sp+Ch] [bp-C4h]@1 | |
634 GUIWindow a1; // [sp+70h] [bp-60h]@1 | |
635 unsigned int v20; // [sp+C4h] [bp-Ch]@15 | |
636 int v21; // [sp+C8h] [bp-8h]@14 | |
637 int v22; // [sp+CCh] [bp-4h]@40 | |
638 | |
521 | 639 auto player = &pParty->pPlayers[uPlayerID - 1]; |
255 | 640 //v1 = uPlayerID; |
0 | 641 v2 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); |
521 | 642 award_texture_id = pIcons_LOD->LoadTexture("fr_award", TEXTURE_16BIT_PALETTE); |
643 pRenderer->DrawTextureIndexed(8u, 8u, (Texture *)(award_texture_id != -1 ? &pIcons_LOD->pTextures[award_texture_id] : 0)); | |
644 sprintfex(pTmpBuf, "%s \f%05d", pGlobalTXT_LocalizationStrings[LOCSTR_AVARDS_FOR], v2); | |
645 sprintfex(Source, pGlobalTXT_LocalizationStrings[LOCSTR_S_THE_S], player->pName, pClassNames[player->classType]); | |
0 | 646 strcat(pTmpBuf, Source); |
521 | 647 strcat(pTmpBuf, "\f00000"); |
0 | 648 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 24, 18, 0, pTmpBuf, 0, 0, 0); |
649 result = dword_506528; | |
650 a1.uFrameX = 12; | |
651 a1.uFrameY = 48; | |
652 a1.uFrameWidth = 424; | |
653 a1.uFrameHeight = 290; | |
654 a1.uFrameZ = 435; | |
655 a1.uFrameW = 337; | |
521 | 656 if ( dword_506544 && awards_count + dword_506528 < awards_count2 ) |
0 | 657 result = dword_506528++ + 1; |
658 if ( dword_506548 && result ) | |
659 { | |
660 --result; | |
661 dword_506528 = result; | |
662 } | |
663 if ( dword_50651C < 0 ) | |
664 { | |
521 | 665 result += awards_count; |
0 | 666 dword_506528 = result; |
521 | 667 if ( (signed int)(awards_count + result) <= awards_count2 ) |
0 | 668 goto LABEL_14; |
521 | 669 result = awards_count2 - awards_count; |
0 | 670 goto LABEL_13; |
671 } | |
672 if ( dword_50651C > 0 ) | |
673 { | |
521 | 674 result -= awards_count; |
0 | 675 dword_506528 = result; |
676 if ( (result & 0x80000000u) != 0 ) | |
677 { | |
678 result = 0; | |
679 LABEL_13: | |
680 dword_506528 = result; | |
681 goto LABEL_14; | |
682 } | |
683 } | |
684 LABEL_14: | |
685 dword_506544 = 0; | |
686 dword_506548 = 0; | |
521 | 687 awards_count = 0; |
0 | 688 dword_50651C = 0; |
689 v21 = result; | |
521 | 690 if ( (signed int)result < awards_count2 ) |
0 | 691 { |
692 while ( 1 ) | |
693 { | |
521 | 694 v5 = achievedAwardsIndex[v21]; |
695 v20 = achievedAwardsIndex[v21]; | |
696 v6 = (char *)pAwards[v20].pText;//(char *)dword_723E80_award_related[v20 / 4]; | |
0 | 697 if ( v5 != 1 ) |
698 break; | |
699 v17 = pParty->uFine; | |
700 LABEL_42: | |
701 sprintf(pTmpBuf, v6, v17); | |
702 v6 = pTmpBuf; | |
703 LABEL_43: | |
521 | 704 v14 = pAwards[v20].uSort;//dword_723E84[v20 / 4]; |
705 ++awards_count; | |
0 | 706 v15 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat( |
707 pAwardsTextColors[3 * v14 % 6], | |
708 pAwardsTextColors[3 * v14 % 6 + 1], | |
709 pAwardsTextColors[3 * v14 % 6 + 2]); | |
710 a1.DrawText(pFontArrus, 0, 0, v15, v6, 0, 0, 0); | |
711 v16 = pFontArrus->CalcTextHeight(v6, &a1, 0, 0); | |
712 result = v16 + a1.uFrameY + 4; | |
713 if ( (signed int)result <= (signed int)a1.uFrameHeight ) | |
714 { | |
715 ++v21; | |
716 a1.uFrameY = result; | |
717 result = v21; | |
521 | 718 if ( v21 < awards_count2 ) |
0 | 719 continue; |
720 } | |
521 | 721 return; |
0 | 722 } |
723 if ( (v5 < 85 || v5 > 91) && (v5 < 103 || v5 > 104) ) | |
724 goto LABEL_43; | |
725 if ( v5 > 89 ) | |
726 { | |
727 v11 = v5 - 90; | |
728 if ( !v11 ) | |
729 { | |
730 v10 = (unsigned __int8)pParty->uNumArenaKnightWins; | |
731 goto LABEL_40; | |
732 } | |
733 v12 = v11 - 1; | |
734 if ( !v12 ) | |
735 { | |
736 v10 = (unsigned __int8)pParty->uNumArenaLordWins; | |
737 goto LABEL_40; | |
738 } | |
739 v13 = v12 - 12; | |
740 if ( !v13 ) | |
741 { | |
742 v10 = pParty->field_874; | |
743 goto LABEL_40; | |
744 } | |
745 if ( v13 == 1 ) | |
746 { | |
747 v10 = pParty->field_878; | |
748 goto LABEL_40; | |
749 } | |
750 } | |
751 else | |
752 { | |
753 if ( v5 == 89 ) | |
754 { | |
755 v10 = (unsigned __int8)pParty->uNumArenaSquireWins; | |
756 goto LABEL_40; | |
757 } | |
758 v7 = v5 - 85; | |
759 if ( !v7 ) | |
760 { | |
761 v10 = pParty->uNumDeaths; | |
762 goto LABEL_40; | |
763 } | |
764 v8 = v7 - 1; | |
765 if ( !v8 ) | |
766 { | |
767 v10 = pParty->uNumBountiesCollected; | |
768 goto LABEL_40; | |
769 } | |
770 v9 = v8 - 1; | |
771 if ( !v9 ) | |
772 { | |
773 v10 = pParty->uNumPrisonTerms; | |
774 goto LABEL_40; | |
775 } | |
776 if ( v9 == 1 ) | |
777 { | |
778 v10 = (unsigned __int8)pParty->uNumArenaPageWins; | |
779 LABEL_40: | |
780 v22 = v10; | |
781 goto LABEL_41; | |
782 } | |
783 } | |
784 LABEL_41: | |
785 v17 = v22; | |
786 goto LABEL_42; | |
787 } | |
521 | 788 return; |
0 | 789 } |
790 // 50651C: using guessed type int dword_50651C; | |
791 // 506520: using guessed type int dword_506520; | |
792 // 506524: using guessed type int dword_506524; | |
793 // 506528: using guessed type int dword_506528; | |
794 // 506544: using guessed type int dword_506544; | |
795 // 506548: using guessed type int dword_506548; | |
796 // 723E80: using guessed type int dword_723E80_award_related[]; | |
797 // 723E84: using guessed type int dword_723E84[]; | |
798 | |
799 //----- (0041A2C1) -------------------------------------------------------- | |
800 unsigned int __fastcall GetSizeInInventorySlots(unsigned int uNumPixels) | |
801 { | |
802 if ( (signed int)uNumPixels < 14 ) | |
803 uNumPixels = 14; | |
804 return ((signed int)(uNumPixels - 14) >> 5) + 1; | |
805 } | |
806 | |
807 //----- (0041A2D1) -------------------------------------------------------- | |
808 void __fastcall CharacterUI_InventoryTab_Draw(unsigned int uPlayerID, char a2) | |
809 { | |
22 | 810 Player *pPlayer; // esi@1 |
0 | 811 char v3; // bl@1 |
812 unsigned int v4; // eax@2 | |
22 | 813 ItemGen *pItem; // ebx@5 |
0 | 814 unsigned int v6; // eax@6 |
815 Texture *v7; // esi@6 | |
816 __int16 v8; // ax@6 | |
817 signed int v9; // edi@6 | |
818 signed int v10; // ecx@6 | |
819 signed int v11; // edx@6 | |
820 signed int v12; // eax@11 | |
821 int v13; // eax@13 | |
822 signed int v14; // edx@13 | |
823 int v15; // eax@13 | |
824 unsigned int v16; // ebx@15 | |
825 unsigned int v17; // edi@15 | |
22 | 826 Texture *pTexture; // ebx@24 |
0 | 827 double v19; // st7@26 |
828 const char *v20; // [sp-8h] [bp-40h]@20 | |
22 | 829 Player *pPlayer2; // [sp+14h] [bp-24h]@1 |
0 | 830 int uTextureId; // [sp+18h] [bp-20h]@6 |
831 int *v23; // [sp+1Ch] [bp-1Ch]@1 | |
832 int v24; // [sp+20h] [bp-18h]@5 | |
22 | 833 ItemGen *pItem2; // [sp+24h] [bp-14h]@5 |
0 | 834 int v26; // [sp+28h] [bp-10h]@3 |
68 | 835 unsigned int uCellID; // [sp+2Ch] [bp-Ch]@3 |
836 unsigned int uCellX; // [sp+30h] [bp-8h]@5 | |
837 unsigned int uCellY; // [sp+34h] [bp-4h]@5 | |
0 | 838 |
839 v23 = pRenderer->pActiveZBuffer; | |
22 | 840 pPlayer = pPlayers[uPlayerID]; |
0 | 841 v3 = a2; |
22 | 842 pPlayer2 = pPlayers[uPlayerID]; |
843 pRenderer->DrawTextureIndexed(8, 8, (Texture *)(uTextureID_507958 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_507958] : 0)); | |
0 | 844 if ( v3 ) |
845 { | |
846 v4 = pIcons_LOD->LoadTexture("fr_strip", TEXTURE_16BIT_PALETTE); | |
847 pRenderer->DrawTextureIndexed(8u, 0x131u, (Texture *)(v4 != -1 ? (int)&pIcons_LOD->pTextures[v4] : 0)); | |
848 } | |
68 | 849 uCellID = 0; |
22 | 850 v26 = (int)pPlayer->pInventoryIndices; |
0 | 851 do |
852 { | |
853 if ( *(int *)v26 > 0 ) | |
854 { | |
855 v24 = *(int *)v26 - 1; | |
68 | 856 uCellY = 32 * (uCellID / 14) + 17; |
22 | 857 pItem = &pPlayer->pInventoryItems[v24]; |
68 | 858 uCellX = 32 * (uCellID % 14) + 14; |
22 | 859 pItem2 = pItem; |
860 if ( pItem->uItemID ) | |
861 { | |
862 v6 = pIcons_LOD->LoadTexture(pItemsTable->pItems[pItem->uItemID].pIconName, TEXTURE_16BIT_PALETTE); | |
0 | 863 uTextureId = v6; |
864 v7 = (Texture *)(v6 != -1 ? (int)&pIcons_LOD->pTextures[v6] : 0); | |
865 v8 = (v6 != -1 ? pIcons_LOD->pTextures[v6].uTextureWidth : 24); | |
866 v9 = v7->uTextureHeight; | |
867 v10 = v7->uTextureWidth; | |
868 v11 = v7->uTextureWidth; | |
869 if ( v10 < 14 ) | |
870 v11 = 14; | |
871 if ( (v11 - 14) >> 5 == 0 && v8 < 32 ) | |
68 | 872 uCellX += (32 - v10) / 2; |
0 | 873 v12 = v7->uTextureWidth; |
874 if ( v10 < 14 ) | |
875 v12 = 14; | |
876 v13 = v12 - 14; | |
877 v14 = v7->uTextureHeight; | |
878 LOBYTE(v13) = v13 & 0xE0; | |
879 v15 = v13 + 32; | |
880 if ( v9 < 14 ) | |
881 v14 = 14; | |
22 | 882 v16 = pItem->uAttributes; |
68 | 883 v17 = uCellX + ((v15 - v10) >> 1) + pSRZBufferLineOffsets[uCellY + ((((v14 - 14) & 0xFFFFFFE0) - v9 + 32) >> 1)]; |
0 | 884 if ( !(v16 & 0xF0) ) |
885 { | |
315 | 886 if (pItem->Identified() || pCurrentScreen != SCREEN_HOUSE ) |
0 | 887 { |
315 | 888 if (pItem->Broken()) |
889 pRenderer->DrawTransparentRedShade(uCellX, uCellY, v7); | |
0 | 890 else |
68 | 891 pRenderer->DrawTextureTransparent(uCellX, uCellY, v7); |
0 | 892 } |
893 else | |
894 { | |
68 | 895 pRenderer->DrawTransparentGreenShade(uCellX, uCellY, v7); |
0 | 896 } |
22 | 897 ZBuffer_Fill(&v23[v17], uTextureId, v24 + 1); |
898 pPlayer = pPlayer2; | |
899 //goto LABEL_34; | |
68 | 900 ++uCellID; |
22 | 901 v26 += 4; |
68 | 902 continue; |
0 | 903 } |
904 if ( (unsigned __int8)(v16 & 0xF0) != 16 ) | |
905 { | |
906 if ( (unsigned __int8)(v16 & 0xF0) == 32 ) | |
907 { | |
908 v20 = "sp28a"; | |
22 | 909 pTexture = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v20, TEXTURE_16BIT_PALETTE)]; |
910 dword_50C9A8 -= pEventTimer->uTimeElapsed; | |
911 if ( dword_50C9A8 <= 0 ) | |
912 { | |
913 dword_50C9A8 = 0; | |
914 LOBYTE(pItem2->uAttributes) &= 0xFu; | |
915 ptr_50C9A4 = 0; | |
916 } | |
917 v19 = (double)GetTickCount() * 0.1; | |
68 | 918 pRenderer->_4A63E6(uCellX, uCellY, v7, pTexture, (signed __int64)v19, 0, 255); |
22 | 919 ZBuffer_Fill(&v23[v17], uTextureId, v24 + 1); |
920 pPlayer = pPlayer2; | |
921 //goto LABEL_34; | |
68 | 922 ++uCellID; |
22 | 923 v26 += 4; |
68 | 924 continue; |
0 | 925 } |
926 if ( (unsigned __int8)(v16 & 0xF0) == 64 ) | |
927 { | |
928 v20 = "sp30a"; | |
22 | 929 pTexture = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v20, TEXTURE_16BIT_PALETTE)]; |
0 | 930 dword_50C9A8 -= pEventTimer->uTimeElapsed; |
931 if ( dword_50C9A8 <= 0 ) | |
932 { | |
933 dword_50C9A8 = 0; | |
22 | 934 LOBYTE(pItem2->uAttributes) &= 0xFu; |
935 ptr_50C9A4 = 0; | |
936 } | |
937 v19 = (double)GetTickCount() * 0.1; | |
68 | 938 pRenderer->_4A63E6(uCellX, uCellY, v7, pTexture, (signed __int64)v19, 0, 255); |
22 | 939 ZBuffer_Fill(&v23[v17], uTextureId, v24 + 1); |
940 pPlayer = pPlayer2; | |
941 //goto LABEL_34; | |
68 | 942 ++uCellID; |
22 | 943 v26 += 4; |
68 | 944 continue; |
22 | 945 } |
946 if ( (unsigned __int8)(v16 & 0xF0) == 128 ) | |
947 { | |
948 v20 = "sp91a"; | |
949 pTexture = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v20, TEXTURE_16BIT_PALETTE)]; | |
950 dword_50C9A8 -= pEventTimer->uTimeElapsed; | |
951 if ( dword_50C9A8 <= 0 ) | |
952 { | |
953 dword_50C9A8 = 0; | |
954 LOBYTE(pItem2->uAttributes) &= 0xFu; | |
0 | 955 ptr_50C9A4 = 0; |
956 } | |
957 v19 = (double)GetTickCount() * 0.1; | |
68 | 958 pRenderer->_4A63E6(uCellX, uCellY, v7, pTexture, (signed __int64)v19, 0, 255); |
0 | 959 ZBuffer_Fill(&v23[v17], uTextureId, v24 + 1); |
22 | 960 pPlayer = pPlayer2; |
961 //goto LABEL_34; | |
68 | 962 ++uCellID; |
22 | 963 v26 += 4; |
68 | 964 continue; |
0 | 965 } |
966 } | |
967 v20 = "sptext01"; | |
22 | 968 pTexture = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(v20, TEXTURE_16BIT_PALETTE)]; |
969 dword_50C9A8 -= pEventTimer->uTimeElapsed; | |
970 if ( dword_50C9A8 <= 0 ) | |
971 { | |
972 dword_50C9A8 = 0; | |
973 LOBYTE(pItem2->uAttributes) &= 0xFu; | |
974 ptr_50C9A4 = 0; | |
975 } | |
976 v19 = (double)GetTickCount() * 0.1; | |
68 | 977 pRenderer->_4A63E6(uCellX, uCellY, v7, pTexture, (signed __int64)v19, 0, 255); |
22 | 978 ZBuffer_Fill(&v23[v17], uTextureId, v24 + 1); |
979 pPlayer = pPlayer2; | |
980 } | |
981 } | |
982 //LABEL_34: | |
68 | 983 ++uCellID; |
0 | 984 v26 += 4; |
985 } | |
68 | 986 while ( uCellID < 126 ); |
0 | 987 } |
988 | |
989 //----- (0041A556) -------------------------------------------------------- | |
990 void __cdecl draw_leather() | |
991 { | |
566 | 992 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->GetTexture(uTextureID_Leather)); |
0 | 993 } |
994 | |
995 //----- (0041A57E) -------------------------------------------------------- | |
566 | 996 void QuickRefDraw() |
0 | 997 { |
998 unsigned int v0; // ebx@1 | |
566 | 999 //unsigned int v1; // eax@1 |
0 | 1000 Player *pPlayer; // ebp@2 |
1001 int v3; // eax@6 | |
1002 int v4; // edi@6 | |
1003 unsigned int v5; // eax@7 | |
1004 unsigned int v6; // edi@9 | |
1005 unsigned int v7; // edi@11 | |
1006 signed int v8; // eax@13 | |
1007 unsigned int v9; // eax@13 | |
1008 unsigned int v10; // edi@13 | |
1009 int v11; // eax@15 | |
1010 unsigned int v12; // eax@15 | |
1011 unsigned int v13; // edi@15 | |
1012 int v14; // eax@17 | |
1013 int v15; // ST18_4@17 | |
1014 int v16; // ebx@17 | |
1015 int v17; // eax@17 | |
1016 unsigned int v18; // eax@17 | |
1017 unsigned int v19; // edi@17 | |
1018 int v20; // eax@19 | |
1019 unsigned int v21; // edi@19 | |
1020 char *v22; // eax@21 | |
1021 unsigned int v23; // edi@21 | |
1022 int v24; // eax@23 | |
1023 unsigned int v25; // edi@23 | |
1024 char *v26; // eax@25 | |
1025 unsigned int v27; // edi@25 | |
1026 int v28; // ecx@27 | |
1027 char *v29; // eax@27 | |
1028 signed int v30; // edx@27 | |
1029 unsigned int v31; // edi@31 | |
1030 unsigned int v32; // edi@33 | |
1031 const char *v33; // ST10_4@35 | |
1032 unsigned int v34; // eax@35 | |
1033 unsigned int v35; // edi@35 | |
1034 unsigned __int8 v36; // al@37 | |
1035 char *v37; // eax@38 | |
1036 int v38; // eax@41 | |
1037 signed int v39; // edi@42 | |
1038 char *v40; // eax@45 | |
1039 unsigned int v41; // eax@45 | |
1040 signed int v43; // [sp+10h] [bp-1Ch]@1 | |
1041 unsigned int v44; // [sp+14h] [bp-18h]@2 | |
1042 int v45; // [sp+18h] [bp-14h]@1 | |
1043 unsigned int v46; // [sp+1Ch] [bp-10h]@1 | |
1044 unsigned int v47; // [sp+20h] [bp-Ch]@1 | |
1045 unsigned int v48; // [sp+24h] [bp-8h]@33 | |
566 | 1046 //unsigned int v49; // [sp+28h] [bp-4h]@1 |
0 | 1047 |
1048 v0 = 0; | |
1049 v47 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); | |
566 | 1050 //v49 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0, 0); |
0 | 1051 v46 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, 0); |
566 | 1052 //v1 = pIcons_LOD->LoadTexture("quikref", TEXTURE_16BIT_PALETTE); |
1053 pRenderer->DrawTextureIndexed(8, 8, pIcons_LOD->LoadTexturePtr("quikref", TEXTURE_16BIT_PALETTE)); | |
0 | 1054 v43 = 0; |
1055 v45 = LOBYTE(pFontArrus->uFontHeight) + 1; | |
1056 do | |
1057 { | |
1058 pPlayer = &pParty->pPlayers[v43]; | |
1059 v44 = 94 * v43 + 89; | |
1060 if ( v43 == v0 ) | |
24 | 1061 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, 0x12u, v0, pGlobalTXT_LocalizationStrings[149], 60, v0);//Name |
0 | 1062 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 94 * v43 + 89, 0x12u, v47, pPlayer->pName, 84, v0); |
1063 if ( v43 == v0 ) | |
24 | 1064 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, 0x2Fu, v0, pGlobalTXT_LocalizationStrings[131], 60, v0); //Óðîâ. |
0 | 1065 v3 = pPlayer->GetActualLevel(); |
1066 sprintf(pTmpBuf, "%lu", v3); | |
1067 v4 = pPlayer->GetBaseLevel(); | |
1068 if ( pPlayer->GetActualLevel() <= v4 ) | |
1069 v5 = pPlayer->GetExperienceDisplayColor(); | |
1070 else | |
1071 v5 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0xFFu, v0); | |
1072 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, 0x2Fu, v5, pTmpBuf, 84, v0); | |
1073 v6 = v45 + 47; | |
1074 if ( v43 == v0 ) | |
24 | 1075 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v45 + 47, v0, pGlobalTXT_LocalizationStrings[41], 60, v0);//Êëàññ |
135 | 1076 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v6, v0, pClassNames[pPlayer->classType], 84, v0); |
0 | 1077 v7 = v45 + v6; |
1078 if ( v43 == v0 ) | |
24 | 1079 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v7, v0, pGlobalTXT_LocalizationStrings[107], 60, v0);//Çäîð. |
0 | 1080 sprintf(pTmpBuf, "%d", pPlayer->sHealth); |
1081 v8 = pPlayer->GetMaxHealth(); | |
1082 v9 = UI_GetHealthManaStringColor(pPlayer->sHealth, v8); | |
1083 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v7, v9, pTmpBuf, 84, v0); | |
1084 v10 = v45 + v7; | |
1085 if ( v43 == v0 ) | |
24 | 1086 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v10, v0, pGlobalTXT_LocalizationStrings[209], 60, v0);//Ìàíà |
0 | 1087 sprintf(pTmpBuf, "%d", pPlayer->sMana); |
1088 v11 = pPlayer->GetMaxMana(); | |
1089 v12 = UI_GetHealthManaStringColor(pPlayer->sMana, v11); | |
1090 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v10, v12, pTmpBuf, 84, v0); | |
1091 v13 = v45 + v10; | |
1092 if ( v43 == v0 ) | |
24 | 1093 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v13, v0, pGlobalTXT_LocalizationStrings[0], 60, v0);//Êëàññ áðîíè |
0 | 1094 v14 = pPlayer->GetActualAC(); |
1095 sprintf(pTmpBuf, "%d", v14); | |
1096 v15 = v0; | |
1097 v16 = pPlayer->GetBaseAC(); | |
1098 v17 = pPlayer->GetActualAC(); | |
1099 v18 = UI_GetHealthManaStringColor(v17, v16); | |
1100 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v13, v18, pTmpBuf, 84, v15); | |
1101 v0 = 0; | |
1102 v19 = v45 + v13; | |
1103 if ( !v43 ) | |
24 | 1104 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v19, 0, pGlobalTXT_LocalizationStrings[18], 60, 0);//Àòàêà |
0 | 1105 v20 = pPlayer->GetActualAttack(0); |
1106 sprintf(pTmpBuf, "%+d", v20); | |
1107 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v19, 0, pTmpBuf, 84, 0); | |
1108 v21 = v45 + v19; | |
1109 if ( !v43 ) | |
24 | 1110 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v21, 0, pGlobalTXT_LocalizationStrings[66], 60, 0);//Ïîâð. |
0 | 1111 v22 = pPlayer->GetMeleeDamageString(); |
1112 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v21, 0, v22, 84, 0); | |
1113 v23 = v45 + v21; | |
1114 if ( !v43 ) | |
24 | 1115 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v23, 0, pGlobalTXT_LocalizationStrings[203], 60, 0);// Ñòðåëÿòü |
0 | 1116 v24 = pPlayer->GetRangedAttack(); |
1117 sprintf(pTmpBuf, "%+d", v24); | |
1118 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v23, 0, pTmpBuf, 84, 0); | |
1119 v25 = v45 + v23; | |
1120 if ( !v43 ) | |
24 | 1121 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v25, 0, pGlobalTXT_LocalizationStrings[66], 60, 0);//Ïîâð. |
0 | 1122 v26 = pPlayer->GetRangedDamageString(); |
1123 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v25, 0, v26, 84, 0); | |
1124 v27 = v45 + v25; | |
1125 if ( !v43 ) | |
24 | 1126 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v27, 0, pGlobalTXT_LocalizationStrings[205], 60, 0);//Íàâûêè |
0 | 1127 v28 = 0; |
1128 v29 = (char *)pPlayer->pActiveSkills; | |
1129 v30 = 36; | |
1130 do | |
1131 { | |
1132 if ( *(short *)v29 ) | |
1133 ++v28; | |
1134 v29 += 2; | |
1135 --v30; | |
1136 } | |
1137 while ( v30 ); | |
1138 sprintf(pTmpBuf, "%lu", v28); | |
1139 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v27, 0, pTmpBuf, 84, 0); | |
1140 v31 = v45 + v27; | |
1141 if ( !v43 ) | |
24 | 1142 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v31, 0, pGlobalTXT_LocalizationStrings[168], 60, 0);//Î÷êè |
0 | 1143 sprintf(pTmpBuf, "%lu", pPlayer->uSkillPoints); |
24 | 1144 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v31, pPlayer->uSkillPoints != 0 ? v46 : 0, pTmpBuf, 84, 0); |
0 | 1145 v32 = v45 + v31; |
1146 v48 = pPlayer->GetMajorConditionIdx(); | |
1147 if ( !v43 ) | |
24 | 1148 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v32, 0, pGlobalTXT_LocalizationStrings[45], 60, 0);//Ñîñò. |
0 | 1149 v33 = aCharacterConditionNames[v48]; |
1150 v34 = GetConditionDrawColor(v48); | |
1151 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v32, v34, v33, 84, 0); | |
1152 v35 = v45 + v32; | |
1153 if ( !v43 ) | |
24 | 1154 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, 0x16u, v35, 0, pGlobalTXT_LocalizationStrings[170], 60, 0);//Á.Ïðèì. |
0 | 1155 v36 = pPlayer->uQuickSpell; |
1156 if ( v36 ) | |
1157 v37 = pSpellStats->pInfos[v36].pShortName; | |
1158 else | |
24 | 1159 v37 = pGlobalTXT_LocalizationStrings[153];//Íåò |
0 | 1160 pGUIWindow_CurrentMenu->DrawTextInRect(pFontArrus, v44, v35, 0, v37, 84, 0); |
1161 ++v43; | |
1162 } | |
1163 while ( v43 < 4 ); | |
566 | 1164 |
0 | 1165 v38 = GetPartyReputation(); |
1166 if ( v38 >= 0 ) | |
1167 { | |
1168 if ( v38 <= 5 ) | |
566 | 1169 v39 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0xFF, 0xFF); |
1170 else | |
1171 v39 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFF, 0, 0); | |
0 | 1172 } |
1173 else | |
1174 v39 = v46; | |
566 | 1175 |
0 | 1176 v40 = GetReputationString(v38); |
566 | 1177 sprintf(pTmpBuf, "%s: \xC" "%05d%s\xC" "00000", pGlobalTXT_LocalizationStrings[180], v39, v40);//Reputation |
0 | 1178 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 22, 323, 0, pTmpBuf, 0, 0, 0); |
1179 v41 = pParty->GetPartyFame(); | |
24 | 1180 sprintf(pTmpBuf, "\r261%s: %d", pGlobalTXT_LocalizationStrings[84], v41);// Fame Ñëàâà |
566 | 1181 pGUIWindow_CurrentMenu->DrawText(pFontArrus, 0, 323, 0, pTmpBuf, 0, 0, 0); |
0 | 1182 } |
1183 | |
1184 //----- (0041ABFD) -------------------------------------------------------- | |
1185 void __thiscall CharacterUI_CharacterScreen_Draw(unsigned int uPlayerIdx) | |
1186 { | |
1187 unsigned int v1; // edi@1 | |
1188 unsigned int v2; // eax@6 | |
17 | 1189 Texture *pTexture; // ecx@6 |
1190 GUIButton *pButton; // eax@6 | |
0 | 1191 unsigned int v5; // eax@7 |
1192 unsigned int v6; // eax@10 | |
1193 unsigned int v7; // eax@11 | |
1194 | |
1195 v1 = uPlayerIdx; | |
1196 if ( uPlayerIdx ) | |
1197 { | |
1198 pRenderer->ClearZBuffer(0, 479); | |
1199 switch ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] ) | |
1200 { | |
17 | 1201 case WINDOW_CharacterWindow_Stats: // stats |
0 | 1202 sub_4196A0(); |
1203 sub_419379(); | |
1204 CharacterUI_StatsTab_Draw(v1); | |
1205 v7 = pIcons_LOD->LoadTexture("ib-cd1-d", TEXTURE_16BIT_PALETTE); | |
17 | 1206 pTexture = (Texture *)(v7 != -1 ? (int)&pIcons_LOD->pTextures[v7] : 0); |
1207 pButton = pCharacterScreen_StatsBtn; | |
0 | 1208 break; |
17 | 1209 case WINDOW_CharacterWindow_Skills: // skills |
0 | 1210 if ( dword_507CC0 != uActiveCharacter ) |
1211 { | |
1212 sub_4196A0(); | |
39 | 1213 CharacterUI_SkillScreen_Draw(); |
0 | 1214 } |
1215 sub_419379(); | |
1216 CharacterUI_SkillsTab_Draw(v1); | |
1217 v6 = pIcons_LOD->LoadTexture("ib-cd2-d", TEXTURE_16BIT_PALETTE); | |
17 | 1218 pTexture = (Texture *)(v6 != -1 ? (int)&pIcons_LOD->pTextures[v6] : 0); |
1219 pButton = pCharacterScreen_SkillsBtn; | |
0 | 1220 break; |
17 | 1221 case WINDOW_CharacterWindow_Awards: // awards |
0 | 1222 sub_4196A0(); |
1223 sub_419379(); | |
1224 sub_419220(); | |
1225 CharacterUI_AwardsTab_Draw(v1); | |
1226 v5 = pIcons_LOD->LoadTexture("ib-cd4-d", TEXTURE_16BIT_PALETTE); | |
17 | 1227 pTexture = (Texture *)(v5 != -1 ? (int)&pIcons_LOD->pTextures[v5] : 0); |
1228 pButton = pCharacterScreen_AwardsBtn; | |
0 | 1229 break; |
17 | 1230 default: // inventory and other |
0 | 1231 if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] != 103 ) |
1232 goto LABEL_13; | |
1233 sub_4196A0(); | |
1234 sub_419379(); | |
1235 CharacterUI_InventoryTab_Draw(v1, 0); | |
1236 v2 = pIcons_LOD->LoadTexture("ib-cd3-d", TEXTURE_16BIT_PALETTE); | |
17 | 1237 pTexture = (Texture *)(v2 != -1 ? (int)&pIcons_LOD->pTextures[v2] : 0); |
1238 pButton = pCharacterScreen_InventoryBtn; | |
0 | 1239 break; |
1240 } | |
17 | 1241 pRenderer->DrawTextureIndexed(pButton->uX, pButton->uY, pTexture); |
0 | 1242 LABEL_13: |
1243 if ( bRingsShownInCharScreen ) | |
1244 CharacterUI_DrawPaperdollWithRingOverlay(v1); | |
1245 else | |
1246 CharacterUI_DrawPaperdoll(v1); | |
1247 } | |
1248 } | |
1249 | |
1250 //----- (0041AD6E) -------------------------------------------------------- | |
1251 void __cdecl GameUI_DrawRightPanelItems() | |
1252 { | |
569 | 1253 if (GameUI_RightPanel_BookFlashTimer > pParty->uTimePlayed) |
1254 GameUI_RightPanel_BookFlashTimer = 0; | |
1255 | |
1256 if (pParty->uTimePlayed - GameUI_RightPanel_BookFlashTimer > 128) | |
0 | 1257 { |
569 | 1258 GameUI_RightPanel_BookFlashTimer = pParty->uTimePlayed; |
0 | 1259 byte_50697C = byte_50697C == 0; |
151 | 1260 if ( byte_50697C && pCurrentScreen != SCREEN_REST ) |
0 | 1261 { |
1262 if ( bFlashQuestBook ) | |
569 | 1263 pRenderer->DrawTextureTransparent(493, 355, pIcons_LOD->GetTexture(uTextureID_ib_td1_A)); |
0 | 1264 if ( bFlashAutonotesBook ) |
569 | 1265 pRenderer->DrawTextureTransparent(527, 353, pIcons_LOD->GetTexture(uTextureID_ib_td2_A)); |
0 | 1266 if ( bFlashHistoryBook ) |
569 | 1267 pRenderer->DrawTextureTransparent(600, 361, pIcons_LOD->GetTexture(uTextureID_ib_td5_A)); |
0 | 1268 } |
1269 else | |
1270 { | |
1271 pRenderer->DrawTextureRGB(468u, 0, pTexture_RightFrame); | |
1272 DrawHiredNPCs(); | |
1273 } | |
1274 } | |
1275 } | |
1276 | |
1277 //----- (0041AEBB) -------------------------------------------------------- | |
1278 void __cdecl GameUI_DrawFoodAndGold() | |
1279 { | |
1280 int v2; // esi@2 | |
1281 | |
1282 if ( uGameState != GAME_STATE_FINAL_WINDOW ) | |
1283 { | |
1284 v2 = sub_44100D() != 0 ? 381 : 322; | |
1285 sprintf(pTmpBuf, "\r087%lu", pParty->uNumFoodRations); | |
569 | 1286 pPrimaryWindow->DrawText(pFontSmallnum, 0, v2, uGameUIFontMain, pTmpBuf, 0, 0, uGameUIFontShadow); |
0 | 1287 sprintf(pTmpBuf, "\r028%lu", pParty->uNumGold); |
569 | 1288 pPrimaryWindow->DrawText(pFontSmallnum, 0, v2, uGameUIFontMain, pTmpBuf, 0, 0, uGameUIFontShadow); |
0 | 1289 } |
1290 } | |
1291 | |
1292 //----- (0041AF52) -------------------------------------------------------- | |
1293 void Actor::DrawHealthBar(Actor *a1, GUIWindow *a2) | |
1294 { | |
1295 unsigned int v2; // eax@1 | |
1296 GUIWindow *v3; // edi@1 | |
1297 unsigned int v4; // esi@1 | |
1298 signed int v5; // ebx@4 | |
1299 double v6; // st7@5 | |
1300 unsigned int v7; // eax@6 | |
1301 unsigned int v8; // ebx@10 | |
1302 unsigned int v9; // [sp+14h] [bp-Ch]@4 | |
1303 unsigned int v10; // [sp+1Ch] [bp-4h]@4 | |
1304 | |
1305 v2 = a1->pMonsterInfo.uHP; | |
1306 v3 = a2; | |
1307 v4 = 25; | |
1308 if ( (signed int)v2 > 25 ) | |
1309 { | |
1310 v4 = 200; | |
1311 if ( (signed int)v2 < 200 ) | |
1312 v4 = a1->pMonsterInfo.uHP; | |
1313 } | |
1314 v5 = a1->sCurrentHP; | |
1315 v10 = v4; | |
1316 v9 = uTextureID_mhp_grn; | |
1317 if ( v5 < (signed int)v2 ) | |
1318 { | |
1319 v6 = (double)(signed int)v2; | |
1320 v10 = (signed __int64)((double)(signed int)v4 / (double)(signed int)v2 * (double)a1->sCurrentHP); | |
1321 if ( v5 <= (signed int)(signed __int64)(0.34 * v6) ) | |
1322 { | |
1323 v7 = uTextureID_mhp_red; | |
1324 LABEL_9: | |
1325 v9 = v7; | |
1326 goto LABEL_10; | |
1327 } | |
1328 if ( v5 <= (signed int)(signed __int64)(v6 * 0.67) ) | |
1329 { | |
1330 v7 = uTextureID_mhp_yel; | |
1331 goto LABEL_9; | |
1332 } | |
1333 } | |
1334 LABEL_10: | |
1335 v8 = a2->uFrameX + (signed int)(a2->uFrameWidth - v4) / 2; | |
1336 pRenderer->Clip(v8, a2->uFrameY + 32, v8 + v4, a2->uFrameY + 52); | |
1337 pRenderer->DrawTextureIndexed( | |
1338 v8, | |
1339 v3->uFrameY + 32, | |
1340 (Texture *)(uTextureID_mhp_bd != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_mhp_bd] : 0)); | |
1341 pRenderer->Clip(v8, v3->uFrameY + 32, v8 + v10, v3->uFrameY + 52); | |
1342 pRenderer->DrawTextureIndexed( | |
1343 v8, | |
1344 v3->uFrameY + 34, | |
1345 (Texture *)(v9 != -1 ? (int)&pIcons_LOD->pTextures[v9] : 0)); | |
1346 pRenderer->ResetClip(); | |
1347 pRenderer->DrawTextureIndexed( | |
1348 v8 - 5, | |
1349 v3->uFrameY + 32, | |
1350 (Texture *)(uTextureID_mhp_capl != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_mhp_capl] : 0)); | |
1351 pRenderer->DrawTextureIndexed( | |
1352 v8 + v4, | |
1353 v3->uFrameY + 32, | |
1354 (Texture *)(uTextureID_mhp_capr != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_mhp_capr] : 0)); | |
1355 } | |
1356 | |
1357 //----- (0041B0C9) -------------------------------------------------------- | |
1358 void __cdecl GameUI_DrawLifeManaBars() | |
1359 { | |
1360 Texture *v0; // ebx@1 | |
1361 Player *v1; // ecx@2 | |
1362 float v2; // ST38_4@3 | |
1363 double v3; // st7@3 | |
1364 signed __int64 v4; // qax@6 | |
1365 Player *v5; // ecx@24 | |
1366 float v6; // ST30_4@25 | |
1367 double v7; // st7@25 | |
1368 bool v8; // ST38_4@27 | |
1369 Texture *v9; // [sp-4h] [bp-30h]@10 | |
1370 Texture *v10; // [sp+Ch] [bp-20h]@1 | |
1371 Player *v11; // [sp+10h] [bp-1Ch]@2 | |
1372 int v12; // [sp+10h] [bp-1Ch]@24 | |
1373 Texture *v13; // [sp+14h] [bp-18h]@1 | |
1374 Texture *v14; // [sp+18h] [bp-14h]@1 | |
1375 float v15; // [sp+1Ch] [bp-10h]@1 | |
1376 signed int v16; // [sp+24h] [bp-8h]@1 | |
1377 signed int v17; // [sp+28h] [bp-4h]@8 | |
1378 | |
1379 v0 = (Texture *)(uTextureID_BarGreen != -1 ? &pIcons_LOD->pTextures[uTextureID_BarGreen] : 0); | |
1380 v14 = (Texture *)(uTextureID_BarYellow != -1 ? &pIcons_LOD->pTextures[uTextureID_BarYellow] : 0); | |
1381 v13 = (Texture *)(uTextureID_BarRed != -1 ? &pIcons_LOD->pTextures[uTextureID_BarRed] : 0); | |
1382 v16 = 0; | |
1383 v10 = (Texture *)(uTextureID_BarBlue != -1 ? &pIcons_LOD->pTextures[uTextureID_BarBlue] : 0); | |
1384 v15 = (double)(uTextureID_BarGreen != -1 ? pIcons_LOD->pTextures[uTextureID_BarGreen].uTextureHeight : 26); | |
1385 do | |
1386 { | |
1387 v1 = &pParty->pPlayers[v16]; | |
1388 v11 = v1; | |
1389 if ( v1->sHealth <= 0 ) | |
1390 goto LABEL_24; | |
1391 v11 = &pParty->pPlayers[v16]; | |
1392 v2 = (double)v1->sHealth; | |
1393 v3 = v2 / (double)v1->GetMaxHealth(); | |
1394 if ( v3 <= 0.5 ) | |
1395 { | |
1396 if ( v3 <= 0.25 ) | |
1397 { | |
1398 if ( v3 <= 0.0 ) | |
1399 goto LABEL_24; | |
1400 if ( v16 == 2 || v16 == 3 ) | |
1401 v17 = 2; | |
1402 else | |
1403 v17 = 0; | |
1404 pRenderer->Clip( | |
1405 v17 + pHealthBarPos[v16], | |
1406 (unsigned __int64)(signed __int64)((1.0 - v3) * v15) + 402, | |
1407 v17 + pHealthBarPos[v16] + v13->uTextureWidth, | |
1408 v13->uTextureHeight + 402); | |
1409 v9 = v13; | |
1410 } | |
1411 else | |
1412 { | |
1413 if ( v16 == 2 || v16 == 3 ) | |
1414 v17 = 2; | |
1415 else | |
1416 v17 = 0; | |
1417 pRenderer->Clip( | |
1418 v17 + pHealthBarPos[v16], | |
1419 (unsigned __int64)(signed __int64)((1.0 - v3) * v15) + 402, | |
1420 v17 + pHealthBarPos[v16] + v14->uTextureWidth, | |
1421 v14->uTextureHeight + 402); | |
1422 v9 = v14; | |
1423 } | |
1424 } | |
1425 else | |
1426 { | |
1427 if ( v3 > 1.0 ) | |
1428 v3 = 1.0; | |
1429 v4 = (signed __int64)((1.0 - v3) * v15); | |
1430 if ( v16 == 2 || v16 == 3 ) | |
1431 v17 = 2; | |
1432 else | |
1433 v17 = 0; | |
1434 pRenderer->Clip( | |
1435 v17 + pHealthBarPos[v16], | |
1436 v4 + 402, | |
1437 v17 + pHealthBarPos[v16] + v0->uTextureWidth, | |
1438 v0->uTextureHeight + 402); | |
1439 v9 = v0; | |
1440 } | |
1441 pRenderer->DrawTextureIndexed(v17 + pHealthBarPos[v16], 0x192u, v9); | |
1442 pRenderer->ResetClip(); | |
1443 LABEL_24: | |
1444 v5 = v11; | |
1445 v12 = v11->sMana; | |
1446 if ( v12 > 0 ) | |
1447 { | |
1448 v6 = (double)v12; | |
1449 v7 = v6 / (double)v5->GetMaxMana(); | |
1450 if ( v7 > 1.0 ) | |
1451 v7 = 1.0; | |
1452 v8 = v16 == 2; | |
1453 pRenderer->Clip( | |
1454 (v16 == 2) + pManaBarPos[v16], | |
1455 (unsigned __int64)(signed __int64)((1.0 - v7) * v15) + 402, | |
1456 v8 + pManaBarPos[v16] + v10->uTextureWidth, | |
1457 v10->uTextureHeight + 402); | |
1458 pRenderer->DrawTextureIndexed(v8 + pManaBarPos[v16], 0x192u, v10); | |
1459 pRenderer->ResetClip(); | |
1460 } | |
1461 ++v16; | |
1462 } | |
1463 while ( v16 < 4 ); | |
1464 } | |
1465 | |
1466 //----- (0041B3B6) -------------------------------------------------------- | |
1467 void __cdecl draw_right_panel() | |
1468 { | |
1469 pRenderer->DrawTextureTransparent( | |
1470 pViewport->uViewportZ, | |
1471 0, | |
1472 (Texture *)(uTextureID_right_panel != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_right_panel] : 0)); | |
1473 } | |
1474 | |
1475 //----- (0041B3E2) -------------------------------------------------------- | |
1476 void __cdecl GameUI_DrawRightPanelFrames() | |
1477 { | |
1478 pRenderer->DrawTextureRGB(0, 0, pTexture_TopFrame); | |
1479 pRenderer->DrawTextureRGB(0, 8u, pTexture_LeftFrame); | |
1480 pRenderer->DrawTextureRGB(468u, 0, pTexture_RightFrame); | |
1481 pRenderer->DrawTextureRGB(0, 352u, pTexture_BottomFrame); | |
1482 GameUI_DrawFoodAndGold(); | |
1483 GameUI_DrawRightPanelItems(); | |
1484 } | |
1485 | |
1486 //----- (0041B438) -------------------------------------------------------- | |
1487 GUIButton *__fastcall GUI_HandleHotkey(unsigned __int8 uHotkey) | |
1488 { | |
1489 char v1; // al@1 | |
1490 int v2; // esi@1 | |
1491 char v3; // dl@1 | |
1492 GUIWindow *v4; // ecx@2 | |
1493 GUIButton *result; // eax@2 | |
1494 int v6; // edx@12 | |
1495 | |
1496 v1 = toupper(uHotkey); | |
1497 v2 = uNumVisibleWindows; | |
1498 v3 = v1; | |
1499 if ( uNumVisibleWindows >= 0 ) | |
1500 { | |
1501 while ( 2 ) | |
1502 { | |
1503 v4 = &pWindowList[pVisibleWindowsIdxs[v2] - 1]; | |
1504 for ( result = v4->pControlsHead; result; result = result->pNext ) | |
1505 { | |
1506 if ( result->uHotkey == v3 ) | |
1507 { | |
1508 v6 = result->uControlParam; | |
437 | 1509 pMessageQueue_50CBD0->AddMessage((UIMessageType)result->uControlID, v6, 0); |
1510 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
0 | 1511 { |
1512 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)result->uControlID; | |
1513 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v6; | |
1514 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
1515 ++pMessageQueue_50CBD0->uNumMessages; | |
437 | 1516 }*/ |
0 | 1517 return result; |
1518 } | |
1519 } | |
1520 if ( v4->uFrameX || v4->uFrameY || !(v4->uFrameWidth == 640 & v4->uFrameHeight == 480) ) | |
1521 { | |
1522 --v2; | |
1523 if ( v2 >= 0 ) | |
1524 continue; | |
1525 } | |
1526 break; | |
1527 } | |
1528 } | |
1529 return 0; | |
1530 } | |
1531 // 5075E0: using guessed type int pVisibleWindowsIdxs[20]; | |
1532 | |
1533 //----- (0041B4E1) -------------------------------------------------------- | |
1534 int __fastcall GUI_ReplaceHotkey(unsigned __int8 uOldHotkey, unsigned __int8 uNewHotkey, char bFirstCall) | |
1535 { | |
1536 unsigned __int8 v3; // bl@1 | |
1537 int result; // eax@1 | |
1538 int i; // edx@2 | |
1539 GUIButton *j; // ecx@3 | |
1540 int k; // edx@7 | |
1541 GUIButton *l; // ecx@8 | |
1542 unsigned __int8 v9; // [sp+4h] [bp-8h]@1 | |
1543 char v10; // [sp+8h] [bp-4h]@1 | |
1544 | |
1545 v3 = uNewHotkey; | |
1546 v10 = toupper(uOldHotkey); | |
1547 result = toupper(v3); | |
1548 v9 = result; | |
1549 if ( bFirstCall ) | |
1550 { | |
1551 for ( i = uNumVisibleWindows; i >= 0; --i ) | |
1552 { | |
1553 result = 84 * pVisibleWindowsIdxs[i]; | |
1554 //for ( j = *(GUIButton **)((char *)pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_ + result); j; j = j->pNext ) | |
1555 for ( j = pWindowList[pVisibleWindowsIdxs[i] - 1].pControlsHead; j; j = j->pNext ) | |
1556 j->field_28 = 0; | |
1557 } | |
1558 } | |
1559 for ( k = uNumVisibleWindows; k >= 0; --k ) | |
1560 { | |
1561 result = 84 * pVisibleWindowsIdxs[k]; | |
1562 //for ( l = *(GUIButton **)((char *)pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_ + result); l; l = l->pNext ) | |
1563 for ( l = pWindowList[pVisibleWindowsIdxs[k] - 1].pControlsHead; l; l = l->pNext ) | |
1564 { | |
1565 LOBYTE(result) = v10; | |
1566 if ( l->uHotkey == v10 ) | |
1567 { | |
1568 if ( !l->field_28 ) | |
1569 { | |
1570 LOBYTE(result) = v9; | |
1571 l->field_28 = 1; | |
1572 l->uHotkey = v9; | |
1573 } | |
1574 } | |
1575 } | |
1576 } | |
1577 return result; | |
1578 } | |
1579 // 5075E0: using guessed type int pVisibleWindowsIdxs[20]; | |
1580 | |
1581 //----- (0041B578) -------------------------------------------------------- | |
1582 void __cdecl MainMenuUI_LoadFontsAndSomeStuff() | |
1583 { | |
1584 pIcons_LOD->SetupPalettes(pRenderer->uTargetRBits, | |
1585 pRenderer->uTargetGBits, | |
1586 pRenderer->uTargetBBits); | |
1587 pPaletteManager->SetColorChannelInfo(pRenderer->uTargetRBits, | |
1588 pRenderer->uTargetGBits, | |
1589 pRenderer->uTargetBBits); | |
1590 pPaletteManager->RecalculateAll(); | |
1591 | |
1592 for (uint i = 0; i < 480; ++i) | |
1593 pSRZBufferLineOffsets[i] = 640 * i; | |
1594 | |
1595 pRenderer->ResetClip(); | |
1596 | |
1597 uTextureID_FONTPAL = pIcons_LOD->LoadTexture("FONTPAL", TEXTURE_16BIT_PALETTE); | |
180 | 1598 pFontArrus = LoadFont("arrus.fnt", "FONTPAL", NULL); |
1599 pFontLucida = LoadFont("lucida.fnt", "FONTPAL", NULL); | |
1600 pFontCreate = LoadFont("create.fnt", "FONTPAL", NULL); | |
1601 pFontSmallnum = LoadFont("smallnum.fnt", "FONTPAL", NULL); | |
1602 pFontComic = LoadFont("comic.fnt", "FONTPAL", NULL); | |
0 | 1603 pFontArrus->field_3 = 0; |
1604 pFontLucida->field_3 = 0; | |
1605 pFontCreate->field_3 = 0; | |
1606 | |
1607 for (uint i = 0; i < 20; ++i) | |
1608 pWindowList[i].eWindowType = WINDOW_null; | |
1609 | |
1610 uNumVisibleWindows = -1; | |
1611 memset(pVisibleWindowsIdxs, 0, sizeof(pVisibleWindowsIdxs)); | |
1612 } | |
1613 | |
1614 //----- (0041B690) -------------------------------------------------------- | |
1615 void __cdecl MainMenuUI_Create() | |
1616 { | |
319 | 1617 //unsigned int v0; // eax@1 |
1618 //unsigned int v1; // eax@1 | |
1619 //unsigned int v2; // eax@1 | |
1620 //unsigned int v3; // eax@1 | |
1621 //unsigned int v4; // eax@1 | |
1622 //unsigned int v5; // eax@1 | |
0 | 1623 Texture *v6; // ST78_4@1 |
319 | 1624 //const char *v7; // ST5C_4@1 |
0 | 1625 unsigned __int8 v8; // al@1 |
1626 //Texture *v9; // ST60_4@1 | |
1627 Texture *v10; // ST78_4@1 | |
319 | 1628 //const char *v11; // ST5C_4@1 |
0 | 1629 unsigned __int8 v12; // al@1 |
1630 //Texture *v13; // ST60_4@1 | |
1631 unsigned int v14; // eax@1 | |
1632 Texture *v15; // ST78_4@1 | |
319 | 1633 //const char *v16; // ST5C_4@1 |
0 | 1634 unsigned __int8 v17; // al@1 |
1635 //Texture *v18; // ST60_4@1 | |
1636 unsigned int uTextureID_ib_td4_A; // eax@1 | |
1637 Texture *v20; // ST78_4@1 | |
1638 unsigned __int8 v22; // al@1 | |
1639 //Texture *v23; // ST60_4@1 | |
1640 Texture *v24; // eax@1 | |
319 | 1641 //Texture *v25; // esi@1 |
1642 //Texture *v26; // ST60_4@1 | |
1643 //const char *v27; // ST5C_4@1 | |
0 | 1644 unsigned __int8 v28; // al@1 |
1645 Texture *v29; // eax@1 | |
319 | 1646 //Texture *v30; // esi@1 |
1647 //Texture *v31; // ST60_4@1 | |
1648 //const char *v32; // ST5C_4@1 | |
0 | 1649 unsigned __int8 v33; // al@1 |
1650 | |
319 | 1651 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("wizeyeC")); |
1652 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("wizeyeB")); | |
1653 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("wizeyeA")); | |
1654 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("torchC")); | |
1655 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("torchB")); | |
1656 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("torchA")); | |
1657 | |
0 | 1658 pTextureIDs_pMapDirs[0] = pIcons_LOD->LoadTexture("MAPDIR8", TEXTURE_16BIT_PALETTE); |
1659 pTextureIDs_pMapDirs[1] = pIcons_LOD->LoadTexture("MAPDIR1", TEXTURE_16BIT_PALETTE); | |
1660 pTextureIDs_pMapDirs[2] = pIcons_LOD->LoadTexture("MAPDIR2", TEXTURE_16BIT_PALETTE); | |
1661 pTextureIDs_pMapDirs[3] = pIcons_LOD->LoadTexture("MAPDIR3", TEXTURE_16BIT_PALETTE); | |
1662 pTextureIDs_pMapDirs[4] = pIcons_LOD->LoadTexture("MAPDIR4", TEXTURE_16BIT_PALETTE); | |
1663 pTextureIDs_pMapDirs[5] = pIcons_LOD->LoadTexture("MAPDIR5", TEXTURE_16BIT_PALETTE); | |
1664 pTextureIDs_pMapDirs[6] = pIcons_LOD->LoadTexture("MAPDIR6", TEXTURE_16BIT_PALETTE); | |
1665 pTextureIDs_pMapDirs[7] = pIcons_LOD->LoadTexture("MAPDIR7", TEXTURE_16BIT_PALETTE); | |
319 | 1666 |
0 | 1667 uTextureID_BarBlue = pIcons_LOD->LoadTexture("ib-statB", TEXTURE_16BIT_PALETTE); |
1668 uTextureID_BarGreen = pIcons_LOD->LoadTexture("ib-statG", TEXTURE_16BIT_PALETTE); | |
1669 uTextureID_BarYellow = pIcons_LOD->LoadTexture("ib-statY", TEXTURE_16BIT_PALETTE); | |
1670 uTextureID_BarRed = pIcons_LOD->LoadTexture("ib-statR", TEXTURE_16BIT_PALETTE); | |
1671 uTextureID_mhp_bd = pIcons_LOD->LoadTexture("mhp_bg", TEXTURE_16BIT_PALETTE); | |
1672 uTextureID_mhp_capl = pIcons_LOD->LoadTexture("mhp_capl", TEXTURE_16BIT_PALETTE); | |
1673 uTextureID_mhp_capr = pIcons_LOD->LoadTexture("mhp_capr", TEXTURE_16BIT_PALETTE); | |
1674 uTextureID_mhp_grn = pIcons_LOD->LoadTexture("mhp_grn", TEXTURE_16BIT_PALETTE); | |
1675 uTextureID_mhp_red = pIcons_LOD->LoadTexture("mhp_red", TEXTURE_16BIT_PALETTE); | |
1676 uTextureID_mhp_yel = pIcons_LOD->LoadTexture("mhp_yel", TEXTURE_16BIT_PALETTE); | |
1677 uTextureID_Leather = pIcons_LOD->LoadTexture("LEATHER", TEXTURE_16BIT_PALETTE); | |
1678 pTexture_Leather = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("ibground", TEXTURE_16BIT_PALETTE)]; | |
1679 uTextureID_x_x_u = pIcons_LOD->LoadTexture("x_x_u", TEXTURE_16BIT_PALETTE); | |
1680 uTextureID_BUTTDESC2 = pIcons_LOD->LoadTexture("BUTTESC2", TEXTURE_16BIT_PALETTE); | |
1681 uTextureID_x_ok_u = pIcons_LOD->LoadTexture("x_ok_u", TEXTURE_16BIT_PALETTE); | |
1682 uTextureID_BUTTYES2 = pIcons_LOD->LoadTexture("BUTTYES2", TEXTURE_16BIT_PALETTE); | |
1683 uTextureID_BUTTMAKE = pIcons_LOD->LoadTexture("BUTTMAKE", TEXTURE_16BIT_PALETTE); | |
1684 uTextureID_BUTTMAKE2 = pIcons_LOD->LoadTexture("BUTTMAKE2", TEXTURE_16BIT_PALETTE); | |
1685 | |
1686 pPrimaryWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0); | |
1687 pPrimaryWindow->CreateButton(7u, 8u, 0x1CCu, 0x157u, 1, 0, 0xAu, 0, 0, "", 0); | |
1688 pPrimaryWindow->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 1u, 0x31u, "", 0); | |
1689 pPrimaryWindow->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 2u, 0x32u, "", 0); | |
1690 pPrimaryWindow->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 3u, 0x33u, "", 0); | |
1691 pPrimaryWindow->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 4u, 0x34u, "", 0); | |
1692 pPrimaryWindow->CreateButton(0x18u, 0x194u, 5u, 0x31u, 1, 93, 0, 1u, 0, "", 0); | |
1693 pPrimaryWindow->CreateButton(0x8Bu, 0x194u, 5u, 0x31u, 1, 93, 0, 2u, 0, "", 0); | |
1694 pPrimaryWindow->CreateButton(0xFFu, 0x194u, 5u, 0x31u, 1, 93, 0, 3u, 0, "", 0); | |
1695 pPrimaryWindow->CreateButton(0x172u, 0x194u, 5u, 0x31u, 1, 93, 0, 4u, 0, "", 0); | |
1696 pPrimaryWindow->CreateButton(0x61u, 0x194u, 5u, 0x31u, 1, 93, 0, 1u, 0, "", 0); | |
1697 pPrimaryWindow->CreateButton(0xD4u, 0x194u, 5u, 0x31u, 1, 93, 0, 2u, 0, "", 0); | |
1698 pPrimaryWindow->CreateButton(0x148u, 0x194u, 5u, 0x31u, 1, 93, 0, 3u, 0, "", 0); | |
1699 pPrimaryWindow->CreateButton(0x1BBu, 0x194u, 5u, 0x31u, 1, 93, 0, 4u, 0, "", 0); | |
319 | 1700 |
0 | 1701 uTextureID_ib_td1_A = pIcons_LOD->LoadTexture("ib-td1-A", TEXTURE_16BIT_PALETTE); |
1702 v6 = (Texture *)(uTextureID_ib_td1_A != -1 ? &pIcons_LOD->pTextures[uTextureID_ib_td1_A] : 0); | |
1703 v8 = pKeyActionMap->GetActionVKey(INPUT_Quest); | |
319 | 1704 pBtn_Quests = pPrimaryWindow->CreateButton(0x1EBu, 0x161u, v6->uTextureWidth, v6->uTextureHeight, 1, 0, 0xC8u, 0, v8, pGlobalTXT_LocalizationStrings[174], v6, 0); //Quests |
1705 | |
0 | 1706 uTextureID_ib_td2_A = pIcons_LOD->LoadTexture("ib-td2-A", TEXTURE_16BIT_PALETTE); |
1707 v10 = (Texture *)(uTextureID_ib_td2_A != -1 ? &pIcons_LOD->pTextures[uTextureID_ib_td2_A] : 0); | |
1708 v12 = pKeyActionMap->GetActionVKey(INPUT_Autonotes); | |
319 | 1709 pBtn_Autonotes = pPrimaryWindow->CreateButton(0x20Fu, 0x161u, v10->uTextureWidth, v10->uTextureHeight, 1, 0, 0xC9u, 0, v12, pGlobalTXT_LocalizationStrings[154], v10, 0);//Autonotes |
1710 | |
0 | 1711 v14 = pIcons_LOD->LoadTexture("ib-td3-A", TEXTURE_16BIT_PALETTE); |
319 | 1712 v15 = (Texture *)(v14 != -1 ? &pIcons_LOD->pTextures[v14] : 0); |
0 | 1713 v17 = pKeyActionMap->GetActionVKey(INPUT_Mapbook); |
319 | 1714 pBtn_Maps = pPrimaryWindow->CreateButton(0x222u, 0x161u, v15->uTextureWidth, v15->uTextureHeight, 1, 0, 0xCAu, 0, v17, pGlobalTXT_LocalizationStrings[139], v15, 0); //Maps |
1715 | |
0 | 1716 uTextureID_ib_td4_A = pIcons_LOD->LoadTexture("ib-td4-A", TEXTURE_16BIT_PALETTE); |
319 | 1717 v20 = (Texture *)(uTextureID_ib_td4_A != -1 ? &pIcons_LOD->pTextures[uTextureID_ib_td4_A] : 0); |
0 | 1718 v22 = pKeyActionMap->GetActionVKey(INPUT_TimeCal); |
17 | 1719 pBtn_Calendar = pPrimaryWindow->CreateButton(0x23Au, 0x161u, v20->uTextureWidth, v20->uTextureHeight, 1, 0, 0xCBu, 0, v22, |
1720 pGlobalTXT_LocalizationStrings[78],//Calendar | |
1721 v20, 0); | |
319 | 1722 |
0 | 1723 uTextureID_ib_td5_A = pIcons_LOD->LoadTexture("ib-td5-A", TEXTURE_16BIT_PALETTE); |
17 | 1724 pBtn_History = pPrimaryWindow->CreateButton(0x258u, 0x169u, |
0 | 1725 (uTextureID_ib_td5_A != -1 ? pIcons_LOD->pTextures[uTextureID_ib_td5_A].uTextureWidth : 24), |
1726 (uTextureID_ib_td5_A != -1 ? pIcons_LOD->pTextures[uTextureID_ib_td5_A].uTextureHeight : 26), | |
17 | 1727 1, 0, 0xE0u, 0, 0x48u, pGlobalTXT_LocalizationStrings[602],//History |
1728 (Texture *)(uTextureID_ib_td5_A != -1 ? &pIcons_LOD->pTextures[uTextureID_ib_td5_A] : 0), 0); | |
319 | 1729 |
0 | 1730 bFlashAutonotesBook = 0; |
1731 bFlashQuestBook = 0; | |
319 | 1732 bFlashHistoryBook = 0; |
1733 | |
1734 v24 = &pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn]; | |
0 | 1735 v28 = pKeyActionMap->GetActionVKey(INPUT_ZoomIn); |
358 | 1736 pBtn_ZoomIn = pPrimaryWindow->CreateButton(574, 136, v24->uTextureWidth, v24->uTextureHeight, 2, 0, 0x170u, 0, v28, pGlobalTXT_LocalizationStrings[252], // Zoom In |
1737 v24, 0); | |
319 | 1738 v29 = &pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut]; |
0 | 1739 v33 = pKeyActionMap->GetActionVKey(INPUT_ZoomOut); |
358 | 1740 pBtn_ZoomOut = pPrimaryWindow->CreateButton(519, 136, v29->uTextureWidth, v29->uTextureHeight, 2, 0, 0x16Fu, 0, v33, pGlobalTXT_LocalizationStrings[251], // Zoom Out |
1741 v29, 0); | |
0 | 1742 pPrimaryWindow->CreateButton(0x1E1u, 0, 0x99u, 0x43u, 1, 92, 0, 0, 0, "", 0); |
1743 pPrimaryWindow->CreateButton(0x1EBu, 0x95u, 0x40u, 0x4Au, 1, 0, 0x86u, 0, 0x35u, "", 0); | |
1744 pPrimaryWindow->CreateButton(0x231u, 0x95u, 0x40u, 0x4Au, 1, 0, 0x87u, 0, 0x36u, "", 0); | |
1745 pPrimaryWindow->CreateButton(0x1DCu, 0x142u, 0x4Du, 0x11u, 1, 100, 0, 0, 0, "", 0); | |
1746 pPrimaryWindow->CreateButton(0x22Bu, 0x142u, 0x4Du, 0x11u, 1, 101, 0, 0, 0, "", 0); | |
319 | 1747 pBtn_CastSpell = pPrimaryWindow->CreateButton(0x1DCu, 0x1C2u, |
1748 (uTextureID_Btn_CastSpell != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_CastSpell].uTextureWidth : 24), | |
1749 (uTextureID_Btn_CastSpell != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_CastSpell].uTextureHeight : 26), | |
358 | 1750 1, 0, 0x69u, 0, 0x43u, pGlobalTXT_LocalizationStrings[38], |
319 | 1751 (Texture *)(uTextureID_Btn_CastSpell != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_CastSpell] : 0), |
0 | 1752 0); |
319 | 1753 pBtn_Rest = pPrimaryWindow->CreateButton(0x206u, 0x1C2u, |
1754 (uTextureID_Btn_Rest != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_Rest].uTextureWidth : 24), | |
1755 (uTextureID_Btn_Rest != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_Rest].uTextureHeight : 26), | |
358 | 1756 1, 0, 0x68u, 0, 0x52u, pGlobalTXT_LocalizationStrings[182], |
1757 (Texture *)(uTextureID_Btn_Rest != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_Rest] : 0), 0); | |
319 | 1758 pBtn_QuickReference = pPrimaryWindow->CreateButton(0x230u, 0x1C2u, |
1759 (uTextureID_Btn_QuickReference != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_QuickReference].uTextureWidth : 24), | |
1760 (uTextureID_Btn_QuickReference != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_QuickReference].uTextureHeight : 26), | |
358 | 1761 1, 0, 0x6Au, 0, 0x5Au, pGlobalTXT_LocalizationStrings[173], |
1762 (Texture *)(uTextureID_Btn_QuickReference != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_QuickReference] : 0), 0); | |
319 | 1763 pBtn_GameSettings = pPrimaryWindow->CreateButton(0x25Au, 0x1C2u, |
1764 (uTextureID_Btn_GameSettings != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_GameSettings].uTextureWidth : 24), | |
1765 (uTextureID_Btn_GameSettings != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_GameSettings].uTextureHeight : 26), | |
358 | 1766 1, 0, 0x6Bu, 0, 0, pGlobalTXT_LocalizationStrings[93], |
569 | 1767 (Texture *)(uTextureID_Btn_GameSettings != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_GameSettings] : 0), 0); |
319 | 1768 pBtn_NPCLeft = pPrimaryWindow->CreateButton(0x1D5u, 0xB2u, |
1769 (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureWidth : 24), | |
1770 (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureHeight : 26), | |
358 | 1771 1, 0, 0xBCu, 0, 0, "", |
1772 (Texture *)(uTextureID_Btn_NPCLeft != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft] : 0), 0); | |
319 | 1773 pBtn_NPCRight = pPrimaryWindow->CreateButton(0x272u, 0xB2u, |
1774 (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureWidth : 24), | |
1775 (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureHeight : 26), | |
358 | 1776 1, 0, 0xBCu, 1u, 0, "", |
1777 (Texture *)(uTextureID_Btn_NPCRight != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCRight] : 0), 0); | |
569 | 1778 LoadPartyBuffIcons(); |
0 | 1779 } |
1780 | |
1781 | |
1782 //----- (0041C047) -------------------------------------------------------- | |
1783 void __cdecl GameUI_DrawStatusBar_2() | |
1784 { | |
1785 unsigned int v0; // eax@1 | |
1786 char *v1; // edx@2 | |
1787 unsigned int v2; // ST18_4@5 | |
1788 const char *v3; // ST0C_4@5 | |
1789 unsigned int v4; // ST08_4@5 | |
1790 int v5; // eax@5 | |
1791 | |
1792 pRenderer->DrawTextureRGB(0, 352u, pTexture_StatusBar); | |
1793 if ( GameUI_StatusBar_TimedStringTimeLeft ) | |
1794 { | |
1795 v1 = GameUI_StatusBar_TimedString; | |
1796 } | |
1797 else | |
1798 { | |
1799 if ( !pStatusBarString[0] ) | |
1800 return; | |
1801 v1 = pStatusBarString; | |
1802 } | |
1803 LOWORD(v0) = uGameUIFontShadow; | |
1804 v2 = v0; | |
1805 LOWORD(v0) = uGameUIFontMain; | |
1806 v3 = v1; | |
1807 v4 = v0; | |
1808 v5 = pFontLucida->AlignText_Center(0x1C2u, v1); | |
1809 pPrimaryWindow->DrawText(pFontLucida, v5 + 11, 357, v4, v3, 0, 0, v2); | |
1810 } | |
1811 | |
1812 //----- (0041C0B8) -------------------------------------------------------- | |
1813 void __thiscall sub_41C0B8_set_status_string(const char *pStr) | |
1814 { | |
1815 const char *v1; // esi@1 | |
1816 int i; // eax@7 | |
1817 int j; // eax@11 | |
1818 | |
1819 v1 = pStr; | |
1820 if ( pStr && strcmp(pStr, "test") && !IsBadStringPtrA(v1, 1u) && (*v1 || GameUI_StatusBar_TimedStringTimeLeft) ) | |
1821 { | |
1822 if ( GameUI_StatusBar_TimedStringTimeLeft ) | |
1823 { | |
1824 for ( i = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString); | |
1825 i > 450; | |
1826 i = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString) ) | |
1827 byte_5C3427[strlen(GameUI_StatusBar_TimedString)] = 0; | |
1828 } | |
1829 else | |
1830 { | |
1831 strcpy(pStatusBarString, v1); | |
1832 for ( j = pFontLucida->GetLineWidth(pStatusBarString); | |
1833 j > 450; | |
1834 j = pFontLucida->GetLineWidth(pStatusBarString) ) | |
1835 GameUI_StatusBar_TimedString[strlen(pStatusBarString) + 199] = 0; | |
1836 } | |
1837 } | |
1838 } | |
1839 | |
1840 //----- (0041C179) -------------------------------------------------------- | |
1841 void __cdecl GameUI_DrawStatusBar() | |
1842 { | |
1843 unsigned int v0; // ebp@1 | |
1844 char *v1; // edi@5 | |
1845 int v2; // eax@5 | |
1846 unsigned int v3; // esi@5 | |
1847 size_t v4; // eax@6 | |
1848 GUIFont *v5; // ecx@6 | |
1849 int v6; // eax@9 | |
1850 size_t v7; // eax@10 | |
1851 GUIFont *v8; // ecx@10 | |
1852 char v9; // zf@12 | |
1853 unsigned int v10; // ST08_4@13 | |
1854 int v11; // eax@13 | |
1855 | |
1856 v0 = uGameUIFontShadow; | |
1857 if ( pStatusBarString[0] || GameUI_StatusBar_TimedStringTimeLeft || bForceDrawStatusBar ) | |
1858 { | |
1859 pRenderer->DrawTextureRGB(0, 352u, pTexture_StatusBar); | |
1860 if ( GameUI_StatusBar_TimedStringTimeLeft ) | |
1861 { | |
1862 v1 = GameUI_StatusBar_TimedString; | |
1863 v2 = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString); | |
1864 v3 = 450; | |
1865 while ( v2 > 450 ) | |
1866 { | |
1867 v4 = strlen(GameUI_StatusBar_TimedString); | |
1868 v5 = pFontLucida; | |
1869 byte_5C3427[v4] = 0; | |
1870 v2 = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString); | |
1871 } | |
1872 } | |
1873 else | |
1874 { | |
1875 v1 = pStatusBarString; | |
1876 v6 = pFontLucida->GetLineWidth(pStatusBarString); | |
1877 v3 = 450; | |
1878 while ( v6 > 450 ) | |
1879 { | |
1880 v7 = strlen(pStatusBarString); | |
1881 v8 = pFontLucida; | |
1882 GameUI_StatusBar_TimedString[v7 + 199] = 0; | |
1883 v6 = pFontLucida->GetLineWidth(pStatusBarString); | |
1884 } | |
1885 } | |
1886 v9 = *v1 == 0; | |
1887 bForceDrawStatusBar = 0; | |
1888 if ( !v9 ) | |
1889 { | |
1890 v10 = uGameUIFontMain; | |
1891 v11 = pFontLucida->AlignText_Center(v3, v1); | |
1892 pPrimaryWindow->DrawText(pFontLucida, v11 + 11, 357, v10, v1, 0, 0, v0); | |
1893 } | |
1894 } | |
1895 } | |
1896 // 5C35BC: using guessed type int bForceDrawStatusBar; | |
1897 | |
1898 | |
1899 //----- (0041CD4F) -------------------------------------------------------- | |
1900 bool __thiscall sub_41CD4F(unsigned int _this) | |
1901 { | |
1902 unsigned int v1; // edi@1 | |
1903 unsigned int v2; // eax@2 | |
1904 int v3; // esi@3 | |
1905 int v4; // ecx@10 | |
1906 GUIButton *v5; // eax@11 | |
1907 int v6; // edx@12 | |
1908 int v7; // ecx@20 | |
1909 char v8; // zf@21 | |
1910 GUIButton *v9; // ecx@24 | |
1911 int v10; // esi@24 | |
1912 int v11; // edx@26 | |
1913 int v12; // edx@28 | |
1914 int v13; // esi@32 | |
1915 GUIButton *v14; // eax@37 | |
1916 int v15; // edx@38 | |
1917 int v17; // ecx@50 | |
1918 int v18; // edx@50 | |
1919 GUIButton *v19; // ecx@54 | |
1920 int v20; // esi@54 | |
1921 int v21; // edx@56 | |
1922 int v22; // ecx@59 | |
1923 int v23; // edx@59 | |
1924 int v24; // ecx@60 | |
1925 int v25; // esi@63 | |
1926 unsigned int v26; // [sp+Ch] [bp-14h]@1 | |
1927 int v27; // [sp+10h] [bp-10h]@1 | |
1928 int v28; // [sp+14h] [bp-Ch]@10 | |
1929 int v29; // [sp+14h] [bp-Ch]@36 | |
1930 unsigned int uClickX; // [sp+18h] [bp-8h]@10 | |
1931 unsigned int uClickY; // [sp+1Ch] [bp-4h]@10 | |
1932 | |
1933 v1 = 0; | |
1934 v26 = _this; | |
1935 v27 = uNumVisibleWindows; | |
1936 if ( uNumVisibleWindows < 0 ) | |
1937 return 0; | |
1938 v2 = pMessageQueue_50CBD0->uNumMessages; | |
1939 while ( 1 ) | |
1940 { | |
1941 v3 = pVisibleWindowsIdxs[v27] - 1; | |
1942 if ( pWindowList[v3].field_44 == v1 ) | |
1943 goto LABEL_47; | |
1944 if ( v26 != 34 ) | |
1945 break; | |
1946 if ( pWindowList[v3].field_30 != v1 ) | |
1947 { | |
1948 pMouse->GetClickPos(&uClickX, &uClickY); | |
1949 v4 = pWindowList[v3].pStartingPosActiveItem; | |
1950 v29 = v4 + pWindowList[v3].pNumPresenceButton; | |
1951 if ( v4 < v4 + pWindowList[v3].pNumPresenceButton ) | |
1952 { | |
1953 while ( 1 ) | |
1954 { | |
1955 v14 = pWindowList[v3].pControlsHead; | |
1956 if ( v4 > 0 ) | |
1957 { | |
1958 v15 = v4; | |
1959 do | |
1960 { | |
1961 v14 = v14->pNext; | |
1962 --v15; | |
1963 } | |
1964 while ( v15 ); | |
1965 } | |
1966 if ( (signed int)uClickX >= (signed int)v14->uX | |
1967 && (signed int)uClickX <= (signed int)v14->uZ | |
1968 && (signed int)uClickY >= (signed int)v14->uY | |
1969 && (signed int)uClickY <= (signed int)v14->uW ) | |
1970 goto LABEL_66; | |
1971 ++v4; | |
1972 if ( v4 >= v29 ) | |
1973 { | |
1974 LABEL_45: | |
1975 v1 = 0; | |
1976 goto LABEL_46; | |
1977 } | |
1978 } | |
1979 } | |
1980 goto LABEL_46; | |
1981 } | |
1982 LABEL_47: | |
1983 --v27; | |
1984 if ( v27 < 0 ) | |
1985 return 0; | |
1986 } | |
1987 if ( v26 == 37 ) | |
1988 { | |
1989 v12 = pWindowList[v3].field_34; | |
1990 if ( pWindowList[v3].pCurrentPosActiveItem - pWindowList[v3].pStartingPosActiveItem - v12 >= 0 ) | |
1991 { | |
151 | 1992 v8 = pCurrentScreen == SCREEN_PARTY_CREATION; |
0 | 1993 pWindowList[v3].pCurrentPosActiveItem -= v12; |
1994 if ( v8 ) | |
1995 { | |
187 | 1996 pAudioPlayer->PlaySound(SOUND_Button, v1, v1, -1, v1, v1, v1, v1); |
0 | 1997 v2 = pMessageQueue_50CBD0->uNumMessages; |
1998 } | |
1999 } | |
2000 if ( pWindowList[v3].field_30 != v1 ) | |
2001 goto LABEL_47; | |
2002 v9 = pWindowList[v3].pControlsHead; | |
2003 v13 = pWindowList[v3].pCurrentPosActiveItem; | |
2004 if ( v13 > (signed int)v1 ) | |
2005 { | |
2006 do | |
2007 { | |
2008 v9 = v9->pNext; | |
2009 --v13; | |
2010 } | |
2011 while ( v13 ); | |
2012 } | |
2013 LABEL_26: | |
2014 v11 = v9->uControlParam; | |
437 | 2015 /*if ( (signed int)v2 < 40 ) |
0 | 2016 { |
2017 pMessageQueue_50CBD0->pMessages[v2].eType = (UIMessageType)v9->uControlID; | |
2018 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v11; | |
2019 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = v1; | |
2020 v2 = pMessageQueue_50CBD0->uNumMessages + 1; | |
2021 ++pMessageQueue_50CBD0->uNumMessages; | |
437 | 2022 }*/ |
2023 pMessageQueue_50CBD0->AddMessage((UIMessageType)v9->uControlID, v11, v1); | |
0 | 2024 goto LABEL_47; |
2025 } | |
2026 if ( v26 != 38 ) | |
2027 { | |
2028 if ( v26 == 39 ) | |
2029 { | |
2030 v7 = pWindowList[v3].pCurrentPosActiveItem + pWindowList[v3].field_34; | |
2031 if ( v7 < pWindowList[v3].pNumPresenceButton + pWindowList[v3].pStartingPosActiveItem ) | |
2032 { | |
151 | 2033 v8 = pCurrentScreen == SCREEN_PARTY_CREATION; |
0 | 2034 pWindowList[v3].pCurrentPosActiveItem = v7; |
2035 if ( v8 ) | |
2036 { | |
187 | 2037 pAudioPlayer->PlaySound(SOUND_Button, v1, v1, -1, v1, v1, v1, v1); |
0 | 2038 v2 = pMessageQueue_50CBD0->uNumMessages; |
2039 } | |
2040 } | |
2041 if ( pWindowList[v3].field_30 != v1 ) | |
2042 goto LABEL_47; | |
2043 v9 = pWindowList[v3].pControlsHead; | |
2044 v10 = pWindowList[v3].pCurrentPosActiveItem; | |
2045 if ( v10 > (signed int)v1 ) | |
2046 { | |
2047 do | |
2048 { | |
2049 v9 = v9->pNext; | |
2050 --v10; | |
2051 } | |
2052 while ( v10 ); | |
2053 } | |
2054 goto LABEL_26; | |
2055 } | |
2056 if ( v26 == 40 ) | |
2057 { | |
2058 v17 = pWindowList[v3].pStartingPosActiveItem; | |
2059 v18 = pWindowList[v3].pCurrentPosActiveItem; | |
2060 if ( v18 >= pWindowList[v3].pNumPresenceButton + v17 - 1 ) | |
2061 pWindowList[v3].pCurrentPosActiveItem = v17; | |
2062 else | |
2063 pWindowList[v3].pCurrentPosActiveItem = v18 + 1; | |
2064 if ( pWindowList[v3].field_30 != v1 ) | |
2065 return 1; | |
2066 v19 = pWindowList[v3].pControlsHead; | |
2067 v20 = pWindowList[v3].pCurrentPosActiveItem; | |
2068 if ( v20 > (signed int)v1 ) | |
2069 { | |
2070 do | |
2071 { | |
2072 v19 = v19->pNext; | |
2073 --v20; | |
2074 } | |
2075 while ( v20 ); | |
2076 } | |
2077 goto LABEL_56; | |
2078 } | |
2079 if ( v26 == 41 ) | |
2080 { | |
2081 pMouse->GetClickPos(&uClickX, &uClickY); | |
2082 v4 = pWindowList[v3].pStartingPosActiveItem; | |
2083 v28 = v4 + pWindowList[v3].pNumPresenceButton; | |
2084 if ( v4 < v4 + pWindowList[v3].pNumPresenceButton ) | |
2085 { | |
2086 while ( 1 ) | |
2087 { | |
2088 v5 = pWindowList[v3].pControlsHead; | |
2089 if ( v4 > 0 ) | |
2090 { | |
2091 v6 = v4; | |
2092 do | |
2093 { | |
2094 v5 = v5->pNext; | |
2095 --v6; | |
2096 } | |
2097 while ( v6 ); | |
2098 } | |
2099 if ( (signed int)uClickX >= (signed int)v5->uX | |
2100 && (signed int)uClickX <= (signed int)v5->uZ | |
2101 && (signed int)uClickY >= (signed int)v5->uY | |
2102 && (signed int)uClickY <= (signed int)v5->uW ) | |
2103 break; | |
2104 ++v4; | |
2105 if ( v4 >= v28 ) | |
2106 goto LABEL_45; | |
2107 } | |
2108 LABEL_66: | |
2109 pWindowList[v3].pCurrentPosActiveItem = v4; | |
2110 return 1; | |
2111 } | |
2112 LABEL_46: | |
2113 v2 = pMessageQueue_50CBD0->uNumMessages; | |
2114 goto LABEL_47; | |
2115 } | |
2116 goto LABEL_47; | |
2117 } | |
2118 v22 = pWindowList[v3].pCurrentPosActiveItem; | |
2119 v23 = pWindowList[v3].pStartingPosActiveItem; | |
2120 if ( v22 <= v23 ) | |
2121 v24 = pWindowList[v3].pNumPresenceButton + v23 - 1; | |
2122 else | |
2123 v24 = v22 - 1; | |
2124 v8 = pWindowList[v3].field_30 == v1; | |
2125 pWindowList[v3].pCurrentPosActiveItem = v24; | |
2126 if ( !v8 ) | |
2127 return 1; | |
2128 v19 = pWindowList[v3].pControlsHead; | |
2129 v25 = pWindowList[v3].pCurrentPosActiveItem; | |
2130 if ( v25 > (signed int)v1 ) | |
2131 { | |
2132 do | |
2133 { | |
2134 v19 = v19->pNext; | |
2135 --v25; | |
2136 } | |
2137 while ( v25 ); | |
2138 } | |
2139 LABEL_56: | |
2140 v21 = v19->uControlParam; | |
437 | 2141 /*if ( (signed int)v2 < 40 ) |
0 | 2142 { |
2143 pMessageQueue_50CBD0->pMessages[v2].eType = (UIMessageType)v19->uControlID; | |
2144 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v21; | |
2145 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = v1; | |
2146 ++pMessageQueue_50CBD0->uNumMessages; | |
437 | 2147 }*/ |
2148 pMessageQueue_50CBD0->AddMessage((UIMessageType)v19->uControlID, v21, v1); | |
0 | 2149 return 1; |
2150 } | |
2151 | |
2152 //----- (0041D20D) -------------------------------------------------------- | |
2153 char __fastcall sub_41D20D_buff_remaining_time_string(int ecx0, GUIWindow *edx0, __int64 a3, GUIFont *a2) | |
2154 { | |
2155 unsigned int v4; // edi@1 | |
2156 unsigned int v5; // esi@1 | |
2157 unsigned int v6; // ebp@1 | |
2158 unsigned int v7; // ebx@1 | |
2159 signed __int64 v8; // ST34_8@1 | |
2160 signed __int64 v9; // kr00_8@1 | |
2161 char *v10; // eax@2 | |
2162 char *v11; // eax@7 | |
2163 char *v12; // eax@13 | |
2164 char *v13; // eax@19 | |
2165 int uY; // [sp+0h] [bp-20h]@1 | |
2166 GUIWindow *a1; // [sp+4h] [bp-1Ch]@1 | |
2167 signed __int64 v17; // [sp+10h] [bp-10h]@1 | |
2168 signed __int64 v18; // [sp+18h] [bp-8h]@1 | |
2169 unsigned int v19; // [sp+24h] [bp+4h]@1 | |
2170 | |
2171 a1 = edx0; | |
2172 uY = ecx0; | |
2173 v4 = (unsigned __int64)(signed __int64)((double)a3 * 0.234375) >> 32; | |
2174 v5 = (signed __int64)((double)a3 * 0.234375); | |
2175 v6 = (unsigned __int64)((signed __int64)((double)a3 * 0.234375) / 60) >> 32; | |
2176 v7 = (signed __int64)((double)a3 * 0.234375) / 60; | |
2177 v8 = (signed __int64)((double)a3 * 0.234375) / 60 / 60; | |
2178 v19 = (unsigned int)v8 / 0x18; | |
2179 v18 = (signed __int64)__PAIR__(v4, v5) % 60; | |
2180 v17 = (signed __int64)__PAIR__(v6, v7) % 60; | |
2181 v9 = v8 % 24; | |
2182 strcpy(pTmpBuf, "\r020"); | |
2183 if ( (unsigned int)v8 / 0x18 ) | |
2184 { | |
2185 v10 = pGlobalTXT_LocalizationStrings[57]; // Days | |
2186 if ( v19 <= 1 ) | |
2187 v10 = pGlobalTXT_LocalizationStrings[56]; // Day | |
2188 sprintf(pTmpBuf2, "%d %s ", v19, v10); | |
2189 strcat(pTmpBuf, pTmpBuf2); | |
2190 } | |
2191 if ( v9 ) | |
2192 { | |
2193 if ( v9 <= 1 ) | |
2194 v11 = pGlobalTXT_LocalizationStrings[109];// Hour | |
2195 else | |
2196 v11 = pGlobalTXT_LocalizationStrings[110];// Hours | |
2197 sprintf(pTmpBuf2, "%d %s ", v9, v11); | |
2198 strcat(pTmpBuf, pTmpBuf2); | |
2199 } | |
2200 if ( v17 && !v19 ) | |
2201 { | |
2202 if ( v17 <= 1 ) | |
2203 v12 = pGlobalTXT_LocalizationStrings[437];// Minute | |
2204 else | |
2205 v12 = pGlobalTXT_LocalizationStrings[436];// Minutes | |
2206 sprintf(pTmpBuf2, "%d %s ", v17, v12); | |
2207 strcat(pTmpBuf, pTmpBuf2); | |
2208 } | |
2209 if ( v18 && !v9 ) | |
2210 { | |
2211 if ( v18 <= 1 ) | |
2212 v13 = pGlobalTXT_LocalizationStrings[439];// Second | |
2213 else | |
2214 v13 = pGlobalTXT_LocalizationStrings[438];// Seconds | |
2215 sprintf(pTmpBuf2, "%d %s ", v18, v13); | |
2216 strcat(pTmpBuf, pTmpBuf2); | |
2217 } | |
2218 return a1->DrawText(a2, 32, uY, 0, pTmpBuf, 0, 0, 0); | |
2219 } | |
2220 | |
2221 | |
2222 //----- (0041D895) -------------------------------------------------------- | |
549 | 2223 void GameUI_DrawItemInfo( struct ItemGen* inspect_item ) |
2224 { | |
0 | 2225 ItemGen *v1; // esi@1 |
2226 unsigned int v2; // eax@3 | |
315 | 2227 //char *v3; // edi@5 |
2228 //unsigned int v4; // eax@5 | |
2229 //unsigned int v5; // esi@5 | |
0 | 2230 signed int v6; // eax@5 |
2231 int v7; // edx@5 | |
315 | 2232 //unsigned int v9; // eax@12 |
0 | 2233 char v10; // zf@16 |
2234 ItemGen *v11; // eax@16 | |
2235 ItemGen *v12; // eax@25 | |
315 | 2236 //unsigned int v13; // ecx@32 |
2237 //unsigned int v14; // eax@32 | |
2238 //Render *v15; // edi@33 | |
0 | 2239 const char *v16; // eax@34 |
2240 int v17; // eax@36 | |
2241 int v18; // esi@37 | |
2242 unsigned __int16 v19; // ax@37 | |
315 | 2243 //char v20; // al@40 |
0 | 2244 char v21; // al@44 |
315 | 2245 //char v22; // al@48 |
2246 //char v23; // al@51 | |
0 | 2247 int v24; // eax@52 |
2248 int v25; // eax@57 | |
2249 int v26; // eax@60 | |
2250 int v27; // eax@67 | |
2251 const char *v28; // edi@69 | |
2252 int v29; // eax@70 | |
549 | 2253 char v30; // edi@78 |
0 | 2254 const char *v31; // eax@78 |
2255 int v32; // ecx@81 | |
2256 unsigned int v33; // eax@81 | |
2257 int v34; // esi@81 | |
2258 const char *v35; // eax@85 | |
2259 const char *v36; // eax@87 | |
2260 unsigned int v37; // eax@109 | |
2261 unsigned int v38; // eax@109 | |
2262 int v39; // eax@113 | |
2263 GUIFont *v40; // edx@113 | |
2264 signed int v41; // [sp-20h] [bp-298h]@113 | |
2265 int v42; // [sp-1Ch] [bp-294h]@113 | |
315 | 2266 //char *v43; // [sp-18h] [bp-290h]@46 |
0 | 2267 unsigned int v44; // [sp-18h] [bp-290h]@113 |
315 | 2268 //int v45; // [sp-14h] [bp-28Ch]@46 |
0 | 2269 const char *v46; // [sp-14h] [bp-28Ch]@58 |
2270 char *v47; // [sp-14h] [bp-28Ch]@110 | |
315 | 2271 //char *v48; // [sp-10h] [bp-288h]@46 |
0 | 2272 const char *v49; // [sp-10h] [bp-288h]@56 |
2273 char *v50; // [sp-10h] [bp-288h]@58 | |
2274 int v51; // [sp-10h] [bp-288h]@110 | |
2275 const char *v52; // [sp-Ch] [bp-284h]@36 | |
315 | 2276 //int v53; // [sp-Ch] [bp-284h]@46 |
0 | 2277 char *v54; // [sp-Ch] [bp-284h]@56 |
2278 int v55; // [sp-Ch] [bp-284h]@58 | |
2279 int v56; // [sp-Ch] [bp-284h]@110 | |
2280 unsigned int v57; // [sp-8h] [bp-280h]@36 | |
315 | 2281 //int v58; // [sp-8h] [bp-280h]@46 |
0 | 2282 int v59; // [sp-8h] [bp-280h]@56 |
2283 int v60; // [sp-8h] [bp-280h]@58 | |
2284 unsigned int v61; // [sp-8h] [bp-280h]@110 | |
549 | 2285 char out_text[300]; // [sp+8h] [bp-270h]@40 |
309 | 2286 //char Dest[100]; // [sp+6Ch] [bp-20Ch]@40 |
2287 //char v64[100]; // [sp+D0h] [bp-1A8h]@40 | |
0 | 2288 char v65[120]; // [sp+134h] [bp-144h]@92 |
2289 char Source[40]; // [sp+1ACh] [bp-CCh]@49 | |
351 | 2290 stru351_summoned_item v67; |
2291 //int v67; // [sp+1D4h] [bp-A4h]@91 | |
2292 //int v68; // [sp+1D8h] [bp-A0h]@106 | |
2293 //int v69; // [sp+1DCh] [bp-9Ch]@101 | |
2294 //int v70; // [sp+1E0h] [bp-98h]@97 | |
2295 //int v71; // [sp+1E8h] [bp-90h]@93 | |
2296 //int v72; // [sp+1ECh] [bp-8Ch]@91 | |
0 | 2297 int var88; // [sp+1F0h] [bp-88h]@1 |
2298 Texture *v73; // [sp+1F4h] [bp-84h]@5 | |
315 | 2299 //unsigned int v75; // [sp+1F8h] [bp-80h]@5 |
2300 //char *v76; // [sp+1FCh] [bp-7Ch]@5 | |
0 | 2301 int v77; // [sp+200h] [bp-78h]@12 |
2302 int v78; // [sp+204h] [bp-74h]@5 | |
549 | 2303 GUIWindow wHintWindow; // [sp+208h] [bp-70h]@2 |
0 | 2304 POINT a2; // [sp+25Ch] [bp-1Ch]@2 |
2305 int v81; // [sp+264h] [bp-14h]@5 | |
549 | 2306 // GUIFont *pFontComic; // [sp+268h] [bp-10h]@1 |
2307 PlayerSpeech v83; // [sp+26Ch] [bp-Ch]@18 | |
2308 char* v84; | |
2309 int v85; | |
0 | 2310 char *Str; // [sp+270h] [bp-8h]@65 |
549 | 2311 |
2312 v1 = inspect_item; | |
0 | 2313 var88 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); |
549 | 2314 if (!inspect_item->uItemID) |
306 | 2315 return; |
2316 | |
549 | 2317 wHintWindow.Hint = 0; |
2318 wHintWindow.uFrameWidth = 384; | |
2319 wHintWindow.uFrameHeight = 180; | |
2320 wHintWindow.uFrameY = 40; | |
0 | 2321 if ( pMouse->GetCursorPos(&a2)->x <= 320 ) |
2322 v2 = pMouse->GetCursorPos(&a2)->x + 30; | |
2323 else | |
549 | 2324 v2 = pMouse->GetCursorPos(&a2)->x - wHintWindow.uFrameWidth - 30; |
2325 wHintWindow.uFrameX = v2; | |
2326 auto item_desc = &pItemsTable->pItems[inspect_item->uItemID]; | |
315 | 2327 //v3 = (char *)&pItemsTable->pItems[_this->uItemID].pIconName; |
2328 //v76 = v3; | |
2329 //v4 = pIcons_LOD->LoadTexture(pItemsTable->pItems[_this->uItemID].pIconName, TEXTURE_16BIT_PALETTE); | |
2330 //v5 = v4; | |
2331 //v4 *= 72; | |
2332 //v75 = v4; | |
2333 //v73 = &pIcons_LOD->pTextures[v4]; | |
2334 v73 = pIcons_LOD->LoadTexturePtr(item_desc->pIconName, TEXTURE_16BIT_PALETTE); | |
2335 v6 = 100 - v73->uTextureWidth; | |
0 | 2336 v7 = v73->uTextureHeight; |
2337 v78 = v6; | |
2338 v81 = 144 - v7; | |
2339 if ( v6 > 0 ) | |
2340 v78 = v6 >> 1; | |
2341 if ( v81 <= 0 ) | |
2342 v81 = 0; | |
2343 else | |
2344 v81 >>= 1; | |
315 | 2345 if ( !item_desc->uItemID_Rep_St ) |
549 | 2346 inspect_item->SetIdentified(); |
315 | 2347 //v9 = v8->uAttributes; |
0 | 2348 v77 = 0; |
315 | 2349 //a2.y = v8->uAttributes & 2; |
549 | 2350 if (pItemsTable->pItems[inspect_item->uItemID].uEquipType == EQUIP_GOLD) |
2351 v77 = inspect_item->uSpecEnchantmentType; | |
0 | 2352 if ( uActiveCharacter ) |
2353 { | |
549 | 2354 //try to identify |
2355 if (!inspect_item->Identified()) | |
0 | 2356 { |
549 | 2357 |
2358 v11 = inspect_item; | |
2359 if ( pPlayers[uActiveCharacter]->CanIdentify(inspect_item) == 1 ) | |
2360 inspect_item->SetIdentified(); | |
2361 v83 = SPEECH_9; | |
2362 if ( !inspect_item->Identified() ) | |
0 | 2363 { |
549 | 2364 ShowStatusBarString(pGlobalTXT_LocalizationStrings[446], 2u);//"Identify Failed" |
0 | 2365 } |
2366 else | |
2367 { | |
549 | 2368 v83 = SPEECH_8; |
2369 if ( inspect_item->GetValue() < 100 * (pPlayers[uActiveCharacter]->uLevel + 5) ) | |
2370 v83 = SPEECH_7; | |
0 | 2371 } |
2372 if ( dword_4E455C ) | |
2373 { | |
187 | 2374 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)(int)v83, 0); |
0 | 2375 dword_4E455C = 0; |
2376 } | |
2377 } | |
549 | 2378 inspect_item->UpdateTempBonus(pParty->uTimePlayed); |
2379 if (inspect_item->Broken()) | |
0 | 2380 { |
549 | 2381 if ( pPlayers[uActiveCharacter]->CanRepair(inspect_item) == 1 ) |
2382 inspect_item->uAttributes = inspect_item->uAttributes & 0xFFFFFFFD | 1; | |
2383 v83 = SPEECH_11; | |
2384 if ( !inspect_item->Broken() ) | |
2385 v83 = SPEECH_10; | |
0 | 2386 else |
549 | 2387 ShowStatusBarString(pGlobalTXT_LocalizationStrings[448], 2u);//"Repair Failed" |
0 | 2388 if ( dword_4E455C ) |
2389 { | |
549 | 2390 pPlayers[uActiveCharacter]->PlaySound(v83, 0); |
0 | 2391 dword_4E455C = 0; |
2392 } | |
2393 } | |
2394 } | |
315 | 2395 //v13 = _this->uAttributes; |
2396 //v14 = _this->Identified(); | |
549 | 2397 //a2.y = inspect_item->Identified(); |
2398 if (inspect_item->Broken()) | |
0 | 2399 { |
549 | 2400 wHintWindow.DrawMessageBox(0); |
0 | 2401 //v15 = &; |
549 | 2402 pRenderer->Clip(wHintWindow.uFrameX + 12, wHintWindow.uFrameY + 12, |
2403 wHintWindow.uFrameX + wHintWindow.uFrameWidth - 12, | |
2404 wHintWindow.uFrameY + wHintWindow.uFrameHeight - 12); | |
2405 wHintWindow.uFrameWidth -= 24; | |
2406 wHintWindow.uFrameHeight -= 12; | |
2407 wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1; | |
2408 wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1; | |
2409 pRenderer->DrawTransparentRedShade(wHintWindow.uFrameX + v78, v81 + wHintWindow.uFrameY + 30, v73); | |
2410 if ( inspect_item->Identified()) | |
2411 v16 = inspect_item->GetIdentifiedName(); | |
0 | 2412 else |
315 | 2413 v16 = item_desc->pUnidentifiedName; |
549 | 2414 wHintWindow.DrawTitleText(pFontArrus, 0, 0xCu, var88, v16, 3u); |
2415 v17 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[32], &wHintWindow, 0, 0); //"Broken Item" | |
0 | 2416 v18 = v17 >> 1; |
2417 v19 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0x19u, 0x19u); | |
549 | 2418 wHintWindow.DrawTitleText(pFontArrus, 0x64u, ((signed int)wHintWindow.uFrameHeight >> 1) - v18, v19, pGlobalTXT_LocalizationStrings[32], 3); //"Broken Item" |
2419 goto LABEL_116; | |
2420 } | |
2421 if (!inspect_item->Identified()) | |
2422 { | |
2423 wHintWindow.DrawMessageBox(0); | |
2424 pRenderer->Clip(wHintWindow.uFrameX + 12, wHintWindow.uFrameY + 12, | |
2425 wHintWindow.uFrameX + wHintWindow.uFrameWidth - 12, | |
2426 wHintWindow.uFrameY + wHintWindow.uFrameHeight - 12); | |
2427 wHintWindow.uFrameWidth -= 24; | |
2428 wHintWindow.uFrameHeight -= 12; | |
2429 wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1; | |
2430 wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1; | |
2431 pRenderer->DrawTextureTransparent(wHintWindow.uFrameX + v78, v81 + wHintWindow.uFrameY + 30, v73); | |
2432 wHintWindow.DrawTitleText(pFontArrus, 0, 0xCu, var88, item_desc->pUnidentifiedName, 3u); | |
2433 v17 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[232], &wHintWindow, 0, 0); ///"Not Identified" | |
2434 v18 = v17 >> 1; | |
2435 v19 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0x19u, 0x19u); | |
2436 wHintWindow.DrawTitleText(pFontArrus, 0x64u, ((signed int)wHintWindow.uFrameHeight >> 1) - v18, v19, pGlobalTXT_LocalizationStrings[232], 3); | |
0 | 2437 goto LABEL_116; |
2438 } | |
315 | 2439 |
549 | 2440 sprintfex(out_text, pGlobalTXT_LocalizationStrings[463], item_desc->pUnidentifiedName); //"Type: %s" |
2441 out_text[100] = 0; | |
2442 out_text[200] = 0; | |
315 | 2443 //v20 = item_desc->uEquipType; |
2444 switch (item_desc->uEquipType) | |
2445 { | |
2446 case EQUIP_ONE_OR_TWO_HANDS: | |
2447 case EQUIP_TWO_HANDED: | |
549 | 2448 sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[LOCSTR_ATTACK], |
2449 (int)item_desc->uDamageMod, pGlobalTXT_LocalizationStrings[53], (int)item_desc->uDamageDice, (int)item_desc->uDamageRoll); //"Damage" | |
315 | 2450 if (item_desc->uDamageMod) |
0 | 2451 { |
315 | 2452 char mod[16]; |
2453 sprintf(mod, "+%d", (int)item_desc->uDamageMod); | |
549 | 2454 strcat(out_text + 100, mod); |
315 | 2455 } |
2456 break; | |
2457 | |
2458 case EQUIP_BOW: | |
549 | 2459 sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[203], //"Shoot" |
2460 (int)item_desc->uDamageMod, pGlobalTXT_LocalizationStrings[53], //"Damage" | |
2461 (int)item_desc->uDamageDice, (int)item_desc->uDamageRoll); | |
315 | 2462 if (item_desc->uDamageMod) |
2463 { | |
2464 char mod[16]; | |
2465 sprintf(mod, "+%d", (int)item_desc->uDamageMod); | |
549 | 2466 strcat(out_text + 100, mod); |
0 | 2467 } |
315 | 2468 break; |
2469 | |
2470 case EQUIP_ARMOUR: | |
2471 case EQUIP_SHIELD: | |
2472 case EQUIP_HELMET: | |
2473 case EQUIP_BELT: | |
2474 case EQUIP_CLOAK: | |
2475 case EQUIP_GAUNTLETS: | |
2476 case EQUIP_BOOTS: | |
2477 case EQUIP_RING: | |
2478 case EQUIP_AMULET: | |
549 | 2479 if (item_desc->uDamageDice) //"Armor" |
2480 sprintfex(out_text + 100, "%s: +%d", pGlobalTXT_LocalizationStrings[11], item_desc->uDamageDice + item_desc->uDamageMod); | |
315 | 2481 break; |
549 | 2482 case EQUIP_POTION: |
2483 if ( inspect_item->uEncantmentType ) | |
2484 sprintf(out_text + 200, "%s: %d",pGlobalTXT_LocalizationStrings[449] , inspect_item->uEncantmentType); //"Power" | |
2485 break; | |
2486 case EQUIP_REAGENT: | |
2487 sprintf(out_text + 200, "%s: %d", pGlobalTXT_LocalizationStrings[449], pItemsTable->pItems[inspect_item->uItemID].uDamageDice); //"Power" | |
2488 break; | |
315 | 2489 } |
2490 | |
0 | 2491 if ( v77 ) |
2492 goto LABEL_65; | |
315 | 2493 //v23 = item_desc->uEquipType; |
549 | 2494 |
2495 | |
2496 if ( inspect_item->uEncantmentType ) | |
2497 { | |
2498 sprintf(out_text + 200, "%s: %s +%d", pGlobalTXT_LocalizationStrings[210], | |
559 | 2499 pItemsTable->pEnchantments[inspect_item->uEncantmentType-1].pBonusStat, inspect_item->_bonus_strength); //"Special" |
549 | 2500 } |
2501 else if ( inspect_item->uSpecEnchantmentType ) | |
559 | 2502 { |
549 | 2503 sprintf(out_text + 200, "%s: %s", pGlobalTXT_LocalizationStrings[210], |
559 | 2504 pItemsTable->pSpecialEnchantments[inspect_item->uSpecEnchantmentType-1].pBonusStatement, inspect_item->_bonus_strength); |
0 | 2505 } |
549 | 2506 |
2507 else if ( inspect_item->uNumCharges ) | |
2508 { | |
2509 sprintf(out_text + 200, "%s: %lu", pGlobalTXT_LocalizationStrings[464], inspect_item->uNumCharges); //"Charges" | |
2510 | |
2511 } | |
2512 | |
2513 LABEL_65: | |
2514 wHintWindow.uFrameWidth -= 12; | |
2515 v85 = 3; | |
2516 wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1; | |
2517 wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1; | |
2518 Str = (char *)(3 * (LOBYTE(pFontArrus->uFontHeight) + 8)); | |
2519 v84 = &out_text[0]; | |
2520 do | |
2521 { | |
2522 if ( *v84 ) | |
2523 { | |
2524 v27 = pFontComic->CalcTextHeight(v84, &wHintWindow, 100, 0); | |
2525 Str += v27 + 3; | |
2526 } | |
2527 v84 += 100; | |
2528 --v85; | |
2529 } | |
2530 while ( v85 ); | |
2531 v28 = item_desc->pDescription; | |
2532 if ( *v28 ) | |
2533 { | |
2534 v29 = pFontSmallnum->CalcTextHeight(v28, &wHintWindow, 100, 0); | |
2535 Str += v29; | |
2536 } | |
2537 wHintWindow.uFrameHeight = v73->uTextureHeight + v81 + 54; | |
2538 if ( (signed int)Str > (signed int)wHintWindow.uFrameHeight ) | |
2539 wHintWindow.uFrameHeight = (unsigned int)Str; | |
2540 if ( inspect_item->uAttributes & 8 && (inspect_item->uSpecEnchantmentType || inspect_item->uEncantmentType) ) | |
2541 wHintWindow.uFrameHeight += LOBYTE(pFontComic->uFontHeight); | |
2542 v85 = 0; | |
2543 if ( pFontArrus->uFontHeight ) | |
2544 { | |
2545 wHintWindow.uFrameWidth -= 24; | |
2546 v30 = pFontArrus->uFontHeight; | |
2547 v31 = inspect_item->GetIdentifiedName(); | |
2548 if ( pFontArrus->CalcTextHeight(v31, &wHintWindow, 0, 0) / (signed int)v30 ) | |
2549 v85 = v30; | |
2550 wHintWindow.uFrameWidth += 24; | |
2551 } | |
2552 wHintWindow.uFrameWidth += 12; | |
2553 wHintWindow.uFrameHeight += (unsigned int)v85; | |
2554 wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1; | |
2555 wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1; | |
2556 wHintWindow.DrawMessageBox(0); | |
2557 //v15 = pRenderer; | |
2558 pRenderer->Clip(wHintWindow.uFrameX + 12, wHintWindow.uFrameY + 12, | |
2559 wHintWindow.uFrameX + wHintWindow.uFrameWidth - 12, wHintWindow.uFrameY + wHintWindow.uFrameHeight - 12); | |
2560 wHintWindow.uFrameWidth -= 12; | |
2561 v32 = v73->uTextureHeight; | |
2562 v33 = wHintWindow.uFrameHeight; | |
2563 wHintWindow.uFrameHeight -= 12; | |
2564 wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1; | |
2565 wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1; | |
2566 pRenderer->DrawTextureTransparent( | |
2567 wHintWindow.uFrameX + v78, | |
2568 wHintWindow.uFrameY + (signed int)(v33 - v32) / 2, | |
2569 v73); | |
2570 | |
2571 v34 = (int)(v85 + 35); | |
2572 v85 = 3; | |
2573 Str = out_text; | |
2574 do | |
2575 { | |
2576 if ( *Str ) | |
2577 { | |
2578 wHintWindow.DrawText(pFontComic, 100, v34, 0, Str, 0, 0, 0); | |
2579 v34 += pFontComic->CalcTextHeight(Str, &wHintWindow, 100, 0) + 3; | |
2580 } | |
2581 Str += 100; | |
2582 --v85; | |
2583 } | |
2584 while (v85 ); | |
2585 v35 = item_desc->pDescription; | |
2586 if ( *v35 ) | |
2587 wHintWindow.DrawText(pFontSmallnum, 100, v34, 0, v35, 0, 0, 0); | |
2588 wHintWindow.uFrameX += 12; | |
2589 wHintWindow.uFrameWidth -= 24; | |
2590 v36 = inspect_item->GetIdentifiedName(); | |
2591 wHintWindow.DrawTitleText(pFontArrus, 0, 0xCu, var88, v36, 3u); | |
2592 wHintWindow.uFrameWidth += 24; | |
2593 wHintWindow.uFrameX -= 12; | |
2594 if ( v77 ) | |
2595 { | |
2596 sprintf(pTmpBuf, "%s: %lu", pGlobalTXT_LocalizationStrings[465], v77);//"Value" | |
2597 v40 = pFontComic; | |
2598 v61 = 0; | |
2599 v56 = 0; | |
2600 v51 = 0; | |
2601 v47 = pTmpBuf; | |
2602 v44 = 0; | |
2603 v42 = wHintWindow.uFrameHeight - LOBYTE(pFontComic->uFontHeight); | |
2604 v41 = 100; | |
2605 } | |
2606 else | |
2607 { | |
2608 if ( (inspect_item->uAttributes & 8) && (inspect_item->uSpecEnchantmentType || inspect_item->uEncantmentType) ) | |
2609 { | |
2610 sub_493F79(&v67, inspect_item->uExpireTime - pParty->uTimePlayed); | |
2611 strcpy(pTmpBuf, "Duration:"); | |
2612 Str = (char *)(v67.field_18_expire_year - game_starting_year); | |
2613 if (v67.field_18_expire_year != 1168 ) | |
2614 { | |
2615 sprintf(v65, " %d:yr", v67.field_18_expire_year - game_starting_year); | |
2616 strcat(pTmpBuf, v65); | |
2617 } | |
2618 if ( (((v67.field_14_exprie_month || Str) && | |
2619 ((sprintf(v65, " %d:mo", v67.field_14_exprie_month), strcat(pTmpBuf, v65), v67.field_14_exprie_month) || Str) | |
2620 || v67.field_C_expire_day) | |
2621 && ((sprintf(v65, " %d:dy", v67.field_C_expire_day), strcat(pTmpBuf, v65), v67.field_14_exprie_month) || Str || | |
2622 v67.field_C_expire_day) | |
2623 || v67.field_8_expire_hour) | |
2624 && ((sprintf(v65, " %d:hr", v67.field_8_expire_hour), strcat(pTmpBuf, v65), v67.field_14_exprie_month) || Str || | |
2625 v67.field_C_expire_day || v67.field_8_expire_hour) | |
2626 || v67.field_4_expire_minute ) | |
2627 { | |
2628 sprintf(v65, " %d:mn", v67.field_4_expire_minute); | |
2629 strcat(pTmpBuf, v65); | |
2630 } | |
2631 wHintWindow.DrawText(pFontComic, 100, wHintWindow.uFrameHeight - 2 * LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf, 0, 0, 0); | |
2632 } | |
2633 v37 = inspect_item->GetValue(); | |
2634 sprintf(pTmpBuf, "%s: %lu", pGlobalTXT_LocalizationStrings[465], v37); | |
2635 wHintWindow.DrawText(pFontComic, 100, wHintWindow.uFrameHeight - LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf, 0, 0, 0); | |
2636 v38 = inspect_item->uAttributes; | |
2637 if ( BYTE1(v38) & 1 ) | |
2638 { | |
2639 v61 = 0; | |
2640 v56 = 0; | |
2641 v51 = 0; | |
2642 v47 = pGlobalTXT_LocalizationStrings[187]; //"Stolen" | |
2643 } | |
2644 else | |
2645 { | |
2646 if ( !(BYTE1(v38) & 2) ) | |
2647 goto LABEL_116; | |
2648 v61 = 0; | |
2649 v56 = 0; | |
2650 v51 = 0; | |
2651 v47 = pGlobalTXT_LocalizationStrings[651]; //"Hardened" | |
2652 } | |
2653 LOWORD(v38) = LOWORD(pRenderer->uTargetRMask); | |
2654 v44 = v38; | |
2655 v42 = wHintWindow.uFrameHeight - LOBYTE(pFontComic->uFontHeight); | |
2656 v39 = pFontComic->GetLineWidth(pTmpBuf); | |
2657 v40 = pFontComic; | |
2658 v41 = v39 + 132; | |
2659 } | |
2660 wHintWindow.DrawText(v40, v41, v42, v44, v47, v51, v56, v61); | |
0 | 2661 LABEL_116: |
549 | 2662 pRenderer->ResetClip(); |
2663 if ( !areWeLoadingTexture ) | |
2664 { | |
2665 v73->Release(); | |
2666 pIcons_LOD->_40F9C5(); | |
2667 } | |
2668 return; | |
0 | 2669 } |
2670 // 4E455C: using guessed type int dword_4E455C; | |
2671 // 506128: using guessed type int areWeLoadingTexture; | |
2672 | |
549 | 2673 |
0 | 2674 //----- (0041E360) -------------------------------------------------------- |
2675 char *__fastcall MonsterPopup_Draw(unsigned int uActorID, GUIWindow *edx0) | |
2676 { | |
2677 unsigned int v2; // esi@1 | |
2678 Actor *v3; // esi@3 | |
2679 int v4; // eax@3 | |
2680 unsigned int v5; // ecx@3 | |
2681 NPCData *v6; // eax@3 | |
2682 unsigned __int16 v7; // cx@3 | |
2683 int v8; // eax@4 | |
2684 unsigned __int16 v9; // dx@4 | |
2685 SpriteFrame *v10; // edi@17 | |
243 | 2686 LODSprite *v11; // esi@17 |
0 | 2687 unsigned int v12; // ecx@17 |
2688 Sprite *v13; // edi@18 | |
2689 int v14; // ecx@18 | |
2690 int v15; // edx@18 | |
2691 int v16; // edx@18 | |
2692 int v17; // eax@18 | |
2693 unsigned int v18; // ecx@19 | |
2694 unsigned int v19; // eax@21 | |
2695 char *v20; // esi@28 | |
2696 int v21; // edx@29 | |
2697 unsigned __int16 *v22; // ecx@29 | |
2698 int v23; // eax@29 | |
2699 int v24; // eax@32 | |
2700 int v25; // esi@32 | |
2701 char *v26; // edx@34 | |
2702 unsigned __int8 v27; // sf@36 | |
2703 unsigned __int8 v28; // of@36 | |
2704 int v29; // esi@40 | |
2705 char *v30; // ecx@40 | |
2706 int v31; // eax@40 | |
2707 int v32; // esi@43 | |
2708 unsigned __int16 v33; // ax@45 | |
2709 int v34; // edx@45 | |
2710 int v35; // eax@45 | |
2711 int v36; // eax@49 | |
2712 char *v37; // eax@52 | |
2713 int v38; // eax@55 | |
2714 unsigned __int16 v39; // ax@59 | |
2715 SpellBuff *v40; // eax@60 | |
2716 int v41; // edi@61 | |
2717 unsigned int v42; // eax@61 | |
2718 int v43; // eax@62 | |
2719 int v44; // eax@63 | |
2720 signed int v45; // edi@65 | |
2721 unsigned __int16 v46; // ax@73 | |
2722 Player *v47; // ecx@77 | |
2723 unsigned int v48; // eax@85 | |
2724 GUIFont *v49; // edi@90 | |
2725 int v50; // edi@90 | |
2726 SpellBuff *v51; // eax@91 | |
2727 char *v52; // ecx@98 | |
2728 char *v53; // ecx@101 | |
2729 char *v54; // ST0C_4@118 | |
2730 unsigned int v55; // eax@118 | |
2731 GUIFont *v56; // edi@124 | |
2732 unsigned __int8 v57; // al@128 | |
2733 int v58; // eax@132 | |
2734 Actor *v59; // ecx@133 | |
2735 unsigned __int8 v60; // dl@138 | |
2736 char *v62; // eax@147 | |
2737 int v63; // eax@152 | |
2738 char *result; // eax@152 | |
2739 int v65; // eax@155 | |
2740 const char *v66; // [sp-10h] [bp-1FCh]@121 | |
2741 const char *v67; // [sp-10h] [bp-1FCh]@125 | |
2742 const char *v68; // [sp-10h] [bp-1FCh]@142 | |
2743 int v69; // [sp-Ch] [bp-1F8h]@121 | |
2744 char *v70; // [sp-Ch] [bp-1F8h]@125 | |
2745 char *v71; // [sp-Ch] [bp-1F8h]@142 | |
2746 char *v72; // [sp-8h] [bp-1F4h]@54 | |
2747 int v73; // [sp-8h] [bp-1F4h]@79 | |
2748 int v74; // [sp-8h] [bp-1F4h]@121 | |
2749 int v75; // [sp-8h] [bp-1F4h]@125 | |
2750 int v76; // [sp-8h] [bp-1F4h]@142 | |
2751 size_t v77; // [sp-4h] [bp-1F0h]@54 | |
2752 unsigned int v78; // [sp-4h] [bp-1F0h]@121 | |
2753 unsigned int v79; // [sp-4h] [bp-1F0h]@125 | |
2754 char *v80; // [sp-4h] [bp-1F0h]@142 | |
2755 char *v81; // [sp-4h] [bp-1F0h]@148 | |
2756 DDBLTFX Dst; // [sp+Ch] [bp-1E0h]@18 | |
2757 DDSURFACEDESC2 pDesc; // [sp+70h] [bp-17Ch]@18 | |
2758 RECT v84; // [sp+ECh] [bp-100h]@26 | |
241 | 2759 char *v85[10]; // [sp+FCh] [bp-F0h]@145 |
2760 char *v95[11]; // [sp+124h] [bp-C8h]@127 | |
0 | 2761 RenderBillboardTransform_local0 v106; // [sp+150h] [bp-9Ch]@3 |
2762 unsigned int v107; // [sp+1A0h] [bp-4Ch]@18 | |
2763 unsigned __int16 *v108; // [sp+1A4h] [bp-48h]@34 | |
2764 unsigned int v109; // [sp+1A8h] [bp-44h]@32 | |
2765 LPVOID v110; // [sp+1ACh] [bp-40h]@28 | |
2766 unsigned int v111; // [sp+1B0h] [bp-3Ch]@29 | |
2767 char **v112; // [sp+1B4h] [bp-38h]@3 | |
2768 IDirectDrawSurface *v222; // [sp+1B8h] [bp-34h]@18 | |
2769 unsigned __int8 v114; // [sp+1BFh] [bp-2Dh]@133 | |
2770 int v115; // [sp+1C0h] [bp-2Ch]@3 | |
2771 unsigned int v116; // [sp+1C4h] [bp-28h]@18 | |
2772 int i; // [sp+1C8h] [bp-24h]@18 | |
2773 Player *a2; // [sp+1CCh] [bp-20h]@28 | |
2774 int v119; // [sp+1D0h] [bp-1Ch]@18 | |
2775 SpellBuff *v120; // [sp+1D4h] [bp-18h]@18 | |
2776 Actor *v121; // [sp+1D8h] [bp-14h]@3 | |
2777 int a5; // [sp+1DCh] [bp-10h]@3 | |
2778 GUIWindow *a1; // [sp+1E0h] [bp-Ch]@1 | |
2779 int v124; // [sp+1E4h] [bp-8h]@18 | |
2780 char *a4; // [sp+1E8h] [bp-4h]@18 | |
2781 | |
2782 a1 = edx0; | |
2783 v2 = uActorID; | |
2784 | |
2785 static Actor pMonsterInfoUI_Doll; | |
2786 /*if ( !(bMonsterInfoUI_bDollInitialized & 1) ) | |
2787 { | |
2788 bMonsterInfoUI_bDollInitialized |= 1u; | |
2789 Actor::Actor(&pMonsterInfoUI_Doll); | |
2790 atexit(nullsub_3); | |
2791 }*/ | |
2792 v106.uParentBillboardID = -1; | |
2793 v3 = &pActors[v2]; | |
2794 v121 = v3; | |
2795 v4 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xFFu, 0x9Bu); | |
2796 v5 = v3->uNPC_ID; | |
2797 a5 = v4; | |
2798 v6 = GetNPCData(v5); | |
2799 v7 = v3->pMonsterInfo.uID; | |
2800 v112 = (char **)v6; | |
2801 v115 = byte_4E2B70[((signed __int16)v7 - 1) / 3] - 40; | |
2802 if ( v7 == pMonsterInfoUI_Doll.pMonsterInfo.uID ) | |
2803 { | |
2804 v9 = pMonsterInfoUI_Doll.uCurrentActionLength; | |
2805 } | |
2806 else | |
2807 { | |
2808 memcpy(&pMonsterInfoUI_Doll, v3, sizeof(pMonsterInfoUI_Doll)); | |
305 | 2809 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Bored; |
0 | 2810 pMonsterInfoUI_Doll.uCurrentActionTime = 0; |
2811 v8 = rand(); | |
2812 v3 = v121; | |
2813 v9 = v8 % 256 + 128; | |
2814 pMonsterInfoUI_Doll.uCurrentActionLength = v8 % 256 + 128; | |
2815 } | |
2816 if ( (signed int)pMonsterInfoUI_Doll.uCurrentActionTime > (signed __int16)v9 ) | |
2817 { | |
2818 pMonsterInfoUI_Doll.uCurrentActionTime = 0; | |
305 | 2819 if ( pMonsterInfoUI_Doll.uCurrentActionAnimation == ANIM_Bored || pMonsterInfoUI_Doll.uCurrentActionAnimation == ANIM_AtkMelee) |
2820 { | |
2821 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Standing; | |
0 | 2822 pMonsterInfoUI_Doll.uCurrentActionLength = rand() % 128 + 128; |
2823 } | |
2824 else | |
2825 { | |
2826 rand(); | |
305 | 2827 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Bored; |
0 | 2828 if ( (pMonsterInfoUI_Doll.pMonsterInfo.uID < 115 || pMonsterInfoUI_Doll.pMonsterInfo.uID > 186) |
2829 && (pMonsterInfoUI_Doll.pMonsterInfo.uID < 232 || pMonsterInfoUI_Doll.pMonsterInfo.uID > 249) | |
2830 && rand() % 30 < 100 ) | |
305 | 2831 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_AtkMelee; |
2832 pMonsterInfoUI_Doll.uCurrentActionLength = 8 * pSpriteFrameTable->pSpriteSFrames[v3->pSpriteIDs[(signed __int16)pMonsterInfoUI_Doll.uCurrentActionAnimation]].uAnimLength; | |
2833 } | |
2834 } | |
2835 v10 = pSpriteFrameTable->GetFrame( v3->pSpriteIDs[(signed __int16)pMonsterInfoUI_Doll.uCurrentActionAnimation], pMonsterInfoUI_Doll.uCurrentActionTime); | |
2836 v11 = &pSprites_LOD->pSpriteHeaders[v10->pHwSpriteIDs[0]];//40 * v10->pHwSpriteIDs[0] + 7218180; | |
0 | 2837 v106.pTarget = pRenderer->pTargetSurface; |
2838 v106.pTargetZ = pRenderer->pActiveZBuffer; | |
2839 v106.uTargetPitch = pRenderer->uTargetSurfacePitch; | |
2840 v12 = a1->uFrameY + 52; | |
2841 v106.uViewportX = a1->uFrameX + 13; | |
2842 v106.uViewportY = v12; | |
2843 v106.uViewportW = v12 + 128; | |
2844 v106.uViewportZ = v106.uViewportX + 128; | |
2845 v106.uScreenSpaceX = (signed int)(v106.uViewportX + 128 + v106.uViewportX) / 2; | |
144
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
141
diff
changeset
|
2846 v106._screenspace_x_scaler_packedfloat = 65536; |
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
141
diff
changeset
|
2847 v106._screenspace_y_scaler_packedfloat = 65536; |
243 | 2848 v106.uScreenSpaceY = v115 + v12 + v11->uHeight; |
0 | 2849 v106.pPalette = PaletteManager::Get_Dark_or_Red_LUT(v10->uPaletteIndex, 0, 1); |
2850 v106.sZValue = 0; | |
2851 v106.uFlags = 0; | |
2852 pRenderer->Clip_v2(0, 0, 0x27Fu, 0x1DFu); | |
2853 pRenderer->Line2D(v106.uViewportX - 1, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportY - 1, a5); | |
365 | 2854 pRenderer->Line2D( v106.uViewportX + 129, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportW + 1, a5); |
0 | 2855 pRenderer->Line2D(v106.uViewportX + 129, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportW + 1, a5); |
2856 pRenderer->Line2D(v106.uViewportX - 1, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportY - 1, a5); | |
2857 if ( pRenderer->pRenderD3D ) | |
2858 { | |
2859 v13 = &pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]]; | |
2860 v106.uScreenSpaceY = v115 + v106.uViewportY + v13->uBufferHeight; | |
2861 v222 = (IDirectDrawSurface *)v13->pTextureSurface; | |
2862 memset(&Dst, 0, 0x64u); | |
2863 Dst.dwSize = 100; | |
2864 Dst.dwFillColor = 0; | |
2865 memset(&pDesc, 0, 0x7Cu); | |
2866 pDesc.dwSize = 124; | |
2867 v222->GetSurfaceDesc((LPDDSURFACEDESC)&pDesc); | |
2868 v14 = v13->uBufferHeight; | |
2869 v120 = (SpellBuff *)v13->uBufferWidth; | |
2870 v107 = 0; | |
2871 v15 = v13->uAreaX; | |
2872 v119 = (signed int)v120 / 2; | |
2873 i = 0; | |
2874 a4 = (char *)(v106.uScreenSpaceX + v15 - (signed int)v120 / 2); | |
2875 v115 = v13->uAreaY; | |
2876 v16 = v13->uAreaWidth + (signed int)v120 / 2 + v15 - (int)v120; | |
2877 v124 = v106.uScreenSpaceY + v115 - v14; | |
2878 v17 = v13->uAreaHeight + v115 - v14; | |
2879 v116 = v106.uScreenSpaceX + v16; | |
2880 v119 = v106.uScreenSpaceY + v17; | |
2881 if ( (signed int)a4 < (signed int)v106.uViewportX ) | |
2882 { | |
2883 v18 = v106.uViewportX - (int)a4; | |
2884 a4 = (char *)v106.uViewportX; | |
2885 v107 = v18; | |
2886 } | |
2887 if ( v124 < (signed int)v106.uViewportY ) | |
2888 { | |
2889 v19 = v106.uViewportY - v124; | |
2890 v124 = v106.uViewportY; | |
2891 i = v19; | |
2892 } | |
2893 if ( (signed int)v116 > (signed int)v106.uViewportZ ) | |
2894 v116 = v106.uViewportZ; | |
2895 if ( v119 > (signed int)v106.uViewportW ) | |
2896 v119 = v106.uViewportW; | |
499 | 2897 pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, |
0 | 2898 pRenderer->uTargetBMask | pRenderer->uTargetGMask); |
499 | 2899 pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, |
0 | 2900 pRenderer->uTargetBMask | pRenderer->uTargetGMask); |
2901 v84.left = v106.uViewportX; | |
2902 v84.top = v106.uViewportY; | |
2903 v84.right = v106.uViewportZ; | |
2904 v84.bottom = v106.uViewportW; | |
2905 ErrD3D(pRenderer->pBackBuffer4->Blt(&v84, 0, 0, 16778240u, &Dst)); | |
2906 if ( pRenderer->uTargetGBits == 5 ) | |
2907 { | |
2908 memset(&pDesc, 0, 0x7Cu); | |
2909 pDesc.dwSize = 124; | |
242 | 2910 if ( pRenderer->LockSurface_DDraw4((IDirectDrawSurface4 *)v222, &pDesc, DDLOCK_WAIT)) |
2911 { | |
2912 v20 = (char *)v124; | |
2913 v110 = pDesc.lpSurface; | |
2914 a2 = (Player *)v124; | |
2915 if ( v124 < v119 ) | |
2916 { | |
2917 v111 = 2 * pRenderer->uTargetSurfacePitch; | |
2918 v21 = (int)a4; | |
2919 v22 = &pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]]; | |
2920 v23 = i - v124; | |
2921 v120 = (SpellBuff *)&pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]]; | |
2922 v115 = i - v124; | |
2923 while ( 1 ) | |
2924 { | |
2925 v124 = v21; | |
2926 if ( v21 < (signed int)v116 ) | |
2927 { | |
2928 v24 = (int)&v20[v23]; | |
2929 v25 = v107 - v21; | |
2930 v109 = v24; | |
2931 for ( i = v107 - v21; ; v25 = i ) | |
2932 { | |
2933 v108 = (unsigned __int16 *)((pDesc.lPitch >> 1) * pDesc.dwHeight * v109 / v13->uAreaHeight); | |
2934 v26 = (char *)v108 + pDesc.dwWidth * (v25 + v124++) / v13->uAreaWidth; | |
2935 *v22 = *((short *)v110 + (int)v26); | |
2936 ++v22; | |
2937 if ( v124 >= (signed int)v116 ) | |
2938 break; | |
2939 } | |
2940 v23 = v115; | |
2941 } | |
2942 v22 = (unsigned __int16 *)((char *)v120 + v111); | |
2943 v20 = (char *)&a2->pConditions[0] + 1; | |
2944 v28 = __OFSUB__((int)&a2->pConditions[0] + 1, v119); | |
2945 v27 = (signed int)((char *)&a2->pConditions[0] + -v119 + 1) < 0; | |
2946 a2 = (Player *)((char *)a2 + 1); | |
2947 v120 = (SpellBuff *)((char *)v120 + v111); | |
2948 if ( !(v27 ^ v28) ) | |
2949 break; | |
2950 v21 = (int)a4; | |
2951 } | |
2952 } | |
2953 v222->Unlock(0); | |
2954 } | |
2955 } | |
2956 else | |
2957 { | |
2958 memset(&pDesc, 0, 0x7Cu); | |
2959 pDesc.dwSize = 124; | |
2960 if ( pRenderer->LockSurface_DDraw4((IDirectDrawSurface4 *)v222, &pDesc, DDLOCK_WAIT) ) | |
2961 { | |
2962 v108 = (unsigned __int16 *)pDesc.lpSurface; | |
2963 a2 = (Player *)v124; | |
306 | 2964 if ( v124 < v119 ) |
242 | 2965 { |
2966 v109 = 2 * pRenderer->uTargetSurfacePitch; | |
2967 v29 = (int)a4; | |
2968 v30 = (char *)&pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]]; | |
2969 v31 = i - v124; | |
2970 v120 = (SpellBuff *)&pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]]; | |
2971 v115 = i - v124; | |
2972 while ( 1 ) | |
2973 { | |
2974 v124 = v29; | |
2975 if ( v29 < (signed int)v116 ) | |
2976 { | |
2977 v32 = v107 - (int)a4; | |
2978 v111 = (unsigned int)((char *)a2 + v31); | |
2979 for ( i = v107 - (int)a4; ; v32 = i ) | |
2980 { | |
2981 v110 = (LPVOID)((pDesc.lPitch >> 1) * pDesc.dwHeight * v111 / v13->uAreaHeight); | |
2982 v33 = v108[(int)((char *)v110 + pDesc.dwWidth * (v32 + v124) / v13->uAreaWidth)]; | |
499 | 2983 v34 = v33 & 0x1F | 2 * (unsigned __int16)(v108[(int)((char *)v110 + pDesc.dwWidth * (v32 + v124++) / v13->uAreaWidth)] & 0xFFE0); |
242 | 2984 v35 = v124; |
2985 *(short *)v30 = v34; | |
2986 v30 += 2; | |
2987 if ( v35 >= (signed int)v116 ) | |
2988 break; | |
2989 } | |
2990 v31 = v115; | |
2991 } | |
2992 a2 = (Player *)((char *)a2 + 1); | |
2993 v30 = (char *)v120 + v109; | |
2994 v120 = (SpellBuff *)((char *)v120 + v109); | |
2995 if ( (signed int)a2 >= v119 ) | |
2996 break; | |
2997 v29 = (int)a4; | |
2998 } | |
2999 } | |
3000 v222->Unlock(0); | |
3001 } | |
3002 } | |
0 | 3003 } |
3004 else | |
3005 { | |
499 | 3006 pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, 0); |
0 | 3007 v36 = v10->pHwSpriteIDs[0]; |
3008 if ( v36 >= 0 ) | |
3009 pSprites_LOD->pSpriteHeaders[v36]._4ACC38(&v106, 0); | |
3010 } | |
3011 if ( v121->uNPC_ID ) | |
3012 { | |
3013 v37 = v112[6]; | |
3014 if ( v37 ) | |
3015 { | |
264 | 3016 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[429], *v112, aNPCProfessionNames[(signed int)v37]); |
242 | 3017 } |
3018 else | |
3019 { | |
3020 v77 = 2000; | |
3021 v72 = *v112; | |
3022 } | |
0 | 3023 } |
3024 else | |
3025 { | |
3026 v38 = v121->dword_000334_unique_name; | |
3027 v77 = 2000; | |
3028 if ( v38 ) | |
237 | 3029 v72 = pMonsterStats->pPlaceStrings[v38]; |
0 | 3030 else |
3031 v72 = pMonsterStats->pInfos[v121->pMonsterInfo.uID].pName; | |
3032 } | |
242 | 3033 if(!v121->uNPC_ID || (v121->uNPC_ID && !v37)) |
3034 strncpy(pTmpBuf, v72, v77); | |
0 | 3035 v39 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); |
3036 a1->DrawTitleText(pFontComic, 0, 0xCu, v39, pTmpBuf, 3u); | |
3037 Actor::DrawHealthBar(v121, a1); | |
3038 v119 = 0; | |
3039 pMonsterInfoUI_Doll.uCurrentActionTime += pMiscTimer->uTimeElapsed; | |
3040 v115 = 0; | |
3041 v116 = 0; | |
3042 i = 0; | |
3043 v112 = 0; | |
3044 if ( !uActiveCharacter ) | |
3045 { | |
3046 v45 = 1; | |
242 | 3047 } |
3048 else | |
3049 { | |
3050 LOBYTE(v40) = pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID); | |
3051 v120 = v40; | |
3052 if ( !v40 ) | |
499 | 3053 v45 = 1; |
242 | 3054 else |
3055 { | |
3056 v41 = (unsigned __int8)v40 & 0x3F; | |
3057 v42 = SkillToMastery((unsigned __int16)v40) - 1; | |
3058 if ( !v42 ) | |
3059 { | |
3060 if ( v41 + 10 >= v121->pMonsterInfo.uLevel ) | |
3061 { | |
3062 v45 = 1; | |
3063 v119 = 1; | |
3064 } | |
3065 else | |
499 | 3066 v45 = 1; |
242 | 3067 } |
3068 else | |
3069 { | |
3070 v43 = v42 - 1; | |
3071 if ( !v43 ) | |
3072 { | |
3073 if ( 2 * v41 + 10 >= v121->pMonsterInfo.uLevel ) | |
3074 { | |
3075 v45 = 1; | |
3076 v119 = 1; | |
3077 v116 = 1; | |
3078 } | |
3079 else | |
3080 v45 = 1; | |
3081 } | |
3082 else | |
3083 { | |
3084 v44 = v43 - 1; | |
3085 if ( !v44 ) | |
3086 { | |
3087 if ( 3 * v41 + 10 >= v121->pMonsterInfo.uLevel ) | |
3088 { | |
3089 v45 = 1; | |
3090 v119 = 1; | |
3091 v116 = 1; | |
3092 i = 1; | |
3093 } | |
3094 else | |
3095 { | |
3096 v45 = 1; | |
3097 } | |
3098 } | |
3099 else | |
3100 { | |
3101 if ( v44 != 1 ) | |
3102 v45 = 1; | |
3103 else | |
3104 { | |
3105 v45 = 1; | |
3106 v119 = 1; | |
3107 v116 = 1; | |
3108 i = 1; | |
3109 v112 = (char **)1; | |
3110 } | |
3111 } | |
3112 } | |
3113 } | |
3114 } | |
3115 // LABEL_73: | |
3116 v46 = v121->uAIState; | |
3117 if ( v46 != 5 && v46 != 4 && !dword_507BF0_is_there_popup_onscreen && v120 ) | |
3118 { | |
3119 v47 = pPlayers[uActiveCharacter]; | |
3120 if ( v119 | v116 | i | (unsigned int)v112 ) | |
3121 { | |
3122 if ( v121->pMonsterInfo.uLevel >= v47->uLevel - 5 ) | |
3123 v73 = SPEECH_105; | |
3124 else | |
3125 v73 = SPEECH_104; | |
3126 } | |
3127 else | |
3128 { | |
3129 v73 = SPEECH_106; | |
3130 } | |
3131 v47->PlaySound((PlayerSpeech)v73, 0); | |
3132 } | |
3133 } | |
0 | 3134 a2 = pParty->pPlayers; |
3135 do | |
3136 { | |
3137 LOBYTE(v48) = a2->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID); | |
3138 v111 = v48; | |
3139 v120 = (SpellBuff *)138; | |
3140 do | |
3141 { | |
3142 if ( (signed int)SkillToMastery(v111) >= 3 ) | |
3143 v115 = v45; | |
3144 v120 = (SpellBuff *)((char *)v120 - 1); | |
3145 } | |
3146 while ( v120 ); | |
3147 ++a2; | |
3148 } | |
3149 while ( (signed int)a2 < (signed int)pParty->pHirelings ); | |
3150 v49 = pFontSmallnum; | |
3151 a2 = (Player *)pFontSmallnum; | |
3152 a1->DrawText(pFontSmallnum, 12, 196, a5, pGlobalTXT_LocalizationStrings[631], 0, 0, 0); | |
3153 v50 = LOBYTE(v49->uFontHeight) + 193; | |
3154 if ( !v115 ) | |
3155 { | |
3156 v78 = 0; | |
3157 v74 = 0; | |
3158 v69 = 0; | |
3159 v66 = pGlobalTXT_LocalizationStrings[630]; | |
3160 goto LABEL_123; | |
3161 } | |
3162 a4 = 0; | |
3163 v51 = &v121->pActorBuffs[1]; | |
3164 v222 = 0; | |
3165 v120 = &v121->pActorBuffs[1]; | |
3166 do | |
3167 { | |
3168 if ( (signed __int64)v51->uExpireTime > 0 ) | |
3169 { | |
3170 switch ( (int)v51 ) | |
3171 { | |
3172 case 0u: | |
3173 v124 = 60; | |
3174 a4 = pGlobalTXT_LocalizationStrings[591]; | |
3175 break; | |
3176 case 1u: | |
3177 v124 = 82; | |
3178 a4 = pGlobalTXT_LocalizationStrings[649]; | |
3179 break; | |
3180 case 2u: | |
3181 v124 = 92; | |
3182 a4 = pGlobalTXT_LocalizationStrings[592]; | |
3183 break; | |
3184 case 3u: | |
3185 v124 = 63; | |
3186 a4 = pGlobalTXT_LocalizationStrings[4]; | |
3187 break; | |
3188 case 4u: | |
3189 v52 = pGlobalTXT_LocalizationStrings[220]; | |
3190 goto LABEL_100; | |
3191 case 5u: | |
3192 v52 = pGlobalTXT_LocalizationStrings[162]; | |
3193 LABEL_100: | |
3194 a4 = v52; | |
3195 v124 = 81; | |
3196 break; | |
3197 case 6u: | |
3198 v53 = pGlobalTXT_LocalizationStrings[593]; | |
3199 v124 = 35; | |
3200 goto LABEL_103; | |
3201 case 8u: | |
3202 v53 = pGlobalTXT_LocalizationStrings[608]; | |
3203 v124 = 62; | |
3204 LABEL_103: | |
3205 a4 = v53; | |
3206 break; | |
3207 case 7u: | |
3208 case 9u: | |
3209 a4 = 0; | |
3210 v124 = 0; | |
3211 goto LABEL_119; | |
3212 case 0xAu: | |
3213 v124 = 47; | |
3214 a4 = pGlobalTXT_LocalizationStrings[221]; | |
3215 break; | |
3216 case 0xBu: | |
3217 v124 = 66; | |
3218 a4 = pGlobalTXT_LocalizationStrings[607]; | |
3219 break; | |
3220 case 0xCu: | |
3221 v124 = 85; | |
3222 a4 = pGlobalTXT_LocalizationStrings[610]; | |
3223 break; | |
3224 case 0xDu: | |
3225 v124 = 86; | |
3226 a4 = pGlobalTXT_LocalizationStrings[609]; | |
3227 break; | |
3228 case 0xEu: | |
3229 v124 = 17; | |
3230 a4 = pGlobalTXT_LocalizationStrings[279]; | |
3231 break; | |
3232 case 0xFu: | |
3233 v124 = 38; | |
3234 a4 = pGlobalTXT_LocalizationStrings[442]; | |
3235 break; | |
3236 case 0x10u: | |
3237 v124 = 46; | |
3238 a4 = pGlobalTXT_LocalizationStrings[443]; | |
3239 break; | |
3240 case 0x11u: | |
3241 v124 = 51; | |
3242 a4 = pGlobalTXT_LocalizationStrings[440]; | |
3243 break; | |
3244 case 0x12u: | |
3245 v124 = 5; | |
3246 a4 = pGlobalTXT_LocalizationStrings[441]; | |
3247 break; | |
3248 case 0x13u: | |
3249 v124 = 95; | |
3250 a4 = pGlobalTXT_LocalizationStrings[229]; | |
3251 break; | |
3252 case 0x14u: | |
3253 v124 = 73; | |
3254 a4 = pGlobalTXT_LocalizationStrings[228]; | |
3255 break; | |
3256 default: | |
3257 a4 = 0; | |
3258 break; | |
3259 } | |
3260 if ( a4 ) | |
3261 { | |
3262 v54 = a4; | |
3263 v55 = GetSpellColor(v124); | |
3264 a1->DrawText((GUIFont *)a2, 28, v50, v55, v54, 0, 0, 0); | |
3265 v50 = v50 + BYTE5(a2->pConditions[0]) - 3; | |
3266 v51 = v120; | |
3267 } | |
3268 } | |
3269 LABEL_119: | |
3270 ++v51; | |
3271 v222 = (IDirectDrawSurface *)((char *)v222 + 1); | |
3272 v120 = v51; | |
3273 | |
3274 __debugbreak(); // fix condition | |
3275 } | |
3276 //while ( (signed int)((char *)&v222->lpVtbl + 1) < 22 ); | |
3277 while (true); | |
3278 if ( !a4 ) | |
3279 { | |
3280 v78 = 0; | |
3281 v74 = 0; | |
3282 v69 = 0; | |
3283 v66 = pGlobalTXT_LocalizationStrings[153]; | |
3284 LABEL_123: | |
3285 a1->DrawText((GUIFont *)a2, 28, v50, a5, v66, v69, v74, v78); | |
3286 } | |
3287 v56 = pFontSmallnum; | |
3288 a4 = (char *)v106.uViewportY; | |
3289 if ( v119 ) | |
3290 { | |
241 | 3291 sprintf(pTmpBuf, "%s\f%05u\t100%d\n", pGlobalTXT_LocalizationStrings[108], 0, v121->pMonsterInfo.uHP); |
0 | 3292 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); |
3293 a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; | |
3294 v79 = v121->pMonsterInfo.uAC; | |
3295 v75 = 0; | |
3296 v70 = pGlobalTXT_LocalizationStrings[12]; | |
241 | 3297 v67 = "%s\f%05u\t100%d\n"; |
0 | 3298 } |
3299 else | |
3300 { | |
241 | 3301 sprintf(pTmpBuf, "%s\f%05u\t100%s\n", pGlobalTXT_LocalizationStrings[108], 0, pGlobalTXT_LocalizationStrings[630]); |
0 | 3302 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); |
3303 v79 = (unsigned int)pGlobalTXT_LocalizationStrings[630]; | |
3304 v75 = 0; | |
3305 v70 = pGlobalTXT_LocalizationStrings[12]; | |
3306 a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; | |
241 | 3307 v67 = "%s\f%05u\t100%s\n"; |
0 | 3308 } |
3309 sprintf(pTmpBuf, v67, v70, v75, v79); | |
3310 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); | |
3311 a4 = &a4[LOBYTE(v56->uFontHeight) - 6] + LOBYTE(v56->uFontHeight); | |
241 | 3312 v95[0] = pGlobalTXT_LocalizationStrings[87]; |
3313 v95[1] = pGlobalTXT_LocalizationStrings[6]; | |
3314 v95[2] = pGlobalTXT_LocalizationStrings[240]; | |
3315 v95[3] = pGlobalTXT_LocalizationStrings[70]; | |
3316 v95[4] = pGlobalTXT_LocalizationStrings[624]; | |
3317 v95[5] = pGlobalTXT_LocalizationStrings[138]; | |
3318 v95[6] = pGlobalTXT_LocalizationStrings[214]; | |
3319 v95[7] = pGlobalTXT_LocalizationStrings[142]; | |
3320 v95[8] = pGlobalTXT_LocalizationStrings[29]; | |
3321 v95[9] = pGlobalTXT_LocalizationStrings[133]; | |
3322 v95[10] = pGlobalTXT_LocalizationStrings[54]; | |
0 | 3323 if ( v116 ) |
3324 { | |
241 | 3325 sprintf(pTmpBuf, "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, v95[v121->pMonsterInfo.uAttack1Type]); |
0 | 3326 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); |
3327 a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; | |
3328 v57 = v121->pMonsterInfo.uAttack1DamageBonus; | |
3329 if ( v57 ) | |
499 | 3330 sprintf(pTmpBuf, "%s\f%05u\t080%dd%d+%d\n", pGlobalTXT_LocalizationStrings[53], |
3331 0, v121->pMonsterInfo.uAttack1DamageDiceRolls, v121->pMonsterInfo.uAttack1DamageDiceSides, v57); | |
0 | 3332 else |
499 | 3333 sprintf(pTmpBuf, "%s\f%05u\t080%dd%d\n", pGlobalTXT_LocalizationStrings[53], |
3334 0, v121->pMonsterInfo.uAttack1DamageDiceRolls, v121->pMonsterInfo.uAttack1DamageDiceSides); | |
0 | 3335 } |
3336 else | |
3337 { | |
241 | 3338 sprintf(pTmpBuf, "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, pGlobalTXT_LocalizationStrings[630]); |
0 | 3339 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); |
3340 a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; | |
241 | 3341 sprintf(pTmpBuf, "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[53], 0, pGlobalTXT_LocalizationStrings[630]); |
0 | 3342 } |
3343 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); | |
3344 v58 = LOBYTE(v56->uFontHeight); | |
3345 a4 = &a4[v58 - 6] + v58; | |
3346 if ( !i ) | |
3347 { | |
3348 v80 = pGlobalTXT_LocalizationStrings[630]; | |
3349 v76 = 0; | |
3350 v71 = pGlobalTXT_LocalizationStrings[628]; | |
241 | 3351 v68 = "%s\f%05u\t080%s\n"; |
0 | 3352 goto LABEL_144; |
3353 } | |
3354 v120 = (SpellBuff *)pGlobalTXT_LocalizationStrings[628]; | |
3355 v59 = v121; | |
3356 v114 = v121->pMonsterInfo.uSpell1ID; | |
3357 if ( v114 && v121->pMonsterInfo.uSpell2ID ) | |
3358 v120 = (SpellBuff *)pGlobalTXT_LocalizationStrings[629]; | |
3359 if ( v114 ) | |
3360 { | |
241 | 3361 sprintf(pTmpBuf, "%s\f%05u\t060%s\n", v120, 0, pSpellStats->pInfos[v114].pShortName); |
0 | 3362 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); |
3363 v58 = LOBYTE(v56->uFontHeight); | |
3364 a4 = &a4[v58 - 3]; | |
3365 v59 = v121; | |
3366 } | |
3367 v60 = v59->pMonsterInfo.uSpell2ID; | |
3368 if ( v60 ) | |
3369 { | |
241 | 3370 sprintf(pTmpBuf, "\f%05u\t060%s\n", 0, pSpellStats->pInfos[v60].pShortName); |
0 | 3371 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); |
3372 v58 = LOBYTE(v56->uFontHeight); | |
3373 a4 = &a4[v58 - 3]; | |
3374 v59 = v121; | |
3375 } | |
3376 if ( !v59->pMonsterInfo.uSpell1ID && !v59->pMonsterInfo.uSpell2ID ) | |
3377 { | |
3378 v80 = pGlobalTXT_LocalizationStrings[153]; | |
3379 v76 = 0; | |
3380 v71 = pGlobalTXT_LocalizationStrings[628]; | |
241 | 3381 v68 = "%s\f%05u\t060%s\n"; |
0 | 3382 LABEL_144: |
3383 sprintf(pTmpBuf, v68, v71, v76, v80); | |
3384 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); | |
3385 v58 = LOBYTE(v56->uFontHeight); | |
3386 a4 = &a4[v58 - 3]; | |
3387 } | |
3388 a4 = &a4[v58 - 3]; | |
3389 a1->DrawText(v56, 150, (int)a4, a5, pGlobalTXT_LocalizationStrings[626], 0, 0, 0); | |
3390 a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; | |
241 | 3391 v85[0] = pGlobalTXT_LocalizationStrings[87]; |
3392 v85[1] = pGlobalTXT_LocalizationStrings[6]; | |
3393 v85[2] = pGlobalTXT_LocalizationStrings[240]; | |
3394 v85[3] = pGlobalTXT_LocalizationStrings[70]; | |
3395 v85[4] = pGlobalTXT_LocalizationStrings[142]; | |
3396 v85[5] = pGlobalTXT_LocalizationStrings[214]; | |
3397 v85[6] = pGlobalTXT_LocalizationStrings[29]; | |
3398 v85[7] = pGlobalTXT_LocalizationStrings[133]; | |
3399 v85[8] = pGlobalTXT_LocalizationStrings[54]; | |
3400 v85[9] = pGlobalTXT_LocalizationStrings[624]; | |
3401 v95[1] = (char *)v121->pMonsterInfo.uResFire; | |
3402 v95[2] = (char *)v121->pMonsterInfo.uResAir; | |
3403 v95[3] = (char *)v121->pMonsterInfo.uResWater; | |
3404 v95[4] = (char *)v121->pMonsterInfo.uResEarth; | |
3405 v95[5] = (char *)v121->pMonsterInfo.uResMind; | |
3406 v95[6] = (char *)v121->pMonsterInfo.uResSpirit; | |
3407 v95[7] = (char *)v121->pMonsterInfo.uResBody; | |
3408 v95[8] = (char *)v121->pMonsterInfo.uResLight; | |
3409 v95[9] = (char *)v121->pMonsterInfo.uResPhysical; | |
3410 v95[10] = (char *)v121->pMonsterInfo.uResDark; | |
0 | 3411 if ( v112 ) |
3412 { | |
3413 v124 = 0; | |
3414 do | |
3415 { | |
241 | 3416 v62 = v95[v124+1]; |
0 | 3417 if ( v62 == (char *)200 ) |
3418 { | |
3419 v81 = pGlobalTXT_LocalizationStrings[625]; | |
3420 } | |
3421 else | |
3422 { | |
3423 if ( v62 ) | |
3424 v81 = pGlobalTXT_LocalizationStrings[627]; | |
3425 else | |
3426 v81 = pGlobalTXT_LocalizationStrings[153]; | |
3427 } | |
241 | 3428 sprintf(pTmpBuf, "%s\f%05u\t070%s\n", v85[v124], 0, v81); |
0 | 3429 a1->DrawText(v56, 170, (int)a4, a5, pTmpBuf, 0, 0, 0); |
3430 v63 = LOBYTE(v56->uFontHeight); | |
3431 v124 += 4; | |
3432 result = &a4[v63 - 3]; | |
3433 a4 = result; | |
3434 } | |
3435 while ( v124 < 40 ); | |
3436 } | |
3437 else | |
3438 { | |
3439 i = 0; | |
3440 do | |
3441 { | |
241 | 3442 sprintf(pTmpBuf, "%s\f%05u\t070%s\n", v85[i], 0, pGlobalTXT_LocalizationStrings[630]); // "?" |
0 | 3443 a1->DrawText(v56, 170, (int)a4, a5, pTmpBuf, 0, 0, 0); |
3444 v65 = LOBYTE(v56->uFontHeight); | |
3445 ++i; | |
3446 result = &a4[v65 - 3]; | |
3447 a4 = result; | |
3448 } | |
3449 while ( i < 10 ); | |
3450 } | |
3451 if ( (signed __int64)pParty->pPartyBuffs[3].uExpireTime > 0 ) | |
3452 { | |
3453 sprintf(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[650], v121->sCurrentHP); | |
3454 pFontSmallnum->GetLineWidth(pTmpBuf); | |
499 | 3455 result = a1->DrawTitleText(pFontSmallnum, 0, a1->uFrameHeight - LOBYTE(pFontSmallnum->uFontHeight) - 12, 0, pTmpBuf, 3); |
0 | 3456 } |
3457 return result; | |
3458 } | |
3459 | |
3460 //----- (0041F54A) -------------------------------------------------------- | |
3461 void __cdecl LoadActualSkyFrame() | |
3462 { | |
3463 if ( pTexture_RestUI_CurrentSkyFrame ) | |
3464 pTexture_RestUI_CurrentSkyFrame->Release(); | |
3465 if ( pTexture_RestUI_CurrentHourglassFrame ) | |
3466 pTexture_RestUI_CurrentHourglassFrame->Release(); | |
3467 pIcons_LOD->_40F9C5(); | |
3468 sprintf(pTmpBuf, "TERRA%03d", pParty->uCurrentMinute / 6 + 10 * pParty->uCurrentHour); | |
3469 pTexture_RestUI_CurrentSkyFrame = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pTmpBuf, TEXTURE_16BIT_PALETTE)]; | |
3470 } | |
3471 | |
3472 //----- (0041F5BE) -------------------------------------------------------- | |
3473 void __cdecl Sleep6Hours() | |
3474 { | |
3475 if ( _506F18_num_hours_to_sleep < 6 ) | |
3476 { | |
3477 pParty->pPlayers[3].pConditions[2] = 0i64; | |
3478 pParty->pPlayers[2].pConditions[2] = 0i64; | |
3479 pParty->pPlayers[1].pConditions[2] = 0i64; | |
3480 pParty->pPlayers[0].pConditions[2] = 0i64; | |
3481 if ( _506F18_num_hours_to_sleep ) | |
3482 { | |
3483 Rest(_506F18_num_hours_to_sleep); | |
3484 _506F18_num_hours_to_sleep = 0; | |
3485 LoadActualSkyFrame(); | |
3486 } | |
3487 if ( dword_506F14 == 2 ) | |
3488 { | |
3489 pGUIWindow_CurrentMenu->Release(); | |
3490 pEventTimer->Resume(); | |
3491 if ( pTexture_RestUI_CurrentSkyFrame ) | |
3492 pTexture_RestUI_CurrentSkyFrame->Release(); | |
3493 if ( pTexture_RestUI_CurrentHourglassFrame ) | |
3494 pTexture_RestUI_CurrentHourglassFrame->Release(); | |
3495 pTexture_RestUI_CurrentHourglassFrame = 0; | |
3496 pTexture_RestUI_CurrentSkyFrame = 0; | |
3497 pIcons_LOD->_4114F2(); | |
3498 pIcons_LOD->_40F9C5(); | |
151 | 3499 pCurrentScreen = SCREEN_GAME; |
0 | 3500 viewparams->bRedrawGameUI = 1; |
3501 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
3502 { | |
3503 pOutdoor->UpdateSunlightVectors(); | |
3504 pOutdoor->UpdateFog(); | |
3505 } | |
3506 } | |
3507 dword_506F14 = 0; | |
3508 } | |
3509 else | |
3510 { | |
3511 Rest(6u); | |
3512 _506F18_num_hours_to_sleep -= 6; | |
3513 LoadActualSkyFrame(); | |
3514 } | |
3515 viewparams->bRedrawGameUI = 1; | |
3516 } | |
3517 | |
3518 //----- (0041F6C1) -------------------------------------------------------- | |
3519 void __cdecl RestUI_Initialize() | |
3520 { | |
89 | 3521 Player *v0; // eax@10 |
0 | 3522 |
3523 if ( !dword_506F14 ) | |
3524 pAudioPlayer->StopChannels(-1, -1); | |
3525 if ( pCurrentScreen ) | |
3526 { | |
3527 pGUIWindow_CurrentMenu->Release(); | |
151 | 3528 pCurrentScreen = SCREEN_GAME; |
0 | 3529 viewparams->bRedrawGameUI = 1; |
3530 } | |
3531 pEventTimer->Pause(); | |
3532 if ( dword_506F14 != 2 ) | |
3533 GUIWindow::Create(518u, 450u, 0, 0, (enum WindowType)90, (int)pBtn_Rest, 0); | |
3534 _506F18_num_hours_to_sleep = 0; | |
3535 dword_506F14 = 0; | |
3536 uRestUI_FoodRequiredToRest = 2; | |
3537 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
3538 uRestUI_FoodRequiredToRest = pOutdoor->GetNumFoodRequiredToRestInCurrentPos( | |
3539 pParty->vPosition.x, | |
3540 pParty->vPosition.y, | |
3541 pParty->vPosition.z); | |
248 | 3542 if ( PartyHasDragon() ) |
0 | 3543 { |
89 | 3544 v0 = pParty->pPlayers;//[0].uClass; |
3545 while ( v0 <= &pParty->pPlayers[3] ) | |
3546 { | |
3547 ++v0; | |
3548 if ( v0 > &pParty->pPlayers[3] ) | |
3549 break; | |
3550 } | |
255 | 3551 if(v0->classType == PLAYER_CLASS_WARLOCK) |
89 | 3552 ++uRestUI_FoodRequiredToRest; |
3553 } | |
0 | 3554 if ( CheckHiredNPCSpeciality(0x1Du) ) |
3555 --uRestUI_FoodRequiredToRest; | |
3556 if ( CheckHiredNPCSpeciality(0x1Eu) ) | |
3557 uRestUI_FoodRequiredToRest -= 2; | |
3558 if ( CheckHiredNPCSpeciality(0x30u) ) | |
3559 --uRestUI_FoodRequiredToRest; | |
3560 if ( uRestUI_FoodRequiredToRest < 1 ) | |
3561 uRestUI_FoodRequiredToRest = 1; | |
484 | 3562 if ( !_strcmpi(pCurrentMapName, "d29.blv") && (unsigned __int16)_449B57_test_bit(pParty->_quest_bits, 98) ) |
0 | 3563 uRestUI_FoodRequiredToRest = 0; |
3564 ++pIcons_LOD->uTexturePacksCount; | |
3565 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | |
3566 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
151 | 3567 pCurrentScreen = SCREEN_REST; |
0 | 3568 _507CD4_RestUI_hourglass_anim_controller = 0; |
3569 uTextureID_RestUI_restmain = pIcons_LOD->LoadTexture("restmain", TEXTURE_16BIT_PALETTE); | |
3570 uTextureID_RestUI_restb1 = pIcons_LOD->LoadTexture("restb1", TEXTURE_16BIT_PALETTE); | |
3571 uTextureID_RestUI_restb2 = pIcons_LOD->LoadTexture("restb2", TEXTURE_16BIT_PALETTE); | |
3572 uTextureID_RestUI_restb3 = pIcons_LOD->LoadTexture("restb3", TEXTURE_16BIT_PALETTE); | |
3573 uTextureID_RestUI_restb4 = pIcons_LOD->LoadTexture("restb4", TEXTURE_16BIT_PALETTE); | |
3574 uTextureID_RestUI_restexit = pIcons_LOD->LoadTexture("restexit", TEXTURE_16BIT_PALETTE); | |
3575 LoadActualSkyFrame(); | |
3576 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640u, 480u, (enum WindowType)16, 0, 0); | |
3577 pButton_RestUI_Exit = pGUIWindow_CurrentMenu->CreateButton( | |
3578 280u, | |
3579 297u, | |
3580 154u, | |
3581 37u, | |
3582 1, | |
3583 0, | |
3584 0xA7u, | |
3585 0, | |
3586 0, | |
3587 "", | |
3588 (Texture *)(uTextureID_RestUI_restexit != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restexit] : 0), | |
3589 0); | |
3590 pButton_RestUI_Main = pGUIWindow_CurrentMenu->CreateButton( | |
3591 24u, | |
3592 154u, | |
3593 225u, | |
3594 37u, | |
3595 1, | |
3596 0, | |
3597 0x61u, | |
3598 0, | |
3599 0x52u, | |
3600 "", | |
3601 (Texture *)(uTextureID_RestUI_restb4 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb4] : 0), | |
3602 0); | |
3603 pButton_RestUI_WaitUntilDawn = pGUIWindow_CurrentMenu->CreateButton( | |
3604 61u, | |
3605 232u, | |
3606 154u, | |
3607 33u, | |
3608 1, | |
3609 0, | |
3610 0x6Du, | |
3611 0, | |
3612 0x44u, | |
3613 "", | |
3614 (Texture *)(uTextureID_RestUI_restb1 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb1] : 0), | |
3615 0); | |
3616 pButton_RestUI_Wait1Hour = pGUIWindow_CurrentMenu->CreateButton( | |
3617 61u, | |
3618 264u, | |
3619 154u, | |
3620 33u, | |
3621 1, | |
3622 0, | |
3623 0x60u, | |
3624 0, | |
3625 0x48u, | |
3626 "", | |
3627 (Texture *)(uTextureID_RestUI_restb2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb2] : 0), | |
3628 0); | |
3629 pButton_RestUI_Wait5Minutes = pGUIWindow_CurrentMenu->CreateButton( | |
3630 61u, | |
3631 296u, | |
3632 154u, | |
3633 33u, | |
3634 1, | |
3635 0, | |
3636 0x5Fu, | |
3637 0, | |
3638 0x4Du, | |
3639 "", | |
3640 (Texture *)(uTextureID_RestUI_restb3 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb3] : 0), | |
3641 0); | |
3642 } | |
3643 | |
3644 //----- (0041FA01) -------------------------------------------------------- | |
3645 void __cdecl RestUI_Draw() | |
3646 { | |
3647 int v0; // esi@1 | |
3648 Player **ppPlayers; // ecx@1 | |
3649 Player *pPlayer; // eax@2 | |
3650 unsigned int v3; // eax@15 | |
3651 char v4; // al@17 | |
3652 bool v5; // eax@21 | |
3653 GUIButton Dst; // [sp+8h] [bp-DCh]@19 | |
3654 //double v7; // [sp+C4h] [bp-20h]@17 | |
3655 float v8; // [sp+CCh] [bp-18h]@17 | |
3656 __int64 v9; // [sp+D0h] [bp-14h]@17 | |
3657 unsigned int v10; // [sp+D8h] [bp-Ch]@9 | |
3658 __int16 a9[2]; // [sp+DCh] [bp-8h]@1 | |
3659 int a5; // [sp+E0h] [bp-4h]@1 | |
3660 | |
3661 v0 = 0; | |
3662 a5 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xAu, 0, 0); | |
3663 *(int *)a9 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE6u, 0xD6u, 0xC1u); | |
3664 ppPlayers = &pPlayers[1]; | |
3665 do | |
3666 { | |
3667 pPlayer = *ppPlayers; | |
3668 if ( !(*ppPlayers)->pConditions[14] && !pPlayer->pConditions[16] && pPlayer->sHealth > 0 ) | |
3669 ++v0; | |
3670 ++ppPlayers; | |
3671 } | |
3672 while ( (signed int)ppPlayers <= (signed int)&pPlayers[4] ); | |
3673 if ( v0 ) | |
3674 { | |
3675 pRenderer->DrawTextureIndexed( | |
3676 8u, | |
3677 8u, | |
3678 (Texture *)(uTextureID_RestUI_restmain != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restmain] : 0)); | |
3679 v10 = pParty->uCurrentHour; | |
3680 dword_506F1C = pGUIWindow_CurrentMenu->pCurrentPosActiveItem; | |
3681 if ( (signed int)pParty->uCurrentHour <= 12 ) | |
3682 { | |
3683 if ( !v10 ) | |
3684 v10 = 12; | |
3685 } | |
3686 else | |
3687 { | |
3688 v10 -= 12; | |
3689 } | |
3690 pRenderer->DrawTextureIndexed(16u, 26u, pTexture_RestUI_CurrentSkyFrame); | |
3691 if ( pTexture_RestUI_CurrentHourglassFrame ) | |
3692 { | |
3693 pTexture_RestUI_CurrentHourglassFrame->Release(); | |
3694 pIcons_LOD->_40F9C5(); | |
3695 } | |
3696 v3 = pEventTimer->uTimeElapsed + _507CD4_RestUI_hourglass_anim_controller; | |
3697 _507CD4_RestUI_hourglass_anim_controller += pEventTimer->uTimeElapsed; | |
3698 if ( (unsigned int)_507CD4_RestUI_hourglass_anim_controller >= 512 ) | |
3699 { | |
3700 v3 = 0; | |
3701 _507CD4_RestUI_hourglass_anim_controller = 0; | |
3702 } | |
3703 v9 = v3; | |
3704 v8 = (double)v3 * 0.001953125 * 120.0; | |
3705 //v7 = v8 + 6.7553994e15; | |
3706 HIDWORD(v9) = floorf(v8 + 0.5f);//LODWORD(v7); | |
3707 v4 = (int)floorf(v8 + 0.5f) % 256 + 1;//LOBYTE(v7) + 1; | |
3708 byte_4E2BC8 = v4; | |
3709 if ( (unsigned __int8)(v4) >= 0x78u ) | |
3710 { | |
3711 v4 = 1; | |
3712 byte_4E2BC8 = 1; | |
3713 } | |
3714 sprintf(pTmpBuf, "hglas%03d", (unsigned __int8)v4); | |
3715 pTexture_RestUI_CurrentHourglassFrame = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pTmpBuf, TEXTURE_16BIT_PALETTE)]; | |
3716 pRenderer->DrawTextureIndexed(0x10Bu, 0x9Fu, pTexture_RestUI_CurrentHourglassFrame); | |
3717 memset(&Dst, 0, 0xBCu); | |
3718 Dst.uX = 24; | |
3719 Dst.uY = 154; | |
3720 Dst.uWidth = 171; | |
3721 Dst.uHeight = 37; | |
3722 Dst.uZ = 194; | |
3723 Dst.uW = 190; | |
3724 Dst.pParent = pButton_RestUI_WaitUntilDawn->pParent; | |
3725 Dst.DrawLabel(pGlobalTXT_LocalizationStrings[183], pFontCreate, a5, *(int **)a9); | |
3726 Dst.pParent = 0; | |
3727 sprintf(pTmpBuf, "\r408%d", uRestUI_FoodRequiredToRest); | |
3728 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 0, 164, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); | |
3729 pButton_RestUI_WaitUntilDawn->DrawLabel( | |
3730 pGlobalTXT_LocalizationStrings[237], | |
3731 pFontCreate, | |
3732 a5, | |
3733 *(int **)a9); | |
3734 pButton_RestUI_Wait1Hour->DrawLabel(pGlobalTXT_LocalizationStrings[239], pFontCreate, a5, *(int **)a9); | |
3735 pButton_RestUI_Wait5Minutes->DrawLabel(pGlobalTXT_LocalizationStrings[238], pFontCreate, a5, *(int **)a9); | |
3736 pButton_RestUI_Exit->DrawLabel(pGlobalTXT_LocalizationStrings[81], pFontCreate, a5, *(int **)a9); | |
3737 memset(&Dst, 0, 0xBCu); | |
3738 Dst.uX = 45; | |
3739 Dst.uY = 199; | |
3740 Dst.uWidth = 185; | |
3741 Dst.uHeight = 30; | |
3742 Dst.uZ = 229; | |
3743 Dst.uW = 228; | |
3744 Dst.pParent = pButton_RestUI_WaitUntilDawn->pParent; | |
3745 Dst.DrawLabel(pGlobalTXT_LocalizationStrings[236], pFontCreate, a5, *(int **)a9); | |
3746 Dst.pParent = 0; | |
3747 v5 = pParty->uCurrentHour >= 0xC && pParty->uCurrentHour < 0x18; | |
3748 sprintf(pTmpBuf, "%d:%02d %s", v10, pParty->uCurrentMinute, aAMPMNames[v5]); | |
3749 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 368, 168, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); | |
3750 sprintf(pTmpBuf, "%s\r190%d", pGlobalTXT_LocalizationStrings[56], pParty->uDaysPlayed + 1); | |
3751 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 190, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); | |
3752 sprintf(pTmpBuf, "%s\r190%d", pGlobalTXT_LocalizationStrings[146], pParty->uCurrentMonth + 1); | |
3753 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 222, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); | |
3754 sprintf(pTmpBuf, "%s\r190%d", pGlobalTXT_LocalizationStrings[245], pParty->uCurrentYear); | |
3755 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 254, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); | |
3756 if ( dword_506F14 ) | |
3757 Sleep6Hours(); | |
3758 } | |
3759 else | |
3760 { | |
3761 GUIWindow::Create( | |
3762 pButton_RestUI_Exit->uX, | |
3763 pButton_RestUI_Exit->uY, | |
3764 0, | |
3765 0, | |
3766 (enum WindowType)96, | |
3767 (int)pButton_RestUI_Exit, | |
3768 (int)pGlobalTXT_LocalizationStrings[81]); | |
3769 } | |
3770 } | |
421 | 3771 |
0 | 3772 |
3773 //----- (0042038D) -------------------------------------------------------- | |
3774 void __cdecl sub_42038D() | |
3775 { | |
3776 POINT *v0; // esi@2 | |
3777 int v1; // ecx@2 | |
3778 const char *v2; // eax@3 | |
3779 POINT v3; // [sp+0h] [bp-10h]@2 | |
3780 POINT a2; // [sp+8h] [bp-8h]@1 | |
3781 | |
3782 if ( pMouse->GetCursorPos(&a2)->y < 350 ) | |
3783 { | |
3784 v0 = pMouse->GetCursorPos(&a2); | |
3785 v1 = pRenderer->pActiveZBuffer[v0->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v3)->y]]; | |
3786 if ( v1 ) | |
3787 { | |
3788 auto _w = (ItemGen *)(&pOtherOverlayList->pOverlays[49].field_4 + 2662 * (unsigned int)pChestWindow->ptr_1C | |
526 | 3789 + 18 * *((short *)&pChests[0].igChestItems[139].uExpireTime |
0 | 3790 + v1 + 2662 * (unsigned int)pChestWindow->ptr_1C + 3)); |
3791 v2 = _w->GetDisplayName(); | |
3792 sub_41C0B8_set_status_string(v2); | |
3793 } | |
3794 } | |
3795 } | |
3796 | |
3797 | |
3798 //----- (00420C05) -------------------------------------------------------- | |
3799 void __fastcall party_finds_gold(unsigned int uNumGold, int _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal) | |
3800 { | |
3801 unsigned int v2; // edi@1 | |
3802 int v3; // ebp@1 | |
3803 unsigned int v4; // esi@1 | |
3804 int v5; // ecx@6 | |
3805 NPCData *v6; // eax@6 | |
3806 signed int v7; // edx@8 | |
3807 signed int v8; // ebx@10 | |
3808 char *v9; // edi@11 | |
3809 signed int v10; // ecx@17 | |
3810 int v11; // eax@21 | |
3811 NPCData *v12; // ecx@21 | |
3812 unsigned int v13; // ecx@23 | |
3813 signed int v14; // [sp+Ch] [bp-4h]@6 | |
3814 | |
3815 v2 = 0; | |
3816 v3 = 0; | |
3817 v4 = uNumGold; | |
3818 if ( _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal ) | |
3819 { | |
3820 if ( _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal == 1 ) | |
3821 { | |
3822 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[467], uNumGold);// You found %lu gold! | |
3823 } | |
3824 else | |
3825 { | |
3826 if ( _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal == 2 ) | |
3827 pTmpBuf2[0] = 0; | |
3828 } | |
3829 } | |
3830 else | |
3831 { | |
3832 v14 = 0; | |
3833 v5 = 0; | |
3834 v6 = pParty->pHirelings; | |
3835 do | |
3836 { | |
3837 if ( v6->pName ) | |
3838 { | |
3839 v7 = v14++; | |
3840 pTmpBuf[v7] = v5; | |
3841 } | |
3842 ++v6; | |
3843 ++v5; | |
3844 } | |
3845 while ( (signed int)v6 < (signed int)&pParty->pPickedItem ); | |
3846 v8 = 0; | |
3847 if ( (signed int)pNPCStats->uNumNewNPCs > 0 ) | |
3848 { | |
3849 v9 = (char *)pNPCStats->pNewNPCData; | |
3850 do | |
3851 { | |
3852 if ( v9[8] & 0x80 | |
3853 && (!pParty->pHirelings[0].pName || strcmp(*(const char **)v9, pParty->pHirelings[0].pName)) | |
3854 && (!pParty->pHirelings[1].pName || strcmp(*(const char **)v9, pParty->pHirelings[1].pName)) ) | |
3855 { | |
3856 v10 = v14++; | |
3857 pTmpBuf[v10] = v8 + 2; | |
3858 } | |
3859 ++v8; | |
3860 v9 += 76; | |
3861 } | |
3862 while ( v8 < (signed int)pNPCStats->uNumNewNPCs ); | |
3863 v2 = 0; | |
3864 } | |
3865 if ( v14 > 0 ) | |
3866 { | |
3867 do | |
3868 { | |
3869 v11 = (unsigned __int8)pTmpBuf[v2]; | |
3870 v12 = &pNPCStats->pNPCData[v11 + 499]; | |
33 | 3871 if ( (unsigned __int8)pTmpBuf[v2] < 2 ) |
0 | 3872 v12 = &pParty->pHirelings[v11]; |
3873 v13 = v12->uProfession; | |
3874 if ( v13 ) | |
291 | 3875 v3 += pNPCStats->pProfessions[v13].uHirePrice;//*(&pNPCStats->field_13A58 + 5 * v13); |
0 | 3876 ++v2; |
3877 } | |
3878 while ( (signed int)v2 < v14 ); | |
3879 } | |
3880 if ( CheckHiredNPCSpeciality(0x1Fu) ) | |
3881 v4 += (signed int)(10 * v4) / 100; | |
3882 if ( CheckHiredNPCSpeciality(0x20u) ) | |
3883 v4 += (signed int)(20 * v4) / 100; | |
3884 if ( CheckHiredNPCSpeciality(0x2Du) ) | |
3885 v4 += (signed int)(10 * v4) / 100; | |
3886 if ( v3 ) | |
3887 { | |
3888 v3 = (signed int)(v4 * v3 / 100) / 100; | |
3889 if ( v3 < 1 ) | |
3890 v3 = 1; | |
3891 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[466], v4, v3);// You found %lu gold (followers take %lu)! | |
3892 } | |
3893 else | |
3894 { | |
3895 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[467], v4);// You found %lu gold! | |
3896 } | |
3897 v2 = 0; | |
3898 } | |
3899 pParty->uNumGold += v4 - v3; | |
3900 pUIAnim_Gold->uAnimTime = v2; | |
3901 pUIAnim_Gold->uAnimLength = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Gold->uIconID].uAnimLength; | |
3902 if ( pTmpBuf2[0] ) | |
3903 ShowStatusBarString(pTmpBuf2, 2u); | |
3904 pAudioPlayer->PlaySound(SOUND_GoldReceived, v2, v2, -1, v2, v2, v2, v2); | |
3905 } | |
3906 | |
3907 //----- (00420E01) -------------------------------------------------------- | |
3908 void __cdecl sub_420E01() | |
3909 { | |
526 | 3910 int chest_id; // edi@1 |
0 | 3911 POINT *v1; // esi@2 |
3912 int v2; // eax@2 | |
3913 int v3; // ebx@4 | |
3914 int v4; // esi@6 | |
3915 int v5; // ecx@6 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
3916 //SpriteObject v6; // [sp+Ch] [bp-80h]@1 |
526 | 3917 POINT v7; // [sp+7Ch] [bp-10h]@2 |
0 | 3918 POINT a2; // [sp+84h] [bp-8h]@2 |
3919 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
3920 SpriteObject v6; // [sp+Ch] [bp-80h]@1 |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
3921 //SpriteObject::SpriteObject(&v6); |
0 | 3922 |
526 | 3923 chest_id = pGUIWindow_CurrentMenu->par1C; |
0 | 3924 if ( pParty->pPickedItem.uItemID ) |
3925 { | |
526 | 3926 if ( Chest::PutItemInChest(-1, &pParty->pPickedItem, pGUIWindow_CurrentMenu->par1C) ) |
0 | 3927 pMouse->RemoveHoldingItem(); |
3928 } | |
3929 else | |
3930 { | |
3931 v1 = pMouse->GetCursorPos(&a2); | |
3932 v2 = pRenderer->pActiveZBuffer[v1->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v7)->y]] & 0xFFFF; | |
3933 if ( v2 ) | |
3934 { | |
3935 if ( v2 ) | |
3936 v3 = v2 - 1; | |
3937 else | |
3938 v3 = -1; | |
526 | 3939 v4 = pChests[chest_id].pInventoryIndices[v3] - 1; |
3940 if ( pItemsTable->pItems[pChests[chest_id].igChestItems[v4].uItemID].uEquipType == 18 ) | |
0 | 3941 { |
526 | 3942 party_finds_gold(pItemsTable->pItems[pChests[chest_id].igChestItems[v4].uItemID].uValue, 0); //recheck |
0 | 3943 viewparams->bRedrawGameUI = 1; |
3944 } | |
3945 else | |
3946 { | |
526 | 3947 pParty->SetHoldingItem(&pChests[chest_id].igChestItems[v4]); |
0 | 3948 } |
3949 sub_420B13(v4, v3); | |
3950 } | |
3951 } | |
3952 } | |
3953 | |
3954 //----- (00420EFF) -------------------------------------------------------- | |
3955 void __cdecl GameUI_WritePointedObjectStatusString() | |
3956 { | |
3957 int v1; // ebx@6 | |
8 | 3958 GUIWindow *pWindow; // edi@7 |
3959 GUIButton *pButton; // ecx@11 | |
3960 Player *pPlayer; // eax@19 | |
0 | 3961 char v5; // cl@19 |
3962 unsigned int v6; // eax@19 | |
3963 int v7; // ecx@19 | |
3964 __int16 v8; // fps@23 | |
3965 unsigned __int8 v9; // c0@23 | |
3966 unsigned __int8 v10; // c3@23 | |
8 | 3967 enum UIMessageType pMessageType1; // esi@24 |
0 | 3968 int v12; // edx@25 |
3969 char *v13; // ecx@28 | |
3970 int v14; // eax@41 | |
8 | 3971 ItemGen *pItemGen; // ecx@44 |
0 | 3972 int v16; // ecx@46 |
3973 const char *v17; // eax@49 | |
3974 signed int v18; // eax@55 | |
3975 signed int v19; // ecx@63 | |
3976 BLVFace *pFace; // eax@69 | |
3977 __int16 v21; // ax@70 | |
3978 const char *v22; // eax@72 | |
3979 LevelDecoration *v23; // ecx@75 | |
3980 LevelDecoration *v24; // esi@75 | |
3981 __int16 v25; // ax@75 | |
3982 const char *v26; // ecx@79 | |
3983 Actor *pActor; // ecx@82 | |
3984 char *v28; // esi@82 | |
3985 int v29; // eax@82 | |
3986 signed int v30; // ecx@88 | |
3987 const char *v31; // eax@91 | |
3988 __int16 v32; // fps@109 | |
14 | 3989 //unsigned __int8 v33; // c0@109 |
3990 //unsigned __int8 v34; // c3@109 | |
8 | 3991 enum UIMessageType pMessageType2; // esi@110 |
0 | 3992 int v36; // edx@111 |
8 | 3993 enum UIMessageType pMessageType3; // edx@117 |
0 | 3994 int v38; // ecx@118 |
3995 const char *v39; // [sp-8h] [bp-E8h]@20 | |
3996 char *v40; // [sp-8h] [bp-E8h]@83 | |
3997 int v41; // [sp-4h] [bp-E4h]@20 | |
3998 char Str1[200]; // [sp+Ch] [bp-D4h]@129 | |
3999 unsigned int pX; // [sp+D4h] [bp-Ch]@1 | |
4000 unsigned int pY; // [sp+D8h] [bp-8h]@1 | |
4001 unsigned int v45; // [sp+DCh] [bp-4h]@21 | |
4002 | |
4003 v13 = nullptr; | |
4004 | |
4005 pMouse->uPointingObjectID = 0; | |
4006 pMouse->GetClickPos(&pX, &pY); | |
14 | 4007 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 ) |
0 | 4008 return; |
323 | 4009 if (pCurrentScreen == SCREEN_GAME) |
0 | 4010 { |
4011 if ( (signed int)pX > 467 || (signed int)pY > 351 ) | |
4012 goto _click_on_game_ui; | |
4013 if ( pRenderer->pRenderD3D ) | |
4014 { | |
4015 v18 = pGame->pVisInstance->get_picked_object_zbuf_val(); | |
4016 if ( (signed int)pX < (signed int)pViewport->uScreenX | |
4017 || (signed int)pX > (signed int)pViewport->uScreenZ | |
4018 || (signed int)pY < (signed int)pViewport->uScreenY | |
4019 || (signed int)pY > (signed int)pViewport->uScreenW ) | |
4020 v18 = -1; | |
4021 if ( v18 == -1 ) | |
8 | 4022 //goto LABEL_61; |
4023 { | |
4024 pMouse->uPointingObjectID = 0; | |
4025 if ( pMouse->uPointingObjectID == 0 ) | |
4026 { | |
4027 if ( uLastPointedObjectID != 0 ) | |
4028 { | |
4029 pStatusBarString[0] = 0; | |
4030 bForceDrawStatusBar = 1; | |
4031 } | |
4032 } | |
4033 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4034 return; | |
4035 } | |
0 | 4036 } |
4037 else | |
4038 { | |
4039 v18 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; | |
4040 } | |
4041 pMouse->uPointingObjectID = (unsigned __int16)v18; | |
4042 v19 = (signed int)(unsigned __int16)v18 >> 3; | |
4043 if ( (v18 & 7) == OBJECT_Item ) | |
4044 { | |
4045 v30 = v19; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
4046 if ( pObjectList->pObjects[pSpriteObjects[v30].uObjectDescID].uFlags & 0x10 ) |
8 | 4047 //goto LABEL_73; |
4048 { | |
4049 pMouse->uPointingObjectID = 0; | |
4050 //goto LABEL_50; | |
4051 uLastPointedObjectID = 1; | |
4052 if ( pMouse->uPointingObjectID == 0 ) | |
4053 { | |
4054 if ( uLastPointedObjectID != 0 ) | |
4055 { | |
4056 pStatusBarString[0] = 0; | |
4057 bForceDrawStatusBar = 1; | |
4058 } | |
4059 } | |
4060 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4061 return; | |
4062 } | |
0 | 4063 if ( v18 >= (signed int)0x2000000u || pParty->pPickedItem.uItemID ) |
4064 { | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
4065 v22 = pSpriteObjects[v30].stru_24.GetDisplayName(); |
8 | 4066 //LABEL_93: |
0 | 4067 v26 = v22; |
8 | 4068 //goto LABEL_87; |
4069 sub_41C0B8_set_status_string(v26); | |
4070 if ( pMouse->uPointingObjectID == 0 ) | |
4071 { | |
4072 if ( uLastPointedObjectID != 0 ) | |
4073 { | |
4074 pStatusBarString[0] = 0; | |
4075 bForceDrawStatusBar = 1; | |
4076 } | |
4077 } | |
4078 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4079 return; | |
0 | 4080 } |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
4081 v31 = pSpriteObjects[v30].stru_24.GetDisplayName(); |
0 | 4082 v28 = pTmpBuf; |
4083 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[470], v31);// "Get %s" | |
4084 } | |
4085 else | |
4086 { | |
4087 if ( (v18 & 7) != OBJECT_Actor ) | |
4088 { | |
4089 if ( (v18 & 7) == OBJECT_Decoration ) | |
4090 { | |
4091 v23 = &pLevelDecorations[v19]; | |
4092 v24 = v23; | |
4093 v25 = v23->field_16_event_id; | |
4094 if ( !v25 ) | |
4095 { | |
4096 if ( v23->IsInteractive() ) | |
4097 v26 = pNPCTopics[stru_5E4C90._decor_events[v24->_idx_in_stru123 - 75] + 379].pTopic; | |
4098 else | |
4099 v26 = pDecorationList->pDecorations[v24->uDecorationDescID].field_20; | |
8 | 4100 //goto LABEL_87; |
4101 sub_41C0B8_set_status_string(v26); | |
4102 if ( pMouse->uPointingObjectID == 0 ) | |
4103 { | |
4104 if ( uLastPointedObjectID != 0 ) | |
4105 { | |
4106 pStatusBarString[0] = 0; | |
4107 bForceDrawStatusBar = 1; | |
4108 } | |
4109 } | |
4110 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4111 return; | |
0 | 4112 } |
428 | 4113 v22 = GetEventHintString(v25); |
0 | 4114 if ( !v22 ) |
8 | 4115 //goto _return; |
4116 { | |
4117 if ( pMouse->uPointingObjectID == 0 ) | |
4118 { | |
4119 if ( uLastPointedObjectID != 0 ) | |
4120 { | |
4121 pStatusBarString[0] = 0; | |
4122 bForceDrawStatusBar = 1; | |
4123 } | |
4124 } | |
4125 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4126 return; | |
4127 } | |
4128 //goto LABEL_93; | |
4129 v26 = v22; | |
4130 //goto LABEL_87; | |
4131 sub_41C0B8_set_status_string(v26); | |
4132 if ( pMouse->uPointingObjectID == 0 ) | |
4133 { | |
4134 if ( uLastPointedObjectID != 0 ) | |
4135 { | |
4136 pStatusBarString[0] = 0; | |
4137 bForceDrawStatusBar = 1; | |
4138 } | |
4139 } | |
4140 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4141 return; | |
0 | 4142 } |
141 | 4143 if ( (v18 & 7) == OBJECT_BModel) |
0 | 4144 { |
4145 if ( v18 < (signed int)0x2000000u ) | |
4146 { | |
4147 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor) | |
4148 { | |
4149 v21 = pOutdoor->pBModels[(signed int)(unsigned __int16)v18 >> 9].pFaces[v19 & 0x3F].sCogTriggeredID; | |
8 | 4150 //goto LABEL_71; |
428 | 4151 if ( !v21 || (v22 = GetEventHintString(v21)) == 0 ) |
8 | 4152 //goto LABEL_73; |
4153 { | |
4154 pMouse->uPointingObjectID = 0; | |
4155 //goto LABEL_50; | |
4156 uLastPointedObjectID = 1; | |
4157 if ( pMouse->uPointingObjectID == 0 ) | |
4158 { | |
4159 if ( uLastPointedObjectID != 0 ) | |
4160 { | |
4161 pStatusBarString[0] = 0; | |
4162 bForceDrawStatusBar = 1; | |
4163 } | |
4164 } | |
4165 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4166 return; | |
4167 } | |
4168 //goto LABEL_93; | |
4169 v26 = v22; | |
4170 //goto LABEL_87; | |
4171 sub_41C0B8_set_status_string(v26); | |
4172 if ( pMouse->uPointingObjectID == 0 ) | |
4173 { | |
4174 if ( uLastPointedObjectID != 0 ) | |
4175 { | |
4176 pStatusBarString[0] = 0; | |
4177 bForceDrawStatusBar = 1; | |
4178 } | |
4179 } | |
4180 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4181 return; | |
0 | 4182 } |
4183 pFace = &pIndoor->pFaces[v19]; | |
4184 if ( BYTE3(pFace->uAttributes) & 6 ) | |
4185 { | |
4186 v21 = pIndoor->pFaceExtras[pFace->uFaceExtraID].uEventID; | |
8 | 4187 //LABEL_71: |
428 | 4188 if ( !v21 || (v22 = GetEventHintString(v21)) == 0 ) |
8 | 4189 //goto LABEL_73; |
4190 { | |
4191 pMouse->uPointingObjectID = 0; | |
4192 //goto LABEL_50; | |
4193 uLastPointedObjectID = 1; | |
4194 if ( pMouse->uPointingObjectID == 0 ) | |
4195 { | |
4196 if ( uLastPointedObjectID != 0 ) | |
4197 { | |
4198 pStatusBarString[0] = 0; | |
4199 bForceDrawStatusBar = 1; | |
4200 } | |
4201 } | |
4202 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4203 return; | |
4204 } | |
4205 //goto LABEL_93; | |
4206 v26 = v22; | |
4207 //goto LABEL_87; | |
4208 sub_41C0B8_set_status_string(v26); | |
4209 if ( pMouse->uPointingObjectID == 0 ) | |
4210 { | |
4211 if ( uLastPointedObjectID != 0 ) | |
4212 { | |
4213 pStatusBarString[0] = 0; | |
4214 bForceDrawStatusBar = 1; | |
4215 } | |
4216 } | |
4217 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4218 return; | |
0 | 4219 } |
4220 } | |
8 | 4221 //LABEL_73: |
0 | 4222 pMouse->uPointingObjectID = 0; |
8 | 4223 //goto LABEL_50; |
4224 uLastPointedObjectID = 1; | |
4225 if ( pMouse->uPointingObjectID == 0 ) | |
4226 { | |
4227 if ( uLastPointedObjectID != 0 ) | |
4228 { | |
4229 pStatusBarString[0] = 0; | |
4230 bForceDrawStatusBar = 1; | |
4231 } | |
4232 } | |
4233 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4234 return; | |
0 | 4235 } |
8 | 4236 //LABEL_61: |
0 | 4237 pMouse->uPointingObjectID = 0; |
8 | 4238 //goto _return; |
4239 if ( pMouse->uPointingObjectID == 0 ) | |
4240 { | |
4241 if ( uLastPointedObjectID != 0 ) | |
4242 { | |
4243 pStatusBarString[0] = 0; | |
4244 bForceDrawStatusBar = 1; | |
4245 } | |
4246 } | |
4247 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4248 return; | |
0 | 4249 } |
4250 if ( v18 >= 335544320 ) | |
8 | 4251 //goto LABEL_61; |
4252 { | |
4253 pMouse->uPointingObjectID = 0; | |
4254 if ( pMouse->uPointingObjectID == 0 ) | |
4255 { | |
4256 if ( uLastPointedObjectID != 0 ) | |
4257 { | |
4258 pStatusBarString[0] = 0; | |
4259 bForceDrawStatusBar = 1; | |
4260 } | |
4261 } | |
4262 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4263 return; | |
4264 } | |
0 | 4265 pActor = &pActors[v19]; |
4266 v28 = pTmpBuf; | |
4267 v29 = pActor->dword_000334_unique_name; | |
4268 if ( v29 ) | |
237 | 4269 v40 = pMonsterStats->pPlaceStrings[v29]; |
0 | 4270 else |
4271 v40 = pMonsterStats->pInfos[pActor->pMonsterInfo.uID].pName; | |
4272 strncpy(pTmpBuf, v40, 0x7D0u); | |
4273 } | |
4274 v26 = v28; | |
8 | 4275 //LABEL_87: |
0 | 4276 sub_41C0B8_set_status_string(v26); |
8 | 4277 //goto _return; |
4278 if ( pMouse->uPointingObjectID == 0 ) | |
4279 { | |
4280 if ( uLastPointedObjectID != 0 ) | |
4281 { | |
4282 pStatusBarString[0] = 0; | |
4283 bForceDrawStatusBar = 1; | |
4284 } | |
4285 } | |
4286 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4287 return; | |
0 | 4288 } |
4289 v1 = uNumVisibleWindows; | |
4290 if ( uNumVisibleWindows <= 0 ) | |
4291 { | |
4292 LABEL_38: | |
151 | 4293 if ( pCurrentScreen == SCREEN_CHEST ) |
0 | 4294 { |
4295 sub_42038D(); | |
8 | 4296 //goto _return; |
4297 if ( pMouse->uPointingObjectID == 0 ) | |
4298 { | |
4299 if ( uLastPointedObjectID != 0 ) | |
4300 { | |
4301 pStatusBarString[0] = 0; | |
4302 bForceDrawStatusBar = 1; | |
4303 } | |
4304 } | |
4305 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4306 return; | |
0 | 4307 } |
151 | 4308 if ( pCurrentScreen == SCREEN_HOUSE ) |
0 | 4309 { |
4310 if ( dword_F8B19C != 2 | |
4311 || (v16 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]], v16 == 0) | |
4312 || v16 == -65536 ) | |
8 | 4313 //goto _return; |
4314 { | |
4315 if ( pMouse->uPointingObjectID == 0 ) | |
4316 { | |
4317 if ( uLastPointedObjectID != 0 ) | |
4318 { | |
4319 pStatusBarString[0] = 0; | |
4320 bForceDrawStatusBar = 1; | |
4321 } | |
4322 } | |
4323 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4324 return; | |
4325 } | |
336 | 4326 pItemGen = (ItemGen *)((char *)&pParty->pPickedItem + 36 * (v16 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 4); |
8 | 4327 //LABEL_49: |
4328 v17 = pItemGen->GetDisplayName(); | |
0 | 4329 sub_41C0B8_set_status_string(v17); |
8 | 4330 //LABEL_50: |
0 | 4331 uLastPointedObjectID = 1; |
8 | 4332 //_return: |
0 | 4333 if ( pMouse->uPointingObjectID == 0 ) |
4334 { | |
4335 if ( uLastPointedObjectID != 0 ) | |
4336 { | |
4337 pStatusBarString[0] = 0; | |
4338 bForceDrawStatusBar = 1; | |
4339 } | |
4340 } | |
4341 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4342 return; | |
4343 } | |
4344 if ( (signed int)pY < 350 ) | |
4345 { | |
4346 v14 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; | |
4347 if ( v14 == 0 || v14 == -65536 || (unsigned int)v14 >= 0x1388 ) | |
8 | 4348 //goto _return; |
4349 { | |
4350 if ( pMouse->uPointingObjectID == 0 ) | |
4351 { | |
4352 if ( uLastPointedObjectID != 0 ) | |
4353 { | |
4354 pStatusBarString[0] = 0; | |
4355 bForceDrawStatusBar = 1; | |
4356 } | |
4357 } | |
4358 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4359 return; | |
4360 } | |
232 | 4361 pItemGen = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItems[v14-1]; |
8 | 4362 //goto LABEL_49; |
4363 v17 = pItemGen->GetDisplayName(); | |
4364 sub_41C0B8_set_status_string(v17); | |
4365 uLastPointedObjectID = 1; | |
4366 if ( pMouse->uPointingObjectID == 0 ) | |
4367 { | |
4368 if ( uLastPointedObjectID != 0 ) | |
4369 { | |
4370 pStatusBarString[0] = 0; | |
4371 bForceDrawStatusBar = 1; | |
4372 } | |
4373 } | |
4374 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4375 return; | |
0 | 4376 } |
4377 _click_on_game_ui: | |
4378 if ( (signed int)pX >= (signed int)pWindowList[0].uFrameX | |
4379 && (signed int)pX <= (signed int)pWindowList[0].uFrameZ | |
4380 && (signed int)pY >= (signed int)pWindowList[0].uFrameY | |
4381 && (signed int)pY <= (signed int)pWindowList[0].uFrameW ) | |
4382 { | |
8 | 4383 for ( pButton = pWindowList[0].pControlsHead; pButton != (GUIButton *)0; pButton = pButton->pNext ) |
4384 { | |
4385 if ( pButton->uButtonType == 1 ) | |
0 | 4386 { |
8 | 4387 if ( (signed int)pX >= (signed int)pButton->uX |
4388 && (signed int)pX <= (signed int)pButton->uZ | |
4389 && (signed int)pY >= (signed int)pButton->uY | |
4390 && (signed int)pY <= (signed int)pButton->uW ) | |
0 | 4391 { |
8 | 4392 pMessageType3 = (UIMessageType)pButton->field_1C; |
17 | 4393 if ( pMessageType3 == 0 ) // For books |
8 | 4394 //goto LABEL_28; |
4395 { | |
4396 v13 = pButton->pButtonName; | |
4397 sub_41C0B8_set_status_string(v13); | |
4398 uLastPointedObjectID = 1; | |
4399 return; | |
4400 } | |
4401 v38 = pButton->uControlParam; | |
437 | 4402 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) |
0 | 4403 { |
8 | 4404 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType3; |
0 | 4405 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v38; |
4406 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
4407 ++pMessageQueue_50CBD0->uNumMessages; | |
437 | 4408 }*/ |
4409 pMessageQueue_50CBD0->AddMessage(pMessageType3, v38, 0); | |
8 | 4410 //goto LABEL_131; |
0 | 4411 uLastPointedObjectID = 1; |
4412 return; | |
4413 } | |
4414 } | |
4415 else | |
4416 { | |
8 | 4417 if ( pButton->uButtonType == 2 ) |
0 | 4418 { |
8 | 4419 v45 = pX - pButton->uX; |
4420 v45 = pY - pButton->uY; | |
4421 | |
4422 if (pX >= pButton->uX && pX <= pButton->uZ && | |
4423 pY >= pButton->uY && pY <= pButton->uW) | |
4424 if ( (double)(signed int)pButton->uWidth != 0.0 ) | |
0 | 4425 { |
8 | 4426 if ( (double)(signed int)pButton->uHeight != 0.0 ) |
0 | 4427 { |
8 | 4428 //UNDEF(v32); |
14 | 4429 //if ( v33 | v34 ) |
4430 //{ | |
8 | 4431 pMessageType2 = (UIMessageType)pButton->field_1C; |
4432 if ( pMessageType2 != 0 ) | |
4433 { | |
4434 v36 = pButton->uControlParam; | |
4435 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
4436 { | |
437 | 4437 pMessageQueue_50CBD0->AddMessage(pMessageType2, v36, 0); |
4438 /*pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType2; | |
8 | 4439 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v36; |
4440 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
4441 //goto LABEL_27; | |
437 | 4442 ++pMessageQueue_50CBD0->uNumMessages;*/ |
8 | 4443 v13 = pButton->pButtonName; |
4444 sub_41C0B8_set_status_string(v13); | |
4445 uLastPointedObjectID = 1; | |
4446 return; | |
4447 } | |
4448 } | |
4449 //goto LABEL_28; | |
4450 v13 = pButton->pButtonName; | |
4451 sub_41C0B8_set_status_string(v13); | |
4452 uLastPointedObjectID = 1; | |
4453 return; | |
14 | 4454 //} |
0 | 4455 } |
4456 } | |
4457 } | |
8 | 4458 else |
0 | 4459 { |
8 | 4460 if ( pButton->uButtonType == 3 |
4461 && (signed int)pX >= (signed int)pButton->uX | |
4462 && (signed int)pX <= (signed int)pButton->uZ | |
4463 && (signed int)pY >= (signed int)pButton->uY | |
4464 && (signed int)pY <= (signed int)pButton->uW ) | |
4465 //goto LABEL_19; | |
0 | 4466 { |
8 | 4467 pPlayer = pPlayers[uActiveCharacter]; |
4468 v5 = LOBYTE(pPlayer->pActiveSkills[pButton->uControlParam]); | |
4469 v6 = pPlayer->uSkillPoints; | |
0 | 4470 v7 = (v5 & 0x3F) + 1; |
4471 if ( v6 < v7 ) | |
4472 { | |
4473 v41 = v7 - v6; | |
4474 v39 = pGlobalTXT_LocalizationStrings[469];// "You need %d more Skill Points to advance here" | |
4475 } | |
4476 else | |
4477 { | |
4478 v41 = v7; | |
4479 v39 = pGlobalTXT_LocalizationStrings[468];// "Clicking here will spend %d Skill Points" | |
4480 } | |
4481 sprintf(Str1, v39, v41); | |
4482 v13 = Str1; | |
8 | 4483 //goto _set_status_and_ret; |
4484 sub_41C0B8_set_status_string(v13); | |
4485 uLastPointedObjectID = 1; | |
4486 return; | |
0 | 4487 } |
4488 } | |
4489 } | |
4490 } | |
4491 } | |
8 | 4492 pMouse->uPointingObjectID = sub_46A99B(); |
4493 //goto _return; | |
4494 if ( pMouse->uPointingObjectID == 0 ) | |
4495 { | |
4496 if ( uLastPointedObjectID != 0 ) | |
4497 { | |
4498 pStatusBarString[0] = 0; | |
4499 bForceDrawStatusBar = 1; | |
4500 } | |
4501 } | |
4502 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4503 return; | |
4504 } | |
4505 while ( 1 ) // some other fullscreen ui | |
4506 { | |
4507 pWindow = &pWindowList[pVisibleWindowsIdxs[v1] - 1]; | |
4508 if ( (signed int)pX >= (signed int)pWindow->uFrameX | |
4509 && (signed int)pX <= (signed int)pWindow->uFrameZ | |
4510 && (signed int)pY >= (signed int)pWindow->uFrameY | |
4511 && (signed int)pY <= (signed int)pWindow->uFrameW ) | |
4512 { | |
4513 for ( pButton = pWindow->pControlsHead; ; pButton = pButton->pNext ) | |
4514 { | |
4515 if ( !pButton ) | |
4516 break; | |
4517 if ( pButton->uButtonType == 1 ) | |
4518 { | |
4519 if ( (signed int)pX >= (signed int)pButton->uX | |
4520 && (signed int)pX <= (signed int)pButton->uZ | |
4521 && (signed int)pY >= (signed int)pButton->uY | |
4522 && (signed int)pY <= (signed int)pButton->uW ) | |
4523 { | |
4524 //LABEL_24: | |
4525 pMessageType1 = (UIMessageType)pButton->field_1C; | |
4526 if ( pMessageType1 ) | |
4527 { | |
4528 v12 = pButton->uControlParam; | |
437 | 4529 pMessageQueue_50CBD0->AddMessage(pMessageType1, v12, 0); |
4530 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
8 | 4531 { |
4532 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType1; | |
4533 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v12; | |
4534 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
4535 //LABEL_27: | |
4536 ++pMessageQueue_50CBD0->uNumMessages; | |
437 | 4537 }*/ |
8 | 4538 } |
4539 //LABEL_28: | |
4540 v13 = pButton->pButtonName; | |
4541 //_set_status_and_ret: | |
4542 sub_41C0B8_set_status_string(v13); | |
4543 //LABEL_131: | |
4544 uLastPointedObjectID = 1; | |
4545 return; | |
4546 } | |
4547 } | |
4548 else | |
4549 { | |
4550 if ( pButton->uButtonType == 2 ) | |
4551 { | |
4552 v45 = pX - pButton->uX; | |
4553 v45 = pY - pButton->uY; | |
4554 if ( (double)(signed int)pButton->uWidth != 0.0 ) | |
4555 { | |
4556 if ( (double)(signed int)pButton->uHeight != 0.0 ) | |
4557 { | |
4558 //UNDEF(v8); | |
14 | 4559 //if ( v9 | v10 ) |
8 | 4560 //goto LABEL_24; |
14 | 4561 //{ |
8 | 4562 pMessageType1 = (UIMessageType)pButton->field_1C; |
4563 if ( pMessageType1 ) | |
4564 { | |
4565 v12 = pButton->uControlParam; | |
437 | 4566 pMessageQueue_50CBD0->AddMessage(pMessageType1, v12, 0); |
4567 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
8 | 4568 { |
4569 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType1; | |
4570 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v12; | |
4571 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
4572 ++pMessageQueue_50CBD0->uNumMessages; | |
437 | 4573 }*/ |
8 | 4574 } |
4575 v13 = pButton->pButtonName; | |
4576 sub_41C0B8_set_status_string(v13); | |
4577 uLastPointedObjectID = 1; | |
4578 return; | |
14 | 4579 //} |
8 | 4580 } |
4581 } | |
4582 } | |
4583 else // click on skill | |
4584 { | |
4585 if ( pButton->uButtonType == 3 | |
4586 && (signed int)pX >= (signed int)pButton->uX | |
4587 && (signed int)pX <= (signed int)pButton->uZ | |
4588 && (signed int)pY >= (signed int)pButton->uY | |
4589 && (signed int)pY <= (signed int)pButton->uW ) | |
4590 { | |
4591 //LABEL_19: | |
4592 pPlayer = pPlayers[uActiveCharacter]; | |
4593 v5 = LOBYTE(pPlayer->pActiveSkills[pButton->uControlParam]); | |
4594 v6 = pPlayer->uSkillPoints; | |
4595 v7 = (v5 & 0x3F) + 1; | |
4596 if ( v6 < v7 ) | |
4597 { | |
4598 v41 = v7 - v6; | |
4599 v39 = pGlobalTXT_LocalizationStrings[469];// "You need %d more Skill Points to advance here" | |
4600 } | |
4601 else | |
4602 { | |
4603 v41 = v7; | |
4604 v39 = pGlobalTXT_LocalizationStrings[468];// "Clicking here will spend %d Skill Points" | |
4605 } | |
4606 sprintf(Str1, v39, v41); | |
4607 v13 = Str1; | |
4608 //goto _set_status_and_ret; | |
4609 sub_41C0B8_set_status_string(v13); | |
4610 uLastPointedObjectID = 1; | |
4611 return; | |
4612 } | |
4613 } | |
4614 } | |
4615 } | |
4616 } | |
4617 if ( pWindow->uFrameHeight == 480 ) | |
0 | 4618 break; |
4619 --v1; | |
4620 if ( v1 <= 0 ) | |
4621 { | |
4622 goto LABEL_38; | |
4623 } | |
4624 } | |
4625 } | |
4626 | |
4627 | |
4628 //----- (00421626) -------------------------------------------------------- | |
4629 GUIWindow *GameUI_InitializeCharacterWindow(unsigned int _this) | |
4630 { | |
4631 unsigned int v1; // edi@1 | |
11 | 4632 GUIWindow *pWindow; // edi@3 |
0 | 4633 |
4634 ++pIcons_LOD->uTexturePacksCount; | |
4635 v1 = _this; | |
4636 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | |
4637 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
4638 pEventTimer->Pause(); | |
4639 pAudioPlayer->StopChannels(-1, -1); | |
4640 bRingsShownInCharScreen = 0; | |
4641 CharacterUI_LoadPaperdollTextures(); | |
4642 pCurrentScreen = v1; | |
11 | 4643 pWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_CharacterRecord, uActiveCharacter, 0); |
4644 pCharacterScreen_StatsBtn = pWindow->CreateButton(pViewport->uViewportX + 12, pViewport->uViewportY + 308, | |
0 | 4645 (papredoll_dbrds[9] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[9]].uTextureWidth : 24), |
4646 (papredoll_dbrds[9] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[9]].uTextureHeight : 26), | |
11 | 4647 1, 0, 0x73u, 0, 0x53u, pGlobalTXT_LocalizationStrings[216],// Stats |
0 | 4648 (Texture *)(papredoll_dbrds[10] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[10]] : 0), |
11 | 4649 papredoll_dbrds[9] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[9]] : 0, 0); |
4650 pCharacterScreen_SkillsBtn = pWindow->CreateButton(pViewport->uViewportX + 102, pViewport->uViewportY + 308, | |
0 | 4651 (papredoll_dbrds[7] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[7]].uTextureWidth : 24), |
4652 (papredoll_dbrds[7] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[7]].uTextureHeight : 26), | |
11 | 4653 1, 0, 0x72u, 0, 0x4Bu, pGlobalTXT_LocalizationStrings[205],//Skills |
0 | 4654 (Texture *)(papredoll_dbrds[8] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[8]] : 0), |
11 | 4655 papredoll_dbrds[7] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[7]] : 0, 0); |
4656 pCharacterScreen_InventoryBtn = pWindow->CreateButton(pViewport->uViewportX + 192, pViewport->uViewportY + 308, | |
0 | 4657 (papredoll_dbrds[5] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[5]].uTextureWidth : 24), |
4658 (papredoll_dbrds[5] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[5]].uTextureHeight : 26), | |
11 | 4659 1, 0, 0x74u, 0, 0x49u, pGlobalTXT_LocalizationStrings[120], //Inventory |
0 | 4660 (Texture *)(papredoll_dbrds[6] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[6]] : 0), |
11 | 4661 papredoll_dbrds[5] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[5]] : 0, 0); |
4662 pCharacterScreen_AwardsBtn = pWindow->CreateButton(pViewport->uViewportX + 282, pViewport->uViewportY + 308, | |
0 | 4663 (papredoll_dbrds[3] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[3]].uTextureWidth : 24), |
4664 (papredoll_dbrds[3] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[3]].uTextureHeight : 26), | |
11 | 4665 1, 0, 0x75u, 0, 0x41u, pGlobalTXT_LocalizationStrings[22], //Awards |
0 | 4666 (Texture *)(papredoll_dbrds[4] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[4]] : 0), |
11 | 4667 papredoll_dbrds[3] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[3]] : 0, 0); |
4668 pCharacterScreen_ExitBtn = pWindow->CreateButton(pViewport->uViewportX + 371, pViewport->uViewportY + 308, | |
0 | 4669 (papredoll_dbrds[1] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[1]].uTextureWidth : 24), |
4670 (papredoll_dbrds[1] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[1]].uTextureHeight : 26), | |
11 | 4671 1, 0, 0xA8u, 0, 0, pGlobalTXT_LocalizationStrings[79],//Exit |
0 | 4672 (Texture *)(papredoll_dbrds[2] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[2]] : 0), |
11 | 4673 papredoll_dbrds[1] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[1]] : 0, 0); |
4674 pWindow->CreateButton(0, 0, 0x1DCu, 0x159u, 1, 122, 0x78u, 0, 0, "", 0); | |
4675 pCharacterScreen_DetalizBtn = pWindow->CreateButton(0x258u, 0x12Cu, 0x1Eu, 0x1Eu, 1, 0, 0x55u, 0, 0, pGlobalTXT_LocalizationStrings[64], 0); | |
4676 pCharacterScreen_DollBtn = pWindow->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, 0x85u, 0, 0, "", 0); | |
4677 pWindow->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0); | |
4678 pWindow->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0); | |
4679 pWindow->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0); | |
4680 pWindow->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0); | |
4681 pWindow->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, "", 0); | |
521 | 4682 FillAwardsData(); |
11 | 4683 return pWindow; |
0 | 4684 } |
4685 | |
4686 | |
4687 | |
4688 //----- (004219BE) -------------------------------------------------------- | |
4689 GUIWindow *stru277::sub_4219BE() | |
4690 { | |
4691 int v1; // esi@1 | |
4692 GUIWindow *v2; // ebx@1 | |
4693 | |
4694 auto a4 = this; | |
4695 v1 = (int)a4; | |
4696 pEventTimer->Pause(); | |
4697 pAudioPlayer->StopChannels(-1, -1); | |
4698 bRingsShownInCharScreen = 0; | |
4699 CharacterUI_LoadPaperdollTextures(); | |
151 | 4700 pCurrentScreen = SCREEN_CASTING; |
0 | 4701 v2 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|WINDOW_Options), v1, 0); |
4702 pCharacterScreen_ExitBtn = v2->CreateButton( | |
4703 394u, | |
4704 318u, | |
4705 75u, | |
4706 33u, | |
4707 1, | |
4708 0, | |
4709 0xA8u, | |
4710 0, | |
4711 0, | |
4712 pGlobalTXT_LocalizationStrings[79], | |
4713 (Texture *)(papredoll_dbrds[2] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[2]] : 0), | |
4714 papredoll_dbrds[1] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[1]] : 0, | |
4715 0); | |
4716 v2->CreateButton(0, 0, 0x1DCu, 0x159u, 1, 122, 0x78u, 0, 0, "", 0); | |
4717 pCharacterScreen_DollBtn = v2->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, 0x85u, 0, 0, "", 0); | |
4718 v2->CreateButton(61u, 424u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0); | |
4719 v2->CreateButton(177u, 424u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0); | |
4720 v2->CreateButton(292u, 424u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0); | |
4721 v2->CreateButton(407u, 424u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0); | |
4722 return v2; | |
4723 } | |
4724 | |
4725 | |
4726 //----- (00421B2C) -------------------------------------------------------- | |
4727 bool __cdecl sub_421B2C_PlaceInInventory_or_DropPickedItem() | |
4728 { | |
4729 unsigned int v0; // eax@2 | |
4730 Texture *v1; // ebx@2 | |
4731 int v2; // eax@3 | |
4732 Player *v3; // esi@5 | |
4733 int v4; // eax@6 | |
4734 unsigned __int16 v5; // dx@11 | |
4735 signed int v6; // eax@11 | |
4736 char *v7; // edi@12 | |
4737 __int16 v8; // ax@16 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
4738 SpriteObject a1; // [sp+4h] [bp-78h]@11 |
0 | 4739 int v11; // [sp+74h] [bp-8h]@2 |
4740 int v12; // [sp+78h] [bp-4h]@5 | |
4741 | |
4742 if ( !pParty->pPickedItem.uItemID ) | |
4743 return 1; | |
4744 v0 = pIcons_LOD->LoadTexture( | |
4745 pItemsTable->pItems[pParty->pPickedItem.uItemID].pIconName, | |
4746 TEXTURE_16BIT_PALETTE); | |
4747 v1 = (Texture *)(v0 != -1 ? (int)&pIcons_LOD->pTextures[v0] : 0); | |
4748 v11 = areWeLoadingTexture; | |
4749 if ( uActiveCharacter | |
4750 && (v2 = pPlayers[uActiveCharacter]->AddItem(0xFFFFFFFFu, pParty->pPickedItem.uItemID)) != 0 ) | |
4751 { | |
232 | 4752 memcpy(&pPlayers[uActiveCharacter]->pInventoryItems[v2-1], &pParty->pPickedItem, 0x24u); |
244 | 4753 pMouse->RemoveHoldingItem(); |
0 | 4754 } |
4755 else | |
4756 { | |
4757 v12 = 0; | |
4758 v3 = pParty->pPlayers; | |
244 | 4759 while ( v3 <= &pParty->pPlayers[3] ) |
0 | 4760 { |
4761 v4 = v3->AddItem(0xFFFFFFFFu, pParty->pPickedItem.uItemID); | |
4762 if ( v4 ) | |
244 | 4763 { |
4764 memcpy(&pParty->pPlayers[v12].pInventoryItems[v4], &pParty->pPickedItem, 0x24u); | |
4765 pMouse->RemoveHoldingItem(); | |
4766 break; | |
4767 } | |
4768 ++v12; | |
0 | 4769 ++v3; |
244 | 4770 } |
4771 if ( v12 == 4 ) | |
4772 { | |
4773 v5 = pItemsTable->pItems[pParty->pPickedItem.uItemID].uSpriteID; | |
4774 v6 = 0; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
4775 a1.uType = pItemsTable->pItems[pParty->pPickedItem.uItemID].uSpriteID; |
244 | 4776 if ( (signed int)pObjectList->uNumObjects <= 0 ) |
4777 { | |
4778 LOWORD(v6) = 0; | |
4779 } | |
4780 else | |
4781 { | |
4782 v7 = (char *)&pObjectList->pObjects->uObjectID; | |
4783 while ( v5 != *(short *)v7 ) | |
4784 { | |
4785 ++v6; | |
4786 v7 += 56; | |
4787 if ( v6 >= (signed int)pObjectList->uNumObjects ) | |
4788 { | |
4789 LOWORD(v6) = 0; | |
4790 break; | |
4791 } | |
4792 } | |
4793 } | |
303 | 4794 a1.field_58_pid = OBJECT_Player; |
244 | 4795 a1.uObjectDescID = v6; |
4796 a1.vPosition.y = pParty->vPosition.y; | |
4797 a1.vPosition.x = pParty->vPosition.x; | |
4798 a1.vPosition.z = pParty->sEyelevel + pParty->vPosition.z; | |
4799 a1.uSoundID = 0; | |
4800 a1.uFacing = 0; | |
4801 a1.uAttributes = 8; | |
4802 v8 = pIndoor->GetSector( | |
4803 pParty->vPosition.x, | |
4804 pParty->vPosition.y, | |
4805 pParty->sEyelevel + pParty->vPosition.z); | |
4806 a1.uSpriteFrameID = 0; | |
4807 a1.uSectorID = v8; | |
4808 memcpy(&a1.stru_24, &pParty->pPickedItem, sizeof(a1.stru_24)); | |
4809 a1.Create(pParty->sRotationY, 184, 200, 0); | |
4810 pMouse->RemoveHoldingItem(); | |
4811 } | |
4812 } | |
0 | 4813 if ( !v11 ) |
4814 { | |
4815 v1->Release(); | |
4816 pIcons_LOD->_40F9C5(); | |
4817 } | |
4818 return 1; | |
4819 } | |
4820 | |
4821 | |
4822 //----- (00421D00) -------------------------------------------------------- | |
4823 void __fastcall GameUI_OnPlayerPortraitLeftClick(unsigned int uPlayerID) | |
4824 { | |
201 | 4825 //unsigned int v1; // esi@1 |
4826 //int v2; // eax@2 | |
4827 //Player *v3; // ecx@2 | |
4828 //Player *v4; // ecx@5 | |
0 | 4829 unsigned int v5; // [sp-4h] [bp-10h]@21 |
4830 | |
201 | 4831 //v1 = uPlayerID; |
4832 auto player = &pParty->pPlayers[uPlayerID - 1]; | |
4833 if (pParty->pPickedItem.uItemID) | |
4834 { | |
4835 //v3 = player; | |
4836 if (auto slot = player->AddItem(0xFFFFFFFFu, pParty->pPickedItem.uItemID)) | |
4837 { | |
232 | 4838 memcpy(&player->pInventoryItems[slot-1], &pParty->pPickedItem, 0x24u); |
201 | 4839 viewparams->bRedrawGameUI = true; |
0 | 4840 pMouse->RemoveHoldingItem(); |
4841 return; | |
4842 } | |
201 | 4843 |
4844 if (!player->CanAct()) | |
4845 { | |
4846 if ( pPlayers[uActiveCharacter]->CanAct()) | |
0 | 4847 goto LABEL_9; |
201 | 4848 player = pPlayers[uActiveCharacter]; |
4849 } | |
4850 player->PlaySound(SPEECH_NoRoom, 0); | |
4851 } | |
4852 | |
0 | 4853 LABEL_9: |
201 | 4854 if (pCurrentScreen == SCREEN_GAME) |
4855 { | |
4856 viewparams->bRedrawGameUI = true; | |
4857 if ( uActiveCharacter != uPlayerID ) | |
11 | 4858 //goto LABEL_27; |
4859 { | |
201 | 4860 if ( pPlayers[uPlayerID]->uTimeToRecovery ) |
11 | 4861 return; |
201 | 4862 |
4863 uActiveCharacter = uPlayerID; | |
11 | 4864 return; |
4865 } | |
0 | 4866 v5 = 7; |
11 | 4867 //LABEL_22: |
0 | 4868 pGUIWindow_CurrentMenu = GameUI_InitializeCharacterWindow(v5); |
4869 return; | |
4870 } | |
151 | 4871 if ( pCurrentScreen == SCREEN_SPELL_BOOK ) |
0 | 4872 return; |
151 | 4873 if ( pCurrentScreen == SCREEN_CHEST ) |
0 | 4874 { |
11 | 4875 //LABEL_23: |
201 | 4876 viewparams->bRedrawGameUI = true; |
4877 if ( uActiveCharacter == uPlayerID ) | |
0 | 4878 { |
4879 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; | |
151 | 4880 pCurrentScreen = SCREEN_F; |
11 | 4881 //goto LABEL_28; |
201 | 4882 uActiveCharacter = uPlayerID; |
11 | 4883 return; |
4884 } | |
4885 //LABEL_27: | |
201 | 4886 if ( pPlayers[uPlayerID]->uTimeToRecovery ) |
0 | 4887 return; |
11 | 4888 //goto LABEL_28; |
201 | 4889 uActiveCharacter = uPlayerID; |
11 | 4890 return; |
0 | 4891 } |
151 | 4892 if ( pCurrentScreen != SCREEN_HOUSE ) |
4893 { | |
4894 if ( pCurrentScreen == SCREEN_E ) | |
0 | 4895 { |
11 | 4896 //LABEL_28: |
201 | 4897 uActiveCharacter = uPlayerID; |
0 | 4898 return; |
4899 } | |
151 | 4900 if ( pCurrentScreen != SCREEN_F ) |
0 | 4901 { |
201 | 4902 viewparams->bRedrawGameUI = true; |
4903 uActiveCharacter = uPlayerID; | |
0 | 4904 if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 102 ) |
521 | 4905 FillAwardsData(); |
0 | 4906 return; |
4907 } | |
11 | 4908 //goto LABEL_23; |
201 | 4909 viewparams->bRedrawGameUI = true; |
4910 if ( uActiveCharacter == uPlayerID ) | |
11 | 4911 { |
4912 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; | |
151 | 4913 pCurrentScreen = SCREEN_F; |
11 | 4914 //goto LABEL_28; |
201 | 4915 uActiveCharacter = uPlayerID; |
11 | 4916 return; |
4917 } | |
4918 //LABEL_27: | |
201 | 4919 if ( pPlayers[uPlayerID]->uTimeToRecovery ) |
11 | 4920 return; |
4921 //goto LABEL_28; | |
201 | 4922 uActiveCharacter = uPlayerID; |
11 | 4923 return; |
0 | 4924 } |
336 | 4925 if ( window_SpeakInHouse->field_40 == 1 ) |
0 | 4926 return; |
201 | 4927 viewparams->bRedrawGameUI = true; |
4928 if ( uActiveCharacter != uPlayerID ) | |
11 | 4929 //goto LABEL_28; |
201 | 4930 uActiveCharacter = uPlayerID; |
11 | 4931 return; |
0 | 4932 if ( dword_F8B19C == 2 || dword_F8B19C == 6 ) |
4933 { | |
4934 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; | |
4935 v5 = 14; | |
11 | 4936 //goto LABEL_22; |
4937 pGUIWindow_CurrentMenu = GameUI_InitializeCharacterWindow(v5); | |
4938 return; | |
0 | 4939 } |
4940 } | |
4941 // 4E28F8: using guessed type int pCurrentScreen; | |
4942 // F8B19C: using guessed type int dword_F8B19C; | |
4943 | |
4944 //----- (00421EA6) -------------------------------------------------------- | |
4945 void __cdecl sub_421EA6_OnInventoryLeftClick() | |
4946 { | |
4947 Player *v0; // ebx@1 | |
4948 signed int v1; // eax@2 | |
4949 signed int v2; // ecx@2 | |
4950 int v3; // eax@2 | |
4951 char v4; // sf@2 | |
4952 int v5; // eax@2 | |
4953 unsigned int v6; // eax@7 | |
4954 unsigned int v7; // esi@12 | |
4955 unsigned int v8; // eax@12 | |
4956 unsigned int v9; // eax@16 | |
4957 unsigned int v10; // eax@18 | |
4958 ItemGen this_; // [sp+Ch] [bp-3Ch]@1 | |
4959 POINT a2; // [sp+30h] [bp-18h]@4 | |
4960 unsigned int v13; // [sp+38h] [bp-10h]@13 | |
4961 unsigned int pY; // [sp+3Ch] [bp-Ch]@2 | |
4962 unsigned int pX; // [sp+40h] [bp-8h]@2 | |
4963 int a4; // [sp+44h] [bp-4h]@2 | |
4964 | |
4965 v0 = pPlayers[uActiveCharacter]; | |
501 | 4966 if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 103 ) |
0 | 4967 { |
501 | 4968 pMouse->GetClickPos(&pX, &pY); |
4969 pY = pY - 17; | |
4970 v2 =pX - 14; | |
4971 pX = v2; | |
4972 v3 = 14 * (pY >> 5); | |
4973 v2 >>= 5; | |
4974 v4 = v2 + v3 < 0; | |
4975 v5 = v2 + v3; | |
4976 a4 = v5; | |
4977 if ( !v4 ) | |
0 | 4978 { |
501 | 4979 if ( v5 <= 126 && pMouse->GetCursorPos(&a2)->x < 462 |
4980 && pMouse->GetCursorPos(&a2)->x >= 14 ) | |
0 | 4981 { |
501 | 4982 if ( unk_50C9A0 ) |
4983 { | |
4984 v6 = v0->GetItemIDAtInventoryIndex(&a4); | |
4985 if ( v6 ) | |
4986 { | |
4987 *((char *)pGUIWindow_Settings->ptr_1C + 8) &= 0x7Fu; | |
4988 *((short *)pGUIWindow_Settings->ptr_1C + 2) = uActiveCharacter - 1; | |
4989 *((int *)pGUIWindow_Settings->ptr_1C + 3) = v6 - 1; | |
4990 *((short *)pGUIWindow_Settings->ptr_1C + 3) = a4; | |
4991 ptr_50C9A4 = (ItemGen *)&v0->pInventoryItems[v6-1]; | |
4992 unk_50C9A0 = 0; | |
4993 if ( pMessageQueue_50CBD0->uNumMessages ) | |
4994 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
4995 pMouse->SetCursorBitmap("MICON1"); | |
4996 dword_50C9D0 = 113; | |
4997 dword_50C9D4 = 0; | |
4998 dword_50C9D8 = 256; | |
4999 } | |
5000 return; | |
5001 } | |
5002 if ( ptr_50C9A4 ) | |
5003 return; | |
5004 v7 = pParty->pPickedItem.uItemID; | |
5005 v8 = v0->GetItemIDAtInventoryIndex(&a4); | |
5006 if ( !v7 ) | |
5007 { | |
5008 if ( !v8 ) | |
5009 return; | |
5010 memcpy(&pParty->pPickedItem, &v0->pInventoryItems[v8-1], sizeof(pParty->pPickedItem)); | |
5011 v0->RemoveItemAtInventoryIndex(a4); | |
5012 v9 = pParty->pPickedItem.uItemID; | |
5013 goto LABEL_24; | |
5014 } | |
5015 v13 = v8; | |
5016 if ( v8 ) | |
5017 { | |
5018 a2.y = (LONG)&v0->pInventoryItems[v8-1]; | |
5019 memcpy(&this_, (const void *)a2.y, sizeof(this_)); | |
5020 v0->RemoveItemAtInventoryIndex(a4); | |
5021 pX = v0->AddItem2(a4, &pParty->pPickedItem); | |
5022 if ( !pX ) | |
5023 { | |
5024 pX = v0->AddItem2(0xFFFFFFFFu, &pParty->pPickedItem); | |
5025 if ( !pX ) | |
5026 { | |
5027 v0->_49298B(&this_, v13 - 1, a4); | |
5028 memcpy((void *)a2.y, &this_, sizeof(ItemGen)); | |
5029 return; | |
5030 } | |
5031 } | |
5032 v9 = this_.uItemID; | |
5033 memcpy(&pParty->pPickedItem, &this_, sizeof(pParty->pPickedItem)); | |
5034 LABEL_24: | |
5035 pMouse->SetCursorBitmap(pItemsTable->pItems[v9].pIconName); | |
5036 return; | |
5037 } | |
5038 v10 = v0->AddItem(a4, v7); | |
5039 pX = v10; | |
5040 if ( v10 || (v10 = v0->AddItem(0xFFFFFFFFu, pParty->pPickedItem.uItemID), (pX = v10) != 0) ) | |
5041 { | |
5042 memcpy(&v0->pInventoryItems[v10-1], &pParty->pPickedItem, 0x24u); | |
5043 pMouse->RemoveHoldingItem(); | |
5044 } | |
0 | 5045 } |
5046 } | |
5047 } | |
5048 } | |
5049 | |
5050 //----- (0042213C) -------------------------------------------------------- | |
5051 void __cdecl OnGameViewportClick() | |
5052 { | |
5053 signed int v0; // ebx@2 | |
5054 POINT *v1; // esi@3 | |
5055 signed int v2; // eax@9 | |
5056 BLVFace *v3; // eax@10 | |
5057 unsigned int v4; // eax@11 | |
5058 unsigned __int16 v5; // dx@14 | |
5059 signed int v6; // eax@14 | |
5060 char *v7; // esi@15 | |
5061 int *v8; // eax@19 | |
5062 int v9; // eax@19 | |
5063 unsigned int v10; // eax@19 | |
5064 int v11; // ecx@21 | |
5065 ODMFace *v12; // eax@22 | |
5066 LevelDecoration *v13; // esi@24 | |
5067 __int16 v14; // ax@25 | |
5068 int v15; // ecx@29 | |
5069 signed int v16; // edx@30 | |
5070 Actor *v17; // esi@30 | |
5071 int v18; // ebx@47 | |
5072 unsigned __int16 v19; // ax@50 | |
5073 const char *v20; // eax@51 | |
5074 signed int v21; // eax@58 | |
5075 ItemGen *v22; // esi@62 | |
5076 unsigned int v23; // eax@62 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
5077 SpriteObject a1; // [sp+Ch] [bp-80h]@1 |
0 | 5078 POINT v25; // [sp+7Ch] [bp-10h]@3 |
5079 POINT a2; // [sp+84h] [bp-8h]@3 | |
5080 | |
5081 if ( pRenderer->pRenderD3D ) | |
5082 { | |
5083 v0 = pGame->pVisInstance->get_picked_object_zbuf_val(); | |
5084 } | |
5085 else | |
5086 { | |
5087 v1 = pMouse->GetCursorPos(&a2); | |
5088 v0 = pRenderer->pActiveZBuffer[v1->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v25)->y]]; | |
5089 } | |
141 | 5090 if ( (v0 & 7) == OBJECT_Item) |
0 | 5091 { |
5092 a2.y = (signed int)(unsigned __int16)v0 >> 3; | |
5093 v21 = (signed int)(unsigned __int16)v0 >> 3; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
5094 if ( !(pObjectList->pObjects[pSpriteObjects[v21].uObjectDescID].uFlags & 0x10) |
0 | 5095 && a2.y < 1000 |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
5096 && pSpriteObjects[v21].uObjectDescID |
0 | 5097 && (unsigned int)v0 < 0x2000000 ) |
5098 { | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
5099 v22 = &pSpriteObjects[v21].stru_24; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
5100 v23 = pSpriteObjects[v21].stru_24.uItemID; |
0 | 5101 if ( pItemsTable->pItems[v23].uEquipType == 18 ) |
5102 { | |
377 | 5103 party_finds_gold(v22->uSpecEnchantmentType, 0); |
0 | 5104 viewparams->bRedrawGameUI = 1; |
5105 } | |
5106 else | |
5107 { | |
5108 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[v23].pUnidentifiedName); | |
5109 ShowStatusBarString(pTmpBuf2, 2u); | |
5110 if ( v22->uItemID == 506 ) | |
484 | 5111 _449B7E_toggle_bit(pParty->_quest_bits, 184, 1u); |
0 | 5112 if ( v22->uItemID == 455 ) |
484 | 5113 _449B7E_toggle_bit(pParty->_quest_bits, 185, 1u); |
0 | 5114 if ( !pParty->AddItem(v22) ) |
5115 pParty->SetHoldingItem(v22); | |
5116 } | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
5117 SpriteObject::OnInteraction(a2.y); |
0 | 5118 return; |
5119 } | |
5120 goto LABEL_13; | |
5121 } | |
141 | 5122 if ( (v0 & 7) != OBJECT_Actor) |
5123 { | |
5124 if ( (v0 & 7) == OBJECT_Decoration) | |
0 | 5125 { |
5126 v13 = &pLevelDecorations[(signed int)(unsigned __int16)v0 >> 3]; | |
5127 if ( (signed int)(((unsigned int)v0 >> 16) - pDecorationList->pDecorations[v13->uDecorationDescID].uRadius) >= 512 ) | |
5128 goto LABEL_13; | |
5129 v14 = v13->field_16_event_id; | |
5130 if ( !v14 ) | |
5131 { | |
5132 if ( pLevelDecorations[(signed int)(unsigned __int16)v0 >> 3].IsInteractive() ) | |
5133 { | |
5134 v15 = stru_5E4C90._decor_events[v13->_idx_in_stru123 - 75] + 380; | |
520
35f28d4c0ff9
GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents:
515
diff
changeset
|
5135 activeLevelDecoration = &pLevelDecorations[(signed int)(unsigned __int16)v0 >> 3]; |
0 | 5136 EventProcessor(v15, 0, 1); |
520
35f28d4c0ff9
GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents:
515
diff
changeset
|
5137 activeLevelDecoration = NULL; |
0 | 5138 } |
5139 return; | |
5140 } | |
5141 v11 = v14; | |
5142 } | |
5143 else | |
5144 { | |
141 | 5145 if ( (v0 & 7) != OBJECT_BModel || (unsigned int)v0 >= 0x2000000 ) |
0 | 5146 goto LABEL_13; |
5147 v2 = (signed int)(unsigned __int16)v0 >> 3; | |
5148 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
5149 { | |
5150 v3 = &pIndoor->pFaces[v2]; | |
5151 if ( !(v3->uAttributes & 0x2000000) ) | |
5152 { | |
5153 LABEL_11: | |
5154 v4 = pParty->pPickedItem.uItemID; | |
5155 if ( pParty->pPickedItem.uItemID ) | |
5156 { | |
5157 LABEL_14: | |
5158 v5 = pItemsTable->pItems[v4].uSpriteID; | |
5159 v6 = 0; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
5160 a1.uType = v5; |
0 | 5161 if ( (signed int)pObjectList->uNumObjects <= 0 ) |
5162 { | |
5163 LABEL_18: | |
5164 LOWORD(v6) = 0; | |
5165 } | |
5166 else | |
5167 { | |
5168 v7 = (char *)&pObjectList->pObjects->uObjectID; | |
5169 while ( v5 != *(short *)v7 ) | |
5170 { | |
5171 ++v6; | |
5172 v7 += 56; | |
5173 if ( v6 >= (signed int)pObjectList->uNumObjects ) | |
5174 goto LABEL_18; | |
5175 } | |
5176 } | |
5177 a1.uObjectDescID = v6; | |
5178 a1.vPosition.y = pParty->vPosition.y; | |
303 | 5179 a1.field_58_pid = OBJECT_Player; |
0 | 5180 a1.vPosition.x = pParty->vPosition.x; |
5181 a1.vPosition.z = pParty->sEyelevel + pParty->vPosition.z; | |
5182 a1.uSoundID = 0; | |
5183 a1.uFacing = 0; | |
5184 a1.uAttributes = 8; | |
5185 a1.uSectorID = pIndoor->GetSector( | |
5186 pParty->vPosition.x, | |
5187 pParty->vPosition.y, | |
5188 pParty->sEyelevel + pParty->vPosition.z); | |
5189 a1.uSpriteFrameID = 0; | |
5190 memcpy(&a1.stru_24, &pParty->pPickedItem, 0x24u); | |
5191 v8 = (int *)pMouse->GetCursorPos(&v25); | |
5192 v9 = UnprojectX(*v8); | |
5193 a1.Create(pParty->sRotationY + v9, 184, 200, 0); | |
5194 v10 = pIcons_LOD->LoadTexture( | |
5195 pItemsTable->pItems[pParty->pPickedItem.uItemID].pIconName, | |
5196 TEXTURE_16BIT_PALETTE); | |
5197 if (v10 != -1) | |
5198 pIcons_LOD->pTextures[v10].Release(); | |
5199 pMouse->RemoveHoldingItem(); | |
5200 pIcons_LOD->_40F9C5(); | |
5201 return; | |
5202 } | |
5203 ShowNothingHereStatus(); | |
5204 LABEL_13: | |
5205 v4 = pParty->pPickedItem.uItemID; | |
5206 if ( !pParty->pPickedItem.uItemID ) | |
5207 return; | |
5208 goto LABEL_14; | |
5209 } | |
5210 v11 = pIndoor->pFaceExtras[v3->uFaceExtraID].uEventID; | |
5211 } | |
5212 else | |
5213 { | |
5214 v12 = &pOutdoor->pBModels[(signed int)(unsigned __int16)v0 >> 9].pFaces[v2 & 0x3F]; | |
5215 if ( !(v12->uAttributes & 0x2000000) ) | |
5216 goto LABEL_11; | |
5217 v11 = v12->sCogTriggeredID; | |
5218 } | |
5219 } | |
5220 EventProcessor(v11, (unsigned __int16)v0, 1); | |
5221 return; | |
5222 } | |
5223 v16 = (signed int)(unsigned __int16)v0 >> 3; | |
5224 a2.y = v16; | |
5225 v17 = &pActors[v16]; | |
5226 if ( v17->uAIState == 5 ) | |
5227 { | |
5228 if ( (unsigned int)v0 < 0x2000000 ) | |
5229 { | |
5230 stru_50C198.LootActor(&pActors[v16]); | |
5231 return; | |
5232 } | |
5233 goto LABEL_13; | |
5234 } | |
5235 if ( GetAsyncKeyState(VK_SHIFT) >= 0 ) | |
5236 { | |
5237 if ( !v17->GetActorsRelation(0) && !(BYTE2(v17->uAttributes) & 8) ) | |
5238 { | |
5239 if ( (unsigned int)v0 >= 0x2000000 ) | |
5240 goto LABEL_13; | |
5241 if ( !v17->CanAct() ) | |
5242 return; | |
5243 v18 = a2.y; | |
5244 Actor::FaceObject(a2.y, 4u, 0, 0); | |
5245 if ( !v17->uNPC_ID ) | |
5246 { | |
5247 v19 = pNPCStats->pGroups_copy[v17->uGroup]; | |
5248 if ( v19 ) | |
5249 { | |
5250 v20 = pNPCStats->pCatchPhrases[v19]; | |
5251 if ( v20 ) | |
5252 { | |
5253 pParty->uFlags |= 2u; | |
5254 strcpy(byte_5B0938, v20); | |
5255 sub_4451A8_press_any_key(0, 0, 0); | |
5256 } | |
5257 } | |
5258 return; | |
5259 } | |
437 | 5260 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) |
0 | 5261 return; |
5262 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)161; | |
5263 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v18; | |
5264 LABEL_42: | |
5265 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
5266 ++pMessageQueue_50CBD0->uNumMessages; | |
437 | 5267 return;*/ |
5268 pMessageQueue_50CBD0->AddMessage(UIMSG_StartNPCDialogue, v18, 0); | |
0 | 5269 return; |
5270 } | |
5271 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 3 ) | |
5272 { | |
5273 pTurnEngine->field_18 |= 8u; | |
5274 return; | |
5275 } | |
437 | 5276 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) |
0 | 5277 { |
5278 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)23; | |
5279 goto LABEL_41; | |
437 | 5280 }*/ |
5281 pMessageQueue_50CBD0->AddMessage(UIMSG_Attack, 0, 0); | |
0 | 5282 } |
5283 else | |
5284 { | |
5285 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 3 ) | |
5286 { | |
569 | 5287 pParty->uFlags |= PARTY_FLAGS_1_FALLING; |
0 | 5288 return; |
5289 } | |
5290 if ( uActiveCharacter | |
437 | 5291 && sub_427769_spell(pPlayers[uActiveCharacter]->uQuickSpell)) |
0 | 5292 { |
437 | 5293 pMessageQueue_50CBD0->AddMessage(UIMSG_19, 0, 0); |
5294 /*&& (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
0 | 5295 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)25; |
5296 LABEL_41: | |
5297 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
437 | 5298 goto LABEL_42;*/ |
0 | 5299 } |
5300 } | |
5301 } | |
5302 | |
5303 //----- (004226C2) -------------------------------------------------------- | |
265 | 5304 bool PauseGameDrawing() |
0 | 5305 { |
265 | 5306 if ( pCurrentScreen != SCREEN_GAME |
151 | 5307 && pCurrentScreen != SCREEN_NPC_DIALOGUE |
5308 && pCurrentScreen != SCREEN_CHANGE_LOCATION ) | |
5309 { | |
5310 if ( pCurrentScreen == SCREEN_INPUT_BLV ) | |
0 | 5311 return pVideoPlayer->pSmackerMovie != 0; |
151 | 5312 if ( pCurrentScreen != SCREEN_BRANCHLESS_NPC_DIALOG ) |
265 | 5313 return true; |
5314 } | |
5315 return false; | |
0 | 5316 } |
5317 // 4E28F8: using guessed type int pCurrentScreen; | |
5318 | |
5319 //----- (004226EF) -------------------------------------------------------- | |
373 | 5320 void SetUserInterface(PartyAlignment align, bool bReplace) |
0 | 5321 { |
5322 unsigned int v3; // eax@7 | |
5323 unsigned __int16 v4; // dx@7 | |
5324 unsigned __int16 v5; // cx@7 | |
5325 unsigned __int16 v6; // [sp-4h] [bp-14h]@7 | |
5326 | |
373 | 5327 |
5328 if (align == PartyAlignment_Evil) | |
5329 { | |
0 | 5330 if ( bReplace ) |
5331 { | |
5332 pTexture_RightFrame->Reload("ib-r-C.pcx"); | |
5333 pTexture_BottomFrame->Reload("ib-b-C.pcx"); | |
5334 pTexture_TopFrame->Reload("ib-t-C.pcx"); | |
5335 pTexture_LeftFrame->Reload("ib-l-C.pcx"); | |
5336 pTexture_StatusBar->Reload("IB-Foot-c.pcx"); | |
5337 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_right_panel], "ib-mb-C", 2); | |
5338 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D8], "ib-autmask-c", 2); | |
5339 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079B4], "IB-COMP-C", 2); | |
5340 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D0], "IB-InitG-c", 2); | |
5341 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079C8], "IB-InitY-c", 2); | |
5342 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079CC], "IB-InitR-c", 2); | |
319 | 5343 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-C", 2); |
5344 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-C", 2); | |
5345 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-C", 2); | |
5346 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-C", 2); | |
0 | 5347 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50C98C], "IB-selec-C", 2); |
319 | 5348 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-c", 2); |
5349 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-c", 2); | |
5350 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-c", 2); | |
5351 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-c", 2); | |
569 | 5352 |
5353 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-c", 2); | |
5354 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-c", 2); | |
5355 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-c", 2); | |
5356 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-c", 2); | |
5357 | |
0 | 5358 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeC"); |
569 | 5359 pIconsFrameTable->InitializeAnimation(pUIAnim_WizardEye->uIconID); |
0 | 5360 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchC"); |
569 | 5361 pIconsFrameTable->InitializeAnimation(pUIAnum_Torchlight->uIconID); |
5362 | |
526 | 5363 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-c", 2); |
0 | 5364 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc-c", 2); |
5365 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507958], "fr_inven-c", 2); | |
5366 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Parchment], "parchment", 2); | |
5367 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B4], "cornr_ll-c", 2); | |
5368 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B0], "cornr_lr-c", 2); | |
5369 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076AC], "cornr_ul-c", 2); | |
5370 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A8], "cornr_ur-c", 2); | |
5371 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A4], "edge_btm-c", 2); | |
5372 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A0], "edge_lf-c", 2); | |
5373 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50769C], "edge_rt-c", 2); | |
5374 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507698], "edge_top-c", 2); | |
5375 pIcons_LOD->ReloadTexture(pTexture_591428, "endcap-c", 2); | |
5376 } | |
5377 else | |
5378 { | |
5379 pTexture_RightFrame->Load("ib-r-C.pcx", 0); | |
5380 pTexture_BottomFrame->Load("ib-b-c.pcx", 0); | |
5381 pTexture_TopFrame->Load("ib-t-C.pcx", 0); | |
5382 pTexture_LeftFrame->Load("ib-l-C.pcx", 0); | |
5383 pTexture_StatusBar->Load("IB-Foot-c.pcx", 0); | |
5384 uTextureID_right_panel = pIcons_LOD->LoadTexture("ib-mb-C", TEXTURE_16BIT_PALETTE); | |
5385 dword_5079D8 = pIcons_LOD->LoadTexture("ib-autmask-c", TEXTURE_16BIT_PALETTE); | |
5386 dword_5079B4 = pIcons_LOD->LoadTexture("IB-COMP-C", TEXTURE_16BIT_PALETTE); | |
5387 dword_5079D0 = pIcons_LOD->LoadTexture("IB-InitG-c", TEXTURE_16BIT_PALETTE); | |
5388 dword_5079C8 = pIcons_LOD->LoadTexture("IB-InitY-c", TEXTURE_16BIT_PALETTE); | |
5389 dword_5079CC = pIcons_LOD->LoadTexture("IB-InitR-c", TEXTURE_16BIT_PALETTE); | |
319 | 5390 uTextureID_Btn_NPCLeft = pIcons_LOD->LoadTexture("IB-NPCLD-C", TEXTURE_16BIT_PALETTE); |
5391 uTextureID_Btn_NPCRight = pIcons_LOD->LoadTexture("IB-NPCRD-C", TEXTURE_16BIT_PALETTE); | |
328 | 5392 uTextureID_Btn_ZoomIn = pIcons_LOD->LoadTexture("ib-autout-C", TEXTURE_16BIT_PALETTE); |
319 | 5393 uTextureID_Btn_ZoomOut = pIcons_LOD->LoadTexture("ib-autin-C", TEXTURE_16BIT_PALETTE); |
0 | 5394 dword_50C98C = pIcons_LOD->LoadTexture("IB-selec-C", TEXTURE_16BIT_PALETTE); |
319 | 5395 uTextureID_Btn_CastSpell = pIcons_LOD->LoadTexture("ib-m1d-c", TEXTURE_16BIT_PALETTE); |
5396 uTextureID_Btn_Rest = pIcons_LOD->LoadTexture("ib-m2d-c", TEXTURE_16BIT_PALETTE); | |
5397 uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-c", TEXTURE_16BIT_PALETTE); | |
5398 uTextureID_Btn_GameSettings = pIcons_LOD->LoadTexture("ib-m4d-c", TEXTURE_16BIT_PALETTE); | |
526 | 5399 uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-c", TEXTURE_16BIT_PALETTE); |
569 | 5400 uTextureID_PlayerBuff_Bless = pIcons_LOD->LoadTexture("isg-01-c", TEXTURE_16BIT_PALETTE); |
5401 uTextureID_PlayerBuff_Preservation = pIcons_LOD->LoadTexture("isg-02-c", TEXTURE_16BIT_PALETTE); | |
5402 uTextureID_PlayerBuff_Hammerhands = pIcons_LOD->LoadTexture("isg-03-c", TEXTURE_16BIT_PALETTE); | |
5403 uTextureID_PlayerBuff_PainReflection = pIcons_LOD->LoadTexture("isg-04-c", TEXTURE_16BIT_PALETTE); | |
0 | 5404 uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc-c", TEXTURE_16BIT_PALETTE); |
5405 uTextureID_507958 = pIcons_LOD->LoadTexture("fr_inven", TEXTURE_16BIT_PALETTE); | |
5406 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeC"); | |
5407 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
5408 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchC"); | |
5409 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
5410 } | |
5411 v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xC8u, 0, 0); | |
5412 v4 = 0; | |
5413 v6 = 0; | |
5414 v5 = 10; | |
5415 } | |
373 | 5416 else if (align == PartyAlignment_Neutral) |
0 | 5417 { |
5418 if ( bReplace ) | |
5419 { | |
5420 pTexture_RightFrame->Reload("ib-r-a.pcx"); | |
5421 pTexture_BottomFrame->Reload("ib-b-a.pcx"); | |
5422 pTexture_TopFrame->Reload("ib-t-a.pcx"); | |
5423 pTexture_LeftFrame->Reload("ib-l-a.pcx"); | |
5424 pTexture_StatusBar->Reload("IB-Foot-a.pcx"); | |
5425 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_right_panel], "ib-mb-a", 2); | |
5426 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D8], "ib-autmask-a", 2); | |
5427 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079B4], "IB-COMP-a", 2); | |
5428 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D0], "IB-InitG-a", 2); | |
5429 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079C8], "IB-InitY-a", 2); | |
5430 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079CC], "IB-InitR-a", 2); | |
319 | 5431 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-a", 2); |
5432 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-a", 2); | |
5433 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-a", 2); | |
5434 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-a", 2); | |
0 | 5435 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50C98C], "IB-selec-a", 2); |
319 | 5436 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-a", 2); |
5437 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-a", 2); | |
5438 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-a", 2); | |
5439 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-a", 2); | |
569 | 5440 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-a", 2); |
5441 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-a", 2); | |
5442 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-a", 2); | |
5443 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-a", 2); | |
0 | 5444 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeA"); |
5445 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
5446 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchA"); | |
5447 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
526 | 5448 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-a", 2); |
0 | 5449 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc", 2); |
5450 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507958], "fr_inven", 2); | |
5451 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Parchment], "parchment", 2); | |
5452 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B4], "cornr_ll", 2); | |
5453 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B0], "cornr_lr", 2); | |
5454 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076AC], "cornr_ul", 2); | |
5455 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A8], "cornr_ur", 2); | |
5456 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A4], "edge_btm", 2); | |
5457 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A0], "edge_lf", 2); | |
5458 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50769C], "edge_rt", 2); | |
5459 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507698], "edge_top", 2); | |
5460 pIcons_LOD->ReloadTexture(pTexture_591428, "endcap", 2); | |
5461 } | |
5462 else | |
5463 { | |
5464 pTexture_RightFrame->Load("ib-r-A.pcx", 0); | |
5465 pTexture_BottomFrame->Load("ib-b-A.pcx", 0); | |
5466 pTexture_TopFrame->Load("ib-t-A.pcx", 0); | |
5467 pTexture_LeftFrame->Load("ib-l-A.pcx", 0); | |
5468 pTexture_StatusBar->Load("IB-Foot-a.pcx", 0); | |
5469 uTextureID_right_panel = pIcons_LOD->LoadTexture("ib-mb-A", TEXTURE_16BIT_PALETTE); | |
5470 dword_5079D8 = pIcons_LOD->LoadTexture("ib-autmask-a", TEXTURE_16BIT_PALETTE); | |
5471 dword_5079B4 = pIcons_LOD->LoadTexture("IB-COMP-A", TEXTURE_16BIT_PALETTE); | |
5472 dword_5079D0 = pIcons_LOD->LoadTexture("IB-InitG-a", TEXTURE_16BIT_PALETTE); | |
5473 dword_5079C8 = pIcons_LOD->LoadTexture("IB-InitY-a", TEXTURE_16BIT_PALETTE); | |
5474 dword_5079CC = pIcons_LOD->LoadTexture("IB-InitR-a", TEXTURE_16BIT_PALETTE); | |
319 | 5475 uTextureID_Btn_NPCLeft = pIcons_LOD->LoadTexture("IB-NPCLD-A", TEXTURE_16BIT_PALETTE); |
5476 uTextureID_Btn_NPCRight = pIcons_LOD->LoadTexture("IB-NPCRD-A", TEXTURE_16BIT_PALETTE); | |
0 | 5477 dword_50C98C = pIcons_LOD->LoadTexture("IB-selec-A", TEXTURE_16BIT_PALETTE); |
319 | 5478 uTextureID_Btn_CastSpell = pIcons_LOD->LoadTexture("ib-m1d-a", TEXTURE_16BIT_PALETTE); |
5479 uTextureID_Btn_Rest = pIcons_LOD->LoadTexture("ib-m2d-a", TEXTURE_16BIT_PALETTE); | |
5480 uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-a", TEXTURE_16BIT_PALETTE); | |
5481 uTextureID_Btn_GameSettings = pIcons_LOD->LoadTexture("ib-m4d-a", TEXTURE_16BIT_PALETTE); | |
328 | 5482 uTextureID_Btn_ZoomIn = pIcons_LOD->LoadTexture("ib-autout-a", TEXTURE_16BIT_PALETTE); |
319 | 5483 uTextureID_Btn_ZoomOut = pIcons_LOD->LoadTexture("ib-autin-a", TEXTURE_16BIT_PALETTE); |
526 | 5484 uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-a", TEXTURE_16BIT_PALETTE); |
569 | 5485 uTextureID_PlayerBuff_Bless = pIcons_LOD->LoadTexture("isg-01-a", TEXTURE_16BIT_PALETTE); |
5486 uTextureID_PlayerBuff_Preservation = pIcons_LOD->LoadTexture("isg-02-a", TEXTURE_16BIT_PALETTE); | |
5487 uTextureID_PlayerBuff_Hammerhands = pIcons_LOD->LoadTexture("isg-03-a", TEXTURE_16BIT_PALETTE); | |
5488 uTextureID_PlayerBuff_PainReflection = pIcons_LOD->LoadTexture("isg-04-a", TEXTURE_16BIT_PALETTE); | |
0 | 5489 uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc", TEXTURE_16BIT_PALETTE); |
5490 uTextureID_507958 = pIcons_LOD->LoadTexture("fr_inven", TEXTURE_16BIT_PALETTE); | |
5491 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeA"); | |
5492 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
5493 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchA"); | |
5494 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
5495 uTextureID_Parchment = pIcons_LOD->LoadTexture("parchment", TEXTURE_16BIT_PALETTE); | |
5496 uTextureID_5076B4 = pIcons_LOD->LoadTexture("cornr_ll", TEXTURE_16BIT_PALETTE); | |
5497 uTextureID_5076B0 = pIcons_LOD->LoadTexture("cornr_lr", TEXTURE_16BIT_PALETTE); | |
5498 uTextureID_5076AC = pIcons_LOD->LoadTexture("cornr_ul", TEXTURE_16BIT_PALETTE); | |
5499 uTextureID_5076A8 = pIcons_LOD->LoadTexture("cornr_ur", TEXTURE_16BIT_PALETTE); | |
5500 uTextureID_5076A4 = pIcons_LOD->LoadTexture("edge_btm", TEXTURE_16BIT_PALETTE); | |
5501 uTextureID_5076A0 = pIcons_LOD->LoadTexture("edge_lf", TEXTURE_16BIT_PALETTE); | |
5502 uTextureID_50769C = pIcons_LOD->LoadTexture("edge_rt", TEXTURE_16BIT_PALETTE); | |
5503 uTextureID_507698 = pIcons_LOD->LoadTexture("edge_top", TEXTURE_16BIT_PALETTE); | |
5504 pTexture_591428 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("endcap", TEXTURE_16BIT_PALETTE)]; | |
5505 | |
5506 } | |
5507 v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xAu, 0, 0); | |
5508 v4 = 214; | |
5509 v5 = 230; | |
5510 v6 = 193; | |
5511 } | |
373 | 5512 else if (align == PartyAlignment_Good) |
0 | 5513 { |
5514 if ( bReplace ) | |
5515 { | |
5516 pTexture_RightFrame->Reload("ib-r-B.pcx"); | |
5517 pTexture_BottomFrame->Reload("ib-b-B.pcx"); | |
5518 pTexture_TopFrame->Reload("ib-t-B.pcx"); | |
5519 pTexture_LeftFrame->Reload("ib-l-B.pcx"); | |
5520 pTexture_StatusBar->Reload("IB-Foot-b.pcx"); | |
5521 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_right_panel], "ib-mb-B", 2); | |
5522 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D8], "ib-autmask-b", 2); | |
5523 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079B4], "IB-COMP-B", 2); | |
5524 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D0], "IB-InitG-b", 2); | |
5525 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079C8], "IB-InitY-b", 2); | |
5526 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079CC], "IB-InitR-b", 2); | |
319 | 5527 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-B", 2); |
5528 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-B", 2); | |
5529 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-B", 2); | |
5530 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-B", 2); | |
0 | 5531 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50C98C], "IB-selec-B", 2); |
319 | 5532 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-b", 2); |
5533 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-b", 2); | |
5534 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-b", 2); | |
5535 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-b", 2); | |
569 | 5536 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-b", 2); |
5537 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-b", 2); | |
5538 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-b", 2); | |
5539 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-b", 2); | |
0 | 5540 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeB"); |
5541 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
5542 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchB"); | |
5543 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
526 | 5544 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-b", 2); |
0 | 5545 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc-b", 2); |
5546 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507958], "fr_inven-b", 2); | |
5547 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Parchment], "parchment", 2); | |
5548 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B4], "cornr_ll-b", 2); | |
5549 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B0], "cornr_lr-b", 2); | |
5550 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076AC], "cornr_ul-b", 2); | |
5551 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A8], "cornr_ur-b", 2); | |
5552 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A4], "edge_btm-b", 2); | |
5553 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A0], "edge_lf-b", 2); | |
5554 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50769C], "edge_rt-b", 2); | |
5555 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507698], "edge_top-b", 2); | |
5556 pIcons_LOD->ReloadTexture(pTexture_591428, "endcap-b", 2); | |
5557 } | |
5558 v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0xC8u); | |
5559 v5 = 255; | |
5560 v4 = 225; | |
5561 v6 = 255; | |
5562 } | |
373 | 5563 else assert(false); |
5564 | |
0 | 5565 uGameUIFontMain = v3; |
5566 uGameUIFontShadow = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v5, v4, v6); | |
5567 } | |
5568 | |
5569 | |
5570 | |
5571 //----- (00423AEE) -------------------------------------------------------- | |
5572 void __cdecl reset_some_strus_flt_2Cs() | |
5573 { | |
5574 float *v0; // eax@1 | |
5575 signed int v1; // ecx@1 | |
5576 signed int v2; // edx@1 | |
5577 float *v3; // eax@3 | |
5578 signed int v4; // edx@3 | |
5579 float *v5; // eax@5 | |
5580 signed int v6; // edx@5 | |
5581 float *v7; // eax@7 | |
5582 signed int v8; // edx@7 | |
5583 float *v9; // eax@9 | |
5584 | |
5585 v0 = &array_50AC10[0].flt_2C; | |
5586 v1 = 50; | |
5587 v2 = 50; | |
5588 do | |
5589 { | |
5590 *v0 = 0.0; | |
5591 v0 += 12; | |
5592 --v2; | |
5593 } | |
5594 while ( v2 ); | |
5595 v3 = &array_50A2B0[0].flt_2C; | |
5596 v4 = 50; | |
5597 do | |
5598 { | |
5599 *v3 = 0.0; | |
5600 v3 += 12; | |
5601 --v4; | |
5602 } | |
5603 while ( v4 ); | |
5604 v5 = &array_509950[0].flt_2C; | |
5605 v6 = 50; | |
5606 do | |
5607 { | |
5608 *v5 = 0.0; | |
5609 v5 += 12; | |
5610 --v6; | |
5611 } | |
5612 while ( v6 ); | |
5613 v7 = &array_508FF0[0].flt_2C; | |
5614 v8 = 50; | |
5615 do | |
5616 { | |
5617 *v7 = 0.0; | |
5618 v7 += 12; | |
5619 --v8; | |
5620 } | |
5621 while ( v8 ); | |
5622 v9 = &array_508690[0].flt_2C; | |
5623 do | |
5624 { | |
5625 *v9 = 0.0; | |
5626 v9 += 12; | |
5627 --v1; | |
5628 } | |
5629 while ( v1 ); | |
5630 } | |
5631 | |
5632 //----- (00423B4A) -------------------------------------------------------- | |
5633 void __cdecl sub_423B4A() | |
5634 { | |
5635 float *v0; // eax@1 | |
5636 signed int v1; // ecx@1 | |
5637 | |
5638 v0 = &array_507D30[0].flt_2C; | |
5639 v1 = 50; | |
5640 do | |
5641 { | |
5642 *v0 = 0.0; | |
5643 v0 += 12; | |
5644 --v1; | |
5645 } | |
5646 while ( v1 ); | |
5647 } | |
5648 | |
5649 //----- (00423B5D) -------------------------------------------------------- | |
5650 int __fastcall sub_423B5D(unsigned int uFaceID) | |
5651 { | |
5652 BLVFace *v1; // ebx@1 | |
5653 Vec3_short_ *v2; // esi@1 | |
5654 //int v3; // ST28_4@1 | |
5655 __int16 v4; // ST2C_2@1 | |
5656 //signed int v5; // esi@1 | |
5657 //Vec3_short_ *v6; // eax@4 | |
5658 //signed int v7; // edi@5 | |
5659 //signed int v8; // eax@5 | |
5660 //signed int i_; // ecx@10 | |
5661 int v10; // eax@10 | |
5662 int v11; // edx@11 | |
5663 int v12; // ST28_4@12 | |
5664 signed int v13; // edx@12 | |
5665 signed __int64 v14; // qtt@12 | |
5666 int *v15; // ebx@12 | |
5667 int v16; // ST28_4@14 | |
5668 signed int v17; // eax@14 | |
5669 signed __int64 v18; // qtt@14 | |
5670 signed int v19; // edx@15 | |
5671 signed int v20; // edx@17 | |
5672 signed int v21; // ebx@19 | |
5673 signed int v22; // esi@20 | |
5674 int v23; // edi@21 | |
5675 int v24; // eax@21 | |
5676 int v25; // eax@22 | |
5677 int v26; // eax@22 | |
5678 signed int v27; // ST30_4@24 | |
5679 signed __int64 v28; // qtt@24 | |
5680 int v29; // ST18_4@25 | |
5681 int v30; // eax@26 | |
5682 int v31; // eax@27 | |
5683 int v32; // eax@27 | |
5684 signed int v33; // ST30_4@29 | |
5685 signed __int64 v34; // qtt@29 | |
5686 int v35; // ST30_4@30 | |
5687 signed int v36; // edi@31 | |
5688 unsigned int v37; // eax@31 | |
5689 bool v38; // edx@31 | |
5690 int v39; // ecx@31 | |
5691 int v40; // ecx@32 | |
5692 int v41; // esi@32 | |
5693 int v42; // eax@34 | |
5694 signed int v43; // ebx@41 | |
5695 unsigned int v44; // eax@41 | |
5696 signed int v45; // ecx@42 | |
5697 int v46; // esi@42 | |
5698 int v47; // eax@44 | |
5699 signed int v48; // edi@51 | |
5700 unsigned int v49; // eax@51 | |
5701 bool v50; // edx@51 | |
5702 int v51; // ecx@51 | |
5703 int v52; // ecx@52 | |
5704 signed int v53; // esi@52 | |
5705 int v54; // eax@54 | |
5706 int v55; // ebx@61 | |
5707 unsigned int v56; // eax@61 | |
5708 signed int v57; // ecx@62 | |
5709 int v58; // esi@62 | |
5710 int v59; // eax@64 | |
5711 char v61; // zf@72 | |
5712 signed int v62; // edx@75 | |
5713 int v63; // ecx@76 | |
5714 int v64; // esi@76 | |
5715 int v65; // ecx@83 | |
5716 //signed int v66; // [sp+14h] [bp-14h]@3 | |
5717 int v67; // [sp+14h] [bp-14h]@34 | |
5718 int v68; // [sp+14h] [bp-14h]@44 | |
5719 int v69; // [sp+14h] [bp-14h]@54 | |
5720 int v70; // [sp+14h] [bp-14h]@64 | |
5721 signed int v71; // [sp+14h] [bp-14h]@75 | |
5722 bool thisa; // [sp+18h] [bp-10h]@9 | |
5723 int thisb; // [sp+18h] [bp-10h]@12 | |
5724 int thisc; // [sp+18h] [bp-10h]@20 | |
5725 bool thisd; // [sp+18h] [bp-10h]@41 | |
5726 bool thise; // [sp+18h] [bp-10h]@61 | |
5727 int thisf; // [sp+18h] [bp-10h]@74 | |
5728 signed int v79; // [sp+1Ch] [bp-Ch]@9 | |
5729 int v80; // [sp+1Ch] [bp-Ch]@76 | |
5730 bool v81; // [sp+20h] [bp-8h]@10 | |
5731 bool v82; // [sp+20h] [bp-8h]@32 | |
5732 bool v83; // [sp+20h] [bp-8h]@42 | |
5733 bool v84; // [sp+20h] [bp-8h]@52 | |
5734 bool v85; // [sp+20h] [bp-8h]@62 | |
5735 //signed int i; // [sp+24h] [bp-4h]@9 | |
5736 signed int ia; // [sp+24h] [bp-4h]@19 | |
5737 signed int ib; // [sp+24h] [bp-4h]@31 | |
5738 signed int ic; // [sp+24h] [bp-4h]@41 | |
5739 signed int id; // [sp+24h] [bp-4h]@51 | |
5740 signed int ie; // [sp+24h] [bp-4h]@61 | |
5741 | |
5742 v1 = &pIndoor->pFaces[uFaceID]; | |
5743 //this = pGame->pIndoorCameraD3D; | |
5744 v2 = &pIndoor->pVertices[v1->pVertexIDs[0]]; | |
5745 //v3 = *(_DWORD *)&v2->x; | |
5746 v4 = v2->z; | |
5747 //v5 = 0; | |
5748 if ( v1->pFacePlane_old.vNormal.x * (v2->x - pBLVRenderParams->vPartyPos.x) | |
5749 + v1->pFacePlane_old.vNormal.y * (v2->y - pBLVRenderParams->vPartyPos.y) | |
5750 + v1->pFacePlane_old.vNormal.z * (v2->z - pBLVRenderParams->vPartyPos.z) < 0 ) | |
5751 { | |
5752 dword_50B700 = 1; | |
5753 } | |
5754 else | |
5755 { | |
5756 dword_50B700 = 0; | |
315 | 5757 if ( !v1->TwoSided() ) |
0 | 5758 return 0; |
5759 } | |
5760 //v66 = v1->uNumVertices; | |
5761 for (uint i = 0; i < v1->uNumVertices; ++i) | |
5762 { | |
5763 auto v6 = &pIndoor->pVertices[v1->pVertexIDs[i]]; | |
5764 pGame->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible( | |
5765 v6->x, | |
5766 v6->y, | |
5767 v6->z, | |
5768 &_50B924_view_transformed_xs[i], | |
5769 &_50B834_view_transformed_zs[i], | |
5770 &_50B744_view_transformed_ys[i], | |
5771 0); | |
5772 } | |
5773 | |
5774 //v7 = v1->uNumVertices; | |
5775 //v8 = 0; | |
5776 if (v1->uNumVertices <= 0) | |
5777 return 0; | |
5778 | |
5779 bool bFound = false; | |
5780 for (uint i = 0; i < v1->uNumVertices; ++i) | |
5781 if (_50B924_view_transformed_xs[i] >= 0x80000u) | |
5782 { | |
5783 bFound = true; | |
5784 break; | |
5785 } | |
5786 if (!bFound) | |
5787 return 0; | |
5788 | |
5789 v79 = 0; | |
5790 _50B924_view_transformed_xs[v1->uNumVertices] = _50B924_view_transformed_xs[0]; | |
5791 _50B834_view_transformed_zs[v1->uNumVertices] = _50B834_view_transformed_zs[0]; | |
5792 _50B744_view_transformed_ys[v1->uNumVertices] = _50B744_view_transformed_ys[0]; | |
564 | 5793 thisa = _50B924_view_transformed_xs[0] >= (signed int)0x80000u; |
0 | 5794 //int i = 1; |
561 | 5795 for (uint i = 1; i <= v1->uNumVertices; ++i) |
0 | 5796 { |
5797 v10 = _50B924_view_transformed_xs[i]; | |
5798 v81 = v10 >= (signed int)0x80000u; | |
5799 if ( thisa ^ v81 ) | |
5800 { | |
5801 v11 = _50B924_view_transformed_xs[i - 1]; | |
5802 if ( v10 >= (signed int)0x80000u ) | |
5803 { | |
5804 v12 = v10 - v11; | |
5805 v13 = 0x80000 - v11; | |
5806 LODWORD(v14) = v13 << 16; | |
5807 HIDWORD(v14) = v13 >> 16; | |
5808 v15 = &_50B744_view_transformed_ys[i - 1]; | |
486 | 5809 dword_50B828[v79] = ((unsigned __int64)((_50B834_view_transformed_zs[i] - _50B834_view_transformed_zs[i - 1]) * v14 / v12) >> 16) + _50B834_view_transformed_zs[i - 1]; |
0 | 5810 thisb = (unsigned __int64)((_50B744_view_transformed_ys[i] - _50B744_view_transformed_ys[i - 1]) * v14 / v12) >> 16; |
5811 } | |
5812 else | |
5813 { | |
5814 v16 = v11 - v10; | |
5815 v17 = 0x80000 - v10; | |
5816 LODWORD(v18) = v17 << 16; | |
5817 HIDWORD(v18) = v17 >> 16; | |
5818 v15 = &_50B744_view_transformed_ys[i]; | |
108 | 5819 dword_50B828[v79] = ((unsigned __int64)((_50B834_view_transformed_zs[i - 1] - _50B834_view_transformed_zs[i]) * v18 / v16) >> 16) + _50B834_view_transformed_zs[i]; |
0 | 5820 thisb = (unsigned __int64)((_50B744_view_transformed_ys[i - 1] - _50B744_view_transformed_ys[i]) * v18 / v16) >> 16; |
5821 } | |
5822 v19 = v79++; | |
5823 //v7 = v66; | |
5824 dword_50B738[v19] = thisb + *v15; | |
5825 dword_50B918[v19] = 0x80000u; | |
5826 } | |
5827 if ( v81 ) | |
5828 { | |
5829 v20 = v79++; | |
5830 dword_50B918[v20] = _50B924_view_transformed_xs[i]; | |
5831 dword_50B828[v20] = _50B834_view_transformed_zs[i]; | |
5832 dword_50B738[v20] = _50B744_view_transformed_ys[i]; | |
5833 } | |
5834 //++i; | |
5835 thisa = v81; | |
5836 } | |
5837 v21 = v79; | |
5838 dword_50B918[v79] = dword_50B918[0]; | |
5839 dword_50B828[v79] = dword_50B828[0]; | |
561 | 5840 dword_50B738[v79] = dword_50B738[0]; |
5841 for (ia = 0; ia < v79; ++ia) | |
0 | 5842 { |
5843 v22 = ia; | |
5844 thisc = abs(dword_50B918[ia]); | |
5845 if ( abs(dword_50B828[ia]) >> 13 <= thisc ) | |
5846 { | |
5847 v27 = dword_50B828[v22]; | |
5848 LODWORD(v28) = v27 << 16; | |
5849 HIDWORD(v28) = v27 >> 16; | |
5850 v26 = v28 / dword_50B918[v22]; | |
5851 v23 = 0; | |
5852 } | |
5853 else | |
5854 { | |
5855 v23 = 0; | |
5856 v24 = 0; | |
5857 if ( dword_50B828[v22] >= 0 ) | |
5858 { | |
5859 LOBYTE(v24) = dword_50B918[v22] >= 0; | |
5860 v26 = ((v24 - 1) & 0xFF800000) + 0x400000; | |
5861 } | |
5862 else | |
5863 { | |
5864 LOBYTE(v24) = dword_50B918[v22] >= 0; | |
5865 v25 = v24 - 1; | |
5866 v26 = (v25 & 0x800000) - 0x400000; | |
5867 } | |
5868 } | |
5869 v29 = dword_50B738[v22]; | |
561 | 5870 dword_50BAF8_xs[v22] = v26; |
0 | 5871 if ( abs(v29) >> 13 <= thisc ) |
5872 { | |
5873 v33 = dword_50B738[v22]; | |
5874 LODWORD(v34) = v33 << 16; | |
5875 HIDWORD(v34) = v33 >> 16; | |
5876 v32 = v34 / dword_50B918[v22]; | |
5877 } | |
5878 else | |
5879 { | |
5880 v30 = 0; | |
5881 if ( dword_50B738[v22] >= v23 ) | |
5882 { | |
5883 LOBYTE(v30) = dword_50B918[v22] >= v23; | |
5884 v32 = ((v30 - 1) & 0xFF800000) + 0x400000; | |
5885 } | |
5886 else | |
5887 { | |
5888 LOBYTE(v30) = dword_50B918[v22] >= v23; | |
5889 v31 = v30 - 1; | |
5890 v32 = (v31 & 0x800000) - 0x400000; | |
5891 } | |
5892 } | |
561 | 5893 dword_50BA08_ys[v22] = v32; |
5894 dword_50BAF8_xs[v22] = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) * (signed __int64)dword_50BAF8_xs[v22]) >> 16; | |
5895 v35 = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) * (signed __int64)dword_50BA08_ys[v22]) >> 16; | |
5896 dword_50BAF8_xs[v22] = pBLVRenderParams->uViewportCenterX - dword_50BAF8_xs[v22]; | |
5897 dword_50BA08_ys[v22] = pBLVRenderParams->uViewportCenterY - v35; | |
0 | 5898 } |
5899 v36 = 0; | |
561 | 5900 dword_50BAF8_xs[v21] = dword_50BAF8_xs[0]; |
5901 dword_50BA08_ys[v21] = dword_50BA08_ys[0]; | |
0 | 5902 v37 = pBLVRenderParams->uViewportX; |
561 | 5903 v38 = dword_50BAF8_xs[0] < (signed int)pBLVRenderParams->uViewportX; |
5904 LOBYTE(v38) = dword_50BAF8_xs[0] >= (signed int)pBLVRenderParams->uViewportX; | |
0 | 5905 v39 = 1; |
5906 ib = 1; | |
5907 if ( v79 < 1 ) | |
5908 return 0; | |
5909 do | |
5910 { | |
5911 v40 = v39; | |
561 | 5912 v41 = dword_50BAF8_xs[v40]; |
0 | 5913 v82 = v41 >= (signed int)v37; |
5914 if ( v38 ^ v82 ) | |
5915 { | |
5916 if ( v41 >= (signed int)v37 ) | |
5917 { | |
561 | 5918 v67 = (signed int)(v37 - dword_50BAF8_xs[v40 - 1]) * (signed __int64)(dword_50BA08_ys[v40] - dword_50BA08_ys[v40 - 1]) / (v41 - dword_50BAF8_xs[v40 - 1]); |
5919 v42 = dword_50BA08_ys[v40 - 1]; | |
0 | 5920 } |
5921 else | |
5922 { | |
561 | 5923 v67 = (signed int)(v37 - v41) * (signed __int64)(dword_50BA08_ys[v40 - 1] - dword_50BA08_ys[v40]) / (dword_50BAF8_xs[v40 - 1] - v41); |
5924 v42 = dword_50BA08_ys[v40]; | |
0 | 5925 } |
561 | 5926 dword_50B9FC_ys[v36] = v67 + v42; |
5927 v37 = pBLVRenderParams->uViewportX; | |
5928 dword_50BAEC_xs[v36] = pBLVRenderParams->uViewportX; | |
0 | 5929 ++v36; |
5930 } | |
5931 v38 = v82; | |
5932 if ( v82 ) | |
5933 { | |
561 | 5934 dword_50BAEC_xs[v36] = dword_50BAF8_xs[v40]; |
5935 dword_50B9FC_ys[v36] = dword_50BA08_ys[v40]; | |
5936 ++v36; | |
0 | 5937 } |
5938 v39 = ib++ + 1; | |
5939 } | |
5940 while ( ib <= v79 ); | |
5941 | |
486 | 5942 if (v36 < 1) |
0 | 5943 return 0; |
5944 | |
486 | 5945 v43 = 0; |
561 | 5946 dword_50BAEC_xs[v36] = dword_50BAEC_xs[0]; |
5947 dword_50B9FC_ys[v36] = dword_50B9FC_ys[0]; | |
486 | 5948 v44 = pBLVRenderParams->uViewportZ; |
561 | 5949 thisd = dword_50BAEC_xs[0] <= (signed int)pBLVRenderParams->uViewportZ; |
486 | 5950 ic = 1; |
5951 | |
0 | 5952 do |
5953 { | |
5954 v45 = ic; | |
561 | 5955 v46 = dword_50BAEC_xs[ic]; |
0 | 5956 v83 = v46 <= (signed int)v44; |
5957 if ( thisd ^ v83 ) | |
5958 { | |
5959 if ( v46 <= (signed int)v44 ) | |
5960 { | |
561 | 5961 v68 = (signed int)(v44 - dword_50BAEC_xs[v45 - 1]) * (signed __int64)(dword_50B9FC_ys[v45] - dword_50B9FC_ys[v45 - 1]) / (v46 - dword_50BAEC_xs[v45 - 1]); |
5962 v47 = dword_50B9FC_ys[v45 - 1]; | |
0 | 5963 } |
5964 else | |
5965 { | |
561 | 5966 v68 = (signed int)(v44 - v46) * (signed __int64)(dword_50B9FC_ys[v45 - 1] - dword_50B9FC_ys[v45]) / (dword_50BAEC_xs[v45 - 1] - v46); |
5967 v47 = dword_50B9FC_ys[v45]; | |
0 | 5968 } |
561 | 5969 dword_50B9F0[v43] = v68 + v47; |
5970 v44 = pBLVRenderParams->uViewportZ; | |
5971 dword_50BAE0[v43] = pBLVRenderParams->uViewportZ; | |
0 | 5972 ++v43; |
5973 } | |
5974 if ( v83 ) | |
5975 { | |
561 | 5976 dword_50BAE0[v43] = dword_50BAEC_xs[v45]; |
5977 dword_50B9F0[v43++] = dword_50B9FC_ys[v45]; | |
0 | 5978 } |
5979 ++ic; | |
5980 thisd = v83; | |
5981 } | |
5982 while ( ic <= v36 ); | |
486 | 5983 |
5984 if (v43 < 1) | |
0 | 5985 return 0; |
486 | 5986 |
5987 v48 = 0; | |
5988 dword_50BAE0[v43] = dword_50BAE0[0]; | |
5989 dword_50B9F0[v43] = dword_50B9F0[0]; | |
5990 v49 = pBLVRenderParams->uViewportY; | |
5991 v50 = dword_50B9F0[0] < (signed int)pBLVRenderParams->uViewportY; | |
5992 LOBYTE(v50) = dword_50B9F0[0] >= (signed int)pBLVRenderParams->uViewportY; | |
5993 v51 = 1; | |
5994 id = 1; | |
0 | 5995 do |
5996 { | |
5997 v52 = v51; | |
5998 v53 = dword_50B9F0[v52]; | |
5999 v84 = v53 >= (signed int)v49; | |
6000 if ( v50 ^ v84 ) | |
6001 { | |
6002 if ( v53 >= (signed int)v49 ) | |
6003 { | |
561 | 6004 v69 = (signed int)(v49 - dword_50B9F0[v52 - 1]) * (signed __int64)(dword_50BAE0[v52] - dword_50BAE0[v52 - 1]) / (v53 - dword_50B9F0[v52 - 1]); |
6005 v54 = dword_50BAE0[v52 - 1]; | |
0 | 6006 } |
6007 else | |
6008 { | |
561 | 6009 v69 = (signed int)(v49 - v53) * (signed __int64)(dword_50BAE0[v52 - 1] - dword_50BAE0[v52]) / (dword_50B9F0[v52 - 1] - v53); |
0 | 6010 v54 = dword_50BAE0[v52]; |
6011 } | |
561 | 6012 dword_50BAD4[v48] = v69 + v54; |
6013 v49 = pBLVRenderParams->uViewportY; | |
6014 dword_50B9E4[v48] = pBLVRenderParams->uViewportY; | |
0 | 6015 ++v48; |
6016 } | |
6017 v50 = v84; | |
6018 if ( v84 ) | |
6019 { | |
6020 dword_50BAD4[v48] = dword_50BAE0[v52]; | |
561 | 6021 dword_50B9E4[v48++] = dword_50B9F0[v52]; |
0 | 6022 } |
6023 v51 = id++ + 1; | |
6024 } | |
6025 while ( id <= v43 ); | |
486 | 6026 |
6027 if (v48 < 1) | |
0 | 6028 return 0; |
486 | 6029 |
6030 v55 = 0; | |
6031 dword_50BAD4[v48] = dword_50BAD4[0]; | |
561 | 6032 dword_50B9E4[v48] = dword_50B9E4[0]; |
486 | 6033 v56 = pBLVRenderParams->uViewportW; |
561 | 6034 thise = dword_50B9E4[0] <= (signed int)pBLVRenderParams->uViewportW; |
486 | 6035 ie = 1; |
0 | 6036 do |
6037 { | |
6038 v57 = ie; | |
561 | 6039 v58 = dword_50B9E4[ie]; |
0 | 6040 v85 = v58 <= (signed int)v56; |
6041 if ( thise ^ v85 ) | |
6042 { | |
6043 if ( v58 <= (signed int)v56 ) | |
6044 { | |
561 | 6045 v70 = (signed int)(v56 - dword_50B9E4[v57 - 1]) * (signed __int64)(dword_50BAD4[v57] - dword_50BAD4[v57 - 1]) / (v58 - dword_50B9E4[v57 - 1]); |
6046 v59 = dword_50BAD4[v57 - 1]; | |
0 | 6047 } |
6048 else | |
6049 { | |
561 | 6050 v70 = (signed int)(v56 - v58) * (signed __int64)(dword_50BAD4[v57 - 1] - dword_50BAD4[v57]) / (dword_50B9E4[v57 - 1] - v58); |
0 | 6051 v59 = dword_50BAD4[v57]; |
6052 } | |
561 | 6053 dword_50BAC8[v55] = v70 + v59; |
6054 v56 = pBLVRenderParams->uViewportW; | |
6055 dword_50B9D8_ys[v55] = pBLVRenderParams->uViewportW; | |
0 | 6056 ++v55; |
6057 } | |
6058 if ( v85 ) | |
6059 { | |
6060 dword_50BAC8[v55] = dword_50BAD4[v57]; | |
561 | 6061 dword_50B9D8_ys[v55++] = dword_50B9E4[v57]; |
0 | 6062 } |
6063 ++ie; | |
6064 thise = v85; | |
6065 } | |
6066 while ( ie <= v48 ); | |
486 | 6067 |
0 | 6068 if ( !v55 ) |
6069 return 0; | |
6070 v61 = pRenderer->pRenderD3D == 0; | |
6071 dword_50BAC8[v55] = dword_50BAC8[0]; | |
6072 dword_50B9D8_ys[v55] = dword_50B9D8_ys[0]; | |
6073 if ( v61 && v55 > 3 ) | |
6074 { | |
6075 dword_50BAC8[v55 + 1] = dword_50BAC8[1]; | |
6076 dword_50B9D8_ys[v55 + 1] = dword_50B9D8_ys[1]; | |
6077 thisf = 2 * (dword_50B700 != 0) - 1; | |
6078 if ( v55 > 0 ) | |
6079 { | |
6080 v62 = 1; | |
6081 v71 = 1; | |
6082 do | |
6083 { | |
6084 v63 = v62 - 1; | |
6085 v64 = v62 + 1; | |
6086 v80 = v62 + 1; | |
6087 if ( v62 - 1 >= v55 ) | |
6088 v63 -= v55; | |
6089 if ( v62 >= v55 ) | |
6090 v62 -= v55; | |
6091 if ( v64 >= v55 ) | |
6092 v64 -= v55; | |
6093 if ( thisf | |
6094 * ((dword_50B9D8_ys[v64] - dword_50B9D8_ys[v63]) * (dword_50BAC8[v62] - dword_50BAC8[v63]) | |
6095 - (dword_50B9D8_ys[v62] - dword_50B9D8_ys[v63]) * (dword_50BAC8[v64] - dword_50BAC8[v63])) < 0 ) | |
6096 { | |
6097 v62 = v80; | |
6098 v71 = v80; | |
6099 } | |
6100 else | |
6101 { | |
6102 v62 = v71; | |
6103 v65 = v71; | |
6104 if ( v71 < v55 || (v65 = v71 - v55, v71 - v55 < v55) ) | |
6105 { | |
6106 memcpy(&dword_50B9D8_ys[v65], &dword_50B9D8_ys[v65 + 1], 4 * ((unsigned int)(4 * (v55 - v65)) >> 2)); | |
6107 memcpy(&dword_50BAC8[v65], &dword_50BAC8[v65 + 1], 4 * ((unsigned int)(4 * (v55 - v65)) >> 2)); | |
6108 } | |
6109 --v55; | |
6110 } | |
6111 } | |
6112 while ( v62 - 1 < v55 ); | |
6113 } | |
6114 dword_50BAC8[v55] = dword_50BAC8[0]; | |
6115 dword_50B9D8_ys[v55] = dword_50B9D8_ys[0]; | |
6116 } | |
6117 return v55; | |
6118 } | |
6119 | |
6120 //----- (00424579) -------------------------------------------------------- | |
6121 int __fastcall sub_424579(int uFaceID, stru320 *a2) | |
6122 { | |
6123 __debugbreak(); | |
6124 return 0; | |
6125 /*BLVFace *v2; // eax@1 | |
6126 Vec3_short_ *v3; // ebx@1 | |
6127 Vec3_short_ *v4; // esi@1 | |
6128 unsigned int v5; // esi@3 | |
6129 int v7; // ST1C_4@5 | |
6130 int v8; // ST1C_4@5 | |
6131 int v9; // ST1C_4@5 | |
6132 int v10; // ST1C_4@5 | |
6133 int v11; // esi@5 | |
6134 int v12; // ST1C_4@5 | |
6135 unsigned int v15; // ecx@8 | |
6136 unsigned int v19; // ecx@13 | |
6137 signed int v20; // ecx@16 | |
6138 signed int result; // eax@20 | |
6139 signed int v24; // edx@22 | |
6140 unsigned int v25; // [sp+Ch] [bp-1Ch]@3 | |
6141 float v26; // [sp+14h] [bp-14h]@3 | |
6142 float v27; // [sp+1Ch] [bp-Ch]@3 | |
6143 float v28; // [sp+20h] [bp-8h]@3 | |
6144 signed int v29; // [sp+24h] [bp-4h]@3 | |
6145 | |
6146 v2 = &pIndoor->pFaces[uFaceID]; | |
6147 v3 = pIndoor->pVertices; | |
6148 v4 = &pIndoor->pVertices[*v2->pVertexIDs]; | |
6149 if ( v2->pFacePlane_old.vNormal.x * ((signed __int16)*(int *)&v4->x - pBLVRenderParams->vPartyPos.x) | |
6150 + v2->pFacePlane_old.vNormal.y * ((signed __int16)(*(int *)&v4->x >> 16) - pBLVRenderParams->vPartyPos.y) | |
6151 + v2->pFacePlane_old.vNormal.z * (v4->z - pBLVRenderParams->vPartyPos.z) < 0 ) | |
6152 { | |
6153 dword_50B700 = 1; | |
6154 } | |
6155 else | |
6156 { | |
6157 dword_50B700 = 0; | |
6158 if ( !(v2->uAttributes & 1) ) | |
6159 return 0; | |
6160 } | |
6161 v29 = 0; | |
6162 v5 = v2->uNumVertices; | |
6163 __asm { fld pBLVRenderParams->fCosineY } | |
6164 v28 = pBLVRenderParams->fSineY; | |
6165 v26 = pBLVRenderParams->fCosineNegX; | |
6166 v27 = pBLVRenderParams->fSineNegX; | |
6167 v25 = v5; | |
6168 if ( (signed int)v5 > 0 ) | |
6169 { | |
6170 _ECX = (char *)&array_50AC10[0].vWorldPosition.z; | |
6171 do | |
6172 { | |
6173 v7 = v3[v2->pVertexIDs[v29]].x; | |
6174 __asm | |
6175 { | |
6176 fild [ebp+var_10] | |
6177 fstp dword ptr [ecx-8] | |
6178 } | |
6179 v8 = v3[v2->pVertexIDs[v29]].y; | |
6180 __asm | |
6181 { | |
6182 fild [ebp+var_10] | |
6183 fstp dword ptr [ecx-4] | |
6184 } | |
6185 v9 = v3[v2->pVertexIDs[v29]].z; | |
6186 __asm | |
6187 { | |
6188 fild [ebp+var_10] | |
6189 fstp dword ptr [ecx] | |
6190 } | |
6191 _ECX += 48; | |
6192 v10 = a2->pDeltaUV[0] + v2->pVertexUIDs[v29]; | |
6193 __asm | |
6194 { | |
6195 fild [ebp+var_10] | |
6196 fstp dword ptr [ecx-14h] | |
6197 } | |
6198 v11 = a2->pDeltaUV[1] + v2->pVertexVIDs[v29++]; | |
6199 v12 = v11; | |
6200 v5 = v25; | |
6201 __asm | |
6202 { | |
6203 fild [ebp+var_10] | |
6204 fstp dword ptr [ecx-10h] | |
6205 } | |
6206 } | |
6207 while ( v29 < (signed int)v25 ); | |
6208 } | |
6209 _EDX = (char *)&array_50AC10[0].vWorldViewPosition; | |
6210 if ( pBLVRenderParams->sPartyRotX ) | |
6211 { | |
6212 if ( (signed int)v5 > 0 ) | |
6213 { | |
6214 __asm | |
6215 { | |
6216 fild pBLVRenderParams->vPartyPos.x | |
6217 fild pBLVRenderParams->vPartyPos.y | |
6218 fild pBLVRenderParams->vPartyPos.z | |
6219 } | |
6220 _EAX = (char *)&array_50AC10[0].vWorldPosition.z; | |
6221 v15 = v5; | |
6222 do | |
6223 { | |
6224 __asm | |
6225 { | |
6226 fld dword ptr [eax-8] | |
6227 fsub st, st(3) | |
6228 fld dword ptr [eax-4] | |
6229 fsub st, st(3) | |
6230 fld st(1) | |
6231 fmul st, st(6) | |
6232 fld st(1) | |
6233 fmul [ebp+var_8] | |
6234 fsubp st(1), st | |
6235 fstp [ebp+var_4] | |
6236 fld dword ptr [eax] | |
6237 fsub st, st(3) | |
6238 } | |
6239 _EAX += 48; | |
6240 --v15; | |
6241 __asm | |
6242 { | |
6243 fstp [ebp+var_10] | |
6244 fld [ebp+var_4] | |
6245 fmul [ebp+var_14] | |
6246 fld [ebp+var_10] | |
6247 fmul [ebp+var_C] | |
6248 fsubp st(1), st | |
6249 fstp dword ptr [eax-2Ch] | |
6250 fld st(1) | |
6251 fmul [ebp+var_8] | |
6252 fld st(1) | |
6253 fmul st, st(7) | |
6254 faddp st(1), st | |
6255 fstp dword ptr [eax-28h] | |
6256 fstp st | |
6257 fstp st | |
6258 fld [ebp+var_4] | |
6259 fmul [ebp+var_C] | |
6260 fld [ebp+var_10] | |
6261 fmul [ebp+var_14] | |
6262 faddp st(1), st | |
6263 fstp dword ptr [eax-24h] | |
6264 } | |
6265 } | |
6266 while ( v15 ); | |
6267 LABEL_15: | |
6268 __asm | |
6269 { | |
6270 fstp st | |
6271 fstp st | |
6272 fstp st | |
6273 } | |
6274 goto LABEL_16; | |
6275 } | |
6276 } | |
6277 else | |
6278 { | |
6279 if ( (signed int)v5 > 0 ) | |
6280 { | |
6281 __asm | |
6282 { | |
6283 fild pBLVRenderParams->vPartyPos.x | |
6284 fild pBLVRenderParams->vPartyPos.y | |
6285 fild pBLVRenderParams->vPartyPos.z | |
6286 } | |
6287 _EAX = (char *)&array_50AC10[0].vWorldViewPosition; | |
6288 v19 = v5; | |
6289 do | |
6290 { | |
6291 __asm | |
6292 { | |
6293 fld dword ptr [eax-0Ch] | |
6294 fsub st, st(3) | |
6295 fld dword ptr [eax-8] | |
6296 fsub st, st(3) | |
6297 fld st(1) | |
6298 fmul st, st(6) | |
6299 fld st(1) | |
6300 fmul [ebp+var_8] | |
6301 fsubp st(1), st | |
6302 fstp dword ptr [eax] | |
6303 fld st(1) | |
6304 fmul [ebp+var_8] | |
6305 fld st(1) | |
6306 fmul st, st(7) | |
6307 } | |
6308 _EAX += 48; | |
6309 --v19; | |
6310 __asm | |
6311 { | |
6312 faddp st(1), st | |
6313 fstp dword ptr [eax-2Ch] | |
6314 fstp st | |
6315 fstp st | |
6316 fld dword ptr [eax-34h] | |
6317 fsub st, st(1) | |
6318 fstp dword ptr [eax-28h] | |
6319 } | |
6320 } | |
6321 while ( v19 ); | |
6322 goto LABEL_15; | |
6323 } | |
6324 } | |
6325 LABEL_16: | |
6326 v20 = 0; | |
6327 __asm { fstp st } | |
6328 if ( (signed int)v5 <= 0 ) | |
6329 return 0; | |
6330 do | |
6331 { | |
6332 __asm | |
6333 { | |
6334 fld dword ptr [edx] | |
6335 fcomp ds:flt_4D8524 | |
6336 fnstsw ax | |
6337 } | |
6338 if ( !(HIBYTE(_AX) & 1) ) | |
6339 break; | |
6340 ++v20; | |
6341 _EDX += 48; | |
6342 } | |
6343 while ( v20 < (signed int)v5 ); | |
6344 if ( v20 >= (signed int)v5 ) | |
6345 return 0; | |
6346 result = sr_424CD7(v5); | |
6347 if ( result > 0 ) | |
6348 { | |
6349 __asm { fild pBLVRenderParams->field_40 } | |
6350 _ECX = (char *)&array_507D30[0].vWorldViewPosition; | |
6351 v24 = result; | |
6352 __asm | |
6353 { | |
6354 fmul ds:flt_4D84A4 | |
6355 fild pBLVRenderParams->uViewportCenterX | |
6356 fild pBLVRenderParams->uViewportCenterY | |
6357 } | |
6358 do | |
6359 { | |
6360 __asm | |
6361 { | |
6362 fld1 | |
6363 fdiv dword ptr [ecx] | |
6364 } | |
6365 _ECX += 48; | |
6366 --v24; | |
6367 __asm | |
6368 { | |
6369 fld st | |
6370 fmul dword ptr [ecx-2Ch] | |
6371 fmul st, st(4) | |
6372 fsubr st, st(3) | |
6373 fstp dword ptr [ecx-24h] | |
6374 fmul dword ptr [ecx-28h] | |
6375 fmul st, st(3) | |
6376 fsubr st, st(1) | |
6377 fstp dword ptr [ecx-20h] | |
6378 } | |
6379 } | |
6380 while ( v24 ); | |
6381 __asm | |
6382 { | |
6383 fstp st | |
6384 fstp st | |
6385 fstp st | |
6386 } | |
6387 } | |
6388 memcpy(&array_507D30[result], array_507D30, sizeof(array_507D30[result])); | |
6389 return result;*/ | |
6390 } | |
6391 | |
6392 | |
6393 //----- (00424829) -------------------------------------------------------- | |
6394 bool sub_424829(int a1, BspRenderer_stru2 *a2, BspRenderer_stru2 *a3, int a4) | |
6395 { | |
6396 int v4; // edi@1 | |
6397 BspRenderer_stru2 *v5; // ebx@1 | |
6398 int v6; // eax@3 | |
6399 int v7; // esi@5 | |
6400 int v8; // edx@5 | |
6401 int v9; // ecx@6 | |
6402 int v10; // eax@12 | |
6403 int v11; // edi@13 | |
6404 int v12; // edx@18 | |
6405 int v13; // eax@22 | |
6406 int v14; // edi@28 | |
6407 int v15; // ecx@29 | |
6408 int v16; // edi@30 | |
6409 int v17; // edx@35 | |
6410 int v18; // eax@39 | |
6411 int v19; // eax@44 | |
6412 int v20; // ecx@44 | |
6413 int v21; // edi@45 | |
6414 int v22; // edi@46 | |
6415 __int16 *v23; // ecx@47 | |
6416 int v24; // edx@48 | |
6417 int v25; // eax@50 | |
6418 int v26; // eax@55 | |
6419 signed int v27; // edi@55 | |
6420 int v28; // edx@56 | |
6421 int v29; // edx@57 | |
6422 int v30; // eax@59 | |
6423 int v31; // eax@64 | |
6424 signed int v32; // edi@64 | |
6425 int v33; // edx@65 | |
6426 __int16 *v34; // eax@66 | |
6427 __int16 v35; // dx@66 | |
6428 __int16 v36; // dx@67 | |
6429 __int16 v37; // di@67 | |
6430 __int16 v38; // dx@67 | |
6431 BspRenderer_stru2 *v39; // ecx@69 | |
6432 int v40; // edx@69 | |
6433 int v41; // edi@70 | |
6434 __int16 *v42; // eax@76 | |
6435 __int16 *v43; // eax@81 | |
6436 __int16 *v45; // eax@87 | |
6437 int v46; // edx@87 | |
6438 __int16 v47; // cx@88 | |
6439 int v48; // eax@93 | |
6440 int v49; // esi@93 | |
6441 __int16 *v50; // ecx@94 | |
6442 int v51; // eax@95 | |
6443 int v52; // eax@97 | |
6444 int v53; // [sp+Ch] [bp-34h]@44 | |
6445 int v54; // [sp+10h] [bp-30h]@0 | |
6446 int v55; // [sp+14h] [bp-2Ch]@12 | |
6447 __int16 *v56; // [sp+14h] [bp-2Ch]@47 | |
6448 __int16 *v57; // [sp+14h] [bp-2Ch]@76 | |
6449 __int16 *v58; // [sp+14h] [bp-2Ch]@81 | |
6450 __int16 *v59; // [sp+14h] [bp-2Ch]@87 | |
6451 BspRenderer_stru2 *v60; // [sp+18h] [bp-28h]@1 | |
6452 int v61; // [sp+1Ch] [bp-24h]@29 | |
6453 int v62; // [sp+20h] [bp-20h]@0 | |
6454 signed int v63; // [sp+24h] [bp-1Ch]@3 | |
6455 signed int v64; // [sp+28h] [bp-18h]@3 | |
6456 int v65; // [sp+2Ch] [bp-14h]@5 | |
6457 int v66; // [sp+2Ch] [bp-14h]@39 | |
6458 int v67; // [sp+30h] [bp-10h]@22 | |
6459 int v68; // [sp+34h] [bp-Ch]@12 | |
6460 int v69; // [sp+34h] [bp-Ch]@29 | |
6461 int v70; // [sp+34h] [bp-Ch]@46 | |
6462 int v71; // [sp+34h] [bp-Ch]@75 | |
6463 int v72; // [sp+34h] [bp-Ch]@80 | |
6464 int v73; // [sp+38h] [bp-8h]@11 | |
6465 int v74; // [sp+3Ch] [bp-4h]@1 | |
6466 int a3a; // [sp+48h] [bp+8h]@76 | |
6467 int a3b; // [sp+48h] [bp+8h]@87 | |
6468 | |
6469 v4 = a1; | |
6470 v5 = a2; | |
6471 v74 = a1; | |
6472 v60 = a2; | |
6473 if ( !a1 | |
6474 || (!dword_50B700 ? (v64 = -1, v6 = 1, v63 = 1) : (v6 = 1, v63 = -1, v64 = 1), | |
6475 v7 = dword_50B9D8_ys[0], | |
6476 v65 = 0, | |
6477 v8 = dword_50B9D8_ys[0], | |
6478 a1 <= v6) ) | |
6479 return 0; | |
6480 do | |
6481 { | |
6482 v9 = dword_50B9D8_ys[v6]; | |
6483 if ( v9 >= v7 ) | |
6484 { | |
6485 if ( v9 > v8 ) | |
6486 v8 = dword_50B9D8_ys[v6]; | |
6487 } | |
6488 else | |
6489 { | |
6490 v65 = v6; | |
6491 v7 = dword_50B9D8_ys[v6]; | |
6492 } | |
6493 ++v6; | |
6494 } | |
6495 while ( v6 < v4 ); | |
6496 v73 = v8; | |
6497 if ( v8 == v7 ) | |
6498 return 0; | |
6499 v10 = v65; | |
6500 v68 = 0; | |
6501 v5->_viewport_space_y = v7; | |
6502 v5->_viewport_space_w = v8; | |
6503 v55 = v65; | |
6504 if ( v4 > 0 ) | |
6505 { | |
6506 v11 = v65; | |
6507 do | |
6508 { | |
6509 v10 += v64; | |
6510 if ( v10 < v74 ) | |
6511 { | |
6512 if ( v10 < 0 ) | |
6513 v10 += v74; | |
6514 } | |
6515 else | |
6516 { | |
6517 v10 -= v74; | |
6518 } | |
6519 v12 = dword_50B9D8_ys[v10]; | |
6520 if ( v12 <= dword_50B9D8_ys[v11] ) | |
6521 { | |
6522 v55 = v10; | |
6523 v11 = v10; | |
6524 } | |
6525 if ( v12 == v73 ) | |
6526 break; | |
6527 ++v68; | |
6528 } | |
6529 while ( v68 < v74 ); | |
6530 } | |
6531 v13 = v55 + v64; | |
6532 v67 = v55 + v64; | |
6533 if ( v55 + v64 < v74 ) | |
6534 { | |
6535 if ( v13 >= 0 ) | |
6536 goto LABEL_27; | |
6537 v13 += v74; | |
6538 } | |
6539 else | |
6540 { | |
6541 v13 -= v74; | |
6542 } | |
6543 v67 = v13; | |
6544 LABEL_27: | |
6545 if ( dword_50B9D8_ys[v13] != dword_50B9D8_ys[v55] ) | |
6546 { | |
6547 v14 = dword_50BAC8[v55]; | |
6548 v62 = v14 << 16; | |
6549 v54 = ((dword_50BAC8[v13] - v14) << 16) / (dword_50B9D8_ys[v13] - dword_50B9D8_ys[v55]); | |
6550 v5->array_18[v7] = LOWORD(dword_50BAC8[v55]); | |
6551 } | |
6552 v15 = v65; | |
6553 v69 = 0; | |
6554 v61 = v65; | |
6555 if ( v74 > 0 ) | |
6556 { | |
6557 v16 = v65; | |
6558 do | |
6559 { | |
6560 v15 += v63; | |
6561 if ( v15 < v74 ) | |
6562 { | |
6563 if ( v15 < 0 ) | |
6564 v15 += v74; | |
6565 } | |
6566 else | |
6567 { | |
6568 v15 -= v74; | |
6569 } | |
6570 v17 = dword_50B9D8_ys[v15]; | |
6571 if ( v17 <= dword_50B9D8_ys[v16] ) | |
6572 { | |
6573 v61 = v15; | |
6574 v16 = v15; | |
6575 } | |
6576 if ( v17 == v73 ) | |
6577 break; | |
6578 ++v69; | |
6579 } | |
6580 while ( v69 < v74 ); | |
6581 } | |
6582 v18 = v63 + v61; | |
6583 v66 = v63 + v61; | |
6584 if ( v63 + v61 < v74 ) | |
6585 { | |
6586 if ( v18 >= 0 ) | |
6587 goto LABEL_44; | |
6588 v18 += v74; | |
6589 } | |
6590 else | |
6591 { | |
6592 v18 -= v74; | |
6593 } | |
6594 v66 = v18; | |
6595 LABEL_44: | |
6596 v19 = v18; | |
6597 v20 = v61; | |
6598 v53 = dword_50B9D8_ys[v19] - dword_50B9D8_ys[v61]; | |
6599 if ( dword_50B9D8_ys[v19] != dword_50B9D8_ys[v61] ) | |
6600 { | |
6601 v21 = dword_50BAC8[v20]; | |
6602 v5 = v60; | |
6603 v61 = v21 << 16; | |
6604 v53 = ((dword_50BAC8[v19] - v21) << 16) / v53; | |
6605 v60->array_3D8[v73] = LOWORD(dword_50BAC8[v20]); | |
6606 } | |
6607 v22 = v7; | |
6608 v70 = v7; | |
6609 if ( v7 <= v73 ) | |
6610 { | |
6611 v56 = &v5->array_3D8[v7]; | |
6612 v23 = &v5->array_18[v7]; | |
6613 do | |
6614 { | |
6615 v24 = v67; | |
6616 if ( v22 < dword_50B9D8_ys[v67] || v22 == v73 ) | |
6617 goto LABEL_57; | |
6618 v25 = v64 + v67; | |
6619 v67 = v25; | |
6620 if ( v25 < v74 ) | |
6621 { | |
6622 if ( v25 >= 0 ) | |
6623 goto LABEL_55; | |
6624 v25 += v74; | |
6625 } | |
6626 else | |
6627 { | |
6628 v25 -= v74; | |
6629 } | |
6630 v67 = v25; | |
6631 LABEL_55: | |
6632 v26 = v25; | |
6633 v27 = dword_50B9D8_ys[v26] - dword_50B9D8_ys[v24]; | |
6634 if ( dword_50B9D8_ys[v26] - dword_50B9D8_ys[v24] > 0 ) | |
6635 { | |
6636 v28 = dword_50BAC8[v24]; | |
6637 v54 = ((dword_50BAC8[v26] - v28) << 16) / v27; | |
6638 v62 = v28 << 16; | |
6639 } | |
6640 LABEL_57: | |
6641 v29 = v66; | |
6642 if ( v70 >= dword_50B9D8_ys[v66] && v70 != v73 ) | |
6643 { | |
6644 v30 = v63 + v66; | |
6645 v66 += v63; | |
6646 if ( v66 >= v74 ) | |
6647 { | |
6648 v30 -= v74; | |
6649 goto LABEL_63; | |
6650 } | |
6651 if ( v30 < 0 ) | |
6652 { | |
6653 v30 += v74; | |
6654 LABEL_63: | |
6655 v66 = v30; | |
6656 } | |
6657 v31 = v30; | |
6658 v32 = dword_50B9D8_ys[v31] - dword_50B9D8_ys[v29]; | |
6659 if ( dword_50B9D8_ys[v31] - dword_50B9D8_ys[v29] > 0 ) | |
6660 { | |
6661 v33 = dword_50BAC8[v29]; | |
6662 v53 = ((dword_50BAC8[v31] - v33) << 16) / v32; | |
6663 v61 = v33 << 16; | |
6664 } | |
6665 } | |
6666 *(__int16 *)((char *)v56 + (int)(char *)v5->array_18 - (char *)v5->array_3D8) = HIWORD(v62); | |
6667 *v56 = HIWORD(v61); | |
6668 v34 = v23 + 480; | |
6669 v35 = v23[480]; | |
6670 if ( *v23 > v35 ) | |
6671 { | |
6672 v36 = *v23 ^ v35; | |
6673 v37 = *v34; | |
6674 *v23 = v36; | |
6675 v38 = v37 ^ v36; | |
6676 *v23 ^= v38; | |
6677 *v34 = v38; | |
6678 } | |
6679 ++v56; | |
6680 v62 += v54; | |
6681 v22 = v70 + 1; | |
6682 v61 += v53; | |
6683 ++v23; | |
6684 ++v70; | |
6685 } | |
6686 while ( v70 <= v73 ); | |
6687 } | |
6688 v39 = a3; | |
6689 v40 = v73; | |
6690 if ( v73 < a3->_viewport_space_y || (v41 = a3->_viewport_space_w, v7 > v41) ) | |
6691 return 0; | |
6692 if ( v7 < a3->_viewport_space_y ) | |
6693 v7 = a3->_viewport_space_y; | |
6694 if ( v73 > v41 ) | |
6695 { | |
6696 v40 = a3->_viewport_space_w; | |
6697 v73 = a3->_viewport_space_w; | |
6698 } | |
6699 v71 = v7; | |
6700 if ( v7 <= v40 ) | |
6701 { | |
6702 a3a = (char *)v5 - (char *)a3; | |
6703 v57 = &v5->array_18[v7]; | |
6704 v42 = &v39->array_3D8[v7]; | |
6705 do | |
6706 { | |
6707 if ( *(__int16 *)((char *)v42 + a3a) >= *(v42 - 480) && *v57 <= *v42 ) | |
6708 break; | |
6709 ++v57; | |
6710 ++v7; | |
6711 ++v71; | |
6712 ++v42; | |
6713 } | |
6714 while ( v71 <= v40 ); | |
6715 } | |
6716 v72 = v40; | |
6717 if ( v40 < v7 ) | |
6718 return 0; | |
6719 v58 = &v5->array_18[v40]; | |
6720 v43 = &v39->array_3D8[v40]; | |
6721 do | |
6722 { | |
6723 if ( *(__int16 *)((char *)v43 + (int)(char *)v5 - (char *)v39) >= *(v43 - 480) && *v58 <= *v43 ) | |
6724 break; | |
6725 --v58; | |
6726 --v40; | |
6727 --v72; | |
6728 --v43; | |
6729 v73 = v40; | |
6730 } | |
6731 while ( v72 >= v7 ); | |
6732 if ( v7 >= v40 ) | |
6733 return 0; | |
6734 a3b = (char *)v39 - (char *)v5; | |
6735 v59 = &v39->array_3D8[v7]; | |
6736 v45 = &v5->array_18[v7]; | |
6737 v46 = v73 - v7 + 1; | |
6738 do | |
6739 { | |
6740 v47 = *(__int16 *)((char *)v45 + a3b); | |
6741 if ( *v45 < v47 ) | |
6742 *v45 = v47; | |
6743 if ( v45[480] > *v59 ) | |
6744 v45[480] = *v59; | |
6745 ++v59; | |
6746 ++v45; | |
6747 --v46; | |
6748 } | |
6749 while ( v46 ); | |
6750 v5->_viewport_space_y = v7; | |
6751 v5->_viewport_space_w = v73; | |
6752 v5->field_8 = v5->array_18[v7]; | |
6753 v48 = v5->array_3D8[v7]; | |
6754 v5->field_10 = v7; | |
6755 v5->field_14 = v7; | |
6756 v49 = v7 + 1; | |
6757 v5->field_C = v48; | |
6758 if ( v49 <= v73 ) | |
6759 { | |
6760 v50 = &v5->array_3D8[v49]; | |
6761 do | |
6762 { | |
6763 v51 = *(v50 - 480); | |
6764 if ( v51 < v5->field_8 ) | |
6765 { | |
6766 v5->field_8 = v51; | |
6767 v5->field_10 = v49; | |
6768 } | |
6769 v52 = *v50; | |
6770 if ( v52 > v5->field_C ) | |
6771 { | |
6772 v5->field_C = v52; | |
6773 v5->field_14 = v49; | |
6774 } | |
6775 ++v49; | |
6776 ++v50; | |
6777 } | |
6778 while ( v49 <= v73 ); | |
6779 } | |
6780 return 1; | |
6781 } | |
6782 // 50B700: using guessed type int dword_50B700; | |
6783 | |
6784 //----- (00424CD7) -------------------------------------------------------- | |
6785 signed int __fastcall sr_424CD7(unsigned int uVertexID) | |
6786 { | |
6787 unsigned int v1; // edx@1 | |
6788 signed int v2; // edi@1 | |
6789 char *v3; // esi@4 | |
6790 char *v4; // ecx@4 | |
6791 unsigned int v5; // eax@4 | |
6792 char *v6; // edx@4 | |
6793 double v7; // st6@10 | |
6794 double v8; // st5@10 | |
6795 double v9; // st6@11 | |
6796 unsigned __int8 v10; // c2@15 | |
6797 unsigned __int8 v11; // c3@15 | |
6798 RenderVertexSoft *v12; // edi@22 | |
6799 char *v13; // eax@22 | |
6800 double v14; // st6@22 | |
6801 signed int result; // eax@24 | |
6802 unsigned int v16; // [sp+8h] [bp-28h]@4 | |
6803 bool v17; // [sp+Ch] [bp-24h]@6 | |
6804 char *v18; // [sp+10h] [bp-20h]@4 | |
6805 char *v19; // [sp+14h] [bp-1Ch]@4 | |
6806 signed int v20; // [sp+18h] [bp-18h]@1 | |
6807 RenderVertexSoft *v21; // [sp+1Ch] [bp-14h]@4 | |
6808 char *v22; // [sp+20h] [bp-10h]@4 | |
6809 char *v23; // [sp+24h] [bp-Ch]@4 | |
6810 char *v24; // [sp+28h] [bp-8h]@4 | |
6811 char *v25; // [sp+2Ch] [bp-4h]@4 | |
6812 | |
6813 v1 = uVertexID; | |
6814 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); | |
6815 v2 = 0; | |
6816 v20 = 0; | |
6817 if ( array_50AC10[0].vWorldViewPosition.x >= 8.0 ) | |
6818 v2 = 1; | |
6819 if ( (signed int)(uVertexID + 1) <= 1 ) | |
6820 return 0; | |
6821 v3 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
6822 v4 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
6823 v5 = v1; | |
168 | 6824 v23 = (char *)&array_507D30[0]._rhw; |
0 | 6825 v21 = array_507D30; |
6826 v18 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
6827 v19 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
6828 v22 = (char *)&array_507D30[0].vWorldViewPosition; | |
6829 v24 = (char *)&array_507D30[0].v; | |
6830 v25 = (char *)&array_507D30[0].u; | |
6831 v6 = (char *)&array_50AC10[0].v; | |
6832 v16 = v5; | |
6833 do | |
6834 { | |
6835 v17 = *((float *)v6 + 5) >= 8.0; | |
6836 if ( v2 != v17 ) | |
6837 { | |
6838 if ( v17 ) | |
6839 { | |
6840 v7 = (8.0 - *((float *)v6 - 7)) / (*((float *)v6 + 5) - *((float *)v6 - 7)); | |
6841 *(float *)v4 = (*((float *)v6 + 6) - *((float *)v6 - 6)) * v7 + *((float *)v6 - 6); | |
6842 *(float *)v3 = (*((float *)v6 + 7) - *((float *)v6 - 5)) * v7 + *((float *)v6 - 5); | |
6843 *(float *)v25 = (*((float *)v6 + 11) - *((float *)v6 - 1)) * v7 + *((float *)v6 - 1); | |
6844 v8 = (*((float *)v6 + 12) - *(float *)v6) * v7 + *(float *)v6; | |
6845 } | |
6846 else | |
6847 { | |
6848 v9 = (8.0 - *((float *)v6 + 5)) / (*((float *)v6 - 7) - *((float *)v6 + 5)); | |
6849 *(float *)v4 = (*((float *)v6 - 6) - *((float *)v6 + 6)) * v9 + *((float *)v6 + 6); | |
6850 *(float *)v3 = (*((float *)v6 - 5) - *((float *)v6 + 7)) * v9 + *((float *)v6 + 7); | |
6851 *(float *)v25 = (*((float *)v6 - 1) - *((float *)v6 + 11)) * v9 + *((float *)v6 + 11); | |
6852 v8 = (*(float *)v6 - *((float *)v6 + 12)) * v9 + *((float *)v6 + 12); | |
6853 } | |
6854 *(float *)v24 = v8; | |
6855 *(float *)v22 = 8.0; | |
6856 *(int *)v23 = 0x3E000000u; | |
6857 if ( v2 ) | |
6858 { | |
6859 if ( 8.0 == *((float *)v6 - 7) && *(float *)v4 == *((float *)v6 - 6) ) | |
6860 { | |
6861 v10 = 0; | |
6862 v11 = *(float *)v3 == *((float *)v6 - 5); | |
6863 goto LABEL_19; | |
6864 } | |
6865 } | |
6866 else | |
6867 { | |
6868 if ( 8.0 == *((float *)v6 + 5) && *(float *)v4 == *((float *)v6 + 6) ) | |
6869 { | |
6870 v10 = 0; | |
6871 v11 = *(float *)v3 == *((float *)v6 + 7); | |
6872 LABEL_19: | |
6873 if ( v11 | v10 ) | |
6874 goto LABEL_21; | |
6875 goto LABEL_20; | |
6876 } | |
6877 } | |
6878 LABEL_20: | |
6879 ++v21; | |
6880 v22 += 48; | |
6881 v24 += 48; | |
6882 v25 += 48; | |
6883 v4 += 48; | |
6884 v3 += 48; | |
6885 ++v20; | |
6886 v23 += 48; | |
6887 v19 = v4; | |
6888 v18 = v3; | |
6889 } | |
6890 LABEL_21: | |
6891 if ( v17 ) | |
6892 { | |
6893 v12 = v21; | |
6894 v13 = v23; | |
6895 v19 += 48; | |
6896 v18 += 48; | |
6897 v14 = 1.0 / (*((float *)v6 + 5) + 0.0000001); | |
6898 ++v20; | |
6899 v25 += 48; | |
6900 v24 += 48; | |
6901 v22 += 48; | |
6902 ++v21; | |
6903 v23 += 48; | |
6904 memcpy(v12, v6 + 8, 0x30u); | |
6905 v4 = v19; | |
6906 v3 = v18; | |
6907 *(float *)v13 = v14; | |
6908 } | |
6909 v2 = v17; | |
6910 v6 += 48; | |
6911 --v16; | |
6912 } | |
6913 while ( v16 ); | |
6914 result = v20; | |
6915 if ( v20 < 3 ) | |
6916 return 0; | |
6917 return result; | |
6918 } |