Mercurial > mm7
annotate mm7_1.cpp @ 430:58b71c1af7d8
Objects are drawn (items, spells sfx)
author | Nomad |
---|---|
date | Sun, 24 Feb 2013 00:54:25 +0200 |
parents | 80a5aab68b67 |
children | 8c45cac1c5e1 |
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; | |
1523 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
1524 { | |
1525 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)result->uControlID; | |
1526 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v6; | |
1527 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
1528 ++pMessageQueue_50CBD0->uNumMessages; | |
1529 } | |
1530 return result; | |
1531 } | |
1532 } | |
1533 if ( v4->uFrameX || v4->uFrameY || !(v4->uFrameWidth == 640 & v4->uFrameHeight == 480) ) | |
1534 { | |
1535 --v2; | |
1536 if ( v2 >= 0 ) | |
1537 continue; | |
1538 } | |
1539 break; | |
1540 } | |
1541 } | |
1542 return 0; | |
1543 } | |
1544 // 5075E0: using guessed type int pVisibleWindowsIdxs[20]; | |
1545 | |
1546 //----- (0041B4E1) -------------------------------------------------------- | |
1547 int __fastcall GUI_ReplaceHotkey(unsigned __int8 uOldHotkey, unsigned __int8 uNewHotkey, char bFirstCall) | |
1548 { | |
1549 unsigned __int8 v3; // bl@1 | |
1550 int result; // eax@1 | |
1551 int i; // edx@2 | |
1552 GUIButton *j; // ecx@3 | |
1553 int k; // edx@7 | |
1554 GUIButton *l; // ecx@8 | |
1555 unsigned __int8 v9; // [sp+4h] [bp-8h]@1 | |
1556 char v10; // [sp+8h] [bp-4h]@1 | |
1557 | |
1558 v3 = uNewHotkey; | |
1559 v10 = toupper(uOldHotkey); | |
1560 result = toupper(v3); | |
1561 v9 = result; | |
1562 if ( bFirstCall ) | |
1563 { | |
1564 for ( i = uNumVisibleWindows; i >= 0; --i ) | |
1565 { | |
1566 result = 84 * pVisibleWindowsIdxs[i]; | |
1567 //for ( j = *(GUIButton **)((char *)pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_ + result); j; j = j->pNext ) | |
1568 for ( j = pWindowList[pVisibleWindowsIdxs[i] - 1].pControlsHead; j; j = j->pNext ) | |
1569 j->field_28 = 0; | |
1570 } | |
1571 } | |
1572 for ( k = uNumVisibleWindows; k >= 0; --k ) | |
1573 { | |
1574 result = 84 * pVisibleWindowsIdxs[k]; | |
1575 //for ( l = *(GUIButton **)((char *)pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_ + result); l; l = l->pNext ) | |
1576 for ( l = pWindowList[pVisibleWindowsIdxs[k] - 1].pControlsHead; l; l = l->pNext ) | |
1577 { | |
1578 LOBYTE(result) = v10; | |
1579 if ( l->uHotkey == v10 ) | |
1580 { | |
1581 if ( !l->field_28 ) | |
1582 { | |
1583 LOBYTE(result) = v9; | |
1584 l->field_28 = 1; | |
1585 l->uHotkey = v9; | |
1586 } | |
1587 } | |
1588 } | |
1589 } | |
1590 return result; | |
1591 } | |
1592 // 5075E0: using guessed type int pVisibleWindowsIdxs[20]; | |
1593 | |
1594 //----- (0041B578) -------------------------------------------------------- | |
1595 void __cdecl MainMenuUI_LoadFontsAndSomeStuff() | |
1596 { | |
1597 pIcons_LOD->SetupPalettes(pRenderer->uTargetRBits, | |
1598 pRenderer->uTargetGBits, | |
1599 pRenderer->uTargetBBits); | |
1600 pPaletteManager->SetColorChannelInfo(pRenderer->uTargetRBits, | |
1601 pRenderer->uTargetGBits, | |
1602 pRenderer->uTargetBBits); | |
1603 pPaletteManager->RecalculateAll(); | |
1604 | |
1605 for (uint i = 0; i < 480; ++i) | |
1606 pSRZBufferLineOffsets[i] = 640 * i; | |
1607 | |
1608 pRenderer->ResetClip(); | |
1609 | |
1610 uTextureID_FONTPAL = pIcons_LOD->LoadTexture("FONTPAL", TEXTURE_16BIT_PALETTE); | |
180 | 1611 pFontArrus = LoadFont("arrus.fnt", "FONTPAL", NULL); |
1612 pFontLucida = LoadFont("lucida.fnt", "FONTPAL", NULL); | |
1613 pFontCreate = LoadFont("create.fnt", "FONTPAL", NULL); | |
1614 pFontSmallnum = LoadFont("smallnum.fnt", "FONTPAL", NULL); | |
1615 pFontComic = LoadFont("comic.fnt", "FONTPAL", NULL); | |
0 | 1616 pFontArrus->field_3 = 0; |
1617 pFontLucida->field_3 = 0; | |
1618 pFontCreate->field_3 = 0; | |
1619 | |
1620 for (uint i = 0; i < 20; ++i) | |
1621 pWindowList[i].eWindowType = WINDOW_null; | |
1622 | |
1623 uNumVisibleWindows = -1; | |
1624 memset(pVisibleWindowsIdxs, 0, sizeof(pVisibleWindowsIdxs)); | |
1625 } | |
1626 | |
1627 //----- (0041B690) -------------------------------------------------------- | |
1628 void __cdecl MainMenuUI_Create() | |
1629 { | |
319 | 1630 //unsigned int v0; // eax@1 |
1631 //unsigned int v1; // eax@1 | |
1632 //unsigned int v2; // eax@1 | |
1633 //unsigned int v3; // eax@1 | |
1634 //unsigned int v4; // eax@1 | |
1635 //unsigned int v5; // eax@1 | |
0 | 1636 Texture *v6; // ST78_4@1 |
319 | 1637 //const char *v7; // ST5C_4@1 |
0 | 1638 unsigned __int8 v8; // al@1 |
1639 //Texture *v9; // ST60_4@1 | |
1640 Texture *v10; // ST78_4@1 | |
319 | 1641 //const char *v11; // ST5C_4@1 |
0 | 1642 unsigned __int8 v12; // al@1 |
1643 //Texture *v13; // ST60_4@1 | |
1644 unsigned int v14; // eax@1 | |
1645 Texture *v15; // ST78_4@1 | |
319 | 1646 //const char *v16; // ST5C_4@1 |
0 | 1647 unsigned __int8 v17; // al@1 |
1648 //Texture *v18; // ST60_4@1 | |
1649 unsigned int uTextureID_ib_td4_A; // eax@1 | |
1650 Texture *v20; // ST78_4@1 | |
1651 unsigned __int8 v22; // al@1 | |
1652 //Texture *v23; // ST60_4@1 | |
1653 Texture *v24; // eax@1 | |
319 | 1654 //Texture *v25; // esi@1 |
1655 //Texture *v26; // ST60_4@1 | |
1656 //const char *v27; // ST5C_4@1 | |
0 | 1657 unsigned __int8 v28; // al@1 |
1658 Texture *v29; // eax@1 | |
319 | 1659 //Texture *v30; // esi@1 |
1660 //Texture *v31; // ST60_4@1 | |
1661 //const char *v32; // ST5C_4@1 | |
0 | 1662 unsigned __int8 v33; // al@1 |
1663 | |
319 | 1664 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("wizeyeC")); |
1665 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("wizeyeB")); | |
1666 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("wizeyeA")); | |
1667 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("torchC")); | |
1668 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("torchB")); | |
1669 pIconsFrameTable->InitializeAnimation(pIconsFrameTable->FindIcon("torchA")); | |
1670 | |
0 | 1671 pTextureIDs_pMapDirs[0] = pIcons_LOD->LoadTexture("MAPDIR8", TEXTURE_16BIT_PALETTE); |
1672 pTextureIDs_pMapDirs[1] = pIcons_LOD->LoadTexture("MAPDIR1", TEXTURE_16BIT_PALETTE); | |
1673 pTextureIDs_pMapDirs[2] = pIcons_LOD->LoadTexture("MAPDIR2", TEXTURE_16BIT_PALETTE); | |
1674 pTextureIDs_pMapDirs[3] = pIcons_LOD->LoadTexture("MAPDIR3", TEXTURE_16BIT_PALETTE); | |
1675 pTextureIDs_pMapDirs[4] = pIcons_LOD->LoadTexture("MAPDIR4", TEXTURE_16BIT_PALETTE); | |
1676 pTextureIDs_pMapDirs[5] = pIcons_LOD->LoadTexture("MAPDIR5", TEXTURE_16BIT_PALETTE); | |
1677 pTextureIDs_pMapDirs[6] = pIcons_LOD->LoadTexture("MAPDIR6", TEXTURE_16BIT_PALETTE); | |
1678 pTextureIDs_pMapDirs[7] = pIcons_LOD->LoadTexture("MAPDIR7", TEXTURE_16BIT_PALETTE); | |
319 | 1679 |
0 | 1680 uTextureID_BarBlue = pIcons_LOD->LoadTexture("ib-statB", TEXTURE_16BIT_PALETTE); |
1681 uTextureID_BarGreen = pIcons_LOD->LoadTexture("ib-statG", TEXTURE_16BIT_PALETTE); | |
1682 uTextureID_BarYellow = pIcons_LOD->LoadTexture("ib-statY", TEXTURE_16BIT_PALETTE); | |
1683 uTextureID_BarRed = pIcons_LOD->LoadTexture("ib-statR", TEXTURE_16BIT_PALETTE); | |
1684 uTextureID_mhp_bd = pIcons_LOD->LoadTexture("mhp_bg", TEXTURE_16BIT_PALETTE); | |
1685 uTextureID_mhp_capl = pIcons_LOD->LoadTexture("mhp_capl", TEXTURE_16BIT_PALETTE); | |
1686 uTextureID_mhp_capr = pIcons_LOD->LoadTexture("mhp_capr", TEXTURE_16BIT_PALETTE); | |
1687 uTextureID_mhp_grn = pIcons_LOD->LoadTexture("mhp_grn", TEXTURE_16BIT_PALETTE); | |
1688 uTextureID_mhp_red = pIcons_LOD->LoadTexture("mhp_red", TEXTURE_16BIT_PALETTE); | |
1689 uTextureID_mhp_yel = pIcons_LOD->LoadTexture("mhp_yel", TEXTURE_16BIT_PALETTE); | |
1690 uTextureID_Leather = pIcons_LOD->LoadTexture("LEATHER", TEXTURE_16BIT_PALETTE); | |
1691 pTexture_Leather = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("ibground", TEXTURE_16BIT_PALETTE)]; | |
1692 uTextureID_x_x_u = pIcons_LOD->LoadTexture("x_x_u", TEXTURE_16BIT_PALETTE); | |
1693 uTextureID_BUTTDESC2 = pIcons_LOD->LoadTexture("BUTTESC2", TEXTURE_16BIT_PALETTE); | |
1694 uTextureID_x_ok_u = pIcons_LOD->LoadTexture("x_ok_u", TEXTURE_16BIT_PALETTE); | |
1695 uTextureID_BUTTYES2 = pIcons_LOD->LoadTexture("BUTTYES2", TEXTURE_16BIT_PALETTE); | |
1696 uTextureID_BUTTMAKE = pIcons_LOD->LoadTexture("BUTTMAKE", TEXTURE_16BIT_PALETTE); | |
1697 uTextureID_BUTTMAKE2 = pIcons_LOD->LoadTexture("BUTTMAKE2", TEXTURE_16BIT_PALETTE); | |
1698 | |
1699 pPrimaryWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_MainMenu, 0, 0); | |
1700 pPrimaryWindow->CreateButton(7u, 8u, 0x1CCu, 0x157u, 1, 0, 0xAu, 0, 0, "", 0); | |
1701 pPrimaryWindow->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 1u, 0x31u, "", 0); | |
1702 pPrimaryWindow->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 2u, 0x32u, "", 0); | |
1703 pPrimaryWindow->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 3u, 0x33u, "", 0); | |
1704 pPrimaryWindow->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0x28u, 2, 94, 0x6Eu, 4u, 0x34u, "", 0); | |
1705 pPrimaryWindow->CreateButton(0x18u, 0x194u, 5u, 0x31u, 1, 93, 0, 1u, 0, "", 0); | |
1706 pPrimaryWindow->CreateButton(0x8Bu, 0x194u, 5u, 0x31u, 1, 93, 0, 2u, 0, "", 0); | |
1707 pPrimaryWindow->CreateButton(0xFFu, 0x194u, 5u, 0x31u, 1, 93, 0, 3u, 0, "", 0); | |
1708 pPrimaryWindow->CreateButton(0x172u, 0x194u, 5u, 0x31u, 1, 93, 0, 4u, 0, "", 0); | |
1709 pPrimaryWindow->CreateButton(0x61u, 0x194u, 5u, 0x31u, 1, 93, 0, 1u, 0, "", 0); | |
1710 pPrimaryWindow->CreateButton(0xD4u, 0x194u, 5u, 0x31u, 1, 93, 0, 2u, 0, "", 0); | |
1711 pPrimaryWindow->CreateButton(0x148u, 0x194u, 5u, 0x31u, 1, 93, 0, 3u, 0, "", 0); | |
1712 pPrimaryWindow->CreateButton(0x1BBu, 0x194u, 5u, 0x31u, 1, 93, 0, 4u, 0, "", 0); | |
319 | 1713 |
0 | 1714 uTextureID_ib_td1_A = pIcons_LOD->LoadTexture("ib-td1-A", TEXTURE_16BIT_PALETTE); |
1715 v6 = (Texture *)(uTextureID_ib_td1_A != -1 ? &pIcons_LOD->pTextures[uTextureID_ib_td1_A] : 0); | |
1716 v8 = pKeyActionMap->GetActionVKey(INPUT_Quest); | |
319 | 1717 pBtn_Quests = pPrimaryWindow->CreateButton(0x1EBu, 0x161u, v6->uTextureWidth, v6->uTextureHeight, 1, 0, 0xC8u, 0, v8, pGlobalTXT_LocalizationStrings[174], v6, 0); //Quests |
1718 | |
0 | 1719 uTextureID_ib_td2_A = pIcons_LOD->LoadTexture("ib-td2-A", TEXTURE_16BIT_PALETTE); |
1720 v10 = (Texture *)(uTextureID_ib_td2_A != -1 ? &pIcons_LOD->pTextures[uTextureID_ib_td2_A] : 0); | |
1721 v12 = pKeyActionMap->GetActionVKey(INPUT_Autonotes); | |
319 | 1722 pBtn_Autonotes = pPrimaryWindow->CreateButton(0x20Fu, 0x161u, v10->uTextureWidth, v10->uTextureHeight, 1, 0, 0xC9u, 0, v12, pGlobalTXT_LocalizationStrings[154], v10, 0);//Autonotes |
1723 | |
0 | 1724 v14 = pIcons_LOD->LoadTexture("ib-td3-A", TEXTURE_16BIT_PALETTE); |
319 | 1725 v15 = (Texture *)(v14 != -1 ? &pIcons_LOD->pTextures[v14] : 0); |
0 | 1726 v17 = pKeyActionMap->GetActionVKey(INPUT_Mapbook); |
319 | 1727 pBtn_Maps = pPrimaryWindow->CreateButton(0x222u, 0x161u, v15->uTextureWidth, v15->uTextureHeight, 1, 0, 0xCAu, 0, v17, pGlobalTXT_LocalizationStrings[139], v15, 0); //Maps |
1728 | |
0 | 1729 uTextureID_ib_td4_A = pIcons_LOD->LoadTexture("ib-td4-A", TEXTURE_16BIT_PALETTE); |
319 | 1730 v20 = (Texture *)(uTextureID_ib_td4_A != -1 ? &pIcons_LOD->pTextures[uTextureID_ib_td4_A] : 0); |
0 | 1731 v22 = pKeyActionMap->GetActionVKey(INPUT_TimeCal); |
17 | 1732 pBtn_Calendar = pPrimaryWindow->CreateButton(0x23Au, 0x161u, v20->uTextureWidth, v20->uTextureHeight, 1, 0, 0xCBu, 0, v22, |
1733 pGlobalTXT_LocalizationStrings[78],//Calendar | |
1734 v20, 0); | |
319 | 1735 |
0 | 1736 uTextureID_ib_td5_A = pIcons_LOD->LoadTexture("ib-td5-A", TEXTURE_16BIT_PALETTE); |
17 | 1737 pBtn_History = pPrimaryWindow->CreateButton(0x258u, 0x169u, |
0 | 1738 (uTextureID_ib_td5_A != -1 ? pIcons_LOD->pTextures[uTextureID_ib_td5_A].uTextureWidth : 24), |
1739 (uTextureID_ib_td5_A != -1 ? pIcons_LOD->pTextures[uTextureID_ib_td5_A].uTextureHeight : 26), | |
17 | 1740 1, 0, 0xE0u, 0, 0x48u, pGlobalTXT_LocalizationStrings[602],//History |
1741 (Texture *)(uTextureID_ib_td5_A != -1 ? &pIcons_LOD->pTextures[uTextureID_ib_td5_A] : 0), 0); | |
319 | 1742 |
0 | 1743 bFlashAutonotesBook = 0; |
1744 bFlashQuestBook = 0; | |
319 | 1745 bFlashHistoryBook = 0; |
1746 | |
1747 v24 = &pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn]; | |
0 | 1748 v28 = pKeyActionMap->GetActionVKey(INPUT_ZoomIn); |
358 | 1749 pBtn_ZoomIn = pPrimaryWindow->CreateButton(574, 136, v24->uTextureWidth, v24->uTextureHeight, 2, 0, 0x170u, 0, v28, pGlobalTXT_LocalizationStrings[252], // Zoom In |
1750 v24, 0); | |
319 | 1751 v29 = &pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut]; |
0 | 1752 v33 = pKeyActionMap->GetActionVKey(INPUT_ZoomOut); |
358 | 1753 pBtn_ZoomOut = pPrimaryWindow->CreateButton(519, 136, v29->uTextureWidth, v29->uTextureHeight, 2, 0, 0x16Fu, 0, v33, pGlobalTXT_LocalizationStrings[251], // Zoom Out |
1754 v29, 0); | |
0 | 1755 pPrimaryWindow->CreateButton(0x1E1u, 0, 0x99u, 0x43u, 1, 92, 0, 0, 0, "", 0); |
1756 pPrimaryWindow->CreateButton(0x1EBu, 0x95u, 0x40u, 0x4Au, 1, 0, 0x86u, 0, 0x35u, "", 0); | |
1757 pPrimaryWindow->CreateButton(0x231u, 0x95u, 0x40u, 0x4Au, 1, 0, 0x87u, 0, 0x36u, "", 0); | |
1758 pPrimaryWindow->CreateButton(0x1DCu, 0x142u, 0x4Du, 0x11u, 1, 100, 0, 0, 0, "", 0); | |
1759 pPrimaryWindow->CreateButton(0x22Bu, 0x142u, 0x4Du, 0x11u, 1, 101, 0, 0, 0, "", 0); | |
319 | 1760 pBtn_CastSpell = pPrimaryWindow->CreateButton(0x1DCu, 0x1C2u, |
1761 (uTextureID_Btn_CastSpell != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_CastSpell].uTextureWidth : 24), | |
1762 (uTextureID_Btn_CastSpell != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_CastSpell].uTextureHeight : 26), | |
358 | 1763 1, 0, 0x69u, 0, 0x43u, pGlobalTXT_LocalizationStrings[38], |
319 | 1764 (Texture *)(uTextureID_Btn_CastSpell != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_CastSpell] : 0), |
0 | 1765 0); |
319 | 1766 pBtn_Rest = pPrimaryWindow->CreateButton(0x206u, 0x1C2u, |
1767 (uTextureID_Btn_Rest != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_Rest].uTextureWidth : 24), | |
1768 (uTextureID_Btn_Rest != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_Rest].uTextureHeight : 26), | |
358 | 1769 1, 0, 0x68u, 0, 0x52u, pGlobalTXT_LocalizationStrings[182], |
1770 (Texture *)(uTextureID_Btn_Rest != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_Rest] : 0), 0); | |
319 | 1771 pBtn_QuickReference = pPrimaryWindow->CreateButton(0x230u, 0x1C2u, |
1772 (uTextureID_Btn_QuickReference != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_QuickReference].uTextureWidth : 24), | |
1773 (uTextureID_Btn_QuickReference != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_QuickReference].uTextureHeight : 26), | |
358 | 1774 1, 0, 0x6Au, 0, 0x5Au, pGlobalTXT_LocalizationStrings[173], |
1775 (Texture *)(uTextureID_Btn_QuickReference != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_QuickReference] : 0), 0); | |
319 | 1776 pBtn_GameSettings = pPrimaryWindow->CreateButton(0x25Au, 0x1C2u, |
1777 (uTextureID_Btn_GameSettings != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_GameSettings].uTextureWidth : 24), | |
1778 (uTextureID_Btn_GameSettings != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_GameSettings].uTextureHeight : 26), | |
358 | 1779 1, 0, 0x6Bu, 0, 0, pGlobalTXT_LocalizationStrings[93], |
1780 (Texture *)(uTextureID_Btn_GameSettings != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings] : 0), 0); | |
319 | 1781 pBtn_NPCLeft = pPrimaryWindow->CreateButton(0x1D5u, 0xB2u, |
1782 (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureWidth : 24), | |
1783 (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureHeight : 26), | |
358 | 1784 1, 0, 0xBCu, 0, 0, "", |
1785 (Texture *)(uTextureID_Btn_NPCLeft != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft] : 0), 0); | |
319 | 1786 pBtn_NPCRight = pPrimaryWindow->CreateButton(0x272u, 0xB2u, |
1787 (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureWidth : 24), | |
1788 (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureHeight : 26), | |
358 | 1789 1, 0, 0xBCu, 1u, 0, "", |
1790 (Texture *)(uTextureID_Btn_NPCRight != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCRight] : 0), 0); | |
0 | 1791 Load_isn_spells_21_27(); |
1792 } | |
1793 | |
1794 | |
1795 //----- (0041C047) -------------------------------------------------------- | |
1796 void __cdecl GameUI_DrawStatusBar_2() | |
1797 { | |
1798 unsigned int v0; // eax@1 | |
1799 char *v1; // edx@2 | |
1800 unsigned int v2; // ST18_4@5 | |
1801 const char *v3; // ST0C_4@5 | |
1802 unsigned int v4; // ST08_4@5 | |
1803 int v5; // eax@5 | |
1804 | |
1805 pRenderer->DrawTextureRGB(0, 352u, pTexture_StatusBar); | |
1806 if ( GameUI_StatusBar_TimedStringTimeLeft ) | |
1807 { | |
1808 v1 = GameUI_StatusBar_TimedString; | |
1809 } | |
1810 else | |
1811 { | |
1812 if ( !pStatusBarString[0] ) | |
1813 return; | |
1814 v1 = pStatusBarString; | |
1815 } | |
1816 LOWORD(v0) = uGameUIFontShadow; | |
1817 v2 = v0; | |
1818 LOWORD(v0) = uGameUIFontMain; | |
1819 v3 = v1; | |
1820 v4 = v0; | |
1821 v5 = pFontLucida->AlignText_Center(0x1C2u, v1); | |
1822 pPrimaryWindow->DrawText(pFontLucida, v5 + 11, 357, v4, v3, 0, 0, v2); | |
1823 } | |
1824 | |
1825 //----- (0041C0B8) -------------------------------------------------------- | |
1826 void __thiscall sub_41C0B8_set_status_string(const char *pStr) | |
1827 { | |
1828 const char *v1; // esi@1 | |
1829 int i; // eax@7 | |
1830 int j; // eax@11 | |
1831 | |
1832 v1 = pStr; | |
1833 if ( pStr && strcmp(pStr, "test") && !IsBadStringPtrA(v1, 1u) && (*v1 || GameUI_StatusBar_TimedStringTimeLeft) ) | |
1834 { | |
1835 if ( GameUI_StatusBar_TimedStringTimeLeft ) | |
1836 { | |
1837 for ( i = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString); | |
1838 i > 450; | |
1839 i = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString) ) | |
1840 byte_5C3427[strlen(GameUI_StatusBar_TimedString)] = 0; | |
1841 } | |
1842 else | |
1843 { | |
1844 strcpy(pStatusBarString, v1); | |
1845 for ( j = pFontLucida->GetLineWidth(pStatusBarString); | |
1846 j > 450; | |
1847 j = pFontLucida->GetLineWidth(pStatusBarString) ) | |
1848 GameUI_StatusBar_TimedString[strlen(pStatusBarString) + 199] = 0; | |
1849 } | |
1850 } | |
1851 } | |
1852 | |
1853 //----- (0041C179) -------------------------------------------------------- | |
1854 void __cdecl GameUI_DrawStatusBar() | |
1855 { | |
1856 unsigned int v0; // ebp@1 | |
1857 char *v1; // edi@5 | |
1858 int v2; // eax@5 | |
1859 unsigned int v3; // esi@5 | |
1860 size_t v4; // eax@6 | |
1861 GUIFont *v5; // ecx@6 | |
1862 int v6; // eax@9 | |
1863 size_t v7; // eax@10 | |
1864 GUIFont *v8; // ecx@10 | |
1865 char v9; // zf@12 | |
1866 unsigned int v10; // ST08_4@13 | |
1867 int v11; // eax@13 | |
1868 | |
1869 v0 = uGameUIFontShadow; | |
1870 if ( pStatusBarString[0] || GameUI_StatusBar_TimedStringTimeLeft || bForceDrawStatusBar ) | |
1871 { | |
1872 pRenderer->DrawTextureRGB(0, 352u, pTexture_StatusBar); | |
1873 if ( GameUI_StatusBar_TimedStringTimeLeft ) | |
1874 { | |
1875 v1 = GameUI_StatusBar_TimedString; | |
1876 v2 = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString); | |
1877 v3 = 450; | |
1878 while ( v2 > 450 ) | |
1879 { | |
1880 v4 = strlen(GameUI_StatusBar_TimedString); | |
1881 v5 = pFontLucida; | |
1882 byte_5C3427[v4] = 0; | |
1883 v2 = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString); | |
1884 } | |
1885 } | |
1886 else | |
1887 { | |
1888 v1 = pStatusBarString; | |
1889 v6 = pFontLucida->GetLineWidth(pStatusBarString); | |
1890 v3 = 450; | |
1891 while ( v6 > 450 ) | |
1892 { | |
1893 v7 = strlen(pStatusBarString); | |
1894 v8 = pFontLucida; | |
1895 GameUI_StatusBar_TimedString[v7 + 199] = 0; | |
1896 v6 = pFontLucida->GetLineWidth(pStatusBarString); | |
1897 } | |
1898 } | |
1899 v9 = *v1 == 0; | |
1900 bForceDrawStatusBar = 0; | |
1901 if ( !v9 ) | |
1902 { | |
1903 v10 = uGameUIFontMain; | |
1904 v11 = pFontLucida->AlignText_Center(v3, v1); | |
1905 pPrimaryWindow->DrawText(pFontLucida, v11 + 11, 357, v10, v1, 0, 0, v0); | |
1906 } | |
1907 } | |
1908 } | |
1909 // 5C35BC: using guessed type int bForceDrawStatusBar; | |
1910 | |
1911 | |
1912 //----- (0041CD4F) -------------------------------------------------------- | |
1913 bool __thiscall sub_41CD4F(unsigned int _this) | |
1914 { | |
1915 unsigned int v1; // edi@1 | |
1916 unsigned int v2; // eax@2 | |
1917 int v3; // esi@3 | |
1918 int v4; // ecx@10 | |
1919 GUIButton *v5; // eax@11 | |
1920 int v6; // edx@12 | |
1921 int v7; // ecx@20 | |
1922 char v8; // zf@21 | |
1923 GUIButton *v9; // ecx@24 | |
1924 int v10; // esi@24 | |
1925 int v11; // edx@26 | |
1926 int v12; // edx@28 | |
1927 int v13; // esi@32 | |
1928 GUIButton *v14; // eax@37 | |
1929 int v15; // edx@38 | |
1930 int v17; // ecx@50 | |
1931 int v18; // edx@50 | |
1932 GUIButton *v19; // ecx@54 | |
1933 int v20; // esi@54 | |
1934 int v21; // edx@56 | |
1935 int v22; // ecx@59 | |
1936 int v23; // edx@59 | |
1937 int v24; // ecx@60 | |
1938 int v25; // esi@63 | |
1939 unsigned int v26; // [sp+Ch] [bp-14h]@1 | |
1940 int v27; // [sp+10h] [bp-10h]@1 | |
1941 int v28; // [sp+14h] [bp-Ch]@10 | |
1942 int v29; // [sp+14h] [bp-Ch]@36 | |
1943 unsigned int uClickX; // [sp+18h] [bp-8h]@10 | |
1944 unsigned int uClickY; // [sp+1Ch] [bp-4h]@10 | |
1945 | |
1946 v1 = 0; | |
1947 v26 = _this; | |
1948 v27 = uNumVisibleWindows; | |
1949 if ( uNumVisibleWindows < 0 ) | |
1950 return 0; | |
1951 v2 = pMessageQueue_50CBD0->uNumMessages; | |
1952 while ( 1 ) | |
1953 { | |
1954 v3 = pVisibleWindowsIdxs[v27] - 1; | |
1955 if ( pWindowList[v3].field_44 == v1 ) | |
1956 goto LABEL_47; | |
1957 if ( v26 != 34 ) | |
1958 break; | |
1959 if ( pWindowList[v3].field_30 != v1 ) | |
1960 { | |
1961 pMouse->GetClickPos(&uClickX, &uClickY); | |
1962 v4 = pWindowList[v3].pStartingPosActiveItem; | |
1963 v29 = v4 + pWindowList[v3].pNumPresenceButton; | |
1964 if ( v4 < v4 + pWindowList[v3].pNumPresenceButton ) | |
1965 { | |
1966 while ( 1 ) | |
1967 { | |
1968 v14 = pWindowList[v3].pControlsHead; | |
1969 if ( v4 > 0 ) | |
1970 { | |
1971 v15 = v4; | |
1972 do | |
1973 { | |
1974 v14 = v14->pNext; | |
1975 --v15; | |
1976 } | |
1977 while ( v15 ); | |
1978 } | |
1979 if ( (signed int)uClickX >= (signed int)v14->uX | |
1980 && (signed int)uClickX <= (signed int)v14->uZ | |
1981 && (signed int)uClickY >= (signed int)v14->uY | |
1982 && (signed int)uClickY <= (signed int)v14->uW ) | |
1983 goto LABEL_66; | |
1984 ++v4; | |
1985 if ( v4 >= v29 ) | |
1986 { | |
1987 LABEL_45: | |
1988 v1 = 0; | |
1989 goto LABEL_46; | |
1990 } | |
1991 } | |
1992 } | |
1993 goto LABEL_46; | |
1994 } | |
1995 LABEL_47: | |
1996 --v27; | |
1997 if ( v27 < 0 ) | |
1998 return 0; | |
1999 } | |
2000 if ( v26 == 37 ) | |
2001 { | |
2002 v12 = pWindowList[v3].field_34; | |
2003 if ( pWindowList[v3].pCurrentPosActiveItem - pWindowList[v3].pStartingPosActiveItem - v12 >= 0 ) | |
2004 { | |
151 | 2005 v8 = pCurrentScreen == SCREEN_PARTY_CREATION; |
0 | 2006 pWindowList[v3].pCurrentPosActiveItem -= v12; |
2007 if ( v8 ) | |
2008 { | |
187 | 2009 pAudioPlayer->PlaySound(SOUND_Button, v1, v1, -1, v1, v1, v1, v1); |
0 | 2010 v2 = pMessageQueue_50CBD0->uNumMessages; |
2011 } | |
2012 } | |
2013 if ( pWindowList[v3].field_30 != v1 ) | |
2014 goto LABEL_47; | |
2015 v9 = pWindowList[v3].pControlsHead; | |
2016 v13 = pWindowList[v3].pCurrentPosActiveItem; | |
2017 if ( v13 > (signed int)v1 ) | |
2018 { | |
2019 do | |
2020 { | |
2021 v9 = v9->pNext; | |
2022 --v13; | |
2023 } | |
2024 while ( v13 ); | |
2025 } | |
2026 LABEL_26: | |
2027 v11 = v9->uControlParam; | |
2028 if ( (signed int)v2 < 40 ) | |
2029 { | |
2030 pMessageQueue_50CBD0->pMessages[v2].eType = (UIMessageType)v9->uControlID; | |
2031 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v11; | |
2032 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = v1; | |
2033 v2 = pMessageQueue_50CBD0->uNumMessages + 1; | |
2034 ++pMessageQueue_50CBD0->uNumMessages; | |
2035 } | |
2036 goto LABEL_47; | |
2037 } | |
2038 if ( v26 != 38 ) | |
2039 { | |
2040 if ( v26 == 39 ) | |
2041 { | |
2042 v7 = pWindowList[v3].pCurrentPosActiveItem + pWindowList[v3].field_34; | |
2043 if ( v7 < pWindowList[v3].pNumPresenceButton + pWindowList[v3].pStartingPosActiveItem ) | |
2044 { | |
151 | 2045 v8 = pCurrentScreen == SCREEN_PARTY_CREATION; |
0 | 2046 pWindowList[v3].pCurrentPosActiveItem = v7; |
2047 if ( v8 ) | |
2048 { | |
187 | 2049 pAudioPlayer->PlaySound(SOUND_Button, v1, v1, -1, v1, v1, v1, v1); |
0 | 2050 v2 = pMessageQueue_50CBD0->uNumMessages; |
2051 } | |
2052 } | |
2053 if ( pWindowList[v3].field_30 != v1 ) | |
2054 goto LABEL_47; | |
2055 v9 = pWindowList[v3].pControlsHead; | |
2056 v10 = pWindowList[v3].pCurrentPosActiveItem; | |
2057 if ( v10 > (signed int)v1 ) | |
2058 { | |
2059 do | |
2060 { | |
2061 v9 = v9->pNext; | |
2062 --v10; | |
2063 } | |
2064 while ( v10 ); | |
2065 } | |
2066 goto LABEL_26; | |
2067 } | |
2068 if ( v26 == 40 ) | |
2069 { | |
2070 v17 = pWindowList[v3].pStartingPosActiveItem; | |
2071 v18 = pWindowList[v3].pCurrentPosActiveItem; | |
2072 if ( v18 >= pWindowList[v3].pNumPresenceButton + v17 - 1 ) | |
2073 pWindowList[v3].pCurrentPosActiveItem = v17; | |
2074 else | |
2075 pWindowList[v3].pCurrentPosActiveItem = v18 + 1; | |
2076 if ( pWindowList[v3].field_30 != v1 ) | |
2077 return 1; | |
2078 v19 = pWindowList[v3].pControlsHead; | |
2079 v20 = pWindowList[v3].pCurrentPosActiveItem; | |
2080 if ( v20 > (signed int)v1 ) | |
2081 { | |
2082 do | |
2083 { | |
2084 v19 = v19->pNext; | |
2085 --v20; | |
2086 } | |
2087 while ( v20 ); | |
2088 } | |
2089 goto LABEL_56; | |
2090 } | |
2091 if ( v26 == 41 ) | |
2092 { | |
2093 pMouse->GetClickPos(&uClickX, &uClickY); | |
2094 v4 = pWindowList[v3].pStartingPosActiveItem; | |
2095 v28 = v4 + pWindowList[v3].pNumPresenceButton; | |
2096 if ( v4 < v4 + pWindowList[v3].pNumPresenceButton ) | |
2097 { | |
2098 while ( 1 ) | |
2099 { | |
2100 v5 = pWindowList[v3].pControlsHead; | |
2101 if ( v4 > 0 ) | |
2102 { | |
2103 v6 = v4; | |
2104 do | |
2105 { | |
2106 v5 = v5->pNext; | |
2107 --v6; | |
2108 } | |
2109 while ( v6 ); | |
2110 } | |
2111 if ( (signed int)uClickX >= (signed int)v5->uX | |
2112 && (signed int)uClickX <= (signed int)v5->uZ | |
2113 && (signed int)uClickY >= (signed int)v5->uY | |
2114 && (signed int)uClickY <= (signed int)v5->uW ) | |
2115 break; | |
2116 ++v4; | |
2117 if ( v4 >= v28 ) | |
2118 goto LABEL_45; | |
2119 } | |
2120 LABEL_66: | |
2121 pWindowList[v3].pCurrentPosActiveItem = v4; | |
2122 return 1; | |
2123 } | |
2124 LABEL_46: | |
2125 v2 = pMessageQueue_50CBD0->uNumMessages; | |
2126 goto LABEL_47; | |
2127 } | |
2128 goto LABEL_47; | |
2129 } | |
2130 v22 = pWindowList[v3].pCurrentPosActiveItem; | |
2131 v23 = pWindowList[v3].pStartingPosActiveItem; | |
2132 if ( v22 <= v23 ) | |
2133 v24 = pWindowList[v3].pNumPresenceButton + v23 - 1; | |
2134 else | |
2135 v24 = v22 - 1; | |
2136 v8 = pWindowList[v3].field_30 == v1; | |
2137 pWindowList[v3].pCurrentPosActiveItem = v24; | |
2138 if ( !v8 ) | |
2139 return 1; | |
2140 v19 = pWindowList[v3].pControlsHead; | |
2141 v25 = pWindowList[v3].pCurrentPosActiveItem; | |
2142 if ( v25 > (signed int)v1 ) | |
2143 { | |
2144 do | |
2145 { | |
2146 v19 = v19->pNext; | |
2147 --v25; | |
2148 } | |
2149 while ( v25 ); | |
2150 } | |
2151 LABEL_56: | |
2152 v21 = v19->uControlParam; | |
2153 if ( (signed int)v2 < 40 ) | |
2154 { | |
2155 pMessageQueue_50CBD0->pMessages[v2].eType = (UIMessageType)v19->uControlID; | |
2156 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v21; | |
2157 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = v1; | |
2158 ++pMessageQueue_50CBD0->uNumMessages; | |
2159 } | |
2160 return 1; | |
2161 } | |
2162 | |
2163 //----- (0041D20D) -------------------------------------------------------- | |
2164 char __fastcall sub_41D20D_buff_remaining_time_string(int ecx0, GUIWindow *edx0, __int64 a3, GUIFont *a2) | |
2165 { | |
2166 unsigned int v4; // edi@1 | |
2167 unsigned int v5; // esi@1 | |
2168 unsigned int v6; // ebp@1 | |
2169 unsigned int v7; // ebx@1 | |
2170 signed __int64 v8; // ST34_8@1 | |
2171 signed __int64 v9; // kr00_8@1 | |
2172 char *v10; // eax@2 | |
2173 char *v11; // eax@7 | |
2174 char *v12; // eax@13 | |
2175 char *v13; // eax@19 | |
2176 int uY; // [sp+0h] [bp-20h]@1 | |
2177 GUIWindow *a1; // [sp+4h] [bp-1Ch]@1 | |
2178 signed __int64 v17; // [sp+10h] [bp-10h]@1 | |
2179 signed __int64 v18; // [sp+18h] [bp-8h]@1 | |
2180 unsigned int v19; // [sp+24h] [bp+4h]@1 | |
2181 | |
2182 a1 = edx0; | |
2183 uY = ecx0; | |
2184 v4 = (unsigned __int64)(signed __int64)((double)a3 * 0.234375) >> 32; | |
2185 v5 = (signed __int64)((double)a3 * 0.234375); | |
2186 v6 = (unsigned __int64)((signed __int64)((double)a3 * 0.234375) / 60) >> 32; | |
2187 v7 = (signed __int64)((double)a3 * 0.234375) / 60; | |
2188 v8 = (signed __int64)((double)a3 * 0.234375) / 60 / 60; | |
2189 v19 = (unsigned int)v8 / 0x18; | |
2190 v18 = (signed __int64)__PAIR__(v4, v5) % 60; | |
2191 v17 = (signed __int64)__PAIR__(v6, v7) % 60; | |
2192 v9 = v8 % 24; | |
2193 strcpy(pTmpBuf, "\r020"); | |
2194 if ( (unsigned int)v8 / 0x18 ) | |
2195 { | |
2196 v10 = pGlobalTXT_LocalizationStrings[57]; // Days | |
2197 if ( v19 <= 1 ) | |
2198 v10 = pGlobalTXT_LocalizationStrings[56]; // Day | |
2199 sprintf(pTmpBuf2, "%d %s ", v19, v10); | |
2200 strcat(pTmpBuf, pTmpBuf2); | |
2201 } | |
2202 if ( v9 ) | |
2203 { | |
2204 if ( v9 <= 1 ) | |
2205 v11 = pGlobalTXT_LocalizationStrings[109];// Hour | |
2206 else | |
2207 v11 = pGlobalTXT_LocalizationStrings[110];// Hours | |
2208 sprintf(pTmpBuf2, "%d %s ", v9, v11); | |
2209 strcat(pTmpBuf, pTmpBuf2); | |
2210 } | |
2211 if ( v17 && !v19 ) | |
2212 { | |
2213 if ( v17 <= 1 ) | |
2214 v12 = pGlobalTXT_LocalizationStrings[437];// Minute | |
2215 else | |
2216 v12 = pGlobalTXT_LocalizationStrings[436];// Minutes | |
2217 sprintf(pTmpBuf2, "%d %s ", v17, v12); | |
2218 strcat(pTmpBuf, pTmpBuf2); | |
2219 } | |
2220 if ( v18 && !v9 ) | |
2221 { | |
2222 if ( v18 <= 1 ) | |
2223 v13 = pGlobalTXT_LocalizationStrings[439];// Second | |
2224 else | |
2225 v13 = pGlobalTXT_LocalizationStrings[438];// Seconds | |
2226 sprintf(pTmpBuf2, "%d %s ", v18, v13); | |
2227 strcat(pTmpBuf, pTmpBuf2); | |
2228 } | |
2229 return a1->DrawText(a2, 32, uY, 0, pTmpBuf, 0, 0, 0); | |
2230 } | |
2231 | |
2232 | |
2233 //----- (0041D895) -------------------------------------------------------- | |
315 | 2234 void GameUI_DrawItemInfo(ItemGen *ecx0) |
0 | 2235 { |
2236 ItemGen *v1; // esi@1 | |
2237 unsigned int v2; // eax@3 | |
315 | 2238 //char *v3; // edi@5 |
2239 //unsigned int v4; // eax@5 | |
2240 //unsigned int v5; // esi@5 | |
0 | 2241 signed int v6; // eax@5 |
2242 int v7; // edx@5 | |
2243 ItemGen *v8; // ecx@10 | |
315 | 2244 //unsigned int v9; // eax@12 |
0 | 2245 char v10; // zf@16 |
2246 ItemGen *v11; // eax@16 | |
2247 ItemGen *v12; // eax@25 | |
315 | 2248 //unsigned int v13; // ecx@32 |
2249 //unsigned int v14; // eax@32 | |
2250 //Render *v15; // edi@33 | |
0 | 2251 const char *v16; // eax@34 |
2252 int v17; // eax@36 | |
2253 int v18; // esi@37 | |
2254 unsigned __int16 v19; // ax@37 | |
315 | 2255 //char v20; // al@40 |
0 | 2256 char v21; // al@44 |
315 | 2257 //char v22; // al@48 |
2258 //char v23; // al@51 | |
0 | 2259 int v24; // eax@52 |
2260 int v25; // eax@57 | |
2261 int v26; // eax@60 | |
2262 int v27; // eax@67 | |
2263 const char *v28; // edi@69 | |
2264 int v29; // eax@70 | |
2265 char *v30; // edi@78 | |
2266 const char *v31; // eax@78 | |
2267 int v32; // ecx@81 | |
2268 unsigned int v33; // eax@81 | |
2269 int v34; // esi@81 | |
2270 const char *v35; // eax@85 | |
2271 const char *v36; // eax@87 | |
2272 unsigned int v37; // eax@109 | |
2273 unsigned int v38; // eax@109 | |
2274 int v39; // eax@113 | |
2275 GUIFont *v40; // edx@113 | |
2276 signed int v41; // [sp-20h] [bp-298h]@113 | |
2277 int v42; // [sp-1Ch] [bp-294h]@113 | |
315 | 2278 //char *v43; // [sp-18h] [bp-290h]@46 |
0 | 2279 unsigned int v44; // [sp-18h] [bp-290h]@113 |
315 | 2280 //int v45; // [sp-14h] [bp-28Ch]@46 |
0 | 2281 const char *v46; // [sp-14h] [bp-28Ch]@58 |
2282 char *v47; // [sp-14h] [bp-28Ch]@110 | |
315 | 2283 //char *v48; // [sp-10h] [bp-288h]@46 |
0 | 2284 const char *v49; // [sp-10h] [bp-288h]@56 |
2285 char *v50; // [sp-10h] [bp-288h]@58 | |
2286 int v51; // [sp-10h] [bp-288h]@110 | |
2287 const char *v52; // [sp-Ch] [bp-284h]@36 | |
315 | 2288 //int v53; // [sp-Ch] [bp-284h]@46 |
0 | 2289 char *v54; // [sp-Ch] [bp-284h]@56 |
2290 int v55; // [sp-Ch] [bp-284h]@58 | |
2291 int v56; // [sp-Ch] [bp-284h]@110 | |
2292 unsigned int v57; // [sp-8h] [bp-280h]@36 | |
315 | 2293 //int v58; // [sp-8h] [bp-280h]@46 |
0 | 2294 int v59; // [sp-8h] [bp-280h]@56 |
2295 int v60; // [sp-8h] [bp-280h]@58 | |
2296 unsigned int v61; // [sp-8h] [bp-280h]@110 | |
309 | 2297 char a1[300]; // [sp+8h] [bp-270h]@40 |
2298 //char Dest[100]; // [sp+6Ch] [bp-20Ch]@40 | |
2299 //char v64[100]; // [sp+D0h] [bp-1A8h]@40 | |
0 | 2300 char v65[120]; // [sp+134h] [bp-144h]@92 |
2301 char Source[40]; // [sp+1ACh] [bp-CCh]@49 | |
351 | 2302 stru351_summoned_item v67; |
2303 //int v67; // [sp+1D4h] [bp-A4h]@91 | |
2304 //int v68; // [sp+1D8h] [bp-A0h]@106 | |
2305 //int v69; // [sp+1DCh] [bp-9Ch]@101 | |
2306 //int v70; // [sp+1E0h] [bp-98h]@97 | |
2307 //int v71; // [sp+1E8h] [bp-90h]@93 | |
2308 //int v72; // [sp+1ECh] [bp-8Ch]@91 | |
0 | 2309 int var88; // [sp+1F0h] [bp-88h]@1 |
2310 Texture *v73; // [sp+1F4h] [bp-84h]@5 | |
315 | 2311 //unsigned int v75; // [sp+1F8h] [bp-80h]@5 |
2312 //char *v76; // [sp+1FCh] [bp-7Ch]@5 | |
0 | 2313 int v77; // [sp+200h] [bp-78h]@12 |
2314 int v78; // [sp+204h] [bp-74h]@5 | |
2315 GUIWindow v79; // [sp+208h] [bp-70h]@2 | |
2316 POINT a2; // [sp+25Ch] [bp-1Ch]@2 | |
2317 int v81; // [sp+264h] [bp-14h]@5 | |
2318 GUIFont *v82; // [sp+268h] [bp-10h]@1 | |
2319 char *v83; // [sp+26Ch] [bp-Ch]@18 | |
2320 char *Str; // [sp+270h] [bp-8h]@65 | |
2321 ItemGen *_this; // [sp+274h] [bp-4h]@1 | |
2322 | |
2323 v1 = ecx0; | |
2324 _this = ecx0; | |
2325 var88 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); | |
2326 v82 = pFontComic; | |
306 | 2327 if (!v1->uItemID) |
2328 return; | |
2329 | |
0 | 2330 v79.Hint = 0; |
2331 v79.uFrameWidth = 384; | |
2332 v79.uFrameHeight = 180; | |
2333 v79.uFrameY = 40; | |
2334 if ( pMouse->GetCursorPos(&a2)->x <= 320 ) | |
2335 v2 = pMouse->GetCursorPos(&a2)->x + 30; | |
2336 else | |
2337 v2 = pMouse->GetCursorPos(&a2)->x - v79.uFrameWidth - 30; | |
2338 v79.uFrameX = v2; | |
315 | 2339 auto item_desc = &pItemsTable->pItems[_this->uItemID]; |
2340 //v3 = (char *)&pItemsTable->pItems[_this->uItemID].pIconName; | |
2341 //v76 = v3; | |
2342 //v4 = pIcons_LOD->LoadTexture(pItemsTable->pItems[_this->uItemID].pIconName, TEXTURE_16BIT_PALETTE); | |
2343 //v5 = v4; | |
2344 //v4 *= 72; | |
2345 //v75 = v4; | |
2346 //v73 = &pIcons_LOD->pTextures[v4]; | |
2347 v73 = pIcons_LOD->LoadTexturePtr(item_desc->pIconName, TEXTURE_16BIT_PALETTE); | |
2348 v6 = 100 - v73->uTextureWidth; | |
0 | 2349 v7 = v73->uTextureHeight; |
2350 v78 = v6; | |
2351 v81 = 144 - v7; | |
2352 if ( v6 > 0 ) | |
2353 v78 = v6 >> 1; | |
2354 if ( v81 <= 0 ) | |
2355 v81 = 0; | |
2356 else | |
2357 v81 >>= 1; | |
2358 v8 = _this; | |
315 | 2359 if ( !item_desc->uItemID_Rep_St ) |
2360 _this->SetIdentified(); | |
2361 //v9 = v8->uAttributes; | |
0 | 2362 v77 = 0; |
315 | 2363 //a2.y = v8->uAttributes & 2; |
2364 if (pItemsTable->pItems[v8->uItemID].uEquipType == EQUIP_GOLD) | |
377 | 2365 v77 = v8->uSpecEnchantmentType; |
0 | 2366 if ( uActiveCharacter ) |
2367 { | |
315 | 2368 if (!v8->Identified()) |
0 | 2369 { |
2370 v10 = pPlayers[uActiveCharacter]->CanIdentify(_this) == 1; | |
2371 v11 = _this; | |
2372 if ( v10 ) | |
315 | 2373 _this->SetIdentified(); |
2374 v10 = !v11->Identified(); | |
0 | 2375 v83 = (char *)9; |
2376 if ( v10 ) | |
2377 { | |
2378 ShowStatusBarString(pGlobalTXT_LocalizationStrings[446], 2u); | |
2379 } | |
2380 else | |
2381 { | |
187 | 2382 v83 = (char *)SPEECH_8; |
0 | 2383 if ( _this->GetValue() < 100 * (pPlayers[uActiveCharacter]->uLevel + 5) ) |
187 | 2384 v83 = (char *)SPEECH_7; |
0 | 2385 } |
2386 if ( dword_4E455C ) | |
2387 { | |
187 | 2388 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)(int)v83, 0); |
0 | 2389 dword_4E455C = 0; |
2390 } | |
2391 } | |
2392 _this->UpdateTempBonus(pParty->uTimePlayed); | |
315 | 2393 if (v8->Broken()) |
0 | 2394 { |
2395 v10 = pPlayers[uActiveCharacter]->CanRepair(_this) == 1; | |
2396 v12 = _this; | |
2397 if ( v10 ) | |
2398 _this->uAttributes = _this->uAttributes & 0xFFFFFFFD | 1; | |
315 | 2399 v10 = !v12->Broken(); |
187 | 2400 v83 = (char *)SPEECH_11; |
0 | 2401 if ( v10 ) |
187 | 2402 v83 = (char *)SPEECH_10; |
0 | 2403 else |
2404 ShowStatusBarString(pGlobalTXT_LocalizationStrings[448], 2u); | |
2405 if ( dword_4E455C ) | |
2406 { | |
187 | 2407 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)(int)v83, 0); |
0 | 2408 dword_4E455C = 0; |
2409 } | |
2410 } | |
2411 } | |
315 | 2412 //v13 = _this->uAttributes; |
2413 //v14 = _this->Identified(); | |
2414 a2.y = _this->Identified(); | |
2415 if (_this->Broken()) | |
0 | 2416 { |
2417 v79.DrawMessageBox(0); | |
2418 //v15 = &; | |
315 | 2419 pRenderer->Clip(v79.uFrameX + 12, v79.uFrameY + 12, |
2420 v79.uFrameX + v79.uFrameWidth - 12, v79.uFrameY + v79.uFrameHeight - 12); | |
0 | 2421 v79.uFrameWidth -= 24; |
2422 v79.uFrameHeight -= 12; | |
2423 v79.uFrameZ = v79.uFrameX + v79.uFrameWidth - 1; | |
2424 v79.uFrameW = v79.uFrameY + v79.uFrameHeight - 1; | |
315 | 2425 pRenderer->DrawTransparentRedShade(v79.uFrameX + v78, v81 + v79.uFrameY + 30, v73); |
0 | 2426 if ( a2.y ) |
2427 v16 = _this->GetIdentifiedName(); | |
2428 else | |
315 | 2429 v16 = item_desc->pUnidentifiedName; |
0 | 2430 v79.DrawTitleText(pFontArrus, 0, 0xCu, var88, v16, 3u); |
2431 v17 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[32], &v79, 0, 0); | |
2432 v57 = 3; | |
2433 v52 = pGlobalTXT_LocalizationStrings[32]; | |
2434 goto LABEL_37; | |
2435 } | |
315 | 2436 if (!_this->Identified()) |
0 | 2437 { |
2438 v79.DrawMessageBox(0); | |
315 | 2439 //v15 = pRenderer; |
2440 pRenderer->Clip(v79.uFrameX + 12, v79.uFrameY + 12, | |
2441 v79.uFrameX + v79.uFrameWidth - 12, v79.uFrameY + v79.uFrameHeight - 12); | |
0 | 2442 v79.uFrameWidth -= 24; |
2443 v79.uFrameHeight -= 12; | |
2444 v79.uFrameZ = v79.uFrameX + v79.uFrameWidth - 1; | |
2445 v79.uFrameW = v79.uFrameY + v79.uFrameHeight - 1; | |
315 | 2446 pRenderer->DrawTextureTransparent(v79.uFrameX + v78, v81 + v79.uFrameY + 30, v73); |
2447 v79.DrawTitleText(pFontArrus, 0, 0xCu, var88, item_desc->pUnidentifiedName, 3u); | |
0 | 2448 v17 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[232], &v79, 0, 0); |
2449 v57 = 3; | |
2450 v52 = pGlobalTXT_LocalizationStrings[232]; | |
2451 LABEL_37: | |
2452 v18 = v17 >> 1; | |
2453 v19 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0x19u, 0x19u); | |
2454 v79.DrawTitleText(pFontArrus, 0x64u, ((signed int)v79.uFrameHeight >> 1) - v18, v19, v52, v57); | |
2455 goto LABEL_116; | |
2456 } | |
315 | 2457 |
2458 sprintfex(a1, pGlobalTXT_LocalizationStrings[463], item_desc->pUnidentifiedName); | |
2459 a1[100] = 0; | |
2460 a1[200] = 0; | |
2461 //v20 = item_desc->uEquipType; | |
2462 switch (item_desc->uEquipType) | |
2463 { | |
2464 case EQUIP_ONE_OR_TWO_HANDS: | |
2465 case EQUIP_TWO_HANDED: | |
2466 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); | |
2467 if (item_desc->uDamageMod) | |
0 | 2468 { |
315 | 2469 char mod[16]; |
2470 sprintf(mod, "+%d", (int)item_desc->uDamageMod); | |
2471 strcat(a1 + 100, mod); | |
2472 } | |
2473 break; | |
2474 | |
2475 case EQUIP_BOW: | |
2476 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); | |
2477 if (item_desc->uDamageMod) | |
2478 { | |
2479 char mod[16]; | |
2480 sprintf(mod, "+%d", (int)item_desc->uDamageMod); | |
2481 strcat(a1 + 100, mod); | |
0 | 2482 } |
315 | 2483 break; |
2484 | |
2485 case EQUIP_ARMOUR: | |
2486 case EQUIP_SHIELD: | |
2487 case EQUIP_HELMET: | |
2488 case EQUIP_BELT: | |
2489 case EQUIP_CLOAK: | |
2490 case EQUIP_GAUNTLETS: | |
2491 case EQUIP_BOOTS: | |
2492 case EQUIP_RING: | |
2493 case EQUIP_AMULET: | |
2494 if (item_desc->uDamageDice) | |
2495 sprintfex(a1 + 100, "%s: +%d", pGlobalTXT_LocalizationStrings[11], item_desc->uDamageDice + item_desc->uDamageMod); | |
2496 break; | |
2497 } | |
2498 | |
0 | 2499 if ( v77 ) |
2500 goto LABEL_65; | |
315 | 2501 //v23 = item_desc->uEquipType; |
2502 if (item_desc->uEquipType == 14) | |
0 | 2503 { |
377 | 2504 v24 = _this->uEncantmentType; |
0 | 2505 if ( v24 ) |
2506 goto LABEL_56; | |
2507 LABEL_65: | |
2508 v79.uFrameWidth -= 12; | |
2509 a2.y = 3; | |
2510 v79.uFrameZ = v79.uFrameX + v79.uFrameWidth - 1; | |
2511 v79.uFrameW = v79.uFrameY + v79.uFrameHeight - 1; | |
2512 Str = (char *)(3 * (LOBYTE(pFontArrus->uFontHeight) + 8)); | |
2513 v83 = a1; | |
2514 do | |
2515 { | |
2516 if ( *v83 ) | |
2517 { | |
2518 v27 = v82->CalcTextHeight(v83, &v79, 100, 0); | |
2519 Str += v27 + 3; | |
2520 } | |
2521 v83 += 100; | |
2522 --a2.y; | |
2523 } | |
2524 while ( a2.y ); | |
315 | 2525 v28 = item_desc->pDescription; |
0 | 2526 if ( *v28 ) |
2527 { | |
2528 v29 = pFontSmallnum->CalcTextHeight(v28, &v79, 100, 0); | |
2529 Str += v29; | |
2530 } | |
2531 v79.uFrameHeight = v73->uTextureHeight + v81 + 54; | |
2532 if ( (signed int)Str > (signed int)v79.uFrameHeight ) | |
2533 v79.uFrameHeight = (unsigned int)Str; | |
377 | 2534 if ( _this->uAttributes & 8 && (_this->uSpecEnchantmentType || _this->uEncantmentType) ) |
0 | 2535 v79.uFrameHeight += LOBYTE(v82->uFontHeight); |
2536 v83 = 0; | |
2537 if ( LOBYTE(pFontArrus->uFontHeight) ) | |
2538 { | |
2539 v79.uFrameWidth -= 24; | |
2540 v30 = (char *)LOBYTE(pFontArrus->uFontHeight); | |
2541 v31 = _this->GetIdentifiedName(); | |
2542 if ( pFontArrus->CalcTextHeight(v31, &v79, 0, 0) / (signed int)v30 ) | |
2543 v83 = v30; | |
2544 v79.uFrameWidth += 24; | |
2545 } | |
2546 v79.uFrameWidth += 12; | |
2547 v79.uFrameHeight += (unsigned int)v83; | |
2548 v79.uFrameW = v79.uFrameY + v79.uFrameHeight - 1; | |
2549 v79.uFrameZ = v79.uFrameX + v79.uFrameWidth - 1; | |
2550 v79.DrawMessageBox(0); | |
315 | 2551 //v15 = pRenderer; |
2552 pRenderer->Clip(v79.uFrameX + 12, v79.uFrameY + 12, | |
2553 v79.uFrameX + v79.uFrameWidth - 12, v79.uFrameY + v79.uFrameHeight - 12); | |
0 | 2554 v79.uFrameWidth -= 12; |
2555 v32 = v73->uTextureHeight; | |
2556 v33 = v79.uFrameHeight; | |
2557 v79.uFrameHeight -= 12; | |
2558 v79.uFrameZ = v79.uFrameX + v79.uFrameWidth - 1; | |
2559 v79.uFrameW = v79.uFrameY + v79.uFrameHeight - 1; | |
2560 pRenderer->DrawTextureTransparent( | |
2561 v79.uFrameX + v78, | |
2562 v79.uFrameY + (signed int)(v33 - v32) / 2, | |
315 | 2563 v73); |
0 | 2564 a2.y = 3; |
2565 v34 = (int)(v83 + 35); | |
2566 Str = a1; | |
2567 do | |
2568 { | |
2569 if ( *Str ) | |
2570 { | |
2571 v79.DrawText(v82, 100, v34, 0, Str, 0, 0, 0); | |
2572 v34 += v82->CalcTextHeight(Str, &v79, 100, 0) + 3; | |
2573 } | |
2574 Str += 100; | |
2575 --a2.y; | |
2576 } | |
2577 while ( a2.y ); | |
315 | 2578 v35 = item_desc->pDescription; |
0 | 2579 if ( *v35 ) |
2580 v79.DrawText(pFontSmallnum, 100, v34, 0, v35, 0, 0, 0); | |
2581 v79.uFrameX += 12; | |
2582 v79.uFrameWidth -= 24; | |
2583 v36 = _this->GetIdentifiedName(); | |
2584 v79.DrawTitleText(pFontArrus, 0, 0xCu, var88, v36, 3u); | |
2585 v79.uFrameWidth += 24; | |
2586 v79.uFrameX -= 12; | |
2587 if ( v77 ) | |
2588 { | |
2589 sprintf(pTmpBuf, "%s: %lu", pGlobalTXT_LocalizationStrings[465], v77); | |
2590 v40 = v82; | |
2591 v61 = 0; | |
2592 v56 = 0; | |
2593 v51 = 0; | |
2594 v47 = pTmpBuf; | |
2595 v44 = 0; | |
2596 v42 = v79.uFrameHeight - LOBYTE(v82->uFontHeight); | |
2597 v41 = 100; | |
2598 } | |
2599 else | |
2600 { | |
377 | 2601 if ( _this->uAttributes & 8 && (_this->uSpecEnchantmentType || _this->uEncantmentType) ) |
0 | 2602 { |
351 | 2603 sub_493F79(&v67, _this->uExpireTime - pParty->uTimePlayed); |
0 | 2604 strcpy(pTmpBuf, "Duration:"); |
352 | 2605 Str = (char *)(v67.field_18_expire_year - game_starting_year); |
351 | 2606 if (v67.field_18_expire_year != 1168 ) |
0 | 2607 { |
352 | 2608 sprintf(v65, " %d:yr", v67.field_18_expire_year - game_starting_year); |
0 | 2609 strcat(pTmpBuf, v65); |
2610 } | |
351 | 2611 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) |
2612 && ((sprintf(v65, " %d:dy", v67.field_C_expire_day), strcat(pTmpBuf, v65), v67.field_14_exprie_month) || Str || v67.field_C_expire_day) | |
2613 || v67.field_8_expire_hour) | |
2614 && ((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) | |
2615 || v67.field_4_expire_minute ) | |
0 | 2616 { |
351 | 2617 sprintf(v65, " %d:mn", v67.field_4_expire_minute); |
0 | 2618 strcat(pTmpBuf, v65); |
2619 } | |
2620 v79.DrawText(v82, 100, v79.uFrameHeight - 2 * LOBYTE(v82->uFontHeight), 0, pTmpBuf, 0, 0, 0); | |
2621 } | |
2622 v37 = _this->GetValue(); | |
2623 sprintf(pTmpBuf, "%s: %lu", pGlobalTXT_LocalizationStrings[465], v37); | |
2624 v79.DrawText(v82, 100, v79.uFrameHeight - LOBYTE(v82->uFontHeight), 0, pTmpBuf, 0, 0, 0); | |
2625 v38 = _this->uAttributes; | |
2626 if ( BYTE1(v38) & 1 ) | |
2627 { | |
2628 v61 = 0; | |
2629 v56 = 0; | |
2630 v51 = 0; | |
2631 v47 = pGlobalTXT_LocalizationStrings[187]; | |
2632 } | |
2633 else | |
2634 { | |
2635 if ( !(BYTE1(v38) & 2) ) | |
2636 goto LABEL_116; | |
2637 v61 = 0; | |
2638 v56 = 0; | |
2639 v51 = 0; | |
2640 v47 = pGlobalTXT_LocalizationStrings[651]; | |
2641 } | |
2642 LOWORD(v38) = LOWORD(pRenderer->uTargetRMask); | |
2643 v44 = v38; | |
2644 v42 = v79.uFrameHeight - LOBYTE(v82->uFontHeight); | |
2645 v39 = v82->GetLineWidth(pTmpBuf); | |
2646 v40 = v82; | |
2647 v41 = v39 + 132; | |
2648 } | |
2649 v79.DrawText(v40, v41, v42, v44, v47, v51, v56, v61); | |
2650 LABEL_116: | |
2651 pRenderer->ResetClip(); | |
2652 if ( !areWeLoadingTexture ) | |
2653 { | |
2654 v73->Release(); | |
2655 pIcons_LOD->_40F9C5(); | |
2656 } | |
2657 return; | |
2658 } | |
315 | 2659 if (item_desc->uEquipType == 13) |
0 | 2660 { |
2661 v24 = pItemsTable->pItems[_this->uItemID].uDamageDice; | |
2662 LABEL_56: | |
2663 v59 = v24; | |
2664 v54 = pGlobalTXT_LocalizationStrings[449]; | |
2665 v49 = "%s: %d"; | |
2666 LABEL_64: | |
315 | 2667 sprintf(a1 + 200, v49, v54, v59); |
0 | 2668 goto LABEL_65; |
2669 } | |
377 | 2670 v25 = _this->uEncantmentType; |
0 | 2671 if ( v25 ) |
2672 { | |
2673 v60 = _this->_bonus_strength; | |
2674 v55 = *((int *)&pItemsTable->pItems[799].uDamageMod + 5 * v25); | |
2675 v50 = pGlobalTXT_LocalizationStrings[210]; | |
2676 v46 = "%s: %s +%d"; | |
2677 } | |
2678 else | |
2679 { | |
377 | 2680 v26 = _this->uSpecEnchantmentType; |
0 | 2681 if ( !v26 ) |
2682 { | |
2683 if ( _this->uNumCharges ) | |
2684 { | |
2685 v59 = _this->uNumCharges; | |
2686 v54 = pGlobalTXT_LocalizationStrings[464]; | |
2687 v49 = "%s: %lu"; | |
2688 goto LABEL_64; | |
2689 } | |
2690 goto LABEL_65; | |
2691 } | |
2692 v60 = _this->_bonus_strength; | |
222 | 2693 v55 = *((int *)&pItemsTable->pEnchantments[23].pBonusStat + 7 * v26); |
0 | 2694 v50 = pGlobalTXT_LocalizationStrings[210]; |
2695 v46 = "%s: %s"; | |
2696 } | |
315 | 2697 sprintf(a1 + 200, v46, v50, v55, v60); |
0 | 2698 goto LABEL_65; |
2699 } | |
2700 // 4E455C: using guessed type int dword_4E455C; | |
2701 // 506128: using guessed type int areWeLoadingTexture; | |
2702 | |
2703 //----- (0041E360) -------------------------------------------------------- | |
2704 char *__fastcall MonsterPopup_Draw(unsigned int uActorID, GUIWindow *edx0) | |
2705 { | |
2706 unsigned int v2; // esi@1 | |
2707 Actor *v3; // esi@3 | |
2708 int v4; // eax@3 | |
2709 unsigned int v5; // ecx@3 | |
2710 NPCData *v6; // eax@3 | |
2711 unsigned __int16 v7; // cx@3 | |
2712 int v8; // eax@4 | |
2713 unsigned __int16 v9; // dx@4 | |
2714 SpriteFrame *v10; // edi@17 | |
243 | 2715 LODSprite *v11; // esi@17 |
0 | 2716 unsigned int v12; // ecx@17 |
2717 Sprite *v13; // edi@18 | |
2718 int v14; // ecx@18 | |
2719 int v15; // edx@18 | |
2720 int v16; // edx@18 | |
2721 int v17; // eax@18 | |
2722 unsigned int v18; // ecx@19 | |
2723 unsigned int v19; // eax@21 | |
2724 char *v20; // esi@28 | |
2725 int v21; // edx@29 | |
2726 unsigned __int16 *v22; // ecx@29 | |
2727 int v23; // eax@29 | |
2728 int v24; // eax@32 | |
2729 int v25; // esi@32 | |
2730 char *v26; // edx@34 | |
2731 unsigned __int8 v27; // sf@36 | |
2732 unsigned __int8 v28; // of@36 | |
2733 int v29; // esi@40 | |
2734 char *v30; // ecx@40 | |
2735 int v31; // eax@40 | |
2736 int v32; // esi@43 | |
2737 unsigned __int16 v33; // ax@45 | |
2738 int v34; // edx@45 | |
2739 int v35; // eax@45 | |
2740 int v36; // eax@49 | |
2741 char *v37; // eax@52 | |
2742 int v38; // eax@55 | |
2743 unsigned __int16 v39; // ax@59 | |
2744 SpellBuff *v40; // eax@60 | |
2745 int v41; // edi@61 | |
2746 unsigned int v42; // eax@61 | |
2747 int v43; // eax@62 | |
2748 int v44; // eax@63 | |
2749 signed int v45; // edi@65 | |
2750 unsigned __int16 v46; // ax@73 | |
2751 Player *v47; // ecx@77 | |
2752 unsigned int v48; // eax@85 | |
2753 GUIFont *v49; // edi@90 | |
2754 int v50; // edi@90 | |
2755 SpellBuff *v51; // eax@91 | |
2756 char *v52; // ecx@98 | |
2757 char *v53; // ecx@101 | |
2758 char *v54; // ST0C_4@118 | |
2759 unsigned int v55; // eax@118 | |
2760 GUIFont *v56; // edi@124 | |
2761 unsigned __int8 v57; // al@128 | |
2762 int v58; // eax@132 | |
2763 Actor *v59; // ecx@133 | |
2764 unsigned __int8 v60; // dl@138 | |
2765 char *v62; // eax@147 | |
2766 int v63; // eax@152 | |
2767 char *result; // eax@152 | |
2768 int v65; // eax@155 | |
2769 const char *v66; // [sp-10h] [bp-1FCh]@121 | |
2770 const char *v67; // [sp-10h] [bp-1FCh]@125 | |
2771 const char *v68; // [sp-10h] [bp-1FCh]@142 | |
2772 int v69; // [sp-Ch] [bp-1F8h]@121 | |
2773 char *v70; // [sp-Ch] [bp-1F8h]@125 | |
2774 char *v71; // [sp-Ch] [bp-1F8h]@142 | |
2775 char *v72; // [sp-8h] [bp-1F4h]@54 | |
2776 int v73; // [sp-8h] [bp-1F4h]@79 | |
2777 int v74; // [sp-8h] [bp-1F4h]@121 | |
2778 int v75; // [sp-8h] [bp-1F4h]@125 | |
2779 int v76; // [sp-8h] [bp-1F4h]@142 | |
2780 size_t v77; // [sp-4h] [bp-1F0h]@54 | |
2781 unsigned int v78; // [sp-4h] [bp-1F0h]@121 | |
2782 unsigned int v79; // [sp-4h] [bp-1F0h]@125 | |
2783 char *v80; // [sp-4h] [bp-1F0h]@142 | |
2784 char *v81; // [sp-4h] [bp-1F0h]@148 | |
2785 DDBLTFX Dst; // [sp+Ch] [bp-1E0h]@18 | |
2786 DDSURFACEDESC2 pDesc; // [sp+70h] [bp-17Ch]@18 | |
2787 RECT v84; // [sp+ECh] [bp-100h]@26 | |
241 | 2788 char *v85[10]; // [sp+FCh] [bp-F0h]@145 |
2789 char *v95[11]; // [sp+124h] [bp-C8h]@127 | |
0 | 2790 RenderBillboardTransform_local0 v106; // [sp+150h] [bp-9Ch]@3 |
2791 unsigned int v107; // [sp+1A0h] [bp-4Ch]@18 | |
2792 unsigned __int16 *v108; // [sp+1A4h] [bp-48h]@34 | |
2793 unsigned int v109; // [sp+1A8h] [bp-44h]@32 | |
2794 LPVOID v110; // [sp+1ACh] [bp-40h]@28 | |
2795 unsigned int v111; // [sp+1B0h] [bp-3Ch]@29 | |
2796 char **v112; // [sp+1B4h] [bp-38h]@3 | |
2797 IDirectDrawSurface *v222; // [sp+1B8h] [bp-34h]@18 | |
2798 unsigned __int8 v114; // [sp+1BFh] [bp-2Dh]@133 | |
2799 int v115; // [sp+1C0h] [bp-2Ch]@3 | |
2800 unsigned int v116; // [sp+1C4h] [bp-28h]@18 | |
2801 int i; // [sp+1C8h] [bp-24h]@18 | |
2802 Player *a2; // [sp+1CCh] [bp-20h]@28 | |
2803 int v119; // [sp+1D0h] [bp-1Ch]@18 | |
2804 SpellBuff *v120; // [sp+1D4h] [bp-18h]@18 | |
2805 Actor *v121; // [sp+1D8h] [bp-14h]@3 | |
2806 int a5; // [sp+1DCh] [bp-10h]@3 | |
2807 GUIWindow *a1; // [sp+1E0h] [bp-Ch]@1 | |
2808 int v124; // [sp+1E4h] [bp-8h]@18 | |
2809 char *a4; // [sp+1E8h] [bp-4h]@18 | |
2810 | |
2811 a1 = edx0; | |
2812 v2 = uActorID; | |
2813 | |
2814 static Actor pMonsterInfoUI_Doll; | |
2815 /*if ( !(bMonsterInfoUI_bDollInitialized & 1) ) | |
2816 { | |
2817 bMonsterInfoUI_bDollInitialized |= 1u; | |
2818 Actor::Actor(&pMonsterInfoUI_Doll); | |
2819 atexit(nullsub_3); | |
2820 }*/ | |
2821 v106.uParentBillboardID = -1; | |
2822 v3 = &pActors[v2]; | |
2823 v121 = v3; | |
2824 v4 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xFFu, 0x9Bu); | |
2825 v5 = v3->uNPC_ID; | |
2826 a5 = v4; | |
2827 v6 = GetNPCData(v5); | |
2828 v7 = v3->pMonsterInfo.uID; | |
2829 v112 = (char **)v6; | |
2830 v115 = byte_4E2B70[((signed __int16)v7 - 1) / 3] - 40; | |
2831 if ( v7 == pMonsterInfoUI_Doll.pMonsterInfo.uID ) | |
2832 { | |
2833 v9 = pMonsterInfoUI_Doll.uCurrentActionLength; | |
2834 } | |
2835 else | |
2836 { | |
2837 memcpy(&pMonsterInfoUI_Doll, v3, sizeof(pMonsterInfoUI_Doll)); | |
305 | 2838 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Bored; |
0 | 2839 pMonsterInfoUI_Doll.uCurrentActionTime = 0; |
2840 v8 = rand(); | |
2841 v3 = v121; | |
2842 v9 = v8 % 256 + 128; | |
2843 pMonsterInfoUI_Doll.uCurrentActionLength = v8 % 256 + 128; | |
2844 } | |
2845 if ( (signed int)pMonsterInfoUI_Doll.uCurrentActionTime > (signed __int16)v9 ) | |
2846 { | |
2847 pMonsterInfoUI_Doll.uCurrentActionTime = 0; | |
305 | 2848 if ( pMonsterInfoUI_Doll.uCurrentActionAnimation == ANIM_Bored || pMonsterInfoUI_Doll.uCurrentActionAnimation == ANIM_AtkMelee) |
2849 { | |
2850 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Standing; | |
0 | 2851 pMonsterInfoUI_Doll.uCurrentActionLength = rand() % 128 + 128; |
2852 } | |
2853 else | |
2854 { | |
2855 rand(); | |
305 | 2856 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Bored; |
0 | 2857 if ( (pMonsterInfoUI_Doll.pMonsterInfo.uID < 115 || pMonsterInfoUI_Doll.pMonsterInfo.uID > 186) |
2858 && (pMonsterInfoUI_Doll.pMonsterInfo.uID < 232 || pMonsterInfoUI_Doll.pMonsterInfo.uID > 249) | |
2859 && rand() % 30 < 100 ) | |
305 | 2860 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_AtkMelee; |
2861 pMonsterInfoUI_Doll.uCurrentActionLength = 8 * pSpriteFrameTable->pSpriteSFrames[v3->pSpriteIDs[(signed __int16)pMonsterInfoUI_Doll.uCurrentActionAnimation]].uAnimLength; | |
2862 } | |
2863 } | |
2864 v10 = pSpriteFrameTable->GetFrame( v3->pSpriteIDs[(signed __int16)pMonsterInfoUI_Doll.uCurrentActionAnimation], pMonsterInfoUI_Doll.uCurrentActionTime); | |
2865 v11 = &pSprites_LOD->pSpriteHeaders[v10->pHwSpriteIDs[0]];//40 * v10->pHwSpriteIDs[0] + 7218180; | |
0 | 2866 v106.pTarget = pRenderer->pTargetSurface; |
2867 v106.pTargetZ = pRenderer->pActiveZBuffer; | |
2868 v106.uTargetPitch = pRenderer->uTargetSurfacePitch; | |
2869 v12 = a1->uFrameY + 52; | |
2870 v106.uViewportX = a1->uFrameX + 13; | |
2871 v106.uViewportY = v12; | |
2872 v106.uViewportW = v12 + 128; | |
2873 v106.uViewportZ = v106.uViewportX + 128; | |
2874 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
|
2875 v106._screenspace_x_scaler_packedfloat = 65536; |
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
141
diff
changeset
|
2876 v106._screenspace_y_scaler_packedfloat = 65536; |
243 | 2877 v106.uScreenSpaceY = v115 + v12 + v11->uHeight; |
0 | 2878 v106.pPalette = PaletteManager::Get_Dark_or_Red_LUT(v10->uPaletteIndex, 0, 1); |
2879 v106.sZValue = 0; | |
2880 v106.uFlags = 0; | |
2881 pRenderer->Clip_v2(0, 0, 0x27Fu, 0x1DFu); | |
2882 pRenderer->Line2D(v106.uViewportX - 1, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportY - 1, a5); | |
365 | 2883 pRenderer->Line2D( v106.uViewportX + 129, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportW + 1, a5); |
0 | 2884 pRenderer->Line2D(v106.uViewportX + 129, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportW + 1, a5); |
2885 pRenderer->Line2D(v106.uViewportX - 1, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportY - 1, a5); | |
2886 if ( pRenderer->pRenderD3D ) | |
2887 { | |
2888 v13 = &pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]]; | |
2889 v106.uScreenSpaceY = v115 + v106.uViewportY + v13->uBufferHeight; | |
2890 v222 = (IDirectDrawSurface *)v13->pTextureSurface; | |
2891 memset(&Dst, 0, 0x64u); | |
2892 Dst.dwSize = 100; | |
2893 Dst.dwFillColor = 0; | |
2894 memset(&pDesc, 0, 0x7Cu); | |
2895 pDesc.dwSize = 124; | |
2896 v222->GetSurfaceDesc((LPDDSURFACEDESC)&pDesc); | |
2897 v14 = v13->uBufferHeight; | |
2898 v120 = (SpellBuff *)v13->uBufferWidth; | |
2899 v107 = 0; | |
2900 v15 = v13->uAreaX; | |
2901 v119 = (signed int)v120 / 2; | |
2902 i = 0; | |
2903 a4 = (char *)(v106.uScreenSpaceX + v15 - (signed int)v120 / 2); | |
2904 v115 = v13->uAreaY; | |
2905 v16 = v13->uAreaWidth + (signed int)v120 / 2 + v15 - (int)v120; | |
2906 v124 = v106.uScreenSpaceY + v115 - v14; | |
2907 v17 = v13->uAreaHeight + v115 - v14; | |
2908 v116 = v106.uScreenSpaceX + v16; | |
2909 v119 = v106.uScreenSpaceY + v17; | |
2910 if ( (signed int)a4 < (signed int)v106.uViewportX ) | |
2911 { | |
2912 v18 = v106.uViewportX - (int)a4; | |
2913 a4 = (char *)v106.uViewportX; | |
2914 v107 = v18; | |
2915 } | |
2916 if ( v124 < (signed int)v106.uViewportY ) | |
2917 { | |
2918 v19 = v106.uViewportY - v124; | |
2919 v124 = v106.uViewportY; | |
2920 i = v19; | |
2921 } | |
2922 if ( (signed int)v116 > (signed int)v106.uViewportZ ) | |
2923 v116 = v106.uViewportZ; | |
2924 if ( v119 > (signed int)v106.uViewportW ) | |
2925 v119 = v106.uViewportW; | |
2926 pRenderer->FillRectFast( | |
2927 v106.uViewportX, | |
2928 v106.uViewportY, | |
2929 v106.uViewportZ - v106.uViewportX, | |
2930 v106.uViewportW - v106.uViewportY, | |
2931 pRenderer->uTargetBMask | pRenderer->uTargetGMask); | |
2932 pRenderer->FillRectFast( | |
2933 v106.uViewportX, | |
2934 v106.uViewportY, | |
2935 v106.uViewportZ - v106.uViewportX, | |
2936 v106.uViewportW - v106.uViewportY, | |
2937 pRenderer->uTargetBMask | pRenderer->uTargetGMask); | |
2938 v84.left = v106.uViewportX; | |
2939 v84.top = v106.uViewportY; | |
2940 v84.right = v106.uViewportZ; | |
2941 v84.bottom = v106.uViewportW; | |
2942 ErrD3D(pRenderer->pBackBuffer4->Blt(&v84, 0, 0, 16778240u, &Dst)); | |
2943 if ( pRenderer->uTargetGBits == 5 ) | |
2944 { | |
2945 memset(&pDesc, 0, 0x7Cu); | |
2946 pDesc.dwSize = 124; | |
242 | 2947 if ( pRenderer->LockSurface_DDraw4((IDirectDrawSurface4 *)v222, &pDesc, DDLOCK_WAIT)) |
2948 { | |
2949 v20 = (char *)v124; | |
2950 v110 = pDesc.lpSurface; | |
2951 a2 = (Player *)v124; | |
2952 if ( v124 < v119 ) | |
2953 { | |
2954 v111 = 2 * pRenderer->uTargetSurfacePitch; | |
2955 v21 = (int)a4; | |
2956 v22 = &pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]]; | |
2957 v23 = i - v124; | |
2958 v120 = (SpellBuff *)&pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]]; | |
2959 v115 = i - v124; | |
2960 while ( 1 ) | |
2961 { | |
2962 v124 = v21; | |
2963 if ( v21 < (signed int)v116 ) | |
2964 { | |
2965 v24 = (int)&v20[v23]; | |
2966 v25 = v107 - v21; | |
2967 v109 = v24; | |
2968 for ( i = v107 - v21; ; v25 = i ) | |
2969 { | |
2970 v108 = (unsigned __int16 *)((pDesc.lPitch >> 1) * pDesc.dwHeight * v109 / v13->uAreaHeight); | |
2971 v26 = (char *)v108 + pDesc.dwWidth * (v25 + v124++) / v13->uAreaWidth; | |
2972 *v22 = *((short *)v110 + (int)v26); | |
2973 ++v22; | |
2974 if ( v124 >= (signed int)v116 ) | |
2975 break; | |
2976 } | |
2977 v23 = v115; | |
2978 } | |
2979 v22 = (unsigned __int16 *)((char *)v120 + v111); | |
2980 v20 = (char *)&a2->pConditions[0] + 1; | |
2981 v28 = __OFSUB__((int)&a2->pConditions[0] + 1, v119); | |
2982 v27 = (signed int)((char *)&a2->pConditions[0] + -v119 + 1) < 0; | |
2983 a2 = (Player *)((char *)a2 + 1); | |
2984 v120 = (SpellBuff *)((char *)v120 + v111); | |
2985 if ( !(v27 ^ v28) ) | |
2986 break; | |
2987 v21 = (int)a4; | |
2988 } | |
2989 } | |
2990 v222->Unlock(0); | |
2991 } | |
2992 } | |
2993 else | |
2994 { | |
2995 memset(&pDesc, 0, 0x7Cu); | |
2996 pDesc.dwSize = 124; | |
2997 if ( pRenderer->LockSurface_DDraw4((IDirectDrawSurface4 *)v222, &pDesc, DDLOCK_WAIT) ) | |
2998 { | |
2999 v108 = (unsigned __int16 *)pDesc.lpSurface; | |
3000 a2 = (Player *)v124; | |
306 | 3001 if ( v124 < v119 ) |
242 | 3002 { |
3003 v109 = 2 * pRenderer->uTargetSurfacePitch; | |
3004 v29 = (int)a4; | |
3005 v30 = (char *)&pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]]; | |
3006 v31 = i - v124; | |
3007 v120 = (SpellBuff *)&pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]]; | |
3008 v115 = i - v124; | |
3009 while ( 1 ) | |
3010 { | |
3011 v124 = v29; | |
3012 if ( v29 < (signed int)v116 ) | |
3013 { | |
3014 v32 = v107 - (int)a4; | |
3015 v111 = (unsigned int)((char *)a2 + v31); | |
3016 for ( i = v107 - (int)a4; ; v32 = i ) | |
3017 { | |
3018 v110 = (LPVOID)((pDesc.lPitch >> 1) * pDesc.dwHeight * v111 / v13->uAreaHeight); | |
3019 v33 = v108[(int)((char *)v110 + pDesc.dwWidth * (v32 + v124) / v13->uAreaWidth)]; | |
3020 v34 = v33 & 0x1F | 2 | |
3021 * (unsigned __int16)(v108[(int)((char *)v110 | |
3022 + pDesc.dwWidth * (v32 + v124++) / v13->uAreaWidth)] & 0xFFE0); | |
3023 v35 = v124; | |
3024 *(short *)v30 = v34; | |
3025 v30 += 2; | |
3026 if ( v35 >= (signed int)v116 ) | |
3027 break; | |
3028 } | |
3029 v31 = v115; | |
3030 } | |
3031 a2 = (Player *)((char *)a2 + 1); | |
3032 v30 = (char *)v120 + v109; | |
3033 v120 = (SpellBuff *)((char *)v120 + v109); | |
3034 if ( (signed int)a2 >= v119 ) | |
3035 break; | |
3036 v29 = (int)a4; | |
3037 } | |
3038 } | |
3039 v222->Unlock(0); | |
3040 } | |
3041 } | |
0 | 3042 } |
3043 else | |
3044 { | |
3045 pRenderer->FillRectFast( | |
3046 v106.uViewportX, | |
3047 v106.uViewportY, | |
3048 v106.uViewportZ - v106.uViewportX, | |
3049 v106.uViewportW - v106.uViewportY, | |
3050 0); | |
3051 v36 = v10->pHwSpriteIDs[0]; | |
3052 if ( v36 >= 0 ) | |
3053 pSprites_LOD->pSpriteHeaders[v36]._4ACC38(&v106, 0); | |
3054 } | |
3055 if ( v121->uNPC_ID ) | |
3056 { | |
3057 v37 = v112[6]; | |
3058 if ( v37 ) | |
3059 { | |
264 | 3060 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[429], *v112, aNPCProfessionNames[(signed int)v37]); |
242 | 3061 } |
3062 else | |
3063 { | |
3064 v77 = 2000; | |
3065 v72 = *v112; | |
3066 } | |
0 | 3067 } |
3068 else | |
3069 { | |
3070 v38 = v121->dword_000334_unique_name; | |
3071 v77 = 2000; | |
3072 if ( v38 ) | |
237 | 3073 v72 = pMonsterStats->pPlaceStrings[v38]; |
0 | 3074 else |
3075 v72 = pMonsterStats->pInfos[v121->pMonsterInfo.uID].pName; | |
3076 } | |
242 | 3077 if(!v121->uNPC_ID || (v121->uNPC_ID && !v37)) |
3078 strncpy(pTmpBuf, v72, v77); | |
0 | 3079 v39 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); |
3080 a1->DrawTitleText(pFontComic, 0, 0xCu, v39, pTmpBuf, 3u); | |
3081 Actor::DrawHealthBar(v121, a1); | |
3082 v119 = 0; | |
3083 pMonsterInfoUI_Doll.uCurrentActionTime += pMiscTimer->uTimeElapsed; | |
3084 v115 = 0; | |
3085 v116 = 0; | |
3086 i = 0; | |
3087 v112 = 0; | |
3088 if ( !uActiveCharacter ) | |
3089 { | |
3090 v45 = 1; | |
242 | 3091 } |
3092 else | |
3093 { | |
3094 LOBYTE(v40) = pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID); | |
3095 v120 = v40; | |
3096 if ( !v40 ) | |
3097 v45 = 1; | |
3098 else | |
3099 { | |
3100 v41 = (unsigned __int8)v40 & 0x3F; | |
3101 v42 = SkillToMastery((unsigned __int16)v40) - 1; | |
3102 if ( !v42 ) | |
3103 { | |
3104 if ( v41 + 10 >= v121->pMonsterInfo.uLevel ) | |
3105 { | |
3106 v45 = 1; | |
3107 v119 = 1; | |
3108 } | |
3109 else | |
3110 v45 = 1; | |
3111 } | |
3112 else | |
3113 { | |
3114 v43 = v42 - 1; | |
3115 if ( !v43 ) | |
3116 { | |
3117 if ( 2 * v41 + 10 >= v121->pMonsterInfo.uLevel ) | |
3118 { | |
3119 v45 = 1; | |
3120 v119 = 1; | |
3121 v116 = 1; | |
3122 } | |
3123 else | |
3124 v45 = 1; | |
3125 } | |
3126 else | |
3127 { | |
3128 v44 = v43 - 1; | |
3129 if ( !v44 ) | |
3130 { | |
3131 if ( 3 * v41 + 10 >= v121->pMonsterInfo.uLevel ) | |
3132 { | |
3133 v45 = 1; | |
3134 v119 = 1; | |
3135 v116 = 1; | |
3136 i = 1; | |
3137 } | |
3138 else | |
3139 { | |
3140 v45 = 1; | |
3141 } | |
3142 } | |
3143 else | |
3144 { | |
3145 if ( v44 != 1 ) | |
3146 v45 = 1; | |
3147 else | |
3148 { | |
3149 v45 = 1; | |
3150 v119 = 1; | |
3151 v116 = 1; | |
3152 i = 1; | |
3153 v112 = (char **)1; | |
3154 } | |
3155 } | |
3156 } | |
3157 } | |
3158 } | |
3159 // LABEL_73: | |
3160 v46 = v121->uAIState; | |
3161 if ( v46 != 5 && v46 != 4 && !dword_507BF0_is_there_popup_onscreen && v120 ) | |
3162 { | |
3163 v47 = pPlayers[uActiveCharacter]; | |
3164 if ( v119 | v116 | i | (unsigned int)v112 ) | |
3165 { | |
3166 if ( v121->pMonsterInfo.uLevel >= v47->uLevel - 5 ) | |
3167 v73 = SPEECH_105; | |
3168 else | |
3169 v73 = SPEECH_104; | |
3170 } | |
3171 else | |
3172 { | |
3173 v73 = SPEECH_106; | |
3174 } | |
3175 v47->PlaySound((PlayerSpeech)v73, 0); | |
3176 } | |
3177 } | |
0 | 3178 a2 = pParty->pPlayers; |
3179 do | |
3180 { | |
3181 LOBYTE(v48) = a2->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID); | |
3182 v111 = v48; | |
3183 v120 = (SpellBuff *)138; | |
3184 do | |
3185 { | |
3186 if ( (signed int)SkillToMastery(v111) >= 3 ) | |
3187 v115 = v45; | |
3188 v120 = (SpellBuff *)((char *)v120 - 1); | |
3189 } | |
3190 while ( v120 ); | |
3191 ++a2; | |
3192 } | |
3193 while ( (signed int)a2 < (signed int)pParty->pHirelings ); | |
3194 v49 = pFontSmallnum; | |
3195 a2 = (Player *)pFontSmallnum; | |
3196 a1->DrawText(pFontSmallnum, 12, 196, a5, pGlobalTXT_LocalizationStrings[631], 0, 0, 0); | |
3197 v50 = LOBYTE(v49->uFontHeight) + 193; | |
3198 if ( !v115 ) | |
3199 { | |
3200 v78 = 0; | |
3201 v74 = 0; | |
3202 v69 = 0; | |
3203 v66 = pGlobalTXT_LocalizationStrings[630]; | |
3204 goto LABEL_123; | |
3205 } | |
3206 a4 = 0; | |
3207 v51 = &v121->pActorBuffs[1]; | |
3208 v222 = 0; | |
3209 v120 = &v121->pActorBuffs[1]; | |
3210 do | |
3211 { | |
3212 if ( (signed __int64)v51->uExpireTime > 0 ) | |
3213 { | |
3214 switch ( (int)v51 ) | |
3215 { | |
3216 case 0u: | |
3217 v124 = 60; | |
3218 a4 = pGlobalTXT_LocalizationStrings[591]; | |
3219 break; | |
3220 case 1u: | |
3221 v124 = 82; | |
3222 a4 = pGlobalTXT_LocalizationStrings[649]; | |
3223 break; | |
3224 case 2u: | |
3225 v124 = 92; | |
3226 a4 = pGlobalTXT_LocalizationStrings[592]; | |
3227 break; | |
3228 case 3u: | |
3229 v124 = 63; | |
3230 a4 = pGlobalTXT_LocalizationStrings[4]; | |
3231 break; | |
3232 case 4u: | |
3233 v52 = pGlobalTXT_LocalizationStrings[220]; | |
3234 goto LABEL_100; | |
3235 case 5u: | |
3236 v52 = pGlobalTXT_LocalizationStrings[162]; | |
3237 LABEL_100: | |
3238 a4 = v52; | |
3239 v124 = 81; | |
3240 break; | |
3241 case 6u: | |
3242 v53 = pGlobalTXT_LocalizationStrings[593]; | |
3243 v124 = 35; | |
3244 goto LABEL_103; | |
3245 case 8u: | |
3246 v53 = pGlobalTXT_LocalizationStrings[608]; | |
3247 v124 = 62; | |
3248 LABEL_103: | |
3249 a4 = v53; | |
3250 break; | |
3251 case 7u: | |
3252 case 9u: | |
3253 a4 = 0; | |
3254 v124 = 0; | |
3255 goto LABEL_119; | |
3256 case 0xAu: | |
3257 v124 = 47; | |
3258 a4 = pGlobalTXT_LocalizationStrings[221]; | |
3259 break; | |
3260 case 0xBu: | |
3261 v124 = 66; | |
3262 a4 = pGlobalTXT_LocalizationStrings[607]; | |
3263 break; | |
3264 case 0xCu: | |
3265 v124 = 85; | |
3266 a4 = pGlobalTXT_LocalizationStrings[610]; | |
3267 break; | |
3268 case 0xDu: | |
3269 v124 = 86; | |
3270 a4 = pGlobalTXT_LocalizationStrings[609]; | |
3271 break; | |
3272 case 0xEu: | |
3273 v124 = 17; | |
3274 a4 = pGlobalTXT_LocalizationStrings[279]; | |
3275 break; | |
3276 case 0xFu: | |
3277 v124 = 38; | |
3278 a4 = pGlobalTXT_LocalizationStrings[442]; | |
3279 break; | |
3280 case 0x10u: | |
3281 v124 = 46; | |
3282 a4 = pGlobalTXT_LocalizationStrings[443]; | |
3283 break; | |
3284 case 0x11u: | |
3285 v124 = 51; | |
3286 a4 = pGlobalTXT_LocalizationStrings[440]; | |
3287 break; | |
3288 case 0x12u: | |
3289 v124 = 5; | |
3290 a4 = pGlobalTXT_LocalizationStrings[441]; | |
3291 break; | |
3292 case 0x13u: | |
3293 v124 = 95; | |
3294 a4 = pGlobalTXT_LocalizationStrings[229]; | |
3295 break; | |
3296 case 0x14u: | |
3297 v124 = 73; | |
3298 a4 = pGlobalTXT_LocalizationStrings[228]; | |
3299 break; | |
3300 default: | |
3301 a4 = 0; | |
3302 break; | |
3303 } | |
3304 if ( a4 ) | |
3305 { | |
3306 v54 = a4; | |
3307 v55 = GetSpellColor(v124); | |
3308 a1->DrawText((GUIFont *)a2, 28, v50, v55, v54, 0, 0, 0); | |
3309 v50 = v50 + BYTE5(a2->pConditions[0]) - 3; | |
3310 v51 = v120; | |
3311 } | |
3312 } | |
3313 LABEL_119: | |
3314 ++v51; | |
3315 v222 = (IDirectDrawSurface *)((char *)v222 + 1); | |
3316 v120 = v51; | |
3317 | |
3318 __debugbreak(); // fix condition | |
3319 } | |
3320 //while ( (signed int)((char *)&v222->lpVtbl + 1) < 22 ); | |
3321 while (true); | |
3322 if ( !a4 ) | |
3323 { | |
3324 v78 = 0; | |
3325 v74 = 0; | |
3326 v69 = 0; | |
3327 v66 = pGlobalTXT_LocalizationStrings[153]; | |
3328 LABEL_123: | |
3329 a1->DrawText((GUIFont *)a2, 28, v50, a5, v66, v69, v74, v78); | |
3330 } | |
3331 v56 = pFontSmallnum; | |
3332 a4 = (char *)v106.uViewportY; | |
3333 if ( v119 ) | |
3334 { | |
241 | 3335 sprintf(pTmpBuf, "%s\f%05u\t100%d\n", pGlobalTXT_LocalizationStrings[108], 0, v121->pMonsterInfo.uHP); |
0 | 3336 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); |
3337 a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; | |
3338 v79 = v121->pMonsterInfo.uAC; | |
3339 v75 = 0; | |
3340 v70 = pGlobalTXT_LocalizationStrings[12]; | |
241 | 3341 v67 = "%s\f%05u\t100%d\n"; |
0 | 3342 } |
3343 else | |
3344 { | |
241 | 3345 sprintf(pTmpBuf, "%s\f%05u\t100%s\n", pGlobalTXT_LocalizationStrings[108], 0, pGlobalTXT_LocalizationStrings[630]); |
0 | 3346 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); |
3347 v79 = (unsigned int)pGlobalTXT_LocalizationStrings[630]; | |
3348 v75 = 0; | |
3349 v70 = pGlobalTXT_LocalizationStrings[12]; | |
3350 a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; | |
241 | 3351 v67 = "%s\f%05u\t100%s\n"; |
0 | 3352 } |
3353 sprintf(pTmpBuf, v67, v70, v75, v79); | |
3354 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); | |
3355 a4 = &a4[LOBYTE(v56->uFontHeight) - 6] + LOBYTE(v56->uFontHeight); | |
241 | 3356 v95[0] = pGlobalTXT_LocalizationStrings[87]; |
3357 v95[1] = pGlobalTXT_LocalizationStrings[6]; | |
3358 v95[2] = pGlobalTXT_LocalizationStrings[240]; | |
3359 v95[3] = pGlobalTXT_LocalizationStrings[70]; | |
3360 v95[4] = pGlobalTXT_LocalizationStrings[624]; | |
3361 v95[5] = pGlobalTXT_LocalizationStrings[138]; | |
3362 v95[6] = pGlobalTXT_LocalizationStrings[214]; | |
3363 v95[7] = pGlobalTXT_LocalizationStrings[142]; | |
3364 v95[8] = pGlobalTXT_LocalizationStrings[29]; | |
3365 v95[9] = pGlobalTXT_LocalizationStrings[133]; | |
3366 v95[10] = pGlobalTXT_LocalizationStrings[54]; | |
0 | 3367 if ( v116 ) |
3368 { | |
241 | 3369 sprintf(pTmpBuf, "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, v95[v121->pMonsterInfo.uAttack1Type]); |
0 | 3370 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); |
3371 a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; | |
3372 v57 = v121->pMonsterInfo.uAttack1DamageBonus; | |
3373 if ( v57 ) | |
3374 sprintf( | |
3375 pTmpBuf, | |
241 | 3376 "%s\f%05u\t080%dd%d+%d\n", |
0 | 3377 pGlobalTXT_LocalizationStrings[53], |
3378 0, | |
3379 v121->pMonsterInfo.uAttack1DamageDiceRolls, | |
3380 v121->pMonsterInfo.uAttack1DamageDiceSides, | |
3381 v57); | |
3382 else | |
3383 sprintf( | |
3384 pTmpBuf, | |
241 | 3385 "%s\f%05u\t080%dd%d\n", |
0 | 3386 pGlobalTXT_LocalizationStrings[53], |
3387 0, | |
3388 v121->pMonsterInfo.uAttack1DamageDiceRolls, | |
3389 v121->pMonsterInfo.uAttack1DamageDiceSides); | |
3390 } | |
3391 else | |
3392 { | |
241 | 3393 sprintf(pTmpBuf, "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, pGlobalTXT_LocalizationStrings[630]); |
0 | 3394 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); |
3395 a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; | |
241 | 3396 sprintf(pTmpBuf, "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[53], 0, pGlobalTXT_LocalizationStrings[630]); |
0 | 3397 } |
3398 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); | |
3399 v58 = LOBYTE(v56->uFontHeight); | |
3400 a4 = &a4[v58 - 6] + v58; | |
3401 if ( !i ) | |
3402 { | |
3403 v80 = pGlobalTXT_LocalizationStrings[630]; | |
3404 v76 = 0; | |
3405 v71 = pGlobalTXT_LocalizationStrings[628]; | |
241 | 3406 v68 = "%s\f%05u\t080%s\n"; |
0 | 3407 goto LABEL_144; |
3408 } | |
3409 v120 = (SpellBuff *)pGlobalTXT_LocalizationStrings[628]; | |
3410 v59 = v121; | |
3411 v114 = v121->pMonsterInfo.uSpell1ID; | |
3412 if ( v114 && v121->pMonsterInfo.uSpell2ID ) | |
3413 v120 = (SpellBuff *)pGlobalTXT_LocalizationStrings[629]; | |
3414 if ( v114 ) | |
3415 { | |
241 | 3416 sprintf(pTmpBuf, "%s\f%05u\t060%s\n", v120, 0, pSpellStats->pInfos[v114].pShortName); |
0 | 3417 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); |
3418 v58 = LOBYTE(v56->uFontHeight); | |
3419 a4 = &a4[v58 - 3]; | |
3420 v59 = v121; | |
3421 } | |
3422 v60 = v59->pMonsterInfo.uSpell2ID; | |
3423 if ( v60 ) | |
3424 { | |
241 | 3425 sprintf(pTmpBuf, "\f%05u\t060%s\n", 0, pSpellStats->pInfos[v60].pShortName); |
0 | 3426 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); |
3427 v58 = LOBYTE(v56->uFontHeight); | |
3428 a4 = &a4[v58 - 3]; | |
3429 v59 = v121; | |
3430 } | |
3431 if ( !v59->pMonsterInfo.uSpell1ID && !v59->pMonsterInfo.uSpell2ID ) | |
3432 { | |
3433 v80 = pGlobalTXT_LocalizationStrings[153]; | |
3434 v76 = 0; | |
3435 v71 = pGlobalTXT_LocalizationStrings[628]; | |
241 | 3436 v68 = "%s\f%05u\t060%s\n"; |
0 | 3437 LABEL_144: |
3438 sprintf(pTmpBuf, v68, v71, v76, v80); | |
3439 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); | |
3440 v58 = LOBYTE(v56->uFontHeight); | |
3441 a4 = &a4[v58 - 3]; | |
3442 } | |
3443 a4 = &a4[v58 - 3]; | |
3444 a1->DrawText(v56, 150, (int)a4, a5, pGlobalTXT_LocalizationStrings[626], 0, 0, 0); | |
3445 a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; | |
241 | 3446 v85[0] = pGlobalTXT_LocalizationStrings[87]; |
3447 v85[1] = pGlobalTXT_LocalizationStrings[6]; | |
3448 v85[2] = pGlobalTXT_LocalizationStrings[240]; | |
3449 v85[3] = pGlobalTXT_LocalizationStrings[70]; | |
3450 v85[4] = pGlobalTXT_LocalizationStrings[142]; | |
3451 v85[5] = pGlobalTXT_LocalizationStrings[214]; | |
3452 v85[6] = pGlobalTXT_LocalizationStrings[29]; | |
3453 v85[7] = pGlobalTXT_LocalizationStrings[133]; | |
3454 v85[8] = pGlobalTXT_LocalizationStrings[54]; | |
3455 v85[9] = pGlobalTXT_LocalizationStrings[624]; | |
3456 v95[1] = (char *)v121->pMonsterInfo.uResFire; | |
3457 v95[2] = (char *)v121->pMonsterInfo.uResAir; | |
3458 v95[3] = (char *)v121->pMonsterInfo.uResWater; | |
3459 v95[4] = (char *)v121->pMonsterInfo.uResEarth; | |
3460 v95[5] = (char *)v121->pMonsterInfo.uResMind; | |
3461 v95[6] = (char *)v121->pMonsterInfo.uResSpirit; | |
3462 v95[7] = (char *)v121->pMonsterInfo.uResBody; | |
3463 v95[8] = (char *)v121->pMonsterInfo.uResLight; | |
3464 v95[9] = (char *)v121->pMonsterInfo.uResPhysical; | |
3465 v95[10] = (char *)v121->pMonsterInfo.uResDark; | |
0 | 3466 if ( v112 ) |
3467 { | |
3468 v124 = 0; | |
3469 do | |
3470 { | |
241 | 3471 v62 = v95[v124+1]; |
0 | 3472 if ( v62 == (char *)200 ) |
3473 { | |
3474 v81 = pGlobalTXT_LocalizationStrings[625]; | |
3475 } | |
3476 else | |
3477 { | |
3478 if ( v62 ) | |
3479 v81 = pGlobalTXT_LocalizationStrings[627]; | |
3480 else | |
3481 v81 = pGlobalTXT_LocalizationStrings[153]; | |
3482 } | |
241 | 3483 sprintf(pTmpBuf, "%s\f%05u\t070%s\n", v85[v124], 0, v81); |
0 | 3484 a1->DrawText(v56, 170, (int)a4, a5, pTmpBuf, 0, 0, 0); |
3485 v63 = LOBYTE(v56->uFontHeight); | |
3486 v124 += 4; | |
3487 result = &a4[v63 - 3]; | |
3488 a4 = result; | |
3489 } | |
3490 while ( v124 < 40 ); | |
3491 } | |
3492 else | |
3493 { | |
3494 i = 0; | |
3495 do | |
3496 { | |
241 | 3497 sprintf(pTmpBuf, "%s\f%05u\t070%s\n", v85[i], 0, pGlobalTXT_LocalizationStrings[630]); // "?" |
0 | 3498 a1->DrawText(v56, 170, (int)a4, a5, pTmpBuf, 0, 0, 0); |
3499 v65 = LOBYTE(v56->uFontHeight); | |
3500 ++i; | |
3501 result = &a4[v65 - 3]; | |
3502 a4 = result; | |
3503 } | |
3504 while ( i < 10 ); | |
3505 } | |
3506 if ( (signed __int64)pParty->pPartyBuffs[3].uExpireTime > 0 ) | |
3507 { | |
3508 sprintf(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[650], v121->sCurrentHP); | |
3509 pFontSmallnum->GetLineWidth(pTmpBuf); | |
3510 result = a1->DrawTitleText( | |
3511 pFontSmallnum, | |
3512 0, | |
3513 a1->uFrameHeight - LOBYTE(pFontSmallnum->uFontHeight) - 12, | |
3514 0, | |
3515 pTmpBuf, | |
3516 3u); | |
3517 } | |
3518 return result; | |
3519 } | |
3520 | |
3521 | |
3522 | |
3523 //----- (0041F54A) -------------------------------------------------------- | |
3524 void __cdecl LoadActualSkyFrame() | |
3525 { | |
3526 if ( pTexture_RestUI_CurrentSkyFrame ) | |
3527 pTexture_RestUI_CurrentSkyFrame->Release(); | |
3528 if ( pTexture_RestUI_CurrentHourglassFrame ) | |
3529 pTexture_RestUI_CurrentHourglassFrame->Release(); | |
3530 pIcons_LOD->_40F9C5(); | |
3531 sprintf(pTmpBuf, "TERRA%03d", pParty->uCurrentMinute / 6 + 10 * pParty->uCurrentHour); | |
3532 pTexture_RestUI_CurrentSkyFrame = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pTmpBuf, TEXTURE_16BIT_PALETTE)]; | |
3533 } | |
3534 | |
3535 //----- (0041F5BE) -------------------------------------------------------- | |
3536 void __cdecl Sleep6Hours() | |
3537 { | |
3538 if ( _506F18_num_hours_to_sleep < 6 ) | |
3539 { | |
3540 pParty->pPlayers[3].pConditions[2] = 0i64; | |
3541 pParty->pPlayers[2].pConditions[2] = 0i64; | |
3542 pParty->pPlayers[1].pConditions[2] = 0i64; | |
3543 pParty->pPlayers[0].pConditions[2] = 0i64; | |
3544 if ( _506F18_num_hours_to_sleep ) | |
3545 { | |
3546 Rest(_506F18_num_hours_to_sleep); | |
3547 _506F18_num_hours_to_sleep = 0; | |
3548 LoadActualSkyFrame(); | |
3549 } | |
3550 if ( dword_506F14 == 2 ) | |
3551 { | |
3552 pGUIWindow_CurrentMenu->Release(); | |
3553 pEventTimer->Resume(); | |
3554 if ( pTexture_RestUI_CurrentSkyFrame ) | |
3555 pTexture_RestUI_CurrentSkyFrame->Release(); | |
3556 if ( pTexture_RestUI_CurrentHourglassFrame ) | |
3557 pTexture_RestUI_CurrentHourglassFrame->Release(); | |
3558 pTexture_RestUI_CurrentHourglassFrame = 0; | |
3559 pTexture_RestUI_CurrentSkyFrame = 0; | |
3560 pIcons_LOD->_4114F2(); | |
3561 pIcons_LOD->_40F9C5(); | |
151 | 3562 pCurrentScreen = SCREEN_GAME; |
0 | 3563 viewparams->bRedrawGameUI = 1; |
3564 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
3565 { | |
3566 pOutdoor->UpdateSunlightVectors(); | |
3567 pOutdoor->UpdateFog(); | |
3568 } | |
3569 } | |
3570 dword_506F14 = 0; | |
3571 } | |
3572 else | |
3573 { | |
3574 Rest(6u); | |
3575 _506F18_num_hours_to_sleep -= 6; | |
3576 LoadActualSkyFrame(); | |
3577 } | |
3578 viewparams->bRedrawGameUI = 1; | |
3579 } | |
3580 | |
3581 //----- (0041F6C1) -------------------------------------------------------- | |
3582 void __cdecl RestUI_Initialize() | |
3583 { | |
89 | 3584 Player *v0; // eax@10 |
0 | 3585 |
3586 if ( !dword_506F14 ) | |
3587 pAudioPlayer->StopChannels(-1, -1); | |
3588 if ( pCurrentScreen ) | |
3589 { | |
3590 pGUIWindow_CurrentMenu->Release(); | |
151 | 3591 pCurrentScreen = SCREEN_GAME; |
0 | 3592 viewparams->bRedrawGameUI = 1; |
3593 } | |
3594 pEventTimer->Pause(); | |
3595 if ( dword_506F14 != 2 ) | |
3596 GUIWindow::Create(518u, 450u, 0, 0, (enum WindowType)90, (int)pBtn_Rest, 0); | |
3597 _506F18_num_hours_to_sleep = 0; | |
3598 dword_506F14 = 0; | |
3599 uRestUI_FoodRequiredToRest = 2; | |
3600 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
3601 uRestUI_FoodRequiredToRest = pOutdoor->GetNumFoodRequiredToRestInCurrentPos( | |
3602 pParty->vPosition.x, | |
3603 pParty->vPosition.y, | |
3604 pParty->vPosition.z); | |
248 | 3605 if ( PartyHasDragon() ) |
0 | 3606 { |
89 | 3607 v0 = pParty->pPlayers;//[0].uClass; |
3608 while ( v0 <= &pParty->pPlayers[3] ) | |
3609 { | |
3610 ++v0; | |
3611 if ( v0 > &pParty->pPlayers[3] ) | |
3612 break; | |
3613 } | |
255 | 3614 if(v0->classType == PLAYER_CLASS_WARLOCK) |
89 | 3615 ++uRestUI_FoodRequiredToRest; |
3616 } | |
0 | 3617 if ( CheckHiredNPCSpeciality(0x1Du) ) |
3618 --uRestUI_FoodRequiredToRest; | |
3619 if ( CheckHiredNPCSpeciality(0x1Eu) ) | |
3620 uRestUI_FoodRequiredToRest -= 2; | |
3621 if ( CheckHiredNPCSpeciality(0x30u) ) | |
3622 --uRestUI_FoodRequiredToRest; | |
3623 if ( uRestUI_FoodRequiredToRest < 1 ) | |
3624 uRestUI_FoodRequiredToRest = 1; | |
3625 if ( !_strcmpi(pCurrentMapName, "d29.blv") && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 98) ) | |
3626 uRestUI_FoodRequiredToRest = 0; | |
3627 ++pIcons_LOD->uTexturePacksCount; | |
3628 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | |
3629 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
151 | 3630 pCurrentScreen = SCREEN_REST; |
0 | 3631 _507CD4_RestUI_hourglass_anim_controller = 0; |
3632 uTextureID_RestUI_restmain = pIcons_LOD->LoadTexture("restmain", TEXTURE_16BIT_PALETTE); | |
3633 uTextureID_RestUI_restb1 = pIcons_LOD->LoadTexture("restb1", TEXTURE_16BIT_PALETTE); | |
3634 uTextureID_RestUI_restb2 = pIcons_LOD->LoadTexture("restb2", TEXTURE_16BIT_PALETTE); | |
3635 uTextureID_RestUI_restb3 = pIcons_LOD->LoadTexture("restb3", TEXTURE_16BIT_PALETTE); | |
3636 uTextureID_RestUI_restb4 = pIcons_LOD->LoadTexture("restb4", TEXTURE_16BIT_PALETTE); | |
3637 uTextureID_RestUI_restexit = pIcons_LOD->LoadTexture("restexit", TEXTURE_16BIT_PALETTE); | |
3638 LoadActualSkyFrame(); | |
3639 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640u, 480u, (enum WindowType)16, 0, 0); | |
3640 pButton_RestUI_Exit = pGUIWindow_CurrentMenu->CreateButton( | |
3641 280u, | |
3642 297u, | |
3643 154u, | |
3644 37u, | |
3645 1, | |
3646 0, | |
3647 0xA7u, | |
3648 0, | |
3649 0, | |
3650 "", | |
3651 (Texture *)(uTextureID_RestUI_restexit != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restexit] : 0), | |
3652 0); | |
3653 pButton_RestUI_Main = pGUIWindow_CurrentMenu->CreateButton( | |
3654 24u, | |
3655 154u, | |
3656 225u, | |
3657 37u, | |
3658 1, | |
3659 0, | |
3660 0x61u, | |
3661 0, | |
3662 0x52u, | |
3663 "", | |
3664 (Texture *)(uTextureID_RestUI_restb4 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb4] : 0), | |
3665 0); | |
3666 pButton_RestUI_WaitUntilDawn = pGUIWindow_CurrentMenu->CreateButton( | |
3667 61u, | |
3668 232u, | |
3669 154u, | |
3670 33u, | |
3671 1, | |
3672 0, | |
3673 0x6Du, | |
3674 0, | |
3675 0x44u, | |
3676 "", | |
3677 (Texture *)(uTextureID_RestUI_restb1 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb1] : 0), | |
3678 0); | |
3679 pButton_RestUI_Wait1Hour = pGUIWindow_CurrentMenu->CreateButton( | |
3680 61u, | |
3681 264u, | |
3682 154u, | |
3683 33u, | |
3684 1, | |
3685 0, | |
3686 0x60u, | |
3687 0, | |
3688 0x48u, | |
3689 "", | |
3690 (Texture *)(uTextureID_RestUI_restb2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb2] : 0), | |
3691 0); | |
3692 pButton_RestUI_Wait5Minutes = pGUIWindow_CurrentMenu->CreateButton( | |
3693 61u, | |
3694 296u, | |
3695 154u, | |
3696 33u, | |
3697 1, | |
3698 0, | |
3699 0x5Fu, | |
3700 0, | |
3701 0x4Du, | |
3702 "", | |
3703 (Texture *)(uTextureID_RestUI_restb3 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb3] : 0), | |
3704 0); | |
3705 } | |
3706 | |
3707 //----- (0041FA01) -------------------------------------------------------- | |
3708 void __cdecl RestUI_Draw() | |
3709 { | |
3710 int v0; // esi@1 | |
3711 Player **ppPlayers; // ecx@1 | |
3712 Player *pPlayer; // eax@2 | |
3713 unsigned int v3; // eax@15 | |
3714 char v4; // al@17 | |
3715 bool v5; // eax@21 | |
3716 GUIButton Dst; // [sp+8h] [bp-DCh]@19 | |
3717 //double v7; // [sp+C4h] [bp-20h]@17 | |
3718 float v8; // [sp+CCh] [bp-18h]@17 | |
3719 __int64 v9; // [sp+D0h] [bp-14h]@17 | |
3720 unsigned int v10; // [sp+D8h] [bp-Ch]@9 | |
3721 __int16 a9[2]; // [sp+DCh] [bp-8h]@1 | |
3722 int a5; // [sp+E0h] [bp-4h]@1 | |
3723 | |
3724 v0 = 0; | |
3725 a5 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xAu, 0, 0); | |
3726 *(int *)a9 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE6u, 0xD6u, 0xC1u); | |
3727 ppPlayers = &pPlayers[1]; | |
3728 do | |
3729 { | |
3730 pPlayer = *ppPlayers; | |
3731 if ( !(*ppPlayers)->pConditions[14] && !pPlayer->pConditions[16] && pPlayer->sHealth > 0 ) | |
3732 ++v0; | |
3733 ++ppPlayers; | |
3734 } | |
3735 while ( (signed int)ppPlayers <= (signed int)&pPlayers[4] ); | |
3736 if ( v0 ) | |
3737 { | |
3738 pRenderer->DrawTextureIndexed( | |
3739 8u, | |
3740 8u, | |
3741 (Texture *)(uTextureID_RestUI_restmain != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restmain] : 0)); | |
3742 v10 = pParty->uCurrentHour; | |
3743 dword_506F1C = pGUIWindow_CurrentMenu->pCurrentPosActiveItem; | |
3744 if ( (signed int)pParty->uCurrentHour <= 12 ) | |
3745 { | |
3746 if ( !v10 ) | |
3747 v10 = 12; | |
3748 } | |
3749 else | |
3750 { | |
3751 v10 -= 12; | |
3752 } | |
3753 pRenderer->DrawTextureIndexed(16u, 26u, pTexture_RestUI_CurrentSkyFrame); | |
3754 if ( pTexture_RestUI_CurrentHourglassFrame ) | |
3755 { | |
3756 pTexture_RestUI_CurrentHourglassFrame->Release(); | |
3757 pIcons_LOD->_40F9C5(); | |
3758 } | |
3759 v3 = pEventTimer->uTimeElapsed + _507CD4_RestUI_hourglass_anim_controller; | |
3760 _507CD4_RestUI_hourglass_anim_controller += pEventTimer->uTimeElapsed; | |
3761 if ( (unsigned int)_507CD4_RestUI_hourglass_anim_controller >= 512 ) | |
3762 { | |
3763 v3 = 0; | |
3764 _507CD4_RestUI_hourglass_anim_controller = 0; | |
3765 } | |
3766 v9 = v3; | |
3767 v8 = (double)v3 * 0.001953125 * 120.0; | |
3768 //v7 = v8 + 6.7553994e15; | |
3769 HIDWORD(v9) = floorf(v8 + 0.5f);//LODWORD(v7); | |
3770 v4 = (int)floorf(v8 + 0.5f) % 256 + 1;//LOBYTE(v7) + 1; | |
3771 byte_4E2BC8 = v4; | |
3772 if ( (unsigned __int8)(v4) >= 0x78u ) | |
3773 { | |
3774 v4 = 1; | |
3775 byte_4E2BC8 = 1; | |
3776 } | |
3777 sprintf(pTmpBuf, "hglas%03d", (unsigned __int8)v4); | |
3778 pTexture_RestUI_CurrentHourglassFrame = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pTmpBuf, TEXTURE_16BIT_PALETTE)]; | |
3779 pRenderer->DrawTextureIndexed(0x10Bu, 0x9Fu, pTexture_RestUI_CurrentHourglassFrame); | |
3780 memset(&Dst, 0, 0xBCu); | |
3781 Dst.uX = 24; | |
3782 Dst.uY = 154; | |
3783 Dst.uWidth = 171; | |
3784 Dst.uHeight = 37; | |
3785 Dst.uZ = 194; | |
3786 Dst.uW = 190; | |
3787 Dst.pParent = pButton_RestUI_WaitUntilDawn->pParent; | |
3788 Dst.DrawLabel(pGlobalTXT_LocalizationStrings[183], pFontCreate, a5, *(int **)a9); | |
3789 Dst.pParent = 0; | |
3790 sprintf(pTmpBuf, "\r408%d", uRestUI_FoodRequiredToRest); | |
3791 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 0, 164, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); | |
3792 pButton_RestUI_WaitUntilDawn->DrawLabel( | |
3793 pGlobalTXT_LocalizationStrings[237], | |
3794 pFontCreate, | |
3795 a5, | |
3796 *(int **)a9); | |
3797 pButton_RestUI_Wait1Hour->DrawLabel(pGlobalTXT_LocalizationStrings[239], pFontCreate, a5, *(int **)a9); | |
3798 pButton_RestUI_Wait5Minutes->DrawLabel(pGlobalTXT_LocalizationStrings[238], pFontCreate, a5, *(int **)a9); | |
3799 pButton_RestUI_Exit->DrawLabel(pGlobalTXT_LocalizationStrings[81], pFontCreate, a5, *(int **)a9); | |
3800 memset(&Dst, 0, 0xBCu); | |
3801 Dst.uX = 45; | |
3802 Dst.uY = 199; | |
3803 Dst.uWidth = 185; | |
3804 Dst.uHeight = 30; | |
3805 Dst.uZ = 229; | |
3806 Dst.uW = 228; | |
3807 Dst.pParent = pButton_RestUI_WaitUntilDawn->pParent; | |
3808 Dst.DrawLabel(pGlobalTXT_LocalizationStrings[236], pFontCreate, a5, *(int **)a9); | |
3809 Dst.pParent = 0; | |
3810 v5 = pParty->uCurrentHour >= 0xC && pParty->uCurrentHour < 0x18; | |
3811 sprintf(pTmpBuf, "%d:%02d %s", v10, pParty->uCurrentMinute, aAMPMNames[v5]); | |
3812 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 368, 168, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); | |
3813 sprintf(pTmpBuf, "%s\r190%d", pGlobalTXT_LocalizationStrings[56], pParty->uDaysPlayed + 1); | |
3814 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 190, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); | |
3815 sprintf(pTmpBuf, "%s\r190%d", pGlobalTXT_LocalizationStrings[146], pParty->uCurrentMonth + 1); | |
3816 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 222, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); | |
3817 sprintf(pTmpBuf, "%s\r190%d", pGlobalTXT_LocalizationStrings[245], pParty->uCurrentYear); | |
3818 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 254, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); | |
3819 if ( dword_506F14 ) | |
3820 Sleep6Hours(); | |
3821 } | |
3822 else | |
3823 { | |
3824 GUIWindow::Create( | |
3825 pButton_RestUI_Exit->uX, | |
3826 pButton_RestUI_Exit->uY, | |
3827 0, | |
3828 0, | |
3829 (enum WindowType)96, | |
3830 (int)pButton_RestUI_Exit, | |
3831 (int)pGlobalTXT_LocalizationStrings[81]); | |
3832 } | |
3833 } | |
421 | 3834 |
0 | 3835 |
3836 //----- (0042038D) -------------------------------------------------------- | |
3837 void __cdecl sub_42038D() | |
3838 { | |
3839 POINT *v0; // esi@2 | |
3840 int v1; // ecx@2 | |
3841 const char *v2; // eax@3 | |
3842 POINT v3; // [sp+0h] [bp-10h]@2 | |
3843 POINT a2; // [sp+8h] [bp-8h]@1 | |
3844 | |
3845 if ( pMouse->GetCursorPos(&a2)->y < 350 ) | |
3846 { | |
3847 v0 = pMouse->GetCursorPos(&a2); | |
3848 v1 = pRenderer->pActiveZBuffer[v0->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v3)->y]]; | |
3849 if ( v1 ) | |
3850 { | |
3851 auto _w = (ItemGen *)(&pOtherOverlayList->pOverlays[49].field_4 + 2662 * (unsigned int)pChestWindow->ptr_1C | |
3852 + 18 * *((short *)&pChests[0].mm7__vector_pItems[139].uExpireTime | |
3853 + v1 + 2662 * (unsigned int)pChestWindow->ptr_1C + 3)); | |
3854 v2 = _w->GetDisplayName(); | |
3855 sub_41C0B8_set_status_string(v2); | |
3856 } | |
3857 } | |
3858 } | |
3859 | |
3860 //----- (00420B13) -------------------------------------------------------- | |
3861 void __fastcall sub_420B13(int a1, int a2) | |
3862 { | |
3863 void *v2; // eax@1 | |
3864 ItemGen *v3; // ebx@1 | |
3865 unsigned int v4; // eax@1 | |
3866 Texture *v5; // ecx@1 | |
3867 signed int v6; // eax@1 | |
3868 signed int v7; // edi@3 | |
3869 signed int v8; // eax@3 | |
3870 int v9; // edi@3 | |
3871 int v10; // eax@5 | |
3872 int v11; // esi@8 | |
3873 unsigned int v12; // ecx@10 | |
3874 void *v13; // edi@10 | |
3875 unsigned __int8 v14; // cf@10 | |
3876 int v15; // edi@10 | |
3877 int i; // ecx@10 | |
3878 int v17; // [sp+Ch] [bp-14h]@1 | |
3879 int v18; // [sp+10h] [bp-10h]@3 | |
3880 int v19; // [sp+14h] [bp-Ch]@1 | |
3881 void *v20; // [sp+18h] [bp-8h]@1 | |
3882 int v21; // [sp+1Ch] [bp-4h]@5 | |
3883 int v22; // [sp+1Ch] [bp-4h]@8 | |
3884 | |
3885 v19 = a2; | |
3886 v2 = pChestWindow->ptr_1C; | |
3887 v20 = v2; | |
3888 v2 = (void *)(5324 * (int)v2); | |
3889 v3 = (ItemGen *)((char *)v2 + 36 * a1 + (int)((char *)pChests + 4)); | |
3890 v17 = pChestWidthsByType[*(short *)((char *)v2 + (int)pChests)]; | |
3891 v4 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v3->uItemID].pIconName, TEXTURE_16BIT_PALETTE); | |
3892 v5 = (Texture *)(v4 != -1 ? (int)&pIcons_LOD->pTextures[v4] : 0); | |
3893 v6 = (v4 != -1 ? pIcons_LOD->pTextures[v4].uTextureWidth : 24); | |
3894 if ( v6 < 14 ) | |
3895 v6 = 14; | |
3896 v7 = v6 - 14; | |
3897 v8 = v5->uTextureHeight; | |
3898 v9 = (v7 >> 5) + 1; | |
3899 v18 = v9; | |
3900 if ( v8 < 14 ) | |
3901 v8 = 14; | |
3902 v10 = ((v8 - 14) >> 5) + 1; | |
3903 v21 = v10; | |
3904 if ( !areWeLoadingTexture ) | |
3905 { | |
3906 v5->Release(); | |
3907 pIcons_LOD->_40F9C5(); | |
3908 v10 = v21; | |
3909 } | |
3910 if ( v10 > 0 ) | |
3911 { | |
3912 v11 = 0; | |
3913 v22 = v10; | |
3914 do | |
3915 { | |
3916 if ( v9 > 0 ) | |
3917 { | |
3918 v12 = v9; | |
3919 v13 = &pChests[0].pInventoryIndices[v19 + v11 + 2662 * (int)v20]; | |
3920 v14 = v12 & 1; | |
3921 v12 >>= 1; | |
3922 memset(v13, 0, 4 * v12); | |
3923 v15 = (int)((char *)v13 + 4 * v12); | |
3924 for ( i = v14; i; --i ) | |
3925 { | |
3926 *(short *)v15 = 0; | |
3927 v15 += 2; | |
3928 } | |
3929 v9 = v18; | |
3930 } | |
3931 v11 += v17; | |
3932 --v22; | |
3933 } | |
3934 while ( v22 ); | |
3935 } | |
3936 v3->Reset(); | |
3937 } | |
3938 // 506128: using guessed type int areWeLoadingTexture; | |
3939 | |
3940 //----- (00420C05) -------------------------------------------------------- | |
3941 void __fastcall party_finds_gold(unsigned int uNumGold, int _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal) | |
3942 { | |
3943 unsigned int v2; // edi@1 | |
3944 int v3; // ebp@1 | |
3945 unsigned int v4; // esi@1 | |
3946 int v5; // ecx@6 | |
3947 NPCData *v6; // eax@6 | |
3948 signed int v7; // edx@8 | |
3949 signed int v8; // ebx@10 | |
3950 char *v9; // edi@11 | |
3951 signed int v10; // ecx@17 | |
3952 int v11; // eax@21 | |
3953 NPCData *v12; // ecx@21 | |
3954 unsigned int v13; // ecx@23 | |
3955 signed int v14; // [sp+Ch] [bp-4h]@6 | |
3956 | |
3957 v2 = 0; | |
3958 v3 = 0; | |
3959 v4 = uNumGold; | |
3960 if ( _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal ) | |
3961 { | |
3962 if ( _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal == 1 ) | |
3963 { | |
3964 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[467], uNumGold);// You found %lu gold! | |
3965 } | |
3966 else | |
3967 { | |
3968 if ( _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal == 2 ) | |
3969 pTmpBuf2[0] = 0; | |
3970 } | |
3971 } | |
3972 else | |
3973 { | |
3974 v14 = 0; | |
3975 v5 = 0; | |
3976 v6 = pParty->pHirelings; | |
3977 do | |
3978 { | |
3979 if ( v6->pName ) | |
3980 { | |
3981 v7 = v14++; | |
3982 pTmpBuf[v7] = v5; | |
3983 } | |
3984 ++v6; | |
3985 ++v5; | |
3986 } | |
3987 while ( (signed int)v6 < (signed int)&pParty->pPickedItem ); | |
3988 v8 = 0; | |
3989 if ( (signed int)pNPCStats->uNumNewNPCs > 0 ) | |
3990 { | |
3991 v9 = (char *)pNPCStats->pNewNPCData; | |
3992 do | |
3993 { | |
3994 if ( v9[8] & 0x80 | |
3995 && (!pParty->pHirelings[0].pName || strcmp(*(const char **)v9, pParty->pHirelings[0].pName)) | |
3996 && (!pParty->pHirelings[1].pName || strcmp(*(const char **)v9, pParty->pHirelings[1].pName)) ) | |
3997 { | |
3998 v10 = v14++; | |
3999 pTmpBuf[v10] = v8 + 2; | |
4000 } | |
4001 ++v8; | |
4002 v9 += 76; | |
4003 } | |
4004 while ( v8 < (signed int)pNPCStats->uNumNewNPCs ); | |
4005 v2 = 0; | |
4006 } | |
4007 if ( v14 > 0 ) | |
4008 { | |
4009 do | |
4010 { | |
4011 v11 = (unsigned __int8)pTmpBuf[v2]; | |
4012 v12 = &pNPCStats->pNPCData[v11 + 499]; | |
33 | 4013 if ( (unsigned __int8)pTmpBuf[v2] < 2 ) |
0 | 4014 v12 = &pParty->pHirelings[v11]; |
4015 v13 = v12->uProfession; | |
4016 if ( v13 ) | |
291 | 4017 v3 += pNPCStats->pProfessions[v13].uHirePrice;//*(&pNPCStats->field_13A58 + 5 * v13); |
0 | 4018 ++v2; |
4019 } | |
4020 while ( (signed int)v2 < v14 ); | |
4021 } | |
4022 if ( CheckHiredNPCSpeciality(0x1Fu) ) | |
4023 v4 += (signed int)(10 * v4) / 100; | |
4024 if ( CheckHiredNPCSpeciality(0x20u) ) | |
4025 v4 += (signed int)(20 * v4) / 100; | |
4026 if ( CheckHiredNPCSpeciality(0x2Du) ) | |
4027 v4 += (signed int)(10 * v4) / 100; | |
4028 if ( v3 ) | |
4029 { | |
4030 v3 = (signed int)(v4 * v3 / 100) / 100; | |
4031 if ( v3 < 1 ) | |
4032 v3 = 1; | |
4033 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[466], v4, v3);// You found %lu gold (followers take %lu)! | |
4034 } | |
4035 else | |
4036 { | |
4037 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[467], v4);// You found %lu gold! | |
4038 } | |
4039 v2 = 0; | |
4040 } | |
4041 pParty->uNumGold += v4 - v3; | |
4042 pUIAnim_Gold->uAnimTime = v2; | |
4043 pUIAnim_Gold->uAnimLength = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Gold->uIconID].uAnimLength; | |
4044 if ( pTmpBuf2[0] ) | |
4045 ShowStatusBarString(pTmpBuf2, 2u); | |
4046 pAudioPlayer->PlaySound(SOUND_GoldReceived, v2, v2, -1, v2, v2, v2, v2); | |
4047 } | |
4048 | |
4049 //----- (00420E01) -------------------------------------------------------- | |
4050 void __cdecl sub_420E01() | |
4051 { | |
4052 void *v0; // edi@1 | |
4053 POINT *v1; // esi@2 | |
4054 int v2; // eax@2 | |
4055 int v3; // ebx@4 | |
4056 int v4; // esi@6 | |
4057 int v5; // ecx@6 | |
4058 //LayingItem v6; // [sp+Ch] [bp-80h]@1 | |
4059 char v7; // [sp+7Ch] [bp-10h]@2 | |
4060 POINT a2; // [sp+84h] [bp-8h]@2 | |
4061 | |
4062 LayingItem v6; // [sp+Ch] [bp-80h]@1 | |
4063 //LayingItem::LayingItem(&v6); | |
4064 | |
4065 v0 = pGUIWindow_CurrentMenu->ptr_1C; | |
4066 if ( pParty->pPickedItem.uItemID ) | |
4067 { | |
4068 if ( Chest::_41FFA2(-1, &pParty->pPickedItem, (unsigned int)pGUIWindow_CurrentMenu->ptr_1C) ) | |
4069 pMouse->RemoveHoldingItem(); | |
4070 } | |
4071 else | |
4072 { | |
4073 v1 = pMouse->GetCursorPos(&a2); | |
4074 v2 = pRenderer->pActiveZBuffer[v1->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v7)->y]] & 0xFFFF; | |
4075 if ( v2 ) | |
4076 { | |
4077 if ( v2 ) | |
4078 v3 = v2 - 1; | |
4079 else | |
4080 v3 = -1; | |
4081 v4 = pChests[0].pInventoryIndices[v3 + 2662 * (int)v0] - 1; | |
4082 v5 = 5324 * (int)v0 + 36 * v4; | |
4083 if ( pItemsTable->pItems[*(unsigned int *)((char *)&pChests[0].mm7__vector_pItems[0].uItemID + v5)].uEquipType == 18 ) | |
4084 { | |
377 | 4085 party_finds_gold(*(int *)((char *)&pChests[0].mm7__vector_pItems[0].uSpecEnchantmentType + v5), 0); |
0 | 4086 viewparams->bRedrawGameUI = 1; |
4087 } | |
4088 else | |
4089 { | |
4090 pParty->SetHoldingItem((ItemGen *)((char *)pChests[0].mm7__vector_pItems + v5)); | |
4091 } | |
4092 sub_420B13(v4, v3); | |
4093 } | |
4094 } | |
4095 } | |
4096 | |
4097 //----- (00420EFF) -------------------------------------------------------- | |
4098 void __cdecl GameUI_WritePointedObjectStatusString() | |
4099 { | |
4100 int v1; // ebx@6 | |
8 | 4101 GUIWindow *pWindow; // edi@7 |
4102 GUIButton *pButton; // ecx@11 | |
4103 Player *pPlayer; // eax@19 | |
0 | 4104 char v5; // cl@19 |
4105 unsigned int v6; // eax@19 | |
4106 int v7; // ecx@19 | |
4107 __int16 v8; // fps@23 | |
4108 unsigned __int8 v9; // c0@23 | |
4109 unsigned __int8 v10; // c3@23 | |
8 | 4110 enum UIMessageType pMessageType1; // esi@24 |
0 | 4111 int v12; // edx@25 |
4112 char *v13; // ecx@28 | |
4113 int v14; // eax@41 | |
8 | 4114 ItemGen *pItemGen; // ecx@44 |
0 | 4115 int v16; // ecx@46 |
4116 const char *v17; // eax@49 | |
4117 signed int v18; // eax@55 | |
4118 signed int v19; // ecx@63 | |
4119 BLVFace *pFace; // eax@69 | |
4120 __int16 v21; // ax@70 | |
4121 const char *v22; // eax@72 | |
4122 LevelDecoration *v23; // ecx@75 | |
4123 LevelDecoration *v24; // esi@75 | |
4124 __int16 v25; // ax@75 | |
4125 const char *v26; // ecx@79 | |
4126 Actor *pActor; // ecx@82 | |
4127 char *v28; // esi@82 | |
4128 int v29; // eax@82 | |
4129 signed int v30; // ecx@88 | |
4130 const char *v31; // eax@91 | |
4131 __int16 v32; // fps@109 | |
14 | 4132 //unsigned __int8 v33; // c0@109 |
4133 //unsigned __int8 v34; // c3@109 | |
8 | 4134 enum UIMessageType pMessageType2; // esi@110 |
0 | 4135 int v36; // edx@111 |
8 | 4136 enum UIMessageType pMessageType3; // edx@117 |
0 | 4137 int v38; // ecx@118 |
4138 const char *v39; // [sp-8h] [bp-E8h]@20 | |
4139 char *v40; // [sp-8h] [bp-E8h]@83 | |
4140 int v41; // [sp-4h] [bp-E4h]@20 | |
4141 char Str1[200]; // [sp+Ch] [bp-D4h]@129 | |
4142 unsigned int pX; // [sp+D4h] [bp-Ch]@1 | |
4143 unsigned int pY; // [sp+D8h] [bp-8h]@1 | |
4144 unsigned int v45; // [sp+DCh] [bp-4h]@21 | |
4145 | |
4146 v13 = nullptr; | |
4147 | |
4148 pMouse->uPointingObjectID = 0; | |
4149 pMouse->GetClickPos(&pX, &pY); | |
14 | 4150 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 | 4151 return; |
323 | 4152 if (pCurrentScreen == SCREEN_GAME) |
0 | 4153 { |
4154 if ( (signed int)pX > 467 || (signed int)pY > 351 ) | |
4155 goto _click_on_game_ui; | |
4156 if ( pRenderer->pRenderD3D ) | |
4157 { | |
4158 v18 = pGame->pVisInstance->get_picked_object_zbuf_val(); | |
4159 if ( (signed int)pX < (signed int)pViewport->uScreenX | |
4160 || (signed int)pX > (signed int)pViewport->uScreenZ | |
4161 || (signed int)pY < (signed int)pViewport->uScreenY | |
4162 || (signed int)pY > (signed int)pViewport->uScreenW ) | |
4163 v18 = -1; | |
4164 if ( v18 == -1 ) | |
8 | 4165 //goto LABEL_61; |
4166 { | |
4167 pMouse->uPointingObjectID = 0; | |
4168 if ( pMouse->uPointingObjectID == 0 ) | |
4169 { | |
4170 if ( uLastPointedObjectID != 0 ) | |
4171 { | |
4172 pStatusBarString[0] = 0; | |
4173 bForceDrawStatusBar = 1; | |
4174 } | |
4175 } | |
4176 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4177 return; | |
4178 } | |
0 | 4179 } |
4180 else | |
4181 { | |
4182 v18 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; | |
4183 } | |
4184 pMouse->uPointingObjectID = (unsigned __int16)v18; | |
4185 v19 = (signed int)(unsigned __int16)v18 >> 3; | |
4186 if ( (v18 & 7) == OBJECT_Item ) | |
4187 { | |
4188 v30 = v19; | |
4189 if ( pObjectList->pObjects[pLayingItems[v30].uObjectDescID].uFlags & 0x10 ) | |
8 | 4190 //goto LABEL_73; |
4191 { | |
4192 pMouse->uPointingObjectID = 0; | |
4193 //goto LABEL_50; | |
4194 uLastPointedObjectID = 1; | |
4195 if ( pMouse->uPointingObjectID == 0 ) | |
4196 { | |
4197 if ( uLastPointedObjectID != 0 ) | |
4198 { | |
4199 pStatusBarString[0] = 0; | |
4200 bForceDrawStatusBar = 1; | |
4201 } | |
4202 } | |
4203 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4204 return; | |
4205 } | |
0 | 4206 if ( v18 >= (signed int)0x2000000u || pParty->pPickedItem.uItemID ) |
4207 { | |
4208 v22 = pLayingItems[v30].stru_24.GetDisplayName(); | |
8 | 4209 //LABEL_93: |
0 | 4210 v26 = v22; |
8 | 4211 //goto LABEL_87; |
4212 sub_41C0B8_set_status_string(v26); | |
4213 if ( pMouse->uPointingObjectID == 0 ) | |
4214 { | |
4215 if ( uLastPointedObjectID != 0 ) | |
4216 { | |
4217 pStatusBarString[0] = 0; | |
4218 bForceDrawStatusBar = 1; | |
4219 } | |
4220 } | |
4221 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4222 return; | |
0 | 4223 } |
4224 v31 = pLayingItems[v30].stru_24.GetDisplayName(); | |
4225 v28 = pTmpBuf; | |
4226 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[470], v31);// "Get %s" | |
4227 } | |
4228 else | |
4229 { | |
4230 if ( (v18 & 7) != OBJECT_Actor ) | |
4231 { | |
4232 if ( (v18 & 7) == OBJECT_Decoration ) | |
4233 { | |
4234 v23 = &pLevelDecorations[v19]; | |
4235 v24 = v23; | |
4236 v25 = v23->field_16_event_id; | |
4237 if ( !v25 ) | |
4238 { | |
4239 if ( v23->IsInteractive() ) | |
4240 v26 = pNPCTopics[stru_5E4C90._decor_events[v24->_idx_in_stru123 - 75] + 379].pTopic; | |
4241 else | |
4242 v26 = pDecorationList->pDecorations[v24->uDecorationDescID].field_20; | |
8 | 4243 //goto LABEL_87; |
4244 sub_41C0B8_set_status_string(v26); | |
4245 if ( pMouse->uPointingObjectID == 0 ) | |
4246 { | |
4247 if ( uLastPointedObjectID != 0 ) | |
4248 { | |
4249 pStatusBarString[0] = 0; | |
4250 bForceDrawStatusBar = 1; | |
4251 } | |
4252 } | |
4253 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4254 return; | |
0 | 4255 } |
4256 v22 = _444732_GetEventHintString(v25); | |
4257 if ( !v22 ) | |
8 | 4258 //goto _return; |
4259 { | |
4260 if ( pMouse->uPointingObjectID == 0 ) | |
4261 { | |
4262 if ( uLastPointedObjectID != 0 ) | |
4263 { | |
4264 pStatusBarString[0] = 0; | |
4265 bForceDrawStatusBar = 1; | |
4266 } | |
4267 } | |
4268 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4269 return; | |
4270 } | |
4271 //goto LABEL_93; | |
4272 v26 = v22; | |
4273 //goto LABEL_87; | |
4274 sub_41C0B8_set_status_string(v26); | |
4275 if ( pMouse->uPointingObjectID == 0 ) | |
4276 { | |
4277 if ( uLastPointedObjectID != 0 ) | |
4278 { | |
4279 pStatusBarString[0] = 0; | |
4280 bForceDrawStatusBar = 1; | |
4281 } | |
4282 } | |
4283 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4284 return; | |
0 | 4285 } |
141 | 4286 if ( (v18 & 7) == OBJECT_BModel) |
0 | 4287 { |
4288 if ( v18 < (signed int)0x2000000u ) | |
4289 { | |
4290 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor) | |
4291 { | |
4292 v21 = pOutdoor->pBModels[(signed int)(unsigned __int16)v18 >> 9].pFaces[v19 & 0x3F].sCogTriggeredID; | |
8 | 4293 //goto LABEL_71; |
4294 if ( !v21 || (v22 = _444732_GetEventHintString(v21)) == 0 ) | |
4295 //goto LABEL_73; | |
4296 { | |
4297 pMouse->uPointingObjectID = 0; | |
4298 //goto LABEL_50; | |
4299 uLastPointedObjectID = 1; | |
4300 if ( pMouse->uPointingObjectID == 0 ) | |
4301 { | |
4302 if ( uLastPointedObjectID != 0 ) | |
4303 { | |
4304 pStatusBarString[0] = 0; | |
4305 bForceDrawStatusBar = 1; | |
4306 } | |
4307 } | |
4308 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4309 return; | |
4310 } | |
4311 //goto LABEL_93; | |
4312 v26 = v22; | |
4313 //goto LABEL_87; | |
4314 sub_41C0B8_set_status_string(v26); | |
4315 if ( pMouse->uPointingObjectID == 0 ) | |
4316 { | |
4317 if ( uLastPointedObjectID != 0 ) | |
4318 { | |
4319 pStatusBarString[0] = 0; | |
4320 bForceDrawStatusBar = 1; | |
4321 } | |
4322 } | |
4323 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4324 return; | |
0 | 4325 } |
4326 pFace = &pIndoor->pFaces[v19]; | |
4327 if ( BYTE3(pFace->uAttributes) & 6 ) | |
4328 { | |
4329 v21 = pIndoor->pFaceExtras[pFace->uFaceExtraID].uEventID; | |
8 | 4330 //LABEL_71: |
0 | 4331 if ( !v21 || (v22 = _444732_GetEventHintString(v21)) == 0 ) |
8 | 4332 //goto LABEL_73; |
4333 { | |
4334 pMouse->uPointingObjectID = 0; | |
4335 //goto LABEL_50; | |
4336 uLastPointedObjectID = 1; | |
4337 if ( pMouse->uPointingObjectID == 0 ) | |
4338 { | |
4339 if ( uLastPointedObjectID != 0 ) | |
4340 { | |
4341 pStatusBarString[0] = 0; | |
4342 bForceDrawStatusBar = 1; | |
4343 } | |
4344 } | |
4345 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4346 return; | |
4347 } | |
4348 //goto LABEL_93; | |
4349 v26 = v22; | |
4350 //goto LABEL_87; | |
4351 sub_41C0B8_set_status_string(v26); | |
4352 if ( pMouse->uPointingObjectID == 0 ) | |
4353 { | |
4354 if ( uLastPointedObjectID != 0 ) | |
4355 { | |
4356 pStatusBarString[0] = 0; | |
4357 bForceDrawStatusBar = 1; | |
4358 } | |
4359 } | |
4360 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4361 return; | |
0 | 4362 } |
4363 } | |
8 | 4364 //LABEL_73: |
0 | 4365 pMouse->uPointingObjectID = 0; |
8 | 4366 //goto LABEL_50; |
4367 uLastPointedObjectID = 1; | |
4368 if ( pMouse->uPointingObjectID == 0 ) | |
4369 { | |
4370 if ( uLastPointedObjectID != 0 ) | |
4371 { | |
4372 pStatusBarString[0] = 0; | |
4373 bForceDrawStatusBar = 1; | |
4374 } | |
4375 } | |
4376 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4377 return; | |
0 | 4378 } |
8 | 4379 //LABEL_61: |
0 | 4380 pMouse->uPointingObjectID = 0; |
8 | 4381 //goto _return; |
4382 if ( pMouse->uPointingObjectID == 0 ) | |
4383 { | |
4384 if ( uLastPointedObjectID != 0 ) | |
4385 { | |
4386 pStatusBarString[0] = 0; | |
4387 bForceDrawStatusBar = 1; | |
4388 } | |
4389 } | |
4390 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4391 return; | |
0 | 4392 } |
4393 if ( v18 >= 335544320 ) | |
8 | 4394 //goto LABEL_61; |
4395 { | |
4396 pMouse->uPointingObjectID = 0; | |
4397 if ( pMouse->uPointingObjectID == 0 ) | |
4398 { | |
4399 if ( uLastPointedObjectID != 0 ) | |
4400 { | |
4401 pStatusBarString[0] = 0; | |
4402 bForceDrawStatusBar = 1; | |
4403 } | |
4404 } | |
4405 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4406 return; | |
4407 } | |
0 | 4408 pActor = &pActors[v19]; |
4409 v28 = pTmpBuf; | |
4410 v29 = pActor->dword_000334_unique_name; | |
4411 if ( v29 ) | |
237 | 4412 v40 = pMonsterStats->pPlaceStrings[v29]; |
0 | 4413 else |
4414 v40 = pMonsterStats->pInfos[pActor->pMonsterInfo.uID].pName; | |
4415 strncpy(pTmpBuf, v40, 0x7D0u); | |
4416 } | |
4417 v26 = v28; | |
8 | 4418 //LABEL_87: |
0 | 4419 sub_41C0B8_set_status_string(v26); |
8 | 4420 //goto _return; |
4421 if ( pMouse->uPointingObjectID == 0 ) | |
4422 { | |
4423 if ( uLastPointedObjectID != 0 ) | |
4424 { | |
4425 pStatusBarString[0] = 0; | |
4426 bForceDrawStatusBar = 1; | |
4427 } | |
4428 } | |
4429 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4430 return; | |
0 | 4431 } |
4432 v1 = uNumVisibleWindows; | |
4433 if ( uNumVisibleWindows <= 0 ) | |
4434 { | |
4435 LABEL_38: | |
151 | 4436 if ( pCurrentScreen == SCREEN_CHEST ) |
0 | 4437 { |
4438 sub_42038D(); | |
8 | 4439 //goto _return; |
4440 if ( pMouse->uPointingObjectID == 0 ) | |
4441 { | |
4442 if ( uLastPointedObjectID != 0 ) | |
4443 { | |
4444 pStatusBarString[0] = 0; | |
4445 bForceDrawStatusBar = 1; | |
4446 } | |
4447 } | |
4448 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4449 return; | |
0 | 4450 } |
151 | 4451 if ( pCurrentScreen == SCREEN_HOUSE ) |
0 | 4452 { |
4453 if ( dword_F8B19C != 2 | |
4454 || (v16 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]], v16 == 0) | |
4455 || v16 == -65536 ) | |
8 | 4456 //goto _return; |
4457 { | |
4458 if ( pMouse->uPointingObjectID == 0 ) | |
4459 { | |
4460 if ( uLastPointedObjectID != 0 ) | |
4461 { | |
4462 pStatusBarString[0] = 0; | |
4463 bForceDrawStatusBar = 1; | |
4464 } | |
4465 } | |
4466 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4467 return; | |
4468 } | |
336 | 4469 pItemGen = (ItemGen *)((char *)&pParty->pPickedItem + 36 * (v16 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 4); |
8 | 4470 //LABEL_49: |
4471 v17 = pItemGen->GetDisplayName(); | |
0 | 4472 sub_41C0B8_set_status_string(v17); |
8 | 4473 //LABEL_50: |
0 | 4474 uLastPointedObjectID = 1; |
8 | 4475 //_return: |
0 | 4476 if ( pMouse->uPointingObjectID == 0 ) |
4477 { | |
4478 if ( uLastPointedObjectID != 0 ) | |
4479 { | |
4480 pStatusBarString[0] = 0; | |
4481 bForceDrawStatusBar = 1; | |
4482 } | |
4483 } | |
4484 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4485 return; | |
4486 } | |
4487 if ( (signed int)pY < 350 ) | |
4488 { | |
4489 v14 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; | |
4490 if ( v14 == 0 || v14 == -65536 || (unsigned int)v14 >= 0x1388 ) | |
8 | 4491 //goto _return; |
4492 { | |
4493 if ( pMouse->uPointingObjectID == 0 ) | |
4494 { | |
4495 if ( uLastPointedObjectID != 0 ) | |
4496 { | |
4497 pStatusBarString[0] = 0; | |
4498 bForceDrawStatusBar = 1; | |
4499 } | |
4500 } | |
4501 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4502 return; | |
4503 } | |
232 | 4504 pItemGen = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItems[v14-1]; |
8 | 4505 //goto LABEL_49; |
4506 v17 = pItemGen->GetDisplayName(); | |
4507 sub_41C0B8_set_status_string(v17); | |
4508 uLastPointedObjectID = 1; | |
4509 if ( pMouse->uPointingObjectID == 0 ) | |
4510 { | |
4511 if ( uLastPointedObjectID != 0 ) | |
4512 { | |
4513 pStatusBarString[0] = 0; | |
4514 bForceDrawStatusBar = 1; | |
4515 } | |
4516 } | |
4517 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4518 return; | |
0 | 4519 } |
4520 _click_on_game_ui: | |
4521 if ( (signed int)pX >= (signed int)pWindowList[0].uFrameX | |
4522 && (signed int)pX <= (signed int)pWindowList[0].uFrameZ | |
4523 && (signed int)pY >= (signed int)pWindowList[0].uFrameY | |
4524 && (signed int)pY <= (signed int)pWindowList[0].uFrameW ) | |
4525 { | |
8 | 4526 for ( pButton = pWindowList[0].pControlsHead; pButton != (GUIButton *)0; pButton = pButton->pNext ) |
4527 { | |
4528 if ( pButton->uButtonType == 1 ) | |
0 | 4529 { |
8 | 4530 if ( (signed int)pX >= (signed int)pButton->uX |
4531 && (signed int)pX <= (signed int)pButton->uZ | |
4532 && (signed int)pY >= (signed int)pButton->uY | |
4533 && (signed int)pY <= (signed int)pButton->uW ) | |
0 | 4534 { |
8 | 4535 pMessageType3 = (UIMessageType)pButton->field_1C; |
17 | 4536 if ( pMessageType3 == 0 ) // For books |
8 | 4537 //goto LABEL_28; |
4538 { | |
4539 v13 = pButton->pButtonName; | |
4540 sub_41C0B8_set_status_string(v13); | |
4541 uLastPointedObjectID = 1; | |
4542 return; | |
4543 } | |
4544 v38 = pButton->uControlParam; | |
0 | 4545 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) |
4546 { | |
8 | 4547 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType3; |
0 | 4548 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v38; |
4549 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
4550 ++pMessageQueue_50CBD0->uNumMessages; | |
4551 } | |
8 | 4552 //goto LABEL_131; |
0 | 4553 uLastPointedObjectID = 1; |
4554 return; | |
4555 } | |
4556 } | |
4557 else | |
4558 { | |
8 | 4559 if ( pButton->uButtonType == 2 ) |
0 | 4560 { |
8 | 4561 v45 = pX - pButton->uX; |
4562 v45 = pY - pButton->uY; | |
4563 | |
4564 if (pX >= pButton->uX && pX <= pButton->uZ && | |
4565 pY >= pButton->uY && pY <= pButton->uW) | |
4566 if ( (double)(signed int)pButton->uWidth != 0.0 ) | |
0 | 4567 { |
8 | 4568 if ( (double)(signed int)pButton->uHeight != 0.0 ) |
0 | 4569 { |
8 | 4570 //UNDEF(v32); |
14 | 4571 //if ( v33 | v34 ) |
4572 //{ | |
8 | 4573 pMessageType2 = (UIMessageType)pButton->field_1C; |
4574 if ( pMessageType2 != 0 ) | |
4575 { | |
4576 v36 = pButton->uControlParam; | |
4577 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
4578 { | |
4579 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType2; | |
4580 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v36; | |
4581 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
4582 //goto LABEL_27; | |
4583 ++pMessageQueue_50CBD0->uNumMessages; | |
4584 v13 = pButton->pButtonName; | |
4585 sub_41C0B8_set_status_string(v13); | |
4586 uLastPointedObjectID = 1; | |
4587 return; | |
4588 } | |
4589 } | |
4590 //goto LABEL_28; | |
4591 v13 = pButton->pButtonName; | |
4592 sub_41C0B8_set_status_string(v13); | |
4593 uLastPointedObjectID = 1; | |
4594 return; | |
14 | 4595 //} |
0 | 4596 } |
4597 } | |
4598 } | |
8 | 4599 else |
0 | 4600 { |
8 | 4601 if ( pButton->uButtonType == 3 |
4602 && (signed int)pX >= (signed int)pButton->uX | |
4603 && (signed int)pX <= (signed int)pButton->uZ | |
4604 && (signed int)pY >= (signed int)pButton->uY | |
4605 && (signed int)pY <= (signed int)pButton->uW ) | |
4606 //goto LABEL_19; | |
0 | 4607 { |
8 | 4608 pPlayer = pPlayers[uActiveCharacter]; |
4609 v5 = LOBYTE(pPlayer->pActiveSkills[pButton->uControlParam]); | |
4610 v6 = pPlayer->uSkillPoints; | |
0 | 4611 v7 = (v5 & 0x3F) + 1; |
4612 if ( v6 < v7 ) | |
4613 { | |
4614 v41 = v7 - v6; | |
4615 v39 = pGlobalTXT_LocalizationStrings[469];// "You need %d more Skill Points to advance here" | |
4616 } | |
4617 else | |
4618 { | |
4619 v41 = v7; | |
4620 v39 = pGlobalTXT_LocalizationStrings[468];// "Clicking here will spend %d Skill Points" | |
4621 } | |
4622 sprintf(Str1, v39, v41); | |
4623 v13 = Str1; | |
8 | 4624 //goto _set_status_and_ret; |
4625 sub_41C0B8_set_status_string(v13); | |
4626 uLastPointedObjectID = 1; | |
4627 return; | |
0 | 4628 } |
4629 } | |
4630 } | |
4631 } | |
4632 } | |
8 | 4633 pMouse->uPointingObjectID = sub_46A99B(); |
4634 //goto _return; | |
4635 if ( pMouse->uPointingObjectID == 0 ) | |
4636 { | |
4637 if ( uLastPointedObjectID != 0 ) | |
4638 { | |
4639 pStatusBarString[0] = 0; | |
4640 bForceDrawStatusBar = 1; | |
4641 } | |
4642 } | |
4643 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4644 return; | |
4645 } | |
4646 while ( 1 ) // some other fullscreen ui | |
4647 { | |
4648 pWindow = &pWindowList[pVisibleWindowsIdxs[v1] - 1]; | |
4649 if ( (signed int)pX >= (signed int)pWindow->uFrameX | |
4650 && (signed int)pX <= (signed int)pWindow->uFrameZ | |
4651 && (signed int)pY >= (signed int)pWindow->uFrameY | |
4652 && (signed int)pY <= (signed int)pWindow->uFrameW ) | |
4653 { | |
4654 for ( pButton = pWindow->pControlsHead; ; pButton = pButton->pNext ) | |
4655 { | |
4656 if ( !pButton ) | |
4657 break; | |
4658 if ( pButton->uButtonType == 1 ) | |
4659 { | |
4660 if ( (signed int)pX >= (signed int)pButton->uX | |
4661 && (signed int)pX <= (signed int)pButton->uZ | |
4662 && (signed int)pY >= (signed int)pButton->uY | |
4663 && (signed int)pY <= (signed int)pButton->uW ) | |
4664 { | |
4665 //LABEL_24: | |
4666 pMessageType1 = (UIMessageType)pButton->field_1C; | |
4667 if ( pMessageType1 ) | |
4668 { | |
4669 v12 = pButton->uControlParam; | |
4670 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
4671 { | |
4672 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType1; | |
4673 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v12; | |
4674 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
4675 //LABEL_27: | |
4676 ++pMessageQueue_50CBD0->uNumMessages; | |
4677 } | |
4678 } | |
4679 //LABEL_28: | |
4680 v13 = pButton->pButtonName; | |
4681 //_set_status_and_ret: | |
4682 sub_41C0B8_set_status_string(v13); | |
4683 //LABEL_131: | |
4684 uLastPointedObjectID = 1; | |
4685 return; | |
4686 } | |
4687 } | |
4688 else | |
4689 { | |
4690 if ( pButton->uButtonType == 2 ) | |
4691 { | |
4692 v45 = pX - pButton->uX; | |
4693 v45 = pY - pButton->uY; | |
4694 if ( (double)(signed int)pButton->uWidth != 0.0 ) | |
4695 { | |
4696 if ( (double)(signed int)pButton->uHeight != 0.0 ) | |
4697 { | |
4698 //UNDEF(v8); | |
14 | 4699 //if ( v9 | v10 ) |
8 | 4700 //goto LABEL_24; |
14 | 4701 //{ |
8 | 4702 pMessageType1 = (UIMessageType)pButton->field_1C; |
4703 if ( pMessageType1 ) | |
4704 { | |
4705 v12 = pButton->uControlParam; | |
4706 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
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; | |
4712 } | |
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 ) | |
5248 _449B7E_toggle_bit(pParty->_award_bits, 184, 1u); | |
5249 if ( v22->uItemID == 455 ) | |
5250 _449B7E_toggle_bit(pParty->_award_bits, 185, 1u); | |
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; | |
5272 _5C3420_pDecoration = &pLevelDecorations[(signed int)(unsigned __int16)v0 >> 3]; | |
5273 EventProcessor(v15, 0, 1); | |
5274 _5C3420_pDecoration = 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 } | |
5397 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) | |
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; | |
5404 return; | |
5405 } | |
5406 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 3 ) | |
5407 { | |
5408 pTurnEngine->field_18 |= 8u; | |
5409 return; | |
5410 } | |
5411 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
5412 { | |
5413 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)23; | |
5414 goto LABEL_41; | |
5415 } | |
5416 } | |
5417 else | |
5418 { | |
5419 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 3 ) | |
5420 { | |
5421 pParty->uFlags |= 8u; | |
5422 return; | |
5423 } | |
5424 if ( uActiveCharacter | |
5425 && sub_427769_spell(pPlayers[uActiveCharacter]->uQuickSpell) | |
5426 && (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
5427 { | |
5428 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)25; | |
5429 LABEL_41: | |
5430 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
5431 goto LABEL_42; | |
5432 } | |
5433 } | |
5434 } | |
5435 | |
5436 //----- (004226C2) -------------------------------------------------------- | |
265 | 5437 bool PauseGameDrawing() |
0 | 5438 { |
265 | 5439 if ( pCurrentScreen != SCREEN_GAME |
151 | 5440 && pCurrentScreen != SCREEN_NPC_DIALOGUE |
5441 && pCurrentScreen != SCREEN_CHANGE_LOCATION ) | |
5442 { | |
5443 if ( pCurrentScreen == SCREEN_INPUT_BLV ) | |
0 | 5444 return pVideoPlayer->pSmackerMovie != 0; |
151 | 5445 if ( pCurrentScreen != SCREEN_BRANCHLESS_NPC_DIALOG ) |
265 | 5446 return true; |
5447 } | |
5448 return false; | |
0 | 5449 } |
5450 // 4E28F8: using guessed type int pCurrentScreen; | |
5451 | |
5452 //----- (004226EF) -------------------------------------------------------- | |
373 | 5453 void SetUserInterface(PartyAlignment align, bool bReplace) |
0 | 5454 { |
5455 unsigned int v3; // eax@7 | |
5456 unsigned __int16 v4; // dx@7 | |
5457 unsigned __int16 v5; // cx@7 | |
5458 unsigned __int16 v6; // [sp-4h] [bp-14h]@7 | |
5459 | |
373 | 5460 |
5461 if (align == PartyAlignment_Evil) | |
5462 { | |
0 | 5463 if ( bReplace ) |
5464 { | |
5465 pTexture_RightFrame->Reload("ib-r-C.pcx"); | |
5466 pTexture_BottomFrame->Reload("ib-b-C.pcx"); | |
5467 pTexture_TopFrame->Reload("ib-t-C.pcx"); | |
5468 pTexture_LeftFrame->Reload("ib-l-C.pcx"); | |
5469 pTexture_StatusBar->Reload("IB-Foot-c.pcx"); | |
5470 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_right_panel], "ib-mb-C", 2); | |
5471 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D8], "ib-autmask-c", 2); | |
5472 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079B4], "IB-COMP-C", 2); | |
5473 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D0], "IB-InitG-c", 2); | |
5474 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079C8], "IB-InitY-c", 2); | |
5475 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079CC], "IB-InitR-c", 2); | |
319 | 5476 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-C", 2); |
5477 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-C", 2); | |
5478 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-C", 2); | |
5479 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-C", 2); | |
0 | 5480 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50C98C], "IB-selec-C", 2); |
319 | 5481 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-c", 2); |
5482 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-c", 2); | |
5483 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-c", 2); | |
5484 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-c", 2); | |
0 | 5485 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50796C], "isg-01-c", 2); |
5486 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507968], "isg-02-c", 2); | |
5487 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507964], "isg-03-c", 2); | |
5488 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507960], "isg-04-c", 2); | |
5489 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeC"); | |
5490 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
5491 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchC"); | |
5492 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
5493 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_506438], "ib-bcu-c", 2); | |
5494 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc-c", 2); | |
5495 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507958], "fr_inven-c", 2); | |
5496 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Parchment], "parchment", 2); | |
5497 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B4], "cornr_ll-c", 2); | |
5498 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B0], "cornr_lr-c", 2); | |
5499 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076AC], "cornr_ul-c", 2); | |
5500 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A8], "cornr_ur-c", 2); | |
5501 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A4], "edge_btm-c", 2); | |
5502 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A0], "edge_lf-c", 2); | |
5503 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50769C], "edge_rt-c", 2); | |
5504 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507698], "edge_top-c", 2); | |
5505 pIcons_LOD->ReloadTexture(pTexture_591428, "endcap-c", 2); | |
5506 } | |
5507 else | |
5508 { | |
5509 pTexture_RightFrame->Load("ib-r-C.pcx", 0); | |
5510 pTexture_BottomFrame->Load("ib-b-c.pcx", 0); | |
5511 pTexture_TopFrame->Load("ib-t-C.pcx", 0); | |
5512 pTexture_LeftFrame->Load("ib-l-C.pcx", 0); | |
5513 pTexture_StatusBar->Load("IB-Foot-c.pcx", 0); | |
5514 uTextureID_right_panel = pIcons_LOD->LoadTexture("ib-mb-C", TEXTURE_16BIT_PALETTE); | |
5515 dword_5079D8 = pIcons_LOD->LoadTexture("ib-autmask-c", TEXTURE_16BIT_PALETTE); | |
5516 dword_5079B4 = pIcons_LOD->LoadTexture("IB-COMP-C", TEXTURE_16BIT_PALETTE); | |
5517 dword_5079D0 = pIcons_LOD->LoadTexture("IB-InitG-c", TEXTURE_16BIT_PALETTE); | |
5518 dword_5079C8 = pIcons_LOD->LoadTexture("IB-InitY-c", TEXTURE_16BIT_PALETTE); | |
5519 dword_5079CC = pIcons_LOD->LoadTexture("IB-InitR-c", TEXTURE_16BIT_PALETTE); | |
319 | 5520 uTextureID_Btn_NPCLeft = pIcons_LOD->LoadTexture("IB-NPCLD-C", TEXTURE_16BIT_PALETTE); |
5521 uTextureID_Btn_NPCRight = pIcons_LOD->LoadTexture("IB-NPCRD-C", TEXTURE_16BIT_PALETTE); | |
328 | 5522 uTextureID_Btn_ZoomIn = pIcons_LOD->LoadTexture("ib-autout-C", TEXTURE_16BIT_PALETTE); |
319 | 5523 uTextureID_Btn_ZoomOut = pIcons_LOD->LoadTexture("ib-autin-C", TEXTURE_16BIT_PALETTE); |
0 | 5524 dword_50C98C = pIcons_LOD->LoadTexture("IB-selec-C", TEXTURE_16BIT_PALETTE); |
319 | 5525 uTextureID_Btn_CastSpell = pIcons_LOD->LoadTexture("ib-m1d-c", TEXTURE_16BIT_PALETTE); |
5526 uTextureID_Btn_Rest = pIcons_LOD->LoadTexture("ib-m2d-c", TEXTURE_16BIT_PALETTE); | |
5527 uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-c", TEXTURE_16BIT_PALETTE); | |
5528 uTextureID_Btn_GameSettings = pIcons_LOD->LoadTexture("ib-m4d-c", TEXTURE_16BIT_PALETTE); | |
0 | 5529 uTextureID_506438 = pIcons_LOD->LoadTexture("ib-bcu-c", TEXTURE_16BIT_PALETTE); |
5530 dword_50796C = pIcons_LOD->LoadTexture("isg-01-c", TEXTURE_16BIT_PALETTE); | |
5531 dword_507968 = pIcons_LOD->LoadTexture("isg-02-c", TEXTURE_16BIT_PALETTE); | |
5532 dword_507964 = pIcons_LOD->LoadTexture("isg-03-c", TEXTURE_16BIT_PALETTE); | |
5533 dword_507960 = pIcons_LOD->LoadTexture("isg-04-c", TEXTURE_16BIT_PALETTE); | |
5534 uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc-c", TEXTURE_16BIT_PALETTE); | |
5535 uTextureID_507958 = pIcons_LOD->LoadTexture("fr_inven", TEXTURE_16BIT_PALETTE); | |
5536 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeC"); | |
5537 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
5538 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchC"); | |
5539 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
5540 } | |
5541 v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xC8u, 0, 0); | |
5542 v4 = 0; | |
5543 v6 = 0; | |
5544 v5 = 10; | |
5545 } | |
373 | 5546 else if (align == PartyAlignment_Neutral) |
0 | 5547 { |
5548 if ( bReplace ) | |
5549 { | |
5550 pTexture_RightFrame->Reload("ib-r-a.pcx"); | |
5551 pTexture_BottomFrame->Reload("ib-b-a.pcx"); | |
5552 pTexture_TopFrame->Reload("ib-t-a.pcx"); | |
5553 pTexture_LeftFrame->Reload("ib-l-a.pcx"); | |
5554 pTexture_StatusBar->Reload("IB-Foot-a.pcx"); | |
5555 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_right_panel], "ib-mb-a", 2); | |
5556 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D8], "ib-autmask-a", 2); | |
5557 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079B4], "IB-COMP-a", 2); | |
5558 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D0], "IB-InitG-a", 2); | |
5559 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079C8], "IB-InitY-a", 2); | |
5560 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079CC], "IB-InitR-a", 2); | |
319 | 5561 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-a", 2); |
5562 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-a", 2); | |
5563 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-a", 2); | |
5564 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-a", 2); | |
0 | 5565 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50C98C], "IB-selec-a", 2); |
319 | 5566 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-a", 2); |
5567 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-a", 2); | |
5568 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-a", 2); | |
5569 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-a", 2); | |
0 | 5570 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50796C], "isg-01-a", 2); |
5571 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507968], "isg-02-a", 2); | |
5572 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507964], "isg-03-a", 2); | |
5573 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507960], "isg-04-a", 2); | |
5574 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeA"); | |
5575 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
5576 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchA"); | |
5577 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
5578 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_506438], "ib-bcu-a", 2); | |
5579 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc", 2); | |
5580 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507958], "fr_inven", 2); | |
5581 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Parchment], "parchment", 2); | |
5582 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B4], "cornr_ll", 2); | |
5583 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B0], "cornr_lr", 2); | |
5584 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076AC], "cornr_ul", 2); | |
5585 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A8], "cornr_ur", 2); | |
5586 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A4], "edge_btm", 2); | |
5587 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A0], "edge_lf", 2); | |
5588 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50769C], "edge_rt", 2); | |
5589 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507698], "edge_top", 2); | |
5590 pIcons_LOD->ReloadTexture(pTexture_591428, "endcap", 2); | |
5591 } | |
5592 else | |
5593 { | |
5594 pTexture_RightFrame->Load("ib-r-A.pcx", 0); | |
5595 pTexture_BottomFrame->Load("ib-b-A.pcx", 0); | |
5596 pTexture_TopFrame->Load("ib-t-A.pcx", 0); | |
5597 pTexture_LeftFrame->Load("ib-l-A.pcx", 0); | |
5598 pTexture_StatusBar->Load("IB-Foot-a.pcx", 0); | |
5599 uTextureID_right_panel = pIcons_LOD->LoadTexture("ib-mb-A", TEXTURE_16BIT_PALETTE); | |
5600 dword_5079D8 = pIcons_LOD->LoadTexture("ib-autmask-a", TEXTURE_16BIT_PALETTE); | |
5601 dword_5079B4 = pIcons_LOD->LoadTexture("IB-COMP-A", TEXTURE_16BIT_PALETTE); | |
5602 dword_5079D0 = pIcons_LOD->LoadTexture("IB-InitG-a", TEXTURE_16BIT_PALETTE); | |
5603 dword_5079C8 = pIcons_LOD->LoadTexture("IB-InitY-a", TEXTURE_16BIT_PALETTE); | |
5604 dword_5079CC = pIcons_LOD->LoadTexture("IB-InitR-a", TEXTURE_16BIT_PALETTE); | |
319 | 5605 uTextureID_Btn_NPCLeft = pIcons_LOD->LoadTexture("IB-NPCLD-A", TEXTURE_16BIT_PALETTE); |
5606 uTextureID_Btn_NPCRight = pIcons_LOD->LoadTexture("IB-NPCRD-A", TEXTURE_16BIT_PALETTE); | |
0 | 5607 dword_50C98C = pIcons_LOD->LoadTexture("IB-selec-A", TEXTURE_16BIT_PALETTE); |
319 | 5608 uTextureID_Btn_CastSpell = pIcons_LOD->LoadTexture("ib-m1d-a", TEXTURE_16BIT_PALETTE); |
5609 uTextureID_Btn_Rest = pIcons_LOD->LoadTexture("ib-m2d-a", TEXTURE_16BIT_PALETTE); | |
5610 uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-a", TEXTURE_16BIT_PALETTE); | |
5611 uTextureID_Btn_GameSettings = pIcons_LOD->LoadTexture("ib-m4d-a", TEXTURE_16BIT_PALETTE); | |
328 | 5612 uTextureID_Btn_ZoomIn = pIcons_LOD->LoadTexture("ib-autout-a", TEXTURE_16BIT_PALETTE); |
319 | 5613 uTextureID_Btn_ZoomOut = pIcons_LOD->LoadTexture("ib-autin-a", TEXTURE_16BIT_PALETTE); |
0 | 5614 uTextureID_506438 = pIcons_LOD->LoadTexture("ib-bcu-a", TEXTURE_16BIT_PALETTE); |
5615 dword_50796C = pIcons_LOD->LoadTexture("isg-01-a", TEXTURE_16BIT_PALETTE); | |
5616 dword_507968 = pIcons_LOD->LoadTexture("isg-02-a", TEXTURE_16BIT_PALETTE); | |
5617 dword_507964 = pIcons_LOD->LoadTexture("isg-03-a", TEXTURE_16BIT_PALETTE); | |
5618 dword_507960 = pIcons_LOD->LoadTexture("isg-04-a", TEXTURE_16BIT_PALETTE); | |
5619 uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc", TEXTURE_16BIT_PALETTE); | |
5620 uTextureID_507958 = pIcons_LOD->LoadTexture("fr_inven", TEXTURE_16BIT_PALETTE); | |
5621 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeA"); | |
5622 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
5623 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchA"); | |
5624 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
5625 uTextureID_Parchment = pIcons_LOD->LoadTexture("parchment", TEXTURE_16BIT_PALETTE); | |
5626 uTextureID_5076B4 = pIcons_LOD->LoadTexture("cornr_ll", TEXTURE_16BIT_PALETTE); | |
5627 uTextureID_5076B0 = pIcons_LOD->LoadTexture("cornr_lr", TEXTURE_16BIT_PALETTE); | |
5628 uTextureID_5076AC = pIcons_LOD->LoadTexture("cornr_ul", TEXTURE_16BIT_PALETTE); | |
5629 uTextureID_5076A8 = pIcons_LOD->LoadTexture("cornr_ur", TEXTURE_16BIT_PALETTE); | |
5630 uTextureID_5076A4 = pIcons_LOD->LoadTexture("edge_btm", TEXTURE_16BIT_PALETTE); | |
5631 uTextureID_5076A0 = pIcons_LOD->LoadTexture("edge_lf", TEXTURE_16BIT_PALETTE); | |
5632 uTextureID_50769C = pIcons_LOD->LoadTexture("edge_rt", TEXTURE_16BIT_PALETTE); | |
5633 uTextureID_507698 = pIcons_LOD->LoadTexture("edge_top", TEXTURE_16BIT_PALETTE); | |
5634 pTexture_591428 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("endcap", TEXTURE_16BIT_PALETTE)]; | |
5635 | |
5636 } | |
5637 v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xAu, 0, 0); | |
5638 v4 = 214; | |
5639 v5 = 230; | |
5640 v6 = 193; | |
5641 } | |
373 | 5642 else if (align == PartyAlignment_Good) |
0 | 5643 { |
5644 if ( bReplace ) | |
5645 { | |
5646 pTexture_RightFrame->Reload("ib-r-B.pcx"); | |
5647 pTexture_BottomFrame->Reload("ib-b-B.pcx"); | |
5648 pTexture_TopFrame->Reload("ib-t-B.pcx"); | |
5649 pTexture_LeftFrame->Reload("ib-l-B.pcx"); | |
5650 pTexture_StatusBar->Reload("IB-Foot-b.pcx"); | |
5651 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_right_panel], "ib-mb-B", 2); | |
5652 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D8], "ib-autmask-b", 2); | |
5653 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079B4], "IB-COMP-B", 2); | |
5654 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D0], "IB-InitG-b", 2); | |
5655 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079C8], "IB-InitY-b", 2); | |
5656 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079CC], "IB-InitR-b", 2); | |
319 | 5657 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-B", 2); |
5658 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-B", 2); | |
5659 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-B", 2); | |
5660 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-B", 2); | |
0 | 5661 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50C98C], "IB-selec-B", 2); |
319 | 5662 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-b", 2); |
5663 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-b", 2); | |
5664 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-b", 2); | |
5665 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-b", 2); | |
0 | 5666 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50796C], "isg-01-b", 2); |
5667 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507968], "isg-02-b", 2); | |
5668 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507964], "isg-03-b", 2); | |
5669 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507960], "isg-04-b", 2); | |
5670 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeB"); | |
5671 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
5672 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchB"); | |
5673 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
5674 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_506438], "ib-bcu-b", 2); | |
5675 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc-b", 2); | |
5676 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507958], "fr_inven-b", 2); | |
5677 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Parchment], "parchment", 2); | |
5678 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B4], "cornr_ll-b", 2); | |
5679 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B0], "cornr_lr-b", 2); | |
5680 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076AC], "cornr_ul-b", 2); | |
5681 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A8], "cornr_ur-b", 2); | |
5682 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A4], "edge_btm-b", 2); | |
5683 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A0], "edge_lf-b", 2); | |
5684 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50769C], "edge_rt-b", 2); | |
5685 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507698], "edge_top-b", 2); | |
5686 pIcons_LOD->ReloadTexture(pTexture_591428, "endcap-b", 2); | |
5687 } | |
5688 v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0xC8u); | |
5689 v5 = 255; | |
5690 v4 = 225; | |
5691 v6 = 255; | |
5692 } | |
373 | 5693 else assert(false); |
5694 | |
0 | 5695 uGameUIFontMain = v3; |
5696 uGameUIFontShadow = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v5, v4, v6); | |
5697 } | |
5698 | |
5699 | |
5700 | |
5701 //----- (00423AEE) -------------------------------------------------------- | |
5702 void __cdecl reset_some_strus_flt_2Cs() | |
5703 { | |
5704 float *v0; // eax@1 | |
5705 signed int v1; // ecx@1 | |
5706 signed int v2; // edx@1 | |
5707 float *v3; // eax@3 | |
5708 signed int v4; // edx@3 | |
5709 float *v5; // eax@5 | |
5710 signed int v6; // edx@5 | |
5711 float *v7; // eax@7 | |
5712 signed int v8; // edx@7 | |
5713 float *v9; // eax@9 | |
5714 | |
5715 v0 = &array_50AC10[0].flt_2C; | |
5716 v1 = 50; | |
5717 v2 = 50; | |
5718 do | |
5719 { | |
5720 *v0 = 0.0; | |
5721 v0 += 12; | |
5722 --v2; | |
5723 } | |
5724 while ( v2 ); | |
5725 v3 = &array_50A2B0[0].flt_2C; | |
5726 v4 = 50; | |
5727 do | |
5728 { | |
5729 *v3 = 0.0; | |
5730 v3 += 12; | |
5731 --v4; | |
5732 } | |
5733 while ( v4 ); | |
5734 v5 = &array_509950[0].flt_2C; | |
5735 v6 = 50; | |
5736 do | |
5737 { | |
5738 *v5 = 0.0; | |
5739 v5 += 12; | |
5740 --v6; | |
5741 } | |
5742 while ( v6 ); | |
5743 v7 = &array_508FF0[0].flt_2C; | |
5744 v8 = 50; | |
5745 do | |
5746 { | |
5747 *v7 = 0.0; | |
5748 v7 += 12; | |
5749 --v8; | |
5750 } | |
5751 while ( v8 ); | |
5752 v9 = &array_508690[0].flt_2C; | |
5753 do | |
5754 { | |
5755 *v9 = 0.0; | |
5756 v9 += 12; | |
5757 --v1; | |
5758 } | |
5759 while ( v1 ); | |
5760 } | |
5761 | |
5762 //----- (00423B4A) -------------------------------------------------------- | |
5763 void __cdecl sub_423B4A() | |
5764 { | |
5765 float *v0; // eax@1 | |
5766 signed int v1; // ecx@1 | |
5767 | |
5768 v0 = &array_507D30[0].flt_2C; | |
5769 v1 = 50; | |
5770 do | |
5771 { | |
5772 *v0 = 0.0; | |
5773 v0 += 12; | |
5774 --v1; | |
5775 } | |
5776 while ( v1 ); | |
5777 } | |
5778 | |
5779 //----- (00423B5D) -------------------------------------------------------- | |
5780 int __fastcall sub_423B5D(unsigned int uFaceID) | |
5781 { | |
5782 BLVFace *v1; // ebx@1 | |
5783 Vec3_short_ *v2; // esi@1 | |
5784 //int v3; // ST28_4@1 | |
5785 __int16 v4; // ST2C_2@1 | |
5786 //signed int v5; // esi@1 | |
5787 //Vec3_short_ *v6; // eax@4 | |
5788 //signed int v7; // edi@5 | |
5789 //signed int v8; // eax@5 | |
5790 //signed int i_; // ecx@10 | |
5791 int v10; // eax@10 | |
5792 int v11; // edx@11 | |
5793 int v12; // ST28_4@12 | |
5794 signed int v13; // edx@12 | |
5795 signed __int64 v14; // qtt@12 | |
5796 int *v15; // ebx@12 | |
5797 int v16; // ST28_4@14 | |
5798 signed int v17; // eax@14 | |
5799 signed __int64 v18; // qtt@14 | |
5800 signed int v19; // edx@15 | |
5801 signed int v20; // edx@17 | |
5802 signed int v21; // ebx@19 | |
5803 signed int v22; // esi@20 | |
5804 int v23; // edi@21 | |
5805 int v24; // eax@21 | |
5806 int v25; // eax@22 | |
5807 int v26; // eax@22 | |
5808 signed int v27; // ST30_4@24 | |
5809 signed __int64 v28; // qtt@24 | |
5810 int v29; // ST18_4@25 | |
5811 int v30; // eax@26 | |
5812 int v31; // eax@27 | |
5813 int v32; // eax@27 | |
5814 signed int v33; // ST30_4@29 | |
5815 signed __int64 v34; // qtt@29 | |
5816 int v35; // ST30_4@30 | |
5817 signed int v36; // edi@31 | |
5818 unsigned int v37; // eax@31 | |
5819 bool v38; // edx@31 | |
5820 int v39; // ecx@31 | |
5821 int v40; // ecx@32 | |
5822 int v41; // esi@32 | |
5823 int v42; // eax@34 | |
5824 signed int v43; // ebx@41 | |
5825 unsigned int v44; // eax@41 | |
5826 signed int v45; // ecx@42 | |
5827 int v46; // esi@42 | |
5828 int v47; // eax@44 | |
5829 signed int v48; // edi@51 | |
5830 unsigned int v49; // eax@51 | |
5831 bool v50; // edx@51 | |
5832 int v51; // ecx@51 | |
5833 int v52; // ecx@52 | |
5834 signed int v53; // esi@52 | |
5835 int v54; // eax@54 | |
5836 int v55; // ebx@61 | |
5837 unsigned int v56; // eax@61 | |
5838 signed int v57; // ecx@62 | |
5839 int v58; // esi@62 | |
5840 int v59; // eax@64 | |
5841 char v61; // zf@72 | |
5842 signed int v62; // edx@75 | |
5843 int v63; // ecx@76 | |
5844 int v64; // esi@76 | |
5845 int v65; // ecx@83 | |
5846 //signed int v66; // [sp+14h] [bp-14h]@3 | |
5847 int v67; // [sp+14h] [bp-14h]@34 | |
5848 int v68; // [sp+14h] [bp-14h]@44 | |
5849 int v69; // [sp+14h] [bp-14h]@54 | |
5850 int v70; // [sp+14h] [bp-14h]@64 | |
5851 signed int v71; // [sp+14h] [bp-14h]@75 | |
5852 bool thisa; // [sp+18h] [bp-10h]@9 | |
5853 int thisb; // [sp+18h] [bp-10h]@12 | |
5854 int thisc; // [sp+18h] [bp-10h]@20 | |
5855 bool thisd; // [sp+18h] [bp-10h]@41 | |
5856 bool thise; // [sp+18h] [bp-10h]@61 | |
5857 int thisf; // [sp+18h] [bp-10h]@74 | |
5858 signed int v79; // [sp+1Ch] [bp-Ch]@9 | |
5859 int v80; // [sp+1Ch] [bp-Ch]@76 | |
5860 bool v81; // [sp+20h] [bp-8h]@10 | |
5861 bool v82; // [sp+20h] [bp-8h]@32 | |
5862 bool v83; // [sp+20h] [bp-8h]@42 | |
5863 bool v84; // [sp+20h] [bp-8h]@52 | |
5864 bool v85; // [sp+20h] [bp-8h]@62 | |
5865 //signed int i; // [sp+24h] [bp-4h]@9 | |
5866 signed int ia; // [sp+24h] [bp-4h]@19 | |
5867 signed int ib; // [sp+24h] [bp-4h]@31 | |
5868 signed int ic; // [sp+24h] [bp-4h]@41 | |
5869 signed int id; // [sp+24h] [bp-4h]@51 | |
5870 signed int ie; // [sp+24h] [bp-4h]@61 | |
5871 | |
5872 v1 = &pIndoor->pFaces[uFaceID]; | |
5873 //this = pGame->pIndoorCameraD3D; | |
5874 v2 = &pIndoor->pVertices[v1->pVertexIDs[0]]; | |
5875 //v3 = *(_DWORD *)&v2->x; | |
5876 v4 = v2->z; | |
5877 //v5 = 0; | |
5878 if ( v1->pFacePlane_old.vNormal.x * (v2->x - pBLVRenderParams->vPartyPos.x) | |
5879 + v1->pFacePlane_old.vNormal.y * (v2->y - pBLVRenderParams->vPartyPos.y) | |
5880 + v1->pFacePlane_old.vNormal.z * (v2->z - pBLVRenderParams->vPartyPos.z) < 0 ) | |
5881 { | |
5882 dword_50B700 = 1; | |
5883 } | |
5884 else | |
5885 { | |
5886 dword_50B700 = 0; | |
315 | 5887 if ( !v1->TwoSided() ) |
0 | 5888 return 0; |
5889 } | |
5890 //v66 = v1->uNumVertices; | |
5891 for (uint i = 0; i < v1->uNumVertices; ++i) | |
5892 { | |
5893 auto v6 = &pIndoor->pVertices[v1->pVertexIDs[i]]; | |
5894 pGame->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible( | |
5895 v6->x, | |
5896 v6->y, | |
5897 v6->z, | |
5898 &_50B924_view_transformed_xs[i], | |
5899 &_50B834_view_transformed_zs[i], | |
5900 &_50B744_view_transformed_ys[i], | |
5901 0); | |
5902 } | |
5903 | |
5904 //v7 = v1->uNumVertices; | |
5905 //v8 = 0; | |
5906 if (v1->uNumVertices <= 0) | |
5907 return 0; | |
5908 | |
5909 bool bFound = false; | |
5910 for (uint i = 0; i < v1->uNumVertices; ++i) | |
5911 if (_50B924_view_transformed_xs[i] >= 0x80000u) | |
5912 { | |
5913 bFound = true; | |
5914 break; | |
5915 } | |
5916 if (!bFound) | |
5917 return 0; | |
5918 | |
5919 v79 = 0; | |
5920 _50B924_view_transformed_xs[v1->uNumVertices] = _50B924_view_transformed_xs[0]; | |
5921 _50B834_view_transformed_zs[v1->uNumVertices] = _50B834_view_transformed_zs[0]; | |
5922 _50B744_view_transformed_ys[v1->uNumVertices] = _50B744_view_transformed_ys[0]; | |
5923 thisa = _50B924_view_transformed_xs[0] >= 0x80000u; | |
5924 //int i = 1; | |
5925 for (uint i = 1; i < v1->uNumVertices; ++i) | |
5926 { | |
5927 v10 = _50B924_view_transformed_xs[i]; | |
5928 v81 = v10 >= (signed int)0x80000u; | |
5929 if ( thisa ^ v81 ) | |
5930 { | |
5931 v11 = _50B924_view_transformed_xs[i - 1]; | |
5932 if ( v10 >= (signed int)0x80000u ) | |
5933 { | |
5934 v12 = v10 - v11; | |
5935 v13 = 0x80000 - v11; | |
5936 LODWORD(v14) = v13 << 16; | |
5937 HIDWORD(v14) = v13 >> 16; | |
5938 v15 = &_50B744_view_transformed_ys[i - 1]; | |
5939 dword_50B828[v79] = ((unsigned __int64)((_50B834_view_transformed_zs[i] - _50B834_view_transformed_zs[i - 1]) | |
5940 * v14 | |
5941 / v12) >> 16) | |
5942 + _50B834_view_transformed_zs[i - 1]; | |
5943 thisb = (unsigned __int64)((_50B744_view_transformed_ys[i] - _50B744_view_transformed_ys[i - 1]) * v14 / v12) >> 16; | |
5944 } | |
5945 else | |
5946 { | |
5947 v16 = v11 - v10; | |
5948 v17 = 0x80000 - v10; | |
5949 LODWORD(v18) = v17 << 16; | |
5950 HIDWORD(v18) = v17 >> 16; | |
5951 v15 = &_50B744_view_transformed_ys[i]; | |
108 | 5952 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 | 5953 thisb = (unsigned __int64)((_50B744_view_transformed_ys[i - 1] - _50B744_view_transformed_ys[i]) * v18 / v16) >> 16; |
5954 } | |
5955 v19 = v79++; | |
5956 //v7 = v66; | |
5957 dword_50B738[v19] = thisb + *v15; | |
5958 dword_50B918[v19] = 0x80000u; | |
5959 } | |
5960 if ( v81 ) | |
5961 { | |
5962 v20 = v79++; | |
5963 dword_50B918[v20] = _50B924_view_transformed_xs[i]; | |
5964 dword_50B828[v20] = _50B834_view_transformed_zs[i]; | |
5965 dword_50B738[v20] = _50B744_view_transformed_ys[i]; | |
5966 } | |
5967 //++i; | |
5968 thisa = v81; | |
5969 } | |
5970 ia = 0; | |
5971 v21 = v79; | |
5972 dword_50B918[v79] = dword_50B918[0]; | |
5973 dword_50B828[v79] = dword_50B828[0]; | |
5974 for ( dword_50B738[v79] = dword_50B738[0]; ia < v79; dword_50BA08[v22] = pBLVRenderParams->uViewportCenterY - v35 ) | |
5975 { | |
5976 v22 = ia; | |
5977 thisc = abs(dword_50B918[ia]); | |
5978 if ( abs(dword_50B828[ia]) >> 13 <= thisc ) | |
5979 { | |
5980 v27 = dword_50B828[v22]; | |
5981 LODWORD(v28) = v27 << 16; | |
5982 HIDWORD(v28) = v27 >> 16; | |
5983 v26 = v28 / dword_50B918[v22]; | |
5984 v23 = 0; | |
5985 } | |
5986 else | |
5987 { | |
5988 v23 = 0; | |
5989 v24 = 0; | |
5990 if ( dword_50B828[v22] >= 0 ) | |
5991 { | |
5992 LOBYTE(v24) = dword_50B918[v22] >= 0; | |
5993 v26 = ((v24 - 1) & 0xFF800000) + 0x400000; | |
5994 } | |
5995 else | |
5996 { | |
5997 LOBYTE(v24) = dword_50B918[v22] >= 0; | |
5998 v25 = v24 - 1; | |
5999 v26 = (v25 & 0x800000) - 0x400000; | |
6000 } | |
6001 } | |
6002 v29 = dword_50B738[v22]; | |
6003 dword_50BAF4_xs[v22 + 1] = v26; | |
6004 if ( abs(v29) >> 13 <= thisc ) | |
6005 { | |
6006 v33 = dword_50B738[v22]; | |
6007 LODWORD(v34) = v33 << 16; | |
6008 HIDWORD(v34) = v33 >> 16; | |
6009 v32 = v34 / dword_50B918[v22]; | |
6010 } | |
6011 else | |
6012 { | |
6013 v30 = 0; | |
6014 if ( dword_50B738[v22] >= v23 ) | |
6015 { | |
6016 LOBYTE(v30) = dword_50B918[v22] >= v23; | |
6017 v32 = ((v30 - 1) & 0xFF800000) + 0x400000; | |
6018 } | |
6019 else | |
6020 { | |
6021 LOBYTE(v30) = dword_50B918[v22] >= v23; | |
6022 v31 = v30 - 1; | |
6023 v32 = (v31 & 0x800000) - 0x400000; | |
6024 } | |
6025 } | |
6026 dword_50BA08[v22] = v32; | |
6027 dword_50BAF4_xs[v22 + 1] = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) | |
6028 * (signed __int64)dword_50BAF4_xs[v22 + 1]) >> 16; | |
6029 v35 = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) * (signed __int64)dword_50BA08[v22]) >> 16; | |
6030 dword_50BAF4_xs[v22 + 1] = pBLVRenderParams->uViewportCenterX - dword_50BAF4_xs[v22 + 1]; | |
6031 ++ia; | |
6032 } | |
6033 v36 = 0; | |
6034 dword_50BAF4_xs[v21 + 1] = dword_50BAF4_xs[1]; | |
6035 dword_50BA08[v21] = dword_50BA08[0]; | |
6036 v37 = pBLVRenderParams->uViewportX; | |
6037 v38 = dword_50BAF4_xs[1] < (signed int)pBLVRenderParams->uViewportX; | |
6038 LOBYTE(v38) = dword_50BAF4_xs[1] >= (signed int)pBLVRenderParams->uViewportX; | |
6039 v39 = 1; | |
6040 ib = 1; | |
6041 if ( v79 < 1 ) | |
6042 return 0; | |
6043 do | |
6044 { | |
6045 v40 = v39; | |
6046 v41 = dword_50BAF4_xs[v40 + 1]; | |
6047 v82 = v41 >= (signed int)v37; | |
6048 if ( v38 ^ v82 ) | |
6049 { | |
6050 if ( v41 >= (signed int)v37 ) | |
6051 { | |
6052 v67 = (signed int)(v37 - dword_50BAF4_xs[v40]) | |
6053 * (signed __int64)(dword_50BA08[v40] - dword_50B9F8[v40 + 3]) | |
6054 / (v41 - dword_50BAF4_xs[v40]); | |
6055 v42 = dword_50B9F8[v40 + 3]; | |
6056 } | |
6057 else | |
6058 { | |
6059 v67 = (signed int)(v37 - v41) | |
6060 * (signed __int64)(dword_50B9F8[v40 + 3] - dword_50BA08[v40]) | |
6061 / (dword_50BAF4_xs[v40] - v41); | |
6062 v42 = dword_50BA08[v40]; | |
6063 } | |
6064 ++v36; | |
6065 dword_50B9F8[v36] = v67 + v42; | |
6066 v37 = pBLVRenderParams->uViewportX; | |
6067 dword_50BAE8_xs[v36] = pBLVRenderParams->uViewportX; | |
6068 } | |
6069 v38 = v82; | |
6070 if ( v82 ) | |
6071 { | |
6072 dword_50BAE8_xs[v36 + 1] = dword_50BAF4_xs[v40 + 1]; | |
6073 dword_50B9F8[v36++ + 1] = dword_50BA08[v40]; | |
6074 } | |
6075 v39 = ib++ + 1; | |
6076 } | |
6077 while ( ib <= v79 ); | |
6078 | |
6079 if ( !v36 | |
6080 || (v43 = 0, | |
6081 dword_50BAE8_xs[v36 + 1] = dword_50BAE8_xs[1], | |
6082 dword_50B9F8[v36 + 1] = dword_50B9F8[1], | |
6083 v44 = pBLVRenderParams->uViewportZ, | |
6084 thisd = dword_50BAE8_xs[1] <= (signed int)pBLVRenderParams->uViewportZ, | |
6085 ic = 1, | |
6086 v36 < 1) ) | |
6087 return 0; | |
6088 | |
6089 do | |
6090 { | |
6091 v45 = ic; | |
6092 v46 = dword_50BAE8_xs[ic + 1]; | |
6093 v83 = v46 <= (signed int)v44; | |
6094 if ( thisd ^ v83 ) | |
6095 { | |
6096 if ( v46 <= (signed int)v44 ) | |
6097 { | |
6098 v68 = (signed int)(v44 - dword_50BAE8_xs[v45]) | |
6099 * (signed __int64)(dword_50B9F8[v45 + 1] - dword_50B9F8[v45]) | |
6100 / (v46 - dword_50BAE8_xs[v45]); | |
6101 v47 = dword_50B9F8[v45]; | |
6102 } | |
6103 else | |
6104 { | |
6105 v68 = (signed int)(v44 - v46) | |
6106 * (signed __int64)(dword_50B9F8[v45] - dword_50B9F8[v45 + 1]) | |
6107 / (dword_50BAE8_xs[v45] - v46); | |
6108 v47 = dword_50B9F8[v45 + 1]; | |
6109 } | |
6110 ++v43; | |
6111 dword_50B9EC[v43] = v68 + v47; | |
6112 v44 = pBLVRenderParams->uViewportZ; | |
6113 dword_50BADC_xs[v43] = pBLVRenderParams->uViewportZ; | |
6114 } | |
6115 if ( v83 ) | |
6116 { | |
6117 dword_50BAE0[v43] = dword_50BAE8_xs[v45 + 1]; | |
6118 dword_50B9F0[v43++] = dword_50B9F8[v45 + 1]; | |
6119 } | |
6120 ++ic; | |
6121 thisd = v83; | |
6122 } | |
6123 while ( ic <= v36 ); | |
6124 if ( !v43 | |
6125 || (v48 = 0, | |
6126 dword_50BAE0[v43] = dword_50BAE0[0], | |
6127 dword_50B9F0[v43] = dword_50B9F0[0], | |
6128 v49 = pBLVRenderParams->uViewportY, | |
6129 v50 = dword_50B9F0[0] < (signed int)pBLVRenderParams->uViewportY, | |
6130 LOBYTE(v50) = dword_50B9F0[0] >= (signed int)pBLVRenderParams->uViewportY, | |
6131 v51 = 1, | |
6132 id = 1, | |
6133 v43 < 1) ) | |
6134 return 0; | |
6135 do | |
6136 { | |
6137 v52 = v51; | |
6138 v53 = dword_50B9F0[v52]; | |
6139 v84 = v53 >= (signed int)v49; | |
6140 if ( v50 ^ v84 ) | |
6141 { | |
6142 if ( v53 >= (signed int)v49 ) | |
6143 { | |
6144 v69 = (signed int)(v49 - dword_50B9EC[v52]) | |
6145 * (signed __int64)(dword_50BAE0[v52] - dword_50BADC_xs[v52]) | |
6146 / (v53 - dword_50B9EC[v52]); | |
6147 v54 = dword_50BADC_xs[v52]; | |
6148 } | |
6149 else | |
6150 { | |
6151 v69 = (signed int)(v49 - v53) | |
6152 * (signed __int64)(dword_50BADC_xs[v52] - dword_50BAE0[v52]) | |
6153 / (dword_50B9EC[v52] - v53); | |
6154 v54 = dword_50BAE0[v52]; | |
6155 } | |
6156 ++v48; | |
6157 dword_50BAD0[v48] = v69 + v54; | |
6158 v49 = pBLVRenderParams->uViewportY; | |
6159 dword_50B9E0_ys[v48] = pBLVRenderParams->uViewportY; | |
6160 } | |
6161 v50 = v84; | |
6162 if ( v84 ) | |
6163 { | |
6164 dword_50BAD4[v48] = dword_50BAE0[v52]; | |
6165 dword_50B9E0_ys[v48++ + 1] = dword_50B9F0[v52]; | |
6166 } | |
6167 v51 = id++ + 1; | |
6168 } | |
6169 while ( id <= v43 ); | |
6170 if ( !v48 | |
6171 || (v55 = 0, | |
6172 dword_50BAD4[v48] = dword_50BAD4[0], | |
6173 dword_50B9E0_ys[v48 + 1] = dword_50B9E0_ys[1], | |
6174 v56 = pBLVRenderParams->uViewportW, | |
6175 thise = dword_50B9E0_ys[1] <= (signed int)pBLVRenderParams->uViewportW, | |
6176 ie = 1, | |
6177 v48 < 1) ) | |
6178 return 0; | |
6179 do | |
6180 { | |
6181 v57 = ie; | |
6182 v58 = dword_50B9E0_ys[ie + 1]; | |
6183 v85 = v58 <= (signed int)v56; | |
6184 if ( thise ^ v85 ) | |
6185 { | |
6186 if ( v58 <= (signed int)v56 ) | |
6187 { | |
6188 v70 = (signed int)(v56 - dword_50B9E0_ys[v57]) | |
6189 * (signed __int64)(dword_50BAD4[v57] - dword_50BAD0[v57]) | |
6190 / (v58 - dword_50B9E0_ys[v57]); | |
6191 v59 = dword_50BAD0[v57]; | |
6192 } | |
6193 else | |
6194 { | |
6195 v70 = (signed int)(v56 - v58) | |
6196 * (signed __int64)(dword_50BAD0[v57] - dword_50BAD4[v57]) | |
6197 / (dword_50B9E0_ys[v57] - v58); | |
6198 v59 = dword_50BAD4[v57]; | |
6199 } | |
6200 ++v55; | |
6201 dword_50BAC4[v55] = v70 + v59; | |
6202 v56 = pBLVRenderParams->uViewportW; | |
6203 unk_50B9D4[v55] = pBLVRenderParams->uViewportW; | |
6204 } | |
6205 if ( v85 ) | |
6206 { | |
6207 dword_50BAC8[v55] = dword_50BAD4[v57]; | |
6208 dword_50B9D8_ys[v55++] = dword_50B9E0_ys[v57 + 1]; | |
6209 } | |
6210 ++ie; | |
6211 thise = v85; | |
6212 } | |
6213 while ( ie <= v48 ); | |
6214 if ( !v55 ) | |
6215 return 0; | |
6216 v61 = pRenderer->pRenderD3D == 0; | |
6217 dword_50BAC8[v55] = dword_50BAC8[0]; | |
6218 dword_50B9D8_ys[v55] = dword_50B9D8_ys[0]; | |
6219 if ( v61 && v55 > 3 ) | |
6220 { | |
6221 dword_50BAC8[v55 + 1] = dword_50BAC8[1]; | |
6222 dword_50B9D8_ys[v55 + 1] = dword_50B9D8_ys[1]; | |
6223 thisf = 2 * (dword_50B700 != 0) - 1; | |
6224 if ( v55 > 0 ) | |
6225 { | |
6226 v62 = 1; | |
6227 v71 = 1; | |
6228 do | |
6229 { | |
6230 v63 = v62 - 1; | |
6231 v64 = v62 + 1; | |
6232 v80 = v62 + 1; | |
6233 if ( v62 - 1 >= v55 ) | |
6234 v63 -= v55; | |
6235 if ( v62 >= v55 ) | |
6236 v62 -= v55; | |
6237 if ( v64 >= v55 ) | |
6238 v64 -= v55; | |
6239 if ( thisf | |
6240 * ((dword_50B9D8_ys[v64] - dword_50B9D8_ys[v63]) * (dword_50BAC8[v62] - dword_50BAC8[v63]) | |
6241 - (dword_50B9D8_ys[v62] - dword_50B9D8_ys[v63]) * (dword_50BAC8[v64] - dword_50BAC8[v63])) < 0 ) | |
6242 { | |
6243 v62 = v80; | |
6244 v71 = v80; | |
6245 } | |
6246 else | |
6247 { | |
6248 v62 = v71; | |
6249 v65 = v71; | |
6250 if ( v71 < v55 || (v65 = v71 - v55, v71 - v55 < v55) ) | |
6251 { | |
6252 memcpy(&dword_50B9D8_ys[v65], &dword_50B9D8_ys[v65 + 1], 4 * ((unsigned int)(4 * (v55 - v65)) >> 2)); | |
6253 memcpy(&dword_50BAC8[v65], &dword_50BAC8[v65 + 1], 4 * ((unsigned int)(4 * (v55 - v65)) >> 2)); | |
6254 } | |
6255 --v55; | |
6256 } | |
6257 } | |
6258 while ( v62 - 1 < v55 ); | |
6259 } | |
6260 dword_50BAC8[v55] = dword_50BAC8[0]; | |
6261 dword_50B9D8_ys[v55] = dword_50B9D8_ys[0]; | |
6262 } | |
6263 return v55; | |
6264 } | |
6265 | |
6266 //----- (00424579) -------------------------------------------------------- | |
6267 int __fastcall sub_424579(int uFaceID, stru320 *a2) | |
6268 { | |
6269 __debugbreak(); | |
6270 return 0; | |
6271 /*BLVFace *v2; // eax@1 | |
6272 Vec3_short_ *v3; // ebx@1 | |
6273 Vec3_short_ *v4; // esi@1 | |
6274 unsigned int v5; // esi@3 | |
6275 int v7; // ST1C_4@5 | |
6276 int v8; // ST1C_4@5 | |
6277 int v9; // ST1C_4@5 | |
6278 int v10; // ST1C_4@5 | |
6279 int v11; // esi@5 | |
6280 int v12; // ST1C_4@5 | |
6281 unsigned int v15; // ecx@8 | |
6282 unsigned int v19; // ecx@13 | |
6283 signed int v20; // ecx@16 | |
6284 signed int result; // eax@20 | |
6285 signed int v24; // edx@22 | |
6286 unsigned int v25; // [sp+Ch] [bp-1Ch]@3 | |
6287 float v26; // [sp+14h] [bp-14h]@3 | |
6288 float v27; // [sp+1Ch] [bp-Ch]@3 | |
6289 float v28; // [sp+20h] [bp-8h]@3 | |
6290 signed int v29; // [sp+24h] [bp-4h]@3 | |
6291 | |
6292 v2 = &pIndoor->pFaces[uFaceID]; | |
6293 v3 = pIndoor->pVertices; | |
6294 v4 = &pIndoor->pVertices[*v2->pVertexIDs]; | |
6295 if ( v2->pFacePlane_old.vNormal.x * ((signed __int16)*(int *)&v4->x - pBLVRenderParams->vPartyPos.x) | |
6296 + v2->pFacePlane_old.vNormal.y * ((signed __int16)(*(int *)&v4->x >> 16) - pBLVRenderParams->vPartyPos.y) | |
6297 + v2->pFacePlane_old.vNormal.z * (v4->z - pBLVRenderParams->vPartyPos.z) < 0 ) | |
6298 { | |
6299 dword_50B700 = 1; | |
6300 } | |
6301 else | |
6302 { | |
6303 dword_50B700 = 0; | |
6304 if ( !(v2->uAttributes & 1) ) | |
6305 return 0; | |
6306 } | |
6307 v29 = 0; | |
6308 v5 = v2->uNumVertices; | |
6309 __asm { fld pBLVRenderParams->fCosineY } | |
6310 v28 = pBLVRenderParams->fSineY; | |
6311 v26 = pBLVRenderParams->fCosineNegX; | |
6312 v27 = pBLVRenderParams->fSineNegX; | |
6313 v25 = v5; | |
6314 if ( (signed int)v5 > 0 ) | |
6315 { | |
6316 _ECX = (char *)&array_50AC10[0].vWorldPosition.z; | |
6317 do | |
6318 { | |
6319 v7 = v3[v2->pVertexIDs[v29]].x; | |
6320 __asm | |
6321 { | |
6322 fild [ebp+var_10] | |
6323 fstp dword ptr [ecx-8] | |
6324 } | |
6325 v8 = v3[v2->pVertexIDs[v29]].y; | |
6326 __asm | |
6327 { | |
6328 fild [ebp+var_10] | |
6329 fstp dword ptr [ecx-4] | |
6330 } | |
6331 v9 = v3[v2->pVertexIDs[v29]].z; | |
6332 __asm | |
6333 { | |
6334 fild [ebp+var_10] | |
6335 fstp dword ptr [ecx] | |
6336 } | |
6337 _ECX += 48; | |
6338 v10 = a2->pDeltaUV[0] + v2->pVertexUIDs[v29]; | |
6339 __asm | |
6340 { | |
6341 fild [ebp+var_10] | |
6342 fstp dword ptr [ecx-14h] | |
6343 } | |
6344 v11 = a2->pDeltaUV[1] + v2->pVertexVIDs[v29++]; | |
6345 v12 = v11; | |
6346 v5 = v25; | |
6347 __asm | |
6348 { | |
6349 fild [ebp+var_10] | |
6350 fstp dword ptr [ecx-10h] | |
6351 } | |
6352 } | |
6353 while ( v29 < (signed int)v25 ); | |
6354 } | |
6355 _EDX = (char *)&array_50AC10[0].vWorldViewPosition; | |
6356 if ( pBLVRenderParams->sPartyRotX ) | |
6357 { | |
6358 if ( (signed int)v5 > 0 ) | |
6359 { | |
6360 __asm | |
6361 { | |
6362 fild pBLVRenderParams->vPartyPos.x | |
6363 fild pBLVRenderParams->vPartyPos.y | |
6364 fild pBLVRenderParams->vPartyPos.z | |
6365 } | |
6366 _EAX = (char *)&array_50AC10[0].vWorldPosition.z; | |
6367 v15 = v5; | |
6368 do | |
6369 { | |
6370 __asm | |
6371 { | |
6372 fld dword ptr [eax-8] | |
6373 fsub st, st(3) | |
6374 fld dword ptr [eax-4] | |
6375 fsub st, st(3) | |
6376 fld st(1) | |
6377 fmul st, st(6) | |
6378 fld st(1) | |
6379 fmul [ebp+var_8] | |
6380 fsubp st(1), st | |
6381 fstp [ebp+var_4] | |
6382 fld dword ptr [eax] | |
6383 fsub st, st(3) | |
6384 } | |
6385 _EAX += 48; | |
6386 --v15; | |
6387 __asm | |
6388 { | |
6389 fstp [ebp+var_10] | |
6390 fld [ebp+var_4] | |
6391 fmul [ebp+var_14] | |
6392 fld [ebp+var_10] | |
6393 fmul [ebp+var_C] | |
6394 fsubp st(1), st | |
6395 fstp dword ptr [eax-2Ch] | |
6396 fld st(1) | |
6397 fmul [ebp+var_8] | |
6398 fld st(1) | |
6399 fmul st, st(7) | |
6400 faddp st(1), st | |
6401 fstp dword ptr [eax-28h] | |
6402 fstp st | |
6403 fstp st | |
6404 fld [ebp+var_4] | |
6405 fmul [ebp+var_C] | |
6406 fld [ebp+var_10] | |
6407 fmul [ebp+var_14] | |
6408 faddp st(1), st | |
6409 fstp dword ptr [eax-24h] | |
6410 } | |
6411 } | |
6412 while ( v15 ); | |
6413 LABEL_15: | |
6414 __asm | |
6415 { | |
6416 fstp st | |
6417 fstp st | |
6418 fstp st | |
6419 } | |
6420 goto LABEL_16; | |
6421 } | |
6422 } | |
6423 else | |
6424 { | |
6425 if ( (signed int)v5 > 0 ) | |
6426 { | |
6427 __asm | |
6428 { | |
6429 fild pBLVRenderParams->vPartyPos.x | |
6430 fild pBLVRenderParams->vPartyPos.y | |
6431 fild pBLVRenderParams->vPartyPos.z | |
6432 } | |
6433 _EAX = (char *)&array_50AC10[0].vWorldViewPosition; | |
6434 v19 = v5; | |
6435 do | |
6436 { | |
6437 __asm | |
6438 { | |
6439 fld dword ptr [eax-0Ch] | |
6440 fsub st, st(3) | |
6441 fld dword ptr [eax-8] | |
6442 fsub st, st(3) | |
6443 fld st(1) | |
6444 fmul st, st(6) | |
6445 fld st(1) | |
6446 fmul [ebp+var_8] | |
6447 fsubp st(1), st | |
6448 fstp dword ptr [eax] | |
6449 fld st(1) | |
6450 fmul [ebp+var_8] | |
6451 fld st(1) | |
6452 fmul st, st(7) | |
6453 } | |
6454 _EAX += 48; | |
6455 --v19; | |
6456 __asm | |
6457 { | |
6458 faddp st(1), st | |
6459 fstp dword ptr [eax-2Ch] | |
6460 fstp st | |
6461 fstp st | |
6462 fld dword ptr [eax-34h] | |
6463 fsub st, st(1) | |
6464 fstp dword ptr [eax-28h] | |
6465 } | |
6466 } | |
6467 while ( v19 ); | |
6468 goto LABEL_15; | |
6469 } | |
6470 } | |
6471 LABEL_16: | |
6472 v20 = 0; | |
6473 __asm { fstp st } | |
6474 if ( (signed int)v5 <= 0 ) | |
6475 return 0; | |
6476 do | |
6477 { | |
6478 __asm | |
6479 { | |
6480 fld dword ptr [edx] | |
6481 fcomp ds:flt_4D8524 | |
6482 fnstsw ax | |
6483 } | |
6484 if ( !(HIBYTE(_AX) & 1) ) | |
6485 break; | |
6486 ++v20; | |
6487 _EDX += 48; | |
6488 } | |
6489 while ( v20 < (signed int)v5 ); | |
6490 if ( v20 >= (signed int)v5 ) | |
6491 return 0; | |
6492 result = sr_424CD7(v5); | |
6493 if ( result > 0 ) | |
6494 { | |
6495 __asm { fild pBLVRenderParams->field_40 } | |
6496 _ECX = (char *)&array_507D30[0].vWorldViewPosition; | |
6497 v24 = result; | |
6498 __asm | |
6499 { | |
6500 fmul ds:flt_4D84A4 | |
6501 fild pBLVRenderParams->uViewportCenterX | |
6502 fild pBLVRenderParams->uViewportCenterY | |
6503 } | |
6504 do | |
6505 { | |
6506 __asm | |
6507 { | |
6508 fld1 | |
6509 fdiv dword ptr [ecx] | |
6510 } | |
6511 _ECX += 48; | |
6512 --v24; | |
6513 __asm | |
6514 { | |
6515 fld st | |
6516 fmul dword ptr [ecx-2Ch] | |
6517 fmul st, st(4) | |
6518 fsubr st, st(3) | |
6519 fstp dword ptr [ecx-24h] | |
6520 fmul dword ptr [ecx-28h] | |
6521 fmul st, st(3) | |
6522 fsubr st, st(1) | |
6523 fstp dword ptr [ecx-20h] | |
6524 } | |
6525 } | |
6526 while ( v24 ); | |
6527 __asm | |
6528 { | |
6529 fstp st | |
6530 fstp st | |
6531 fstp st | |
6532 } | |
6533 } | |
6534 memcpy(&array_507D30[result], array_507D30, sizeof(array_507D30[result])); | |
6535 return result;*/ | |
6536 } | |
6537 | |
6538 | |
6539 //----- (00424829) -------------------------------------------------------- | |
6540 bool sub_424829(int a1, BspRenderer_stru2 *a2, BspRenderer_stru2 *a3, int a4) | |
6541 { | |
6542 int v4; // edi@1 | |
6543 BspRenderer_stru2 *v5; // ebx@1 | |
6544 int v6; // eax@3 | |
6545 int v7; // esi@5 | |
6546 int v8; // edx@5 | |
6547 int v9; // ecx@6 | |
6548 int v10; // eax@12 | |
6549 int v11; // edi@13 | |
6550 int v12; // edx@18 | |
6551 int v13; // eax@22 | |
6552 int v14; // edi@28 | |
6553 int v15; // ecx@29 | |
6554 int v16; // edi@30 | |
6555 int v17; // edx@35 | |
6556 int v18; // eax@39 | |
6557 int v19; // eax@44 | |
6558 int v20; // ecx@44 | |
6559 int v21; // edi@45 | |
6560 int v22; // edi@46 | |
6561 __int16 *v23; // ecx@47 | |
6562 int v24; // edx@48 | |
6563 int v25; // eax@50 | |
6564 int v26; // eax@55 | |
6565 signed int v27; // edi@55 | |
6566 int v28; // edx@56 | |
6567 int v29; // edx@57 | |
6568 int v30; // eax@59 | |
6569 int v31; // eax@64 | |
6570 signed int v32; // edi@64 | |
6571 int v33; // edx@65 | |
6572 __int16 *v34; // eax@66 | |
6573 __int16 v35; // dx@66 | |
6574 __int16 v36; // dx@67 | |
6575 __int16 v37; // di@67 | |
6576 __int16 v38; // dx@67 | |
6577 BspRenderer_stru2 *v39; // ecx@69 | |
6578 int v40; // edx@69 | |
6579 int v41; // edi@70 | |
6580 __int16 *v42; // eax@76 | |
6581 __int16 *v43; // eax@81 | |
6582 __int16 *v45; // eax@87 | |
6583 int v46; // edx@87 | |
6584 __int16 v47; // cx@88 | |
6585 int v48; // eax@93 | |
6586 int v49; // esi@93 | |
6587 __int16 *v50; // ecx@94 | |
6588 int v51; // eax@95 | |
6589 int v52; // eax@97 | |
6590 int v53; // [sp+Ch] [bp-34h]@44 | |
6591 int v54; // [sp+10h] [bp-30h]@0 | |
6592 int v55; // [sp+14h] [bp-2Ch]@12 | |
6593 __int16 *v56; // [sp+14h] [bp-2Ch]@47 | |
6594 __int16 *v57; // [sp+14h] [bp-2Ch]@76 | |
6595 __int16 *v58; // [sp+14h] [bp-2Ch]@81 | |
6596 __int16 *v59; // [sp+14h] [bp-2Ch]@87 | |
6597 BspRenderer_stru2 *v60; // [sp+18h] [bp-28h]@1 | |
6598 int v61; // [sp+1Ch] [bp-24h]@29 | |
6599 int v62; // [sp+20h] [bp-20h]@0 | |
6600 signed int v63; // [sp+24h] [bp-1Ch]@3 | |
6601 signed int v64; // [sp+28h] [bp-18h]@3 | |
6602 int v65; // [sp+2Ch] [bp-14h]@5 | |
6603 int v66; // [sp+2Ch] [bp-14h]@39 | |
6604 int v67; // [sp+30h] [bp-10h]@22 | |
6605 int v68; // [sp+34h] [bp-Ch]@12 | |
6606 int v69; // [sp+34h] [bp-Ch]@29 | |
6607 int v70; // [sp+34h] [bp-Ch]@46 | |
6608 int v71; // [sp+34h] [bp-Ch]@75 | |
6609 int v72; // [sp+34h] [bp-Ch]@80 | |
6610 int v73; // [sp+38h] [bp-8h]@11 | |
6611 int v74; // [sp+3Ch] [bp-4h]@1 | |
6612 int a3a; // [sp+48h] [bp+8h]@76 | |
6613 int a3b; // [sp+48h] [bp+8h]@87 | |
6614 | |
6615 v4 = a1; | |
6616 v5 = a2; | |
6617 v74 = a1; | |
6618 v60 = a2; | |
6619 if ( !a1 | |
6620 || (!dword_50B700 ? (v64 = -1, v6 = 1, v63 = 1) : (v6 = 1, v63 = -1, v64 = 1), | |
6621 v7 = dword_50B9D8_ys[0], | |
6622 v65 = 0, | |
6623 v8 = dword_50B9D8_ys[0], | |
6624 a1 <= v6) ) | |
6625 return 0; | |
6626 do | |
6627 { | |
6628 v9 = dword_50B9D8_ys[v6]; | |
6629 if ( v9 >= v7 ) | |
6630 { | |
6631 if ( v9 > v8 ) | |
6632 v8 = dword_50B9D8_ys[v6]; | |
6633 } | |
6634 else | |
6635 { | |
6636 v65 = v6; | |
6637 v7 = dword_50B9D8_ys[v6]; | |
6638 } | |
6639 ++v6; | |
6640 } | |
6641 while ( v6 < v4 ); | |
6642 v73 = v8; | |
6643 if ( v8 == v7 ) | |
6644 return 0; | |
6645 v10 = v65; | |
6646 v68 = 0; | |
6647 v5->_viewport_space_y = v7; | |
6648 v5->_viewport_space_w = v8; | |
6649 v55 = v65; | |
6650 if ( v4 > 0 ) | |
6651 { | |
6652 v11 = v65; | |
6653 do | |
6654 { | |
6655 v10 += v64; | |
6656 if ( v10 < v74 ) | |
6657 { | |
6658 if ( v10 < 0 ) | |
6659 v10 += v74; | |
6660 } | |
6661 else | |
6662 { | |
6663 v10 -= v74; | |
6664 } | |
6665 v12 = dword_50B9D8_ys[v10]; | |
6666 if ( v12 <= dword_50B9D8_ys[v11] ) | |
6667 { | |
6668 v55 = v10; | |
6669 v11 = v10; | |
6670 } | |
6671 if ( v12 == v73 ) | |
6672 break; | |
6673 ++v68; | |
6674 } | |
6675 while ( v68 < v74 ); | |
6676 } | |
6677 v13 = v55 + v64; | |
6678 v67 = v55 + v64; | |
6679 if ( v55 + v64 < v74 ) | |
6680 { | |
6681 if ( v13 >= 0 ) | |
6682 goto LABEL_27; | |
6683 v13 += v74; | |
6684 } | |
6685 else | |
6686 { | |
6687 v13 -= v74; | |
6688 } | |
6689 v67 = v13; | |
6690 LABEL_27: | |
6691 if ( dword_50B9D8_ys[v13] != dword_50B9D8_ys[v55] ) | |
6692 { | |
6693 v14 = dword_50BAC8[v55]; | |
6694 v62 = v14 << 16; | |
6695 v54 = ((dword_50BAC8[v13] - v14) << 16) / (dword_50B9D8_ys[v13] - dword_50B9D8_ys[v55]); | |
6696 v5->array_18[v7] = LOWORD(dword_50BAC8[v55]); | |
6697 } | |
6698 v15 = v65; | |
6699 v69 = 0; | |
6700 v61 = v65; | |
6701 if ( v74 > 0 ) | |
6702 { | |
6703 v16 = v65; | |
6704 do | |
6705 { | |
6706 v15 += v63; | |
6707 if ( v15 < v74 ) | |
6708 { | |
6709 if ( v15 < 0 ) | |
6710 v15 += v74; | |
6711 } | |
6712 else | |
6713 { | |
6714 v15 -= v74; | |
6715 } | |
6716 v17 = dword_50B9D8_ys[v15]; | |
6717 if ( v17 <= dword_50B9D8_ys[v16] ) | |
6718 { | |
6719 v61 = v15; | |
6720 v16 = v15; | |
6721 } | |
6722 if ( v17 == v73 ) | |
6723 break; | |
6724 ++v69; | |
6725 } | |
6726 while ( v69 < v74 ); | |
6727 } | |
6728 v18 = v63 + v61; | |
6729 v66 = v63 + v61; | |
6730 if ( v63 + v61 < v74 ) | |
6731 { | |
6732 if ( v18 >= 0 ) | |
6733 goto LABEL_44; | |
6734 v18 += v74; | |
6735 } | |
6736 else | |
6737 { | |
6738 v18 -= v74; | |
6739 } | |
6740 v66 = v18; | |
6741 LABEL_44: | |
6742 v19 = v18; | |
6743 v20 = v61; | |
6744 v53 = dword_50B9D8_ys[v19] - dword_50B9D8_ys[v61]; | |
6745 if ( dword_50B9D8_ys[v19] != dword_50B9D8_ys[v61] ) | |
6746 { | |
6747 v21 = dword_50BAC8[v20]; | |
6748 v5 = v60; | |
6749 v61 = v21 << 16; | |
6750 v53 = ((dword_50BAC8[v19] - v21) << 16) / v53; | |
6751 v60->array_3D8[v73] = LOWORD(dword_50BAC8[v20]); | |
6752 } | |
6753 v22 = v7; | |
6754 v70 = v7; | |
6755 if ( v7 <= v73 ) | |
6756 { | |
6757 v56 = &v5->array_3D8[v7]; | |
6758 v23 = &v5->array_18[v7]; | |
6759 do | |
6760 { | |
6761 v24 = v67; | |
6762 if ( v22 < dword_50B9D8_ys[v67] || v22 == v73 ) | |
6763 goto LABEL_57; | |
6764 v25 = v64 + v67; | |
6765 v67 = v25; | |
6766 if ( v25 < v74 ) | |
6767 { | |
6768 if ( v25 >= 0 ) | |
6769 goto LABEL_55; | |
6770 v25 += v74; | |
6771 } | |
6772 else | |
6773 { | |
6774 v25 -= v74; | |
6775 } | |
6776 v67 = v25; | |
6777 LABEL_55: | |
6778 v26 = v25; | |
6779 v27 = dword_50B9D8_ys[v26] - dword_50B9D8_ys[v24]; | |
6780 if ( dword_50B9D8_ys[v26] - dword_50B9D8_ys[v24] > 0 ) | |
6781 { | |
6782 v28 = dword_50BAC8[v24]; | |
6783 v54 = ((dword_50BAC8[v26] - v28) << 16) / v27; | |
6784 v62 = v28 << 16; | |
6785 } | |
6786 LABEL_57: | |
6787 v29 = v66; | |
6788 if ( v70 >= dword_50B9D8_ys[v66] && v70 != v73 ) | |
6789 { | |
6790 v30 = v63 + v66; | |
6791 v66 += v63; | |
6792 if ( v66 >= v74 ) | |
6793 { | |
6794 v30 -= v74; | |
6795 goto LABEL_63; | |
6796 } | |
6797 if ( v30 < 0 ) | |
6798 { | |
6799 v30 += v74; | |
6800 LABEL_63: | |
6801 v66 = v30; | |
6802 } | |
6803 v31 = v30; | |
6804 v32 = dword_50B9D8_ys[v31] - dword_50B9D8_ys[v29]; | |
6805 if ( dword_50B9D8_ys[v31] - dword_50B9D8_ys[v29] > 0 ) | |
6806 { | |
6807 v33 = dword_50BAC8[v29]; | |
6808 v53 = ((dword_50BAC8[v31] - v33) << 16) / v32; | |
6809 v61 = v33 << 16; | |
6810 } | |
6811 } | |
6812 *(__int16 *)((char *)v56 + (int)(char *)v5->array_18 - (char *)v5->array_3D8) = HIWORD(v62); | |
6813 *v56 = HIWORD(v61); | |
6814 v34 = v23 + 480; | |
6815 v35 = v23[480]; | |
6816 if ( *v23 > v35 ) | |
6817 { | |
6818 v36 = *v23 ^ v35; | |
6819 v37 = *v34; | |
6820 *v23 = v36; | |
6821 v38 = v37 ^ v36; | |
6822 *v23 ^= v38; | |
6823 *v34 = v38; | |
6824 } | |
6825 ++v56; | |
6826 v62 += v54; | |
6827 v22 = v70 + 1; | |
6828 v61 += v53; | |
6829 ++v23; | |
6830 ++v70; | |
6831 } | |
6832 while ( v70 <= v73 ); | |
6833 } | |
6834 v39 = a3; | |
6835 v40 = v73; | |
6836 if ( v73 < a3->_viewport_space_y || (v41 = a3->_viewport_space_w, v7 > v41) ) | |
6837 return 0; | |
6838 if ( v7 < a3->_viewport_space_y ) | |
6839 v7 = a3->_viewport_space_y; | |
6840 if ( v73 > v41 ) | |
6841 { | |
6842 v40 = a3->_viewport_space_w; | |
6843 v73 = a3->_viewport_space_w; | |
6844 } | |
6845 v71 = v7; | |
6846 if ( v7 <= v40 ) | |
6847 { | |
6848 a3a = (char *)v5 - (char *)a3; | |
6849 v57 = &v5->array_18[v7]; | |
6850 v42 = &v39->array_3D8[v7]; | |
6851 do | |
6852 { | |
6853 if ( *(__int16 *)((char *)v42 + a3a) >= *(v42 - 480) && *v57 <= *v42 ) | |
6854 break; | |
6855 ++v57; | |
6856 ++v7; | |
6857 ++v71; | |
6858 ++v42; | |
6859 } | |
6860 while ( v71 <= v40 ); | |
6861 } | |
6862 v72 = v40; | |
6863 if ( v40 < v7 ) | |
6864 return 0; | |
6865 v58 = &v5->array_18[v40]; | |
6866 v43 = &v39->array_3D8[v40]; | |
6867 do | |
6868 { | |
6869 if ( *(__int16 *)((char *)v43 + (int)(char *)v5 - (char *)v39) >= *(v43 - 480) && *v58 <= *v43 ) | |
6870 break; | |
6871 --v58; | |
6872 --v40; | |
6873 --v72; | |
6874 --v43; | |
6875 v73 = v40; | |
6876 } | |
6877 while ( v72 >= v7 ); | |
6878 if ( v7 >= v40 ) | |
6879 return 0; | |
6880 a3b = (char *)v39 - (char *)v5; | |
6881 v59 = &v39->array_3D8[v7]; | |
6882 v45 = &v5->array_18[v7]; | |
6883 v46 = v73 - v7 + 1; | |
6884 do | |
6885 { | |
6886 v47 = *(__int16 *)((char *)v45 + a3b); | |
6887 if ( *v45 < v47 ) | |
6888 *v45 = v47; | |
6889 if ( v45[480] > *v59 ) | |
6890 v45[480] = *v59; | |
6891 ++v59; | |
6892 ++v45; | |
6893 --v46; | |
6894 } | |
6895 while ( v46 ); | |
6896 v5->_viewport_space_y = v7; | |
6897 v5->_viewport_space_w = v73; | |
6898 v5->field_8 = v5->array_18[v7]; | |
6899 v48 = v5->array_3D8[v7]; | |
6900 v5->field_10 = v7; | |
6901 v5->field_14 = v7; | |
6902 v49 = v7 + 1; | |
6903 v5->field_C = v48; | |
6904 if ( v49 <= v73 ) | |
6905 { | |
6906 v50 = &v5->array_3D8[v49]; | |
6907 do | |
6908 { | |
6909 v51 = *(v50 - 480); | |
6910 if ( v51 < v5->field_8 ) | |
6911 { | |
6912 v5->field_8 = v51; | |
6913 v5->field_10 = v49; | |
6914 } | |
6915 v52 = *v50; | |
6916 if ( v52 > v5->field_C ) | |
6917 { | |
6918 v5->field_C = v52; | |
6919 v5->field_14 = v49; | |
6920 } | |
6921 ++v49; | |
6922 ++v50; | |
6923 } | |
6924 while ( v49 <= v73 ); | |
6925 } | |
6926 return 1; | |
6927 } | |
6928 // 50B700: using guessed type int dword_50B700; | |
6929 | |
6930 //----- (00424CD7) -------------------------------------------------------- | |
6931 signed int __fastcall sr_424CD7(unsigned int uVertexID) | |
6932 { | |
6933 unsigned int v1; // edx@1 | |
6934 signed int v2; // edi@1 | |
6935 char *v3; // esi@4 | |
6936 char *v4; // ecx@4 | |
6937 unsigned int v5; // eax@4 | |
6938 char *v6; // edx@4 | |
6939 double v7; // st6@10 | |
6940 double v8; // st5@10 | |
6941 double v9; // st6@11 | |
6942 unsigned __int8 v10; // c2@15 | |
6943 unsigned __int8 v11; // c3@15 | |
6944 RenderVertexSoft *v12; // edi@22 | |
6945 char *v13; // eax@22 | |
6946 double v14; // st6@22 | |
6947 signed int result; // eax@24 | |
6948 unsigned int v16; // [sp+8h] [bp-28h]@4 | |
6949 bool v17; // [sp+Ch] [bp-24h]@6 | |
6950 char *v18; // [sp+10h] [bp-20h]@4 | |
6951 char *v19; // [sp+14h] [bp-1Ch]@4 | |
6952 signed int v20; // [sp+18h] [bp-18h]@1 | |
6953 RenderVertexSoft *v21; // [sp+1Ch] [bp-14h]@4 | |
6954 char *v22; // [sp+20h] [bp-10h]@4 | |
6955 char *v23; // [sp+24h] [bp-Ch]@4 | |
6956 char *v24; // [sp+28h] [bp-8h]@4 | |
6957 char *v25; // [sp+2Ch] [bp-4h]@4 | |
6958 | |
6959 v1 = uVertexID; | |
6960 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); | |
6961 v2 = 0; | |
6962 v20 = 0; | |
6963 if ( array_50AC10[0].vWorldViewPosition.x >= 8.0 ) | |
6964 v2 = 1; | |
6965 if ( (signed int)(uVertexID + 1) <= 1 ) | |
6966 return 0; | |
6967 v3 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
6968 v4 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
6969 v5 = v1; | |
168 | 6970 v23 = (char *)&array_507D30[0]._rhw; |
0 | 6971 v21 = array_507D30; |
6972 v18 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
6973 v19 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
6974 v22 = (char *)&array_507D30[0].vWorldViewPosition; | |
6975 v24 = (char *)&array_507D30[0].v; | |
6976 v25 = (char *)&array_507D30[0].u; | |
6977 v6 = (char *)&array_50AC10[0].v; | |
6978 v16 = v5; | |
6979 do | |
6980 { | |
6981 v17 = *((float *)v6 + 5) >= 8.0; | |
6982 if ( v2 != v17 ) | |
6983 { | |
6984 if ( v17 ) | |
6985 { | |
6986 v7 = (8.0 - *((float *)v6 - 7)) / (*((float *)v6 + 5) - *((float *)v6 - 7)); | |
6987 *(float *)v4 = (*((float *)v6 + 6) - *((float *)v6 - 6)) * v7 + *((float *)v6 - 6); | |
6988 *(float *)v3 = (*((float *)v6 + 7) - *((float *)v6 - 5)) * v7 + *((float *)v6 - 5); | |
6989 *(float *)v25 = (*((float *)v6 + 11) - *((float *)v6 - 1)) * v7 + *((float *)v6 - 1); | |
6990 v8 = (*((float *)v6 + 12) - *(float *)v6) * v7 + *(float *)v6; | |
6991 } | |
6992 else | |
6993 { | |
6994 v9 = (8.0 - *((float *)v6 + 5)) / (*((float *)v6 - 7) - *((float *)v6 + 5)); | |
6995 *(float *)v4 = (*((float *)v6 - 6) - *((float *)v6 + 6)) * v9 + *((float *)v6 + 6); | |
6996 *(float *)v3 = (*((float *)v6 - 5) - *((float *)v6 + 7)) * v9 + *((float *)v6 + 7); | |
6997 *(float *)v25 = (*((float *)v6 - 1) - *((float *)v6 + 11)) * v9 + *((float *)v6 + 11); | |
6998 v8 = (*(float *)v6 - *((float *)v6 + 12)) * v9 + *((float *)v6 + 12); | |
6999 } | |
7000 *(float *)v24 = v8; | |
7001 *(float *)v22 = 8.0; | |
7002 *(int *)v23 = 0x3E000000u; | |
7003 if ( v2 ) | |
7004 { | |
7005 if ( 8.0 == *((float *)v6 - 7) && *(float *)v4 == *((float *)v6 - 6) ) | |
7006 { | |
7007 v10 = 0; | |
7008 v11 = *(float *)v3 == *((float *)v6 - 5); | |
7009 goto LABEL_19; | |
7010 } | |
7011 } | |
7012 else | |
7013 { | |
7014 if ( 8.0 == *((float *)v6 + 5) && *(float *)v4 == *((float *)v6 + 6) ) | |
7015 { | |
7016 v10 = 0; | |
7017 v11 = *(float *)v3 == *((float *)v6 + 7); | |
7018 LABEL_19: | |
7019 if ( v11 | v10 ) | |
7020 goto LABEL_21; | |
7021 goto LABEL_20; | |
7022 } | |
7023 } | |
7024 LABEL_20: | |
7025 ++v21; | |
7026 v22 += 48; | |
7027 v24 += 48; | |
7028 v25 += 48; | |
7029 v4 += 48; | |
7030 v3 += 48; | |
7031 ++v20; | |
7032 v23 += 48; | |
7033 v19 = v4; | |
7034 v18 = v3; | |
7035 } | |
7036 LABEL_21: | |
7037 if ( v17 ) | |
7038 { | |
7039 v12 = v21; | |
7040 v13 = v23; | |
7041 v19 += 48; | |
7042 v18 += 48; | |
7043 v14 = 1.0 / (*((float *)v6 + 5) + 0.0000001); | |
7044 ++v20; | |
7045 v25 += 48; | |
7046 v24 += 48; | |
7047 v22 += 48; | |
7048 ++v21; | |
7049 v23 += 48; | |
7050 memcpy(v12, v6 + 8, 0x30u); | |
7051 v4 = v19; | |
7052 v3 = v18; | |
7053 *(float *)v13 = v14; | |
7054 } | |
7055 v2 = v17; | |
7056 v6 += 48; | |
7057 --v16; | |
7058 } | |
7059 while ( v16 ); | |
7060 result = v20; | |
7061 if ( v20 < 3 ) | |
7062 return 0; | |
7063 return result; | |
7064 } |