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