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