Mercurial > mm7
annotate mm7_1.cpp @ 352:ec6cc5cefa4b
Game starting age (1168) moved to a variable
author | Nomad |
---|---|
date | Thu, 21 Feb 2013 03:06:13 +0200 |
parents | 5f36449527c6 |
children | 4a236657a0be |
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); |
319 | 1747 pBtn_ZoomIn = pPrimaryWindow->CreateButton( |
0 | 1748 0x23Eu, |
1749 0x88u, | |
319 | 1750 v24->uTextureWidth, |
1751 v24->uTextureHeight, | |
0 | 1752 2, |
1753 0, | |
1754 0x170u, | |
1755 0, | |
1756 v28, | |
319 | 1757 pGlobalTXT_LocalizationStrings[252], // Zoom In |
1758 v24, | |
0 | 1759 0); |
319 | 1760 |
1761 v29 = &pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut]; | |
0 | 1762 v33 = pKeyActionMap->GetActionVKey(INPUT_ZoomOut); |
319 | 1763 pBtn_ZoomOut = pPrimaryWindow->CreateButton( |
0 | 1764 0x207u, |
1765 0x88u, | |
319 | 1766 v29->uTextureWidth, |
1767 v29->uTextureHeight, | |
0 | 1768 2, |
1769 0, | |
1770 0x16Fu, | |
1771 0, | |
1772 v33, | |
319 | 1773 pGlobalTXT_LocalizationStrings[251], // Zoom Out |
1774 v29, | |
0 | 1775 0); |
319 | 1776 |
0 | 1777 pPrimaryWindow->CreateButton(0x1E1u, 0, 0x99u, 0x43u, 1, 92, 0, 0, 0, "", 0); |
1778 pPrimaryWindow->CreateButton(0x1EBu, 0x95u, 0x40u, 0x4Au, 1, 0, 0x86u, 0, 0x35u, "", 0); | |
1779 pPrimaryWindow->CreateButton(0x231u, 0x95u, 0x40u, 0x4Au, 1, 0, 0x87u, 0, 0x36u, "", 0); | |
1780 pPrimaryWindow->CreateButton(0x1DCu, 0x142u, 0x4Du, 0x11u, 1, 100, 0, 0, 0, "", 0); | |
1781 pPrimaryWindow->CreateButton(0x22Bu, 0x142u, 0x4Du, 0x11u, 1, 101, 0, 0, 0, "", 0); | |
319 | 1782 pBtn_CastSpell = pPrimaryWindow->CreateButton(0x1DCu, 0x1C2u, |
1783 (uTextureID_Btn_CastSpell != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_CastSpell].uTextureWidth : 24), | |
1784 (uTextureID_Btn_CastSpell != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_CastSpell].uTextureHeight : 26), | |
0 | 1785 1, |
1786 0, | |
1787 0x69u, | |
1788 0, | |
1789 0x43u, | |
1790 pGlobalTXT_LocalizationStrings[38], | |
319 | 1791 (Texture *)(uTextureID_Btn_CastSpell != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_CastSpell] : 0), |
0 | 1792 0); |
319 | 1793 pBtn_Rest = pPrimaryWindow->CreateButton(0x206u, 0x1C2u, |
1794 (uTextureID_Btn_Rest != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_Rest].uTextureWidth : 24), | |
1795 (uTextureID_Btn_Rest != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_Rest].uTextureHeight : 26), | |
0 | 1796 1, |
1797 0, | |
1798 0x68u, | |
1799 0, | |
1800 0x52u, | |
1801 pGlobalTXT_LocalizationStrings[182], | |
319 | 1802 (Texture *)(uTextureID_Btn_Rest != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_Rest] : 0), |
0 | 1803 0); |
319 | 1804 pBtn_QuickReference = pPrimaryWindow->CreateButton(0x230u, 0x1C2u, |
1805 (uTextureID_Btn_QuickReference != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_QuickReference].uTextureWidth : 24), | |
1806 (uTextureID_Btn_QuickReference != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_QuickReference].uTextureHeight : 26), | |
0 | 1807 1, |
1808 0, | |
1809 0x6Au, | |
1810 0, | |
1811 0x5Au, | |
1812 pGlobalTXT_LocalizationStrings[173], | |
319 | 1813 (Texture *)(uTextureID_Btn_QuickReference != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_QuickReference] : 0), |
0 | 1814 0); |
319 | 1815 pBtn_GameSettings = pPrimaryWindow->CreateButton(0x25Au, 0x1C2u, |
1816 (uTextureID_Btn_GameSettings != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_GameSettings].uTextureWidth : 24), | |
1817 (uTextureID_Btn_GameSettings != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_GameSettings].uTextureHeight : 26), | |
0 | 1818 1, |
1819 0, | |
1820 0x6Bu, | |
1821 0, | |
1822 0, | |
1823 pGlobalTXT_LocalizationStrings[93], | |
319 | 1824 (Texture *)(uTextureID_Btn_GameSettings != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings] : 0), |
0 | 1825 0); |
319 | 1826 pBtn_NPCLeft = pPrimaryWindow->CreateButton(0x1D5u, 0xB2u, |
1827 (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureWidth : 24), | |
1828 (uTextureID_Btn_NPCLeft != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft].uTextureHeight : 26), | |
0 | 1829 1, |
1830 0, | |
1831 0xBCu, | |
1832 0, | |
1833 0, | |
1834 "", | |
319 | 1835 (Texture *)(uTextureID_Btn_NPCLeft != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft] : 0), |
0 | 1836 0); |
319 | 1837 pBtn_NPCRight = pPrimaryWindow->CreateButton(0x272u, 0xB2u, |
1838 (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureWidth : 24), | |
1839 (uTextureID_Btn_NPCRight != -1 ? pIcons_LOD->pTextures[uTextureID_Btn_NPCRight].uTextureHeight : 26), | |
0 | 1840 1, |
1841 0, | |
1842 0xBCu, | |
1843 1u, | |
1844 0, | |
1845 "", | |
319 | 1846 (Texture *)(uTextureID_Btn_NPCRight != -1 ? &pIcons_LOD->pTextures[uTextureID_Btn_NPCRight] : 0), |
0 | 1847 0); |
1848 Load_isn_spells_21_27(); | |
1849 } | |
1850 | |
1851 | |
1852 | |
1853 //----- (0041C047) -------------------------------------------------------- | |
1854 void __cdecl GameUI_DrawStatusBar_2() | |
1855 { | |
1856 unsigned int v0; // eax@1 | |
1857 char *v1; // edx@2 | |
1858 unsigned int v2; // ST18_4@5 | |
1859 const char *v3; // ST0C_4@5 | |
1860 unsigned int v4; // ST08_4@5 | |
1861 int v5; // eax@5 | |
1862 | |
1863 pRenderer->DrawTextureRGB(0, 352u, pTexture_StatusBar); | |
1864 if ( GameUI_StatusBar_TimedStringTimeLeft ) | |
1865 { | |
1866 v1 = GameUI_StatusBar_TimedString; | |
1867 } | |
1868 else | |
1869 { | |
1870 if ( !pStatusBarString[0] ) | |
1871 return; | |
1872 v1 = pStatusBarString; | |
1873 } | |
1874 LOWORD(v0) = uGameUIFontShadow; | |
1875 v2 = v0; | |
1876 LOWORD(v0) = uGameUIFontMain; | |
1877 v3 = v1; | |
1878 v4 = v0; | |
1879 v5 = pFontLucida->AlignText_Center(0x1C2u, v1); | |
1880 pPrimaryWindow->DrawText(pFontLucida, v5 + 11, 357, v4, v3, 0, 0, v2); | |
1881 } | |
1882 | |
1883 //----- (0041C0B8) -------------------------------------------------------- | |
1884 void __thiscall sub_41C0B8_set_status_string(const char *pStr) | |
1885 { | |
1886 const char *v1; // esi@1 | |
1887 int i; // eax@7 | |
1888 int j; // eax@11 | |
1889 | |
1890 v1 = pStr; | |
1891 if ( pStr && strcmp(pStr, "test") && !IsBadStringPtrA(v1, 1u) && (*v1 || GameUI_StatusBar_TimedStringTimeLeft) ) | |
1892 { | |
1893 if ( GameUI_StatusBar_TimedStringTimeLeft ) | |
1894 { | |
1895 for ( i = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString); | |
1896 i > 450; | |
1897 i = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString) ) | |
1898 byte_5C3427[strlen(GameUI_StatusBar_TimedString)] = 0; | |
1899 } | |
1900 else | |
1901 { | |
1902 strcpy(pStatusBarString, v1); | |
1903 for ( j = pFontLucida->GetLineWidth(pStatusBarString); | |
1904 j > 450; | |
1905 j = pFontLucida->GetLineWidth(pStatusBarString) ) | |
1906 GameUI_StatusBar_TimedString[strlen(pStatusBarString) + 199] = 0; | |
1907 } | |
1908 } | |
1909 } | |
1910 | |
1911 //----- (0041C179) -------------------------------------------------------- | |
1912 void __cdecl GameUI_DrawStatusBar() | |
1913 { | |
1914 unsigned int v0; // ebp@1 | |
1915 char *v1; // edi@5 | |
1916 int v2; // eax@5 | |
1917 unsigned int v3; // esi@5 | |
1918 size_t v4; // eax@6 | |
1919 GUIFont *v5; // ecx@6 | |
1920 int v6; // eax@9 | |
1921 size_t v7; // eax@10 | |
1922 GUIFont *v8; // ecx@10 | |
1923 char v9; // zf@12 | |
1924 unsigned int v10; // ST08_4@13 | |
1925 int v11; // eax@13 | |
1926 | |
1927 v0 = uGameUIFontShadow; | |
1928 if ( pStatusBarString[0] || GameUI_StatusBar_TimedStringTimeLeft || bForceDrawStatusBar ) | |
1929 { | |
1930 pRenderer->DrawTextureRGB(0, 352u, pTexture_StatusBar); | |
1931 if ( GameUI_StatusBar_TimedStringTimeLeft ) | |
1932 { | |
1933 v1 = GameUI_StatusBar_TimedString; | |
1934 v2 = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString); | |
1935 v3 = 450; | |
1936 while ( v2 > 450 ) | |
1937 { | |
1938 v4 = strlen(GameUI_StatusBar_TimedString); | |
1939 v5 = pFontLucida; | |
1940 byte_5C3427[v4] = 0; | |
1941 v2 = pFontLucida->GetLineWidth(GameUI_StatusBar_TimedString); | |
1942 } | |
1943 } | |
1944 else | |
1945 { | |
1946 v1 = pStatusBarString; | |
1947 v6 = pFontLucida->GetLineWidth(pStatusBarString); | |
1948 v3 = 450; | |
1949 while ( v6 > 450 ) | |
1950 { | |
1951 v7 = strlen(pStatusBarString); | |
1952 v8 = pFontLucida; | |
1953 GameUI_StatusBar_TimedString[v7 + 199] = 0; | |
1954 v6 = pFontLucida->GetLineWidth(pStatusBarString); | |
1955 } | |
1956 } | |
1957 v9 = *v1 == 0; | |
1958 bForceDrawStatusBar = 0; | |
1959 if ( !v9 ) | |
1960 { | |
1961 v10 = uGameUIFontMain; | |
1962 v11 = pFontLucida->AlignText_Center(v3, v1); | |
1963 pPrimaryWindow->DrawText(pFontLucida, v11 + 11, 357, v10, v1, 0, 0, v0); | |
1964 } | |
1965 } | |
1966 } | |
1967 // 5C35BC: using guessed type int bForceDrawStatusBar; | |
1968 | |
1969 | |
1970 //----- (0041CD4F) -------------------------------------------------------- | |
1971 bool __thiscall sub_41CD4F(unsigned int _this) | |
1972 { | |
1973 unsigned int v1; // edi@1 | |
1974 unsigned int v2; // eax@2 | |
1975 int v3; // esi@3 | |
1976 int v4; // ecx@10 | |
1977 GUIButton *v5; // eax@11 | |
1978 int v6; // edx@12 | |
1979 int v7; // ecx@20 | |
1980 char v8; // zf@21 | |
1981 GUIButton *v9; // ecx@24 | |
1982 int v10; // esi@24 | |
1983 int v11; // edx@26 | |
1984 int v12; // edx@28 | |
1985 int v13; // esi@32 | |
1986 GUIButton *v14; // eax@37 | |
1987 int v15; // edx@38 | |
1988 int v17; // ecx@50 | |
1989 int v18; // edx@50 | |
1990 GUIButton *v19; // ecx@54 | |
1991 int v20; // esi@54 | |
1992 int v21; // edx@56 | |
1993 int v22; // ecx@59 | |
1994 int v23; // edx@59 | |
1995 int v24; // ecx@60 | |
1996 int v25; // esi@63 | |
1997 unsigned int v26; // [sp+Ch] [bp-14h]@1 | |
1998 int v27; // [sp+10h] [bp-10h]@1 | |
1999 int v28; // [sp+14h] [bp-Ch]@10 | |
2000 int v29; // [sp+14h] [bp-Ch]@36 | |
2001 unsigned int uClickX; // [sp+18h] [bp-8h]@10 | |
2002 unsigned int uClickY; // [sp+1Ch] [bp-4h]@10 | |
2003 | |
2004 v1 = 0; | |
2005 v26 = _this; | |
2006 v27 = uNumVisibleWindows; | |
2007 if ( uNumVisibleWindows < 0 ) | |
2008 return 0; | |
2009 v2 = pMessageQueue_50CBD0->uNumMessages; | |
2010 while ( 1 ) | |
2011 { | |
2012 v3 = pVisibleWindowsIdxs[v27] - 1; | |
2013 if ( pWindowList[v3].field_44 == v1 ) | |
2014 goto LABEL_47; | |
2015 if ( v26 != 34 ) | |
2016 break; | |
2017 if ( pWindowList[v3].field_30 != v1 ) | |
2018 { | |
2019 pMouse->GetClickPos(&uClickX, &uClickY); | |
2020 v4 = pWindowList[v3].pStartingPosActiveItem; | |
2021 v29 = v4 + pWindowList[v3].pNumPresenceButton; | |
2022 if ( v4 < v4 + pWindowList[v3].pNumPresenceButton ) | |
2023 { | |
2024 while ( 1 ) | |
2025 { | |
2026 v14 = pWindowList[v3].pControlsHead; | |
2027 if ( v4 > 0 ) | |
2028 { | |
2029 v15 = v4; | |
2030 do | |
2031 { | |
2032 v14 = v14->pNext; | |
2033 --v15; | |
2034 } | |
2035 while ( v15 ); | |
2036 } | |
2037 if ( (signed int)uClickX >= (signed int)v14->uX | |
2038 && (signed int)uClickX <= (signed int)v14->uZ | |
2039 && (signed int)uClickY >= (signed int)v14->uY | |
2040 && (signed int)uClickY <= (signed int)v14->uW ) | |
2041 goto LABEL_66; | |
2042 ++v4; | |
2043 if ( v4 >= v29 ) | |
2044 { | |
2045 LABEL_45: | |
2046 v1 = 0; | |
2047 goto LABEL_46; | |
2048 } | |
2049 } | |
2050 } | |
2051 goto LABEL_46; | |
2052 } | |
2053 LABEL_47: | |
2054 --v27; | |
2055 if ( v27 < 0 ) | |
2056 return 0; | |
2057 } | |
2058 if ( v26 == 37 ) | |
2059 { | |
2060 v12 = pWindowList[v3].field_34; | |
2061 if ( pWindowList[v3].pCurrentPosActiveItem - pWindowList[v3].pStartingPosActiveItem - v12 >= 0 ) | |
2062 { | |
151 | 2063 v8 = pCurrentScreen == SCREEN_PARTY_CREATION; |
0 | 2064 pWindowList[v3].pCurrentPosActiveItem -= v12; |
2065 if ( v8 ) | |
2066 { | |
187 | 2067 pAudioPlayer->PlaySound(SOUND_Button, v1, v1, -1, v1, v1, v1, v1); |
0 | 2068 v2 = pMessageQueue_50CBD0->uNumMessages; |
2069 } | |
2070 } | |
2071 if ( pWindowList[v3].field_30 != v1 ) | |
2072 goto LABEL_47; | |
2073 v9 = pWindowList[v3].pControlsHead; | |
2074 v13 = pWindowList[v3].pCurrentPosActiveItem; | |
2075 if ( v13 > (signed int)v1 ) | |
2076 { | |
2077 do | |
2078 { | |
2079 v9 = v9->pNext; | |
2080 --v13; | |
2081 } | |
2082 while ( v13 ); | |
2083 } | |
2084 LABEL_26: | |
2085 v11 = v9->uControlParam; | |
2086 if ( (signed int)v2 < 40 ) | |
2087 { | |
2088 pMessageQueue_50CBD0->pMessages[v2].eType = (UIMessageType)v9->uControlID; | |
2089 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v11; | |
2090 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = v1; | |
2091 v2 = pMessageQueue_50CBD0->uNumMessages + 1; | |
2092 ++pMessageQueue_50CBD0->uNumMessages; | |
2093 } | |
2094 goto LABEL_47; | |
2095 } | |
2096 if ( v26 != 38 ) | |
2097 { | |
2098 if ( v26 == 39 ) | |
2099 { | |
2100 v7 = pWindowList[v3].pCurrentPosActiveItem + pWindowList[v3].field_34; | |
2101 if ( v7 < pWindowList[v3].pNumPresenceButton + pWindowList[v3].pStartingPosActiveItem ) | |
2102 { | |
151 | 2103 v8 = pCurrentScreen == SCREEN_PARTY_CREATION; |
0 | 2104 pWindowList[v3].pCurrentPosActiveItem = v7; |
2105 if ( v8 ) | |
2106 { | |
187 | 2107 pAudioPlayer->PlaySound(SOUND_Button, v1, v1, -1, v1, v1, v1, v1); |
0 | 2108 v2 = pMessageQueue_50CBD0->uNumMessages; |
2109 } | |
2110 } | |
2111 if ( pWindowList[v3].field_30 != v1 ) | |
2112 goto LABEL_47; | |
2113 v9 = pWindowList[v3].pControlsHead; | |
2114 v10 = pWindowList[v3].pCurrentPosActiveItem; | |
2115 if ( v10 > (signed int)v1 ) | |
2116 { | |
2117 do | |
2118 { | |
2119 v9 = v9->pNext; | |
2120 --v10; | |
2121 } | |
2122 while ( v10 ); | |
2123 } | |
2124 goto LABEL_26; | |
2125 } | |
2126 if ( v26 == 40 ) | |
2127 { | |
2128 v17 = pWindowList[v3].pStartingPosActiveItem; | |
2129 v18 = pWindowList[v3].pCurrentPosActiveItem; | |
2130 if ( v18 >= pWindowList[v3].pNumPresenceButton + v17 - 1 ) | |
2131 pWindowList[v3].pCurrentPosActiveItem = v17; | |
2132 else | |
2133 pWindowList[v3].pCurrentPosActiveItem = v18 + 1; | |
2134 if ( pWindowList[v3].field_30 != v1 ) | |
2135 return 1; | |
2136 v19 = pWindowList[v3].pControlsHead; | |
2137 v20 = pWindowList[v3].pCurrentPosActiveItem; | |
2138 if ( v20 > (signed int)v1 ) | |
2139 { | |
2140 do | |
2141 { | |
2142 v19 = v19->pNext; | |
2143 --v20; | |
2144 } | |
2145 while ( v20 ); | |
2146 } | |
2147 goto LABEL_56; | |
2148 } | |
2149 if ( v26 == 41 ) | |
2150 { | |
2151 pMouse->GetClickPos(&uClickX, &uClickY); | |
2152 v4 = pWindowList[v3].pStartingPosActiveItem; | |
2153 v28 = v4 + pWindowList[v3].pNumPresenceButton; | |
2154 if ( v4 < v4 + pWindowList[v3].pNumPresenceButton ) | |
2155 { | |
2156 while ( 1 ) | |
2157 { | |
2158 v5 = pWindowList[v3].pControlsHead; | |
2159 if ( v4 > 0 ) | |
2160 { | |
2161 v6 = v4; | |
2162 do | |
2163 { | |
2164 v5 = v5->pNext; | |
2165 --v6; | |
2166 } | |
2167 while ( v6 ); | |
2168 } | |
2169 if ( (signed int)uClickX >= (signed int)v5->uX | |
2170 && (signed int)uClickX <= (signed int)v5->uZ | |
2171 && (signed int)uClickY >= (signed int)v5->uY | |
2172 && (signed int)uClickY <= (signed int)v5->uW ) | |
2173 break; | |
2174 ++v4; | |
2175 if ( v4 >= v28 ) | |
2176 goto LABEL_45; | |
2177 } | |
2178 LABEL_66: | |
2179 pWindowList[v3].pCurrentPosActiveItem = v4; | |
2180 return 1; | |
2181 } | |
2182 LABEL_46: | |
2183 v2 = pMessageQueue_50CBD0->uNumMessages; | |
2184 goto LABEL_47; | |
2185 } | |
2186 goto LABEL_47; | |
2187 } | |
2188 v22 = pWindowList[v3].pCurrentPosActiveItem; | |
2189 v23 = pWindowList[v3].pStartingPosActiveItem; | |
2190 if ( v22 <= v23 ) | |
2191 v24 = pWindowList[v3].pNumPresenceButton + v23 - 1; | |
2192 else | |
2193 v24 = v22 - 1; | |
2194 v8 = pWindowList[v3].field_30 == v1; | |
2195 pWindowList[v3].pCurrentPosActiveItem = v24; | |
2196 if ( !v8 ) | |
2197 return 1; | |
2198 v19 = pWindowList[v3].pControlsHead; | |
2199 v25 = pWindowList[v3].pCurrentPosActiveItem; | |
2200 if ( v25 > (signed int)v1 ) | |
2201 { | |
2202 do | |
2203 { | |
2204 v19 = v19->pNext; | |
2205 --v25; | |
2206 } | |
2207 while ( v25 ); | |
2208 } | |
2209 LABEL_56: | |
2210 v21 = v19->uControlParam; | |
2211 if ( (signed int)v2 < 40 ) | |
2212 { | |
2213 pMessageQueue_50CBD0->pMessages[v2].eType = (UIMessageType)v19->uControlID; | |
2214 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v21; | |
2215 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = v1; | |
2216 ++pMessageQueue_50CBD0->uNumMessages; | |
2217 } | |
2218 return 1; | |
2219 } | |
2220 | |
2221 //----- (0041D20D) -------------------------------------------------------- | |
2222 char __fastcall sub_41D20D_buff_remaining_time_string(int ecx0, GUIWindow *edx0, __int64 a3, GUIFont *a2) | |
2223 { | |
2224 unsigned int v4; // edi@1 | |
2225 unsigned int v5; // esi@1 | |
2226 unsigned int v6; // ebp@1 | |
2227 unsigned int v7; // ebx@1 | |
2228 signed __int64 v8; // ST34_8@1 | |
2229 signed __int64 v9; // kr00_8@1 | |
2230 char *v10; // eax@2 | |
2231 char *v11; // eax@7 | |
2232 char *v12; // eax@13 | |
2233 char *v13; // eax@19 | |
2234 int uY; // [sp+0h] [bp-20h]@1 | |
2235 GUIWindow *a1; // [sp+4h] [bp-1Ch]@1 | |
2236 signed __int64 v17; // [sp+10h] [bp-10h]@1 | |
2237 signed __int64 v18; // [sp+18h] [bp-8h]@1 | |
2238 unsigned int v19; // [sp+24h] [bp+4h]@1 | |
2239 | |
2240 a1 = edx0; | |
2241 uY = ecx0; | |
2242 v4 = (unsigned __int64)(signed __int64)((double)a3 * 0.234375) >> 32; | |
2243 v5 = (signed __int64)((double)a3 * 0.234375); | |
2244 v6 = (unsigned __int64)((signed __int64)((double)a3 * 0.234375) / 60) >> 32; | |
2245 v7 = (signed __int64)((double)a3 * 0.234375) / 60; | |
2246 v8 = (signed __int64)((double)a3 * 0.234375) / 60 / 60; | |
2247 v19 = (unsigned int)v8 / 0x18; | |
2248 v18 = (signed __int64)__PAIR__(v4, v5) % 60; | |
2249 v17 = (signed __int64)__PAIR__(v6, v7) % 60; | |
2250 v9 = v8 % 24; | |
2251 strcpy(pTmpBuf, "\r020"); | |
2252 if ( (unsigned int)v8 / 0x18 ) | |
2253 { | |
2254 v10 = pGlobalTXT_LocalizationStrings[57]; // Days | |
2255 if ( v19 <= 1 ) | |
2256 v10 = pGlobalTXT_LocalizationStrings[56]; // Day | |
2257 sprintf(pTmpBuf2, "%d %s ", v19, v10); | |
2258 strcat(pTmpBuf, pTmpBuf2); | |
2259 } | |
2260 if ( v9 ) | |
2261 { | |
2262 if ( v9 <= 1 ) | |
2263 v11 = pGlobalTXT_LocalizationStrings[109];// Hour | |
2264 else | |
2265 v11 = pGlobalTXT_LocalizationStrings[110];// Hours | |
2266 sprintf(pTmpBuf2, "%d %s ", v9, v11); | |
2267 strcat(pTmpBuf, pTmpBuf2); | |
2268 } | |
2269 if ( v17 && !v19 ) | |
2270 { | |
2271 if ( v17 <= 1 ) | |
2272 v12 = pGlobalTXT_LocalizationStrings[437];// Minute | |
2273 else | |
2274 v12 = pGlobalTXT_LocalizationStrings[436];// Minutes | |
2275 sprintf(pTmpBuf2, "%d %s ", v17, v12); | |
2276 strcat(pTmpBuf, pTmpBuf2); | |
2277 } | |
2278 if ( v18 && !v9 ) | |
2279 { | |
2280 if ( v18 <= 1 ) | |
2281 v13 = pGlobalTXT_LocalizationStrings[439];// Second | |
2282 else | |
2283 v13 = pGlobalTXT_LocalizationStrings[438];// Seconds | |
2284 sprintf(pTmpBuf2, "%d %s ", v18, v13); | |
2285 strcat(pTmpBuf, pTmpBuf2); | |
2286 } | |
2287 return a1->DrawText(a2, 32, uY, 0, pTmpBuf, 0, 0, 0); | |
2288 } | |
2289 | |
2290 | |
2291 //----- (0041D895) -------------------------------------------------------- | |
315 | 2292 void GameUI_DrawItemInfo(ItemGen *ecx0) |
0 | 2293 { |
2294 ItemGen *v1; // esi@1 | |
2295 unsigned int v2; // eax@3 | |
315 | 2296 //char *v3; // edi@5 |
2297 //unsigned int v4; // eax@5 | |
2298 //unsigned int v5; // esi@5 | |
0 | 2299 signed int v6; // eax@5 |
2300 int v7; // edx@5 | |
2301 ItemGen *v8; // ecx@10 | |
315 | 2302 //unsigned int v9; // eax@12 |
0 | 2303 char v10; // zf@16 |
2304 ItemGen *v11; // eax@16 | |
2305 ItemGen *v12; // eax@25 | |
315 | 2306 //unsigned int v13; // ecx@32 |
2307 //unsigned int v14; // eax@32 | |
2308 //Render *v15; // edi@33 | |
0 | 2309 const char *v16; // eax@34 |
2310 int v17; // eax@36 | |
2311 int v18; // esi@37 | |
2312 unsigned __int16 v19; // ax@37 | |
315 | 2313 //char v20; // al@40 |
0 | 2314 char v21; // al@44 |
315 | 2315 //char v22; // al@48 |
2316 //char v23; // al@51 | |
0 | 2317 int v24; // eax@52 |
2318 int v25; // eax@57 | |
2319 int v26; // eax@60 | |
2320 int v27; // eax@67 | |
2321 const char *v28; // edi@69 | |
2322 int v29; // eax@70 | |
2323 char *v30; // edi@78 | |
2324 const char *v31; // eax@78 | |
2325 int v32; // ecx@81 | |
2326 unsigned int v33; // eax@81 | |
2327 int v34; // esi@81 | |
2328 const char *v35; // eax@85 | |
2329 const char *v36; // eax@87 | |
2330 unsigned int v37; // eax@109 | |
2331 unsigned int v38; // eax@109 | |
2332 int v39; // eax@113 | |
2333 GUIFont *v40; // edx@113 | |
2334 signed int v41; // [sp-20h] [bp-298h]@113 | |
2335 int v42; // [sp-1Ch] [bp-294h]@113 | |
315 | 2336 //char *v43; // [sp-18h] [bp-290h]@46 |
0 | 2337 unsigned int v44; // [sp-18h] [bp-290h]@113 |
315 | 2338 //int v45; // [sp-14h] [bp-28Ch]@46 |
0 | 2339 const char *v46; // [sp-14h] [bp-28Ch]@58 |
2340 char *v47; // [sp-14h] [bp-28Ch]@110 | |
315 | 2341 //char *v48; // [sp-10h] [bp-288h]@46 |
0 | 2342 const char *v49; // [sp-10h] [bp-288h]@56 |
2343 char *v50; // [sp-10h] [bp-288h]@58 | |
2344 int v51; // [sp-10h] [bp-288h]@110 | |
2345 const char *v52; // [sp-Ch] [bp-284h]@36 | |
315 | 2346 //int v53; // [sp-Ch] [bp-284h]@46 |
0 | 2347 char *v54; // [sp-Ch] [bp-284h]@56 |
2348 int v55; // [sp-Ch] [bp-284h]@58 | |
2349 int v56; // [sp-Ch] [bp-284h]@110 | |
2350 unsigned int v57; // [sp-8h] [bp-280h]@36 | |
315 | 2351 //int v58; // [sp-8h] [bp-280h]@46 |
0 | 2352 int v59; // [sp-8h] [bp-280h]@56 |
2353 int v60; // [sp-8h] [bp-280h]@58 | |
2354 unsigned int v61; // [sp-8h] [bp-280h]@110 | |
309 | 2355 char a1[300]; // [sp+8h] [bp-270h]@40 |
2356 //char Dest[100]; // [sp+6Ch] [bp-20Ch]@40 | |
2357 //char v64[100]; // [sp+D0h] [bp-1A8h]@40 | |
0 | 2358 char v65[120]; // [sp+134h] [bp-144h]@92 |
2359 char Source[40]; // [sp+1ACh] [bp-CCh]@49 | |
351 | 2360 stru351_summoned_item v67; |
2361 //int v67; // [sp+1D4h] [bp-A4h]@91 | |
2362 //int v68; // [sp+1D8h] [bp-A0h]@106 | |
2363 //int v69; // [sp+1DCh] [bp-9Ch]@101 | |
2364 //int v70; // [sp+1E0h] [bp-98h]@97 | |
2365 //int v71; // [sp+1E8h] [bp-90h]@93 | |
2366 //int v72; // [sp+1ECh] [bp-8Ch]@91 | |
0 | 2367 int var88; // [sp+1F0h] [bp-88h]@1 |
2368 Texture *v73; // [sp+1F4h] [bp-84h]@5 | |
315 | 2369 //unsigned int v75; // [sp+1F8h] [bp-80h]@5 |
2370 //char *v76; // [sp+1FCh] [bp-7Ch]@5 | |
0 | 2371 int v77; // [sp+200h] [bp-78h]@12 |
2372 int v78; // [sp+204h] [bp-74h]@5 | |
2373 GUIWindow v79; // [sp+208h] [bp-70h]@2 | |
2374 POINT a2; // [sp+25Ch] [bp-1Ch]@2 | |
2375 int v81; // [sp+264h] [bp-14h]@5 | |
2376 GUIFont *v82; // [sp+268h] [bp-10h]@1 | |
2377 char *v83; // [sp+26Ch] [bp-Ch]@18 | |
2378 char *Str; // [sp+270h] [bp-8h]@65 | |
2379 ItemGen *_this; // [sp+274h] [bp-4h]@1 | |
2380 | |
2381 v1 = ecx0; | |
2382 _this = ecx0; | |
2383 var88 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); | |
2384 v82 = pFontComic; | |
306 | 2385 if (!v1->uItemID) |
2386 return; | |
2387 | |
0 | 2388 v79.Hint = 0; |
2389 v79.uFrameWidth = 384; | |
2390 v79.uFrameHeight = 180; | |
2391 v79.uFrameY = 40; | |
2392 if ( pMouse->GetCursorPos(&a2)->x <= 320 ) | |
2393 v2 = pMouse->GetCursorPos(&a2)->x + 30; | |
2394 else | |
2395 v2 = pMouse->GetCursorPos(&a2)->x - v79.uFrameWidth - 30; | |
2396 v79.uFrameX = v2; | |
315 | 2397 auto item_desc = &pItemsTable->pItems[_this->uItemID]; |
2398 //v3 = (char *)&pItemsTable->pItems[_this->uItemID].pIconName; | |
2399 //v76 = v3; | |
2400 //v4 = pIcons_LOD->LoadTexture(pItemsTable->pItems[_this->uItemID].pIconName, TEXTURE_16BIT_PALETTE); | |
2401 //v5 = v4; | |
2402 //v4 *= 72; | |
2403 //v75 = v4; | |
2404 //v73 = &pIcons_LOD->pTextures[v4]; | |
2405 v73 = pIcons_LOD->LoadTexturePtr(item_desc->pIconName, TEXTURE_16BIT_PALETTE); | |
2406 v6 = 100 - v73->uTextureWidth; | |
0 | 2407 v7 = v73->uTextureHeight; |
2408 v78 = v6; | |
2409 v81 = 144 - v7; | |
2410 if ( v6 > 0 ) | |
2411 v78 = v6 >> 1; | |
2412 if ( v81 <= 0 ) | |
2413 v81 = 0; | |
2414 else | |
2415 v81 >>= 1; | |
2416 v8 = _this; | |
315 | 2417 if ( !item_desc->uItemID_Rep_St ) |
2418 _this->SetIdentified(); | |
2419 //v9 = v8->uAttributes; | |
0 | 2420 v77 = 0; |
315 | 2421 //a2.y = v8->uAttributes & 2; |
2422 if (pItemsTable->pItems[v8->uItemID].uEquipType == EQUIP_GOLD) | |
0 | 2423 v77 = v8->uAdditionalValue; |
2424 if ( uActiveCharacter ) | |
2425 { | |
315 | 2426 if (!v8->Identified()) |
0 | 2427 { |
2428 v10 = pPlayers[uActiveCharacter]->CanIdentify(_this) == 1; | |
2429 v11 = _this; | |
2430 if ( v10 ) | |
315 | 2431 _this->SetIdentified(); |
2432 v10 = !v11->Identified(); | |
0 | 2433 v83 = (char *)9; |
2434 if ( v10 ) | |
2435 { | |
2436 ShowStatusBarString(pGlobalTXT_LocalizationStrings[446], 2u); | |
2437 } | |
2438 else | |
2439 { | |
187 | 2440 v83 = (char *)SPEECH_8; |
0 | 2441 if ( _this->GetValue() < 100 * (pPlayers[uActiveCharacter]->uLevel + 5) ) |
187 | 2442 v83 = (char *)SPEECH_7; |
0 | 2443 } |
2444 if ( dword_4E455C ) | |
2445 { | |
187 | 2446 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)(int)v83, 0); |
0 | 2447 dword_4E455C = 0; |
2448 } | |
2449 } | |
2450 _this->UpdateTempBonus(pParty->uTimePlayed); | |
315 | 2451 if (v8->Broken()) |
0 | 2452 { |
2453 v10 = pPlayers[uActiveCharacter]->CanRepair(_this) == 1; | |
2454 v12 = _this; | |
2455 if ( v10 ) | |
2456 _this->uAttributes = _this->uAttributes & 0xFFFFFFFD | 1; | |
315 | 2457 v10 = !v12->Broken(); |
187 | 2458 v83 = (char *)SPEECH_11; |
0 | 2459 if ( v10 ) |
187 | 2460 v83 = (char *)SPEECH_10; |
0 | 2461 else |
2462 ShowStatusBarString(pGlobalTXT_LocalizationStrings[448], 2u); | |
2463 if ( dword_4E455C ) | |
2464 { | |
187 | 2465 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)(int)v83, 0); |
0 | 2466 dword_4E455C = 0; |
2467 } | |
2468 } | |
2469 } | |
315 | 2470 //v13 = _this->uAttributes; |
2471 //v14 = _this->Identified(); | |
2472 a2.y = _this->Identified(); | |
2473 if (_this->Broken()) | |
0 | 2474 { |
2475 v79.DrawMessageBox(0); | |
2476 //v15 = &; | |
315 | 2477 pRenderer->Clip(v79.uFrameX + 12, v79.uFrameY + 12, |
2478 v79.uFrameX + v79.uFrameWidth - 12, v79.uFrameY + v79.uFrameHeight - 12); | |
0 | 2479 v79.uFrameWidth -= 24; |
2480 v79.uFrameHeight -= 12; | |
2481 v79.uFrameZ = v79.uFrameX + v79.uFrameWidth - 1; | |
2482 v79.uFrameW = v79.uFrameY + v79.uFrameHeight - 1; | |
315 | 2483 pRenderer->DrawTransparentRedShade(v79.uFrameX + v78, v81 + v79.uFrameY + 30, v73); |
0 | 2484 if ( a2.y ) |
2485 v16 = _this->GetIdentifiedName(); | |
2486 else | |
315 | 2487 v16 = item_desc->pUnidentifiedName; |
0 | 2488 v79.DrawTitleText(pFontArrus, 0, 0xCu, var88, v16, 3u); |
2489 v17 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[32], &v79, 0, 0); | |
2490 v57 = 3; | |
2491 v52 = pGlobalTXT_LocalizationStrings[32]; | |
2492 goto LABEL_37; | |
2493 } | |
315 | 2494 if (!_this->Identified()) |
0 | 2495 { |
2496 v79.DrawMessageBox(0); | |
315 | 2497 //v15 = pRenderer; |
2498 pRenderer->Clip(v79.uFrameX + 12, v79.uFrameY + 12, | |
2499 v79.uFrameX + v79.uFrameWidth - 12, v79.uFrameY + v79.uFrameHeight - 12); | |
0 | 2500 v79.uFrameWidth -= 24; |
2501 v79.uFrameHeight -= 12; | |
2502 v79.uFrameZ = v79.uFrameX + v79.uFrameWidth - 1; | |
2503 v79.uFrameW = v79.uFrameY + v79.uFrameHeight - 1; | |
315 | 2504 pRenderer->DrawTextureTransparent(v79.uFrameX + v78, v81 + v79.uFrameY + 30, v73); |
2505 v79.DrawTitleText(pFontArrus, 0, 0xCu, var88, item_desc->pUnidentifiedName, 3u); | |
0 | 2506 v17 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[232], &v79, 0, 0); |
2507 v57 = 3; | |
2508 v52 = pGlobalTXT_LocalizationStrings[232]; | |
2509 LABEL_37: | |
2510 v18 = v17 >> 1; | |
2511 v19 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0x19u, 0x19u); | |
2512 v79.DrawTitleText(pFontArrus, 0x64u, ((signed int)v79.uFrameHeight >> 1) - v18, v19, v52, v57); | |
2513 goto LABEL_116; | |
2514 } | |
315 | 2515 |
2516 sprintfex(a1, pGlobalTXT_LocalizationStrings[463], item_desc->pUnidentifiedName); | |
2517 a1[100] = 0; | |
2518 a1[200] = 0; | |
2519 //v20 = item_desc->uEquipType; | |
2520 switch (item_desc->uEquipType) | |
2521 { | |
2522 case EQUIP_ONE_OR_TWO_HANDS: | |
2523 case EQUIP_TWO_HANDED: | |
2524 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); | |
2525 if (item_desc->uDamageMod) | |
0 | 2526 { |
315 | 2527 char mod[16]; |
2528 sprintf(mod, "+%d", (int)item_desc->uDamageMod); | |
2529 strcat(a1 + 100, mod); | |
2530 } | |
2531 break; | |
2532 | |
2533 case EQUIP_BOW: | |
2534 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); | |
2535 if (item_desc->uDamageMod) | |
2536 { | |
2537 char mod[16]; | |
2538 sprintf(mod, "+%d", (int)item_desc->uDamageMod); | |
2539 strcat(a1 + 100, mod); | |
0 | 2540 } |
315 | 2541 break; |
2542 | |
2543 case EQUIP_ARMOUR: | |
2544 case EQUIP_SHIELD: | |
2545 case EQUIP_HELMET: | |
2546 case EQUIP_BELT: | |
2547 case EQUIP_CLOAK: | |
2548 case EQUIP_GAUNTLETS: | |
2549 case EQUIP_BOOTS: | |
2550 case EQUIP_RING: | |
2551 case EQUIP_AMULET: | |
2552 if (item_desc->uDamageDice) | |
2553 sprintfex(a1 + 100, "%s: +%d", pGlobalTXT_LocalizationStrings[11], item_desc->uDamageDice + item_desc->uDamageMod); | |
2554 break; | |
2555 } | |
2556 | |
0 | 2557 if ( v77 ) |
2558 goto LABEL_65; | |
315 | 2559 //v23 = item_desc->uEquipType; |
2560 if (item_desc->uEquipType == 14) | |
0 | 2561 { |
2562 v24 = _this->_bonus_type; | |
2563 if ( v24 ) | |
2564 goto LABEL_56; | |
2565 LABEL_65: | |
2566 v79.uFrameWidth -= 12; | |
2567 a2.y = 3; | |
2568 v79.uFrameZ = v79.uFrameX + v79.uFrameWidth - 1; | |
2569 v79.uFrameW = v79.uFrameY + v79.uFrameHeight - 1; | |
2570 Str = (char *)(3 * (LOBYTE(pFontArrus->uFontHeight) + 8)); | |
2571 v83 = a1; | |
2572 do | |
2573 { | |
2574 if ( *v83 ) | |
2575 { | |
2576 v27 = v82->CalcTextHeight(v83, &v79, 100, 0); | |
2577 Str += v27 + 3; | |
2578 } | |
2579 v83 += 100; | |
2580 --a2.y; | |
2581 } | |
2582 while ( a2.y ); | |
315 | 2583 v28 = item_desc->pDescription; |
0 | 2584 if ( *v28 ) |
2585 { | |
2586 v29 = pFontSmallnum->CalcTextHeight(v28, &v79, 100, 0); | |
2587 Str += v29; | |
2588 } | |
2589 v79.uFrameHeight = v73->uTextureHeight + v81 + 54; | |
2590 if ( (signed int)Str > (signed int)v79.uFrameHeight ) | |
2591 v79.uFrameHeight = (unsigned int)Str; | |
2592 if ( _this->uAttributes & 8 && (_this->uAdditionalValue || _this->_bonus_type) ) | |
2593 v79.uFrameHeight += LOBYTE(v82->uFontHeight); | |
2594 v83 = 0; | |
2595 if ( LOBYTE(pFontArrus->uFontHeight) ) | |
2596 { | |
2597 v79.uFrameWidth -= 24; | |
2598 v30 = (char *)LOBYTE(pFontArrus->uFontHeight); | |
2599 v31 = _this->GetIdentifiedName(); | |
2600 if ( pFontArrus->CalcTextHeight(v31, &v79, 0, 0) / (signed int)v30 ) | |
2601 v83 = v30; | |
2602 v79.uFrameWidth += 24; | |
2603 } | |
2604 v79.uFrameWidth += 12; | |
2605 v79.uFrameHeight += (unsigned int)v83; | |
2606 v79.uFrameW = v79.uFrameY + v79.uFrameHeight - 1; | |
2607 v79.uFrameZ = v79.uFrameX + v79.uFrameWidth - 1; | |
2608 v79.DrawMessageBox(0); | |
315 | 2609 //v15 = pRenderer; |
2610 pRenderer->Clip(v79.uFrameX + 12, v79.uFrameY + 12, | |
2611 v79.uFrameX + v79.uFrameWidth - 12, v79.uFrameY + v79.uFrameHeight - 12); | |
0 | 2612 v79.uFrameWidth -= 12; |
2613 v32 = v73->uTextureHeight; | |
2614 v33 = v79.uFrameHeight; | |
2615 v79.uFrameHeight -= 12; | |
2616 v79.uFrameZ = v79.uFrameX + v79.uFrameWidth - 1; | |
2617 v79.uFrameW = v79.uFrameY + v79.uFrameHeight - 1; | |
2618 pRenderer->DrawTextureTransparent( | |
2619 v79.uFrameX + v78, | |
2620 v79.uFrameY + (signed int)(v33 - v32) / 2, | |
315 | 2621 v73); |
0 | 2622 a2.y = 3; |
2623 v34 = (int)(v83 + 35); | |
2624 Str = a1; | |
2625 do | |
2626 { | |
2627 if ( *Str ) | |
2628 { | |
2629 v79.DrawText(v82, 100, v34, 0, Str, 0, 0, 0); | |
2630 v34 += v82->CalcTextHeight(Str, &v79, 100, 0) + 3; | |
2631 } | |
2632 Str += 100; | |
2633 --a2.y; | |
2634 } | |
2635 while ( a2.y ); | |
315 | 2636 v35 = item_desc->pDescription; |
0 | 2637 if ( *v35 ) |
2638 v79.DrawText(pFontSmallnum, 100, v34, 0, v35, 0, 0, 0); | |
2639 v79.uFrameX += 12; | |
2640 v79.uFrameWidth -= 24; | |
2641 v36 = _this->GetIdentifiedName(); | |
2642 v79.DrawTitleText(pFontArrus, 0, 0xCu, var88, v36, 3u); | |
2643 v79.uFrameWidth += 24; | |
2644 v79.uFrameX -= 12; | |
2645 if ( v77 ) | |
2646 { | |
2647 sprintf(pTmpBuf, "%s: %lu", pGlobalTXT_LocalizationStrings[465], v77); | |
2648 v40 = v82; | |
2649 v61 = 0; | |
2650 v56 = 0; | |
2651 v51 = 0; | |
2652 v47 = pTmpBuf; | |
2653 v44 = 0; | |
2654 v42 = v79.uFrameHeight - LOBYTE(v82->uFontHeight); | |
2655 v41 = 100; | |
2656 } | |
2657 else | |
2658 { | |
2659 if ( _this->uAttributes & 8 && (_this->uAdditionalValue || _this->_bonus_type) ) | |
2660 { | |
351 | 2661 sub_493F79(&v67, _this->uExpireTime - pParty->uTimePlayed); |
0 | 2662 strcpy(pTmpBuf, "Duration:"); |
352 | 2663 Str = (char *)(v67.field_18_expire_year - game_starting_year); |
351 | 2664 if (v67.field_18_expire_year != 1168 ) |
0 | 2665 { |
352 | 2666 sprintf(v65, " %d:yr", v67.field_18_expire_year - game_starting_year); |
0 | 2667 strcat(pTmpBuf, v65); |
2668 } | |
351 | 2669 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) |
2670 && ((sprintf(v65, " %d:dy", v67.field_C_expire_day), strcat(pTmpBuf, v65), v67.field_14_exprie_month) || Str || v67.field_C_expire_day) | |
2671 || v67.field_8_expire_hour) | |
2672 && ((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) | |
2673 || v67.field_4_expire_minute ) | |
0 | 2674 { |
351 | 2675 sprintf(v65, " %d:mn", v67.field_4_expire_minute); |
0 | 2676 strcat(pTmpBuf, v65); |
2677 } | |
2678 v79.DrawText(v82, 100, v79.uFrameHeight - 2 * LOBYTE(v82->uFontHeight), 0, pTmpBuf, 0, 0, 0); | |
2679 } | |
2680 v37 = _this->GetValue(); | |
2681 sprintf(pTmpBuf, "%s: %lu", pGlobalTXT_LocalizationStrings[465], v37); | |
2682 v79.DrawText(v82, 100, v79.uFrameHeight - LOBYTE(v82->uFontHeight), 0, pTmpBuf, 0, 0, 0); | |
2683 v38 = _this->uAttributes; | |
2684 if ( BYTE1(v38) & 1 ) | |
2685 { | |
2686 v61 = 0; | |
2687 v56 = 0; | |
2688 v51 = 0; | |
2689 v47 = pGlobalTXT_LocalizationStrings[187]; | |
2690 } | |
2691 else | |
2692 { | |
2693 if ( !(BYTE1(v38) & 2) ) | |
2694 goto LABEL_116; | |
2695 v61 = 0; | |
2696 v56 = 0; | |
2697 v51 = 0; | |
2698 v47 = pGlobalTXT_LocalizationStrings[651]; | |
2699 } | |
2700 LOWORD(v38) = LOWORD(pRenderer->uTargetRMask); | |
2701 v44 = v38; | |
2702 v42 = v79.uFrameHeight - LOBYTE(v82->uFontHeight); | |
2703 v39 = v82->GetLineWidth(pTmpBuf); | |
2704 v40 = v82; | |
2705 v41 = v39 + 132; | |
2706 } | |
2707 v79.DrawText(v40, v41, v42, v44, v47, v51, v56, v61); | |
2708 LABEL_116: | |
2709 pRenderer->ResetClip(); | |
2710 if ( !areWeLoadingTexture ) | |
2711 { | |
2712 v73->Release(); | |
2713 pIcons_LOD->_40F9C5(); | |
2714 } | |
2715 return; | |
2716 } | |
315 | 2717 if (item_desc->uEquipType == 13) |
0 | 2718 { |
2719 v24 = pItemsTable->pItems[_this->uItemID].uDamageDice; | |
2720 LABEL_56: | |
2721 v59 = v24; | |
2722 v54 = pGlobalTXT_LocalizationStrings[449]; | |
2723 v49 = "%s: %d"; | |
2724 LABEL_64: | |
315 | 2725 sprintf(a1 + 200, v49, v54, v59); |
0 | 2726 goto LABEL_65; |
2727 } | |
2728 v25 = _this->_bonus_type; | |
2729 if ( v25 ) | |
2730 { | |
2731 v60 = _this->_bonus_strength; | |
2732 v55 = *((int *)&pItemsTable->pItems[799].uDamageMod + 5 * v25); | |
2733 v50 = pGlobalTXT_LocalizationStrings[210]; | |
2734 v46 = "%s: %s +%d"; | |
2735 } | |
2736 else | |
2737 { | |
2738 v26 = _this->uAdditionalValue; | |
2739 if ( !v26 ) | |
2740 { | |
2741 if ( _this->uNumCharges ) | |
2742 { | |
2743 v59 = _this->uNumCharges; | |
2744 v54 = pGlobalTXT_LocalizationStrings[464]; | |
2745 v49 = "%s: %lu"; | |
2746 goto LABEL_64; | |
2747 } | |
2748 goto LABEL_65; | |
2749 } | |
2750 v60 = _this->_bonus_strength; | |
222 | 2751 v55 = *((int *)&pItemsTable->pEnchantments[23].pBonusStat + 7 * v26); |
0 | 2752 v50 = pGlobalTXT_LocalizationStrings[210]; |
2753 v46 = "%s: %s"; | |
2754 } | |
315 | 2755 sprintf(a1 + 200, v46, v50, v55, v60); |
0 | 2756 goto LABEL_65; |
2757 } | |
2758 // 4E455C: using guessed type int dword_4E455C; | |
2759 // 506128: using guessed type int areWeLoadingTexture; | |
2760 | |
2761 //----- (0041E360) -------------------------------------------------------- | |
2762 char *__fastcall MonsterPopup_Draw(unsigned int uActorID, GUIWindow *edx0) | |
2763 { | |
2764 unsigned int v2; // esi@1 | |
2765 Actor *v3; // esi@3 | |
2766 int v4; // eax@3 | |
2767 unsigned int v5; // ecx@3 | |
2768 NPCData *v6; // eax@3 | |
2769 unsigned __int16 v7; // cx@3 | |
2770 int v8; // eax@4 | |
2771 unsigned __int16 v9; // dx@4 | |
2772 SpriteFrame *v10; // edi@17 | |
243 | 2773 LODSprite *v11; // esi@17 |
0 | 2774 unsigned int v12; // ecx@17 |
2775 Sprite *v13; // edi@18 | |
2776 int v14; // ecx@18 | |
2777 int v15; // edx@18 | |
2778 int v16; // edx@18 | |
2779 int v17; // eax@18 | |
2780 unsigned int v18; // ecx@19 | |
2781 unsigned int v19; // eax@21 | |
2782 char *v20; // esi@28 | |
2783 int v21; // edx@29 | |
2784 unsigned __int16 *v22; // ecx@29 | |
2785 int v23; // eax@29 | |
2786 int v24; // eax@32 | |
2787 int v25; // esi@32 | |
2788 char *v26; // edx@34 | |
2789 unsigned __int8 v27; // sf@36 | |
2790 unsigned __int8 v28; // of@36 | |
2791 int v29; // esi@40 | |
2792 char *v30; // ecx@40 | |
2793 int v31; // eax@40 | |
2794 int v32; // esi@43 | |
2795 unsigned __int16 v33; // ax@45 | |
2796 int v34; // edx@45 | |
2797 int v35; // eax@45 | |
2798 int v36; // eax@49 | |
2799 char *v37; // eax@52 | |
2800 int v38; // eax@55 | |
2801 unsigned __int16 v39; // ax@59 | |
2802 SpellBuff *v40; // eax@60 | |
2803 int v41; // edi@61 | |
2804 unsigned int v42; // eax@61 | |
2805 int v43; // eax@62 | |
2806 int v44; // eax@63 | |
2807 signed int v45; // edi@65 | |
2808 unsigned __int16 v46; // ax@73 | |
2809 Player *v47; // ecx@77 | |
2810 unsigned int v48; // eax@85 | |
2811 GUIFont *v49; // edi@90 | |
2812 int v50; // edi@90 | |
2813 SpellBuff *v51; // eax@91 | |
2814 char *v52; // ecx@98 | |
2815 char *v53; // ecx@101 | |
2816 char *v54; // ST0C_4@118 | |
2817 unsigned int v55; // eax@118 | |
2818 GUIFont *v56; // edi@124 | |
2819 unsigned __int8 v57; // al@128 | |
2820 int v58; // eax@132 | |
2821 Actor *v59; // ecx@133 | |
2822 unsigned __int8 v60; // dl@138 | |
2823 char *v62; // eax@147 | |
2824 int v63; // eax@152 | |
2825 char *result; // eax@152 | |
2826 int v65; // eax@155 | |
2827 const char *v66; // [sp-10h] [bp-1FCh]@121 | |
2828 const char *v67; // [sp-10h] [bp-1FCh]@125 | |
2829 const char *v68; // [sp-10h] [bp-1FCh]@142 | |
2830 int v69; // [sp-Ch] [bp-1F8h]@121 | |
2831 char *v70; // [sp-Ch] [bp-1F8h]@125 | |
2832 char *v71; // [sp-Ch] [bp-1F8h]@142 | |
2833 char *v72; // [sp-8h] [bp-1F4h]@54 | |
2834 int v73; // [sp-8h] [bp-1F4h]@79 | |
2835 int v74; // [sp-8h] [bp-1F4h]@121 | |
2836 int v75; // [sp-8h] [bp-1F4h]@125 | |
2837 int v76; // [sp-8h] [bp-1F4h]@142 | |
2838 size_t v77; // [sp-4h] [bp-1F0h]@54 | |
2839 unsigned int v78; // [sp-4h] [bp-1F0h]@121 | |
2840 unsigned int v79; // [sp-4h] [bp-1F0h]@125 | |
2841 char *v80; // [sp-4h] [bp-1F0h]@142 | |
2842 char *v81; // [sp-4h] [bp-1F0h]@148 | |
2843 DDBLTFX Dst; // [sp+Ch] [bp-1E0h]@18 | |
2844 DDSURFACEDESC2 pDesc; // [sp+70h] [bp-17Ch]@18 | |
2845 RECT v84; // [sp+ECh] [bp-100h]@26 | |
241 | 2846 char *v85[10]; // [sp+FCh] [bp-F0h]@145 |
2847 char *v95[11]; // [sp+124h] [bp-C8h]@127 | |
0 | 2848 RenderBillboardTransform_local0 v106; // [sp+150h] [bp-9Ch]@3 |
2849 unsigned int v107; // [sp+1A0h] [bp-4Ch]@18 | |
2850 unsigned __int16 *v108; // [sp+1A4h] [bp-48h]@34 | |
2851 unsigned int v109; // [sp+1A8h] [bp-44h]@32 | |
2852 LPVOID v110; // [sp+1ACh] [bp-40h]@28 | |
2853 unsigned int v111; // [sp+1B0h] [bp-3Ch]@29 | |
2854 char **v112; // [sp+1B4h] [bp-38h]@3 | |
2855 IDirectDrawSurface *v222; // [sp+1B8h] [bp-34h]@18 | |
2856 unsigned __int8 v114; // [sp+1BFh] [bp-2Dh]@133 | |
2857 int v115; // [sp+1C0h] [bp-2Ch]@3 | |
2858 unsigned int v116; // [sp+1C4h] [bp-28h]@18 | |
2859 int i; // [sp+1C8h] [bp-24h]@18 | |
2860 Player *a2; // [sp+1CCh] [bp-20h]@28 | |
2861 int v119; // [sp+1D0h] [bp-1Ch]@18 | |
2862 SpellBuff *v120; // [sp+1D4h] [bp-18h]@18 | |
2863 Actor *v121; // [sp+1D8h] [bp-14h]@3 | |
2864 int a5; // [sp+1DCh] [bp-10h]@3 | |
2865 GUIWindow *a1; // [sp+1E0h] [bp-Ch]@1 | |
2866 int v124; // [sp+1E4h] [bp-8h]@18 | |
2867 char *a4; // [sp+1E8h] [bp-4h]@18 | |
2868 | |
2869 a1 = edx0; | |
2870 v2 = uActorID; | |
2871 | |
2872 static Actor pMonsterInfoUI_Doll; | |
2873 /*if ( !(bMonsterInfoUI_bDollInitialized & 1) ) | |
2874 { | |
2875 bMonsterInfoUI_bDollInitialized |= 1u; | |
2876 Actor::Actor(&pMonsterInfoUI_Doll); | |
2877 atexit(nullsub_3); | |
2878 }*/ | |
2879 v106.uParentBillboardID = -1; | |
2880 v3 = &pActors[v2]; | |
2881 v121 = v3; | |
2882 v4 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xFFu, 0x9Bu); | |
2883 v5 = v3->uNPC_ID; | |
2884 a5 = v4; | |
2885 v6 = GetNPCData(v5); | |
2886 v7 = v3->pMonsterInfo.uID; | |
2887 v112 = (char **)v6; | |
2888 v115 = byte_4E2B70[((signed __int16)v7 - 1) / 3] - 40; | |
2889 if ( v7 == pMonsterInfoUI_Doll.pMonsterInfo.uID ) | |
2890 { | |
2891 v9 = pMonsterInfoUI_Doll.uCurrentActionLength; | |
2892 } | |
2893 else | |
2894 { | |
2895 memcpy(&pMonsterInfoUI_Doll, v3, sizeof(pMonsterInfoUI_Doll)); | |
305 | 2896 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Bored; |
0 | 2897 pMonsterInfoUI_Doll.uCurrentActionTime = 0; |
2898 v8 = rand(); | |
2899 v3 = v121; | |
2900 v9 = v8 % 256 + 128; | |
2901 pMonsterInfoUI_Doll.uCurrentActionLength = v8 % 256 + 128; | |
2902 } | |
2903 if ( (signed int)pMonsterInfoUI_Doll.uCurrentActionTime > (signed __int16)v9 ) | |
2904 { | |
2905 pMonsterInfoUI_Doll.uCurrentActionTime = 0; | |
305 | 2906 if ( pMonsterInfoUI_Doll.uCurrentActionAnimation == ANIM_Bored || pMonsterInfoUI_Doll.uCurrentActionAnimation == ANIM_AtkMelee) |
2907 { | |
2908 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Standing; | |
0 | 2909 pMonsterInfoUI_Doll.uCurrentActionLength = rand() % 128 + 128; |
2910 } | |
2911 else | |
2912 { | |
2913 rand(); | |
305 | 2914 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Bored; |
0 | 2915 if ( (pMonsterInfoUI_Doll.pMonsterInfo.uID < 115 || pMonsterInfoUI_Doll.pMonsterInfo.uID > 186) |
2916 && (pMonsterInfoUI_Doll.pMonsterInfo.uID < 232 || pMonsterInfoUI_Doll.pMonsterInfo.uID > 249) | |
2917 && rand() % 30 < 100 ) | |
305 | 2918 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_AtkMelee; |
2919 pMonsterInfoUI_Doll.uCurrentActionLength = 8 * pSpriteFrameTable->pSpriteSFrames[v3->pSpriteIDs[(signed __int16)pMonsterInfoUI_Doll.uCurrentActionAnimation]].uAnimLength; | |
2920 } | |
2921 } | |
2922 v10 = pSpriteFrameTable->GetFrame( v3->pSpriteIDs[(signed __int16)pMonsterInfoUI_Doll.uCurrentActionAnimation], pMonsterInfoUI_Doll.uCurrentActionTime); | |
2923 v11 = &pSprites_LOD->pSpriteHeaders[v10->pHwSpriteIDs[0]];//40 * v10->pHwSpriteIDs[0] + 7218180; | |
0 | 2924 v106.pTarget = pRenderer->pTargetSurface; |
2925 v106.pTargetZ = pRenderer->pActiveZBuffer; | |
2926 v106.uTargetPitch = pRenderer->uTargetSurfacePitch; | |
2927 v12 = a1->uFrameY + 52; | |
2928 v106.uViewportX = a1->uFrameX + 13; | |
2929 v106.uViewportY = v12; | |
2930 v106.uViewportW = v12 + 128; | |
2931 v106.uViewportZ = v106.uViewportX + 128; | |
2932 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
|
2933 v106._screenspace_x_scaler_packedfloat = 65536; |
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
141
diff
changeset
|
2934 v106._screenspace_y_scaler_packedfloat = 65536; |
243 | 2935 v106.uScreenSpaceY = v115 + v12 + v11->uHeight; |
0 | 2936 v106.pPalette = PaletteManager::Get_Dark_or_Red_LUT(v10->uPaletteIndex, 0, 1); |
2937 v106.sZValue = 0; | |
2938 v106.uFlags = 0; | |
2939 pRenderer->Clip_v2(0, 0, 0x27Fu, 0x1DFu); | |
2940 pRenderer->Line2D(v106.uViewportX - 1, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportY - 1, a5); | |
2941 pRenderer->Line2D( | |
2942 v106.uViewportX + 129, | |
2943 v106.uViewportY - 1, | |
2944 v106.uViewportX + 129, | |
2945 v106.uViewportW + 1, | |
2946 a5); | |
2947 pRenderer->Line2D(v106.uViewportX + 129, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportW + 1, a5); | |
2948 pRenderer->Line2D(v106.uViewportX - 1, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportY - 1, a5); | |
2949 if ( pRenderer->pRenderD3D ) | |
2950 { | |
2951 v13 = &pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]]; | |
2952 v106.uScreenSpaceY = v115 + v106.uViewportY + v13->uBufferHeight; | |
2953 v222 = (IDirectDrawSurface *)v13->pTextureSurface; | |
2954 memset(&Dst, 0, 0x64u); | |
2955 Dst.dwSize = 100; | |
2956 Dst.dwFillColor = 0; | |
2957 memset(&pDesc, 0, 0x7Cu); | |
2958 pDesc.dwSize = 124; | |
2959 v222->GetSurfaceDesc((LPDDSURFACEDESC)&pDesc); | |
2960 v14 = v13->uBufferHeight; | |
2961 v120 = (SpellBuff *)v13->uBufferWidth; | |
2962 v107 = 0; | |
2963 v15 = v13->uAreaX; | |
2964 v119 = (signed int)v120 / 2; | |
2965 i = 0; | |
2966 a4 = (char *)(v106.uScreenSpaceX + v15 - (signed int)v120 / 2); | |
2967 v115 = v13->uAreaY; | |
2968 v16 = v13->uAreaWidth + (signed int)v120 / 2 + v15 - (int)v120; | |
2969 v124 = v106.uScreenSpaceY + v115 - v14; | |
2970 v17 = v13->uAreaHeight + v115 - v14; | |
2971 v116 = v106.uScreenSpaceX + v16; | |
2972 v119 = v106.uScreenSpaceY + v17; | |
2973 if ( (signed int)a4 < (signed int)v106.uViewportX ) | |
2974 { | |
2975 v18 = v106.uViewportX - (int)a4; | |
2976 a4 = (char *)v106.uViewportX; | |
2977 v107 = v18; | |
2978 } | |
2979 if ( v124 < (signed int)v106.uViewportY ) | |
2980 { | |
2981 v19 = v106.uViewportY - v124; | |
2982 v124 = v106.uViewportY; | |
2983 i = v19; | |
2984 } | |
2985 if ( (signed int)v116 > (signed int)v106.uViewportZ ) | |
2986 v116 = v106.uViewportZ; | |
2987 if ( v119 > (signed int)v106.uViewportW ) | |
2988 v119 = v106.uViewportW; | |
2989 pRenderer->FillRectFast( | |
2990 v106.uViewportX, | |
2991 v106.uViewportY, | |
2992 v106.uViewportZ - v106.uViewportX, | |
2993 v106.uViewportW - v106.uViewportY, | |
2994 pRenderer->uTargetBMask | pRenderer->uTargetGMask); | |
2995 pRenderer->FillRectFast( | |
2996 v106.uViewportX, | |
2997 v106.uViewportY, | |
2998 v106.uViewportZ - v106.uViewportX, | |
2999 v106.uViewportW - v106.uViewportY, | |
3000 pRenderer->uTargetBMask | pRenderer->uTargetGMask); | |
3001 v84.left = v106.uViewportX; | |
3002 v84.top = v106.uViewportY; | |
3003 v84.right = v106.uViewportZ; | |
3004 v84.bottom = v106.uViewportW; | |
3005 ErrD3D(pRenderer->pBackBuffer4->Blt(&v84, 0, 0, 16778240u, &Dst)); | |
3006 if ( pRenderer->uTargetGBits == 5 ) | |
3007 { | |
3008 memset(&pDesc, 0, 0x7Cu); | |
3009 pDesc.dwSize = 124; | |
242 | 3010 if ( pRenderer->LockSurface_DDraw4((IDirectDrawSurface4 *)v222, &pDesc, DDLOCK_WAIT)) |
3011 { | |
3012 v20 = (char *)v124; | |
3013 v110 = pDesc.lpSurface; | |
3014 a2 = (Player *)v124; | |
3015 if ( v124 < v119 ) | |
3016 { | |
3017 v111 = 2 * pRenderer->uTargetSurfacePitch; | |
3018 v21 = (int)a4; | |
3019 v22 = &pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]]; | |
3020 v23 = i - v124; | |
3021 v120 = (SpellBuff *)&pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]]; | |
3022 v115 = i - v124; | |
3023 while ( 1 ) | |
3024 { | |
3025 v124 = v21; | |
3026 if ( v21 < (signed int)v116 ) | |
3027 { | |
3028 v24 = (int)&v20[v23]; | |
3029 v25 = v107 - v21; | |
3030 v109 = v24; | |
3031 for ( i = v107 - v21; ; v25 = i ) | |
3032 { | |
3033 v108 = (unsigned __int16 *)((pDesc.lPitch >> 1) * pDesc.dwHeight * v109 / v13->uAreaHeight); | |
3034 v26 = (char *)v108 + pDesc.dwWidth * (v25 + v124++) / v13->uAreaWidth; | |
3035 *v22 = *((short *)v110 + (int)v26); | |
3036 ++v22; | |
3037 if ( v124 >= (signed int)v116 ) | |
3038 break; | |
3039 } | |
3040 v23 = v115; | |
3041 } | |
3042 v22 = (unsigned __int16 *)((char *)v120 + v111); | |
3043 v20 = (char *)&a2->pConditions[0] + 1; | |
3044 v28 = __OFSUB__((int)&a2->pConditions[0] + 1, v119); | |
3045 v27 = (signed int)((char *)&a2->pConditions[0] + -v119 + 1) < 0; | |
3046 a2 = (Player *)((char *)a2 + 1); | |
3047 v120 = (SpellBuff *)((char *)v120 + v111); | |
3048 if ( !(v27 ^ v28) ) | |
3049 break; | |
3050 v21 = (int)a4; | |
3051 } | |
3052 } | |
3053 v222->Unlock(0); | |
3054 } | |
3055 } | |
3056 else | |
3057 { | |
3058 memset(&pDesc, 0, 0x7Cu); | |
3059 pDesc.dwSize = 124; | |
3060 if ( pRenderer->LockSurface_DDraw4((IDirectDrawSurface4 *)v222, &pDesc, DDLOCK_WAIT) ) | |
3061 { | |
3062 v108 = (unsigned __int16 *)pDesc.lpSurface; | |
3063 a2 = (Player *)v124; | |
306 | 3064 if ( v124 < v119 ) |
242 | 3065 { |
3066 v109 = 2 * pRenderer->uTargetSurfacePitch; | |
3067 v29 = (int)a4; | |
3068 v30 = (char *)&pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]]; | |
3069 v31 = i - v124; | |
3070 v120 = (SpellBuff *)&pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]]; | |
3071 v115 = i - v124; | |
3072 while ( 1 ) | |
3073 { | |
3074 v124 = v29; | |
3075 if ( v29 < (signed int)v116 ) | |
3076 { | |
3077 v32 = v107 - (int)a4; | |
3078 v111 = (unsigned int)((char *)a2 + v31); | |
3079 for ( i = v107 - (int)a4; ; v32 = i ) | |
3080 { | |
3081 v110 = (LPVOID)((pDesc.lPitch >> 1) * pDesc.dwHeight * v111 / v13->uAreaHeight); | |
3082 v33 = v108[(int)((char *)v110 + pDesc.dwWidth * (v32 + v124) / v13->uAreaWidth)]; | |
3083 v34 = v33 & 0x1F | 2 | |
3084 * (unsigned __int16)(v108[(int)((char *)v110 | |
3085 + pDesc.dwWidth * (v32 + v124++) / v13->uAreaWidth)] & 0xFFE0); | |
3086 v35 = v124; | |
3087 *(short *)v30 = v34; | |
3088 v30 += 2; | |
3089 if ( v35 >= (signed int)v116 ) | |
3090 break; | |
3091 } | |
3092 v31 = v115; | |
3093 } | |
3094 a2 = (Player *)((char *)a2 + 1); | |
3095 v30 = (char *)v120 + v109; | |
3096 v120 = (SpellBuff *)((char *)v120 + v109); | |
3097 if ( (signed int)a2 >= v119 ) | |
3098 break; | |
3099 v29 = (int)a4; | |
3100 } | |
3101 } | |
3102 v222->Unlock(0); | |
3103 } | |
3104 } | |
0 | 3105 } |
3106 else | |
3107 { | |
3108 pRenderer->FillRectFast( | |
3109 v106.uViewportX, | |
3110 v106.uViewportY, | |
3111 v106.uViewportZ - v106.uViewportX, | |
3112 v106.uViewportW - v106.uViewportY, | |
3113 0); | |
3114 v36 = v10->pHwSpriteIDs[0]; | |
3115 if ( v36 >= 0 ) | |
3116 pSprites_LOD->pSpriteHeaders[v36]._4ACC38(&v106, 0); | |
3117 } | |
3118 if ( v121->uNPC_ID ) | |
3119 { | |
3120 v37 = v112[6]; | |
3121 if ( v37 ) | |
3122 { | |
264 | 3123 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[429], *v112, aNPCProfessionNames[(signed int)v37]); |
242 | 3124 } |
3125 else | |
3126 { | |
3127 v77 = 2000; | |
3128 v72 = *v112; | |
3129 } | |
0 | 3130 } |
3131 else | |
3132 { | |
3133 v38 = v121->dword_000334_unique_name; | |
3134 v77 = 2000; | |
3135 if ( v38 ) | |
237 | 3136 v72 = pMonsterStats->pPlaceStrings[v38]; |
0 | 3137 else |
3138 v72 = pMonsterStats->pInfos[v121->pMonsterInfo.uID].pName; | |
3139 } | |
242 | 3140 if(!v121->uNPC_ID || (v121->uNPC_ID && !v37)) |
3141 strncpy(pTmpBuf, v72, v77); | |
0 | 3142 v39 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); |
3143 a1->DrawTitleText(pFontComic, 0, 0xCu, v39, pTmpBuf, 3u); | |
3144 Actor::DrawHealthBar(v121, a1); | |
3145 v119 = 0; | |
3146 pMonsterInfoUI_Doll.uCurrentActionTime += pMiscTimer->uTimeElapsed; | |
3147 v115 = 0; | |
3148 v116 = 0; | |
3149 i = 0; | |
3150 v112 = 0; | |
3151 if ( !uActiveCharacter ) | |
3152 { | |
3153 v45 = 1; | |
242 | 3154 } |
3155 else | |
3156 { | |
3157 LOBYTE(v40) = pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID); | |
3158 v120 = v40; | |
3159 if ( !v40 ) | |
3160 v45 = 1; | |
3161 else | |
3162 { | |
3163 v41 = (unsigned __int8)v40 & 0x3F; | |
3164 v42 = SkillToMastery((unsigned __int16)v40) - 1; | |
3165 if ( !v42 ) | |
3166 { | |
3167 if ( v41 + 10 >= v121->pMonsterInfo.uLevel ) | |
3168 { | |
3169 v45 = 1; | |
3170 v119 = 1; | |
3171 } | |
3172 else | |
3173 v45 = 1; | |
3174 } | |
3175 else | |
3176 { | |
3177 v43 = v42 - 1; | |
3178 if ( !v43 ) | |
3179 { | |
3180 if ( 2 * v41 + 10 >= v121->pMonsterInfo.uLevel ) | |
3181 { | |
3182 v45 = 1; | |
3183 v119 = 1; | |
3184 v116 = 1; | |
3185 } | |
3186 else | |
3187 v45 = 1; | |
3188 } | |
3189 else | |
3190 { | |
3191 v44 = v43 - 1; | |
3192 if ( !v44 ) | |
3193 { | |
3194 if ( 3 * v41 + 10 >= v121->pMonsterInfo.uLevel ) | |
3195 { | |
3196 v45 = 1; | |
3197 v119 = 1; | |
3198 v116 = 1; | |
3199 i = 1; | |
3200 } | |
3201 else | |
3202 { | |
3203 v45 = 1; | |
3204 } | |
3205 } | |
3206 else | |
3207 { | |
3208 if ( v44 != 1 ) | |
3209 v45 = 1; | |
3210 else | |
3211 { | |
3212 v45 = 1; | |
3213 v119 = 1; | |
3214 v116 = 1; | |
3215 i = 1; | |
3216 v112 = (char **)1; | |
3217 } | |
3218 } | |
3219 } | |
3220 } | |
3221 } | |
3222 // LABEL_73: | |
3223 v46 = v121->uAIState; | |
3224 if ( v46 != 5 && v46 != 4 && !dword_507BF0_is_there_popup_onscreen && v120 ) | |
3225 { | |
3226 v47 = pPlayers[uActiveCharacter]; | |
3227 if ( v119 | v116 | i | (unsigned int)v112 ) | |
3228 { | |
3229 if ( v121->pMonsterInfo.uLevel >= v47->uLevel - 5 ) | |
3230 v73 = SPEECH_105; | |
3231 else | |
3232 v73 = SPEECH_104; | |
3233 } | |
3234 else | |
3235 { | |
3236 v73 = SPEECH_106; | |
3237 } | |
3238 v47->PlaySound((PlayerSpeech)v73, 0); | |
3239 } | |
3240 } | |
0 | 3241 a2 = pParty->pPlayers; |
3242 do | |
3243 { | |
3244 LOBYTE(v48) = a2->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID); | |
3245 v111 = v48; | |
3246 v120 = (SpellBuff *)138; | |
3247 do | |
3248 { | |
3249 if ( (signed int)SkillToMastery(v111) >= 3 ) | |
3250 v115 = v45; | |
3251 v120 = (SpellBuff *)((char *)v120 - 1); | |
3252 } | |
3253 while ( v120 ); | |
3254 ++a2; | |
3255 } | |
3256 while ( (signed int)a2 < (signed int)pParty->pHirelings ); | |
3257 v49 = pFontSmallnum; | |
3258 a2 = (Player *)pFontSmallnum; | |
3259 a1->DrawText(pFontSmallnum, 12, 196, a5, pGlobalTXT_LocalizationStrings[631], 0, 0, 0); | |
3260 v50 = LOBYTE(v49->uFontHeight) + 193; | |
3261 if ( !v115 ) | |
3262 { | |
3263 v78 = 0; | |
3264 v74 = 0; | |
3265 v69 = 0; | |
3266 v66 = pGlobalTXT_LocalizationStrings[630]; | |
3267 goto LABEL_123; | |
3268 } | |
3269 a4 = 0; | |
3270 v51 = &v121->pActorBuffs[1]; | |
3271 v222 = 0; | |
3272 v120 = &v121->pActorBuffs[1]; | |
3273 do | |
3274 { | |
3275 if ( (signed __int64)v51->uExpireTime > 0 ) | |
3276 { | |
3277 switch ( (int)v51 ) | |
3278 { | |
3279 case 0u: | |
3280 v124 = 60; | |
3281 a4 = pGlobalTXT_LocalizationStrings[591]; | |
3282 break; | |
3283 case 1u: | |
3284 v124 = 82; | |
3285 a4 = pGlobalTXT_LocalizationStrings[649]; | |
3286 break; | |
3287 case 2u: | |
3288 v124 = 92; | |
3289 a4 = pGlobalTXT_LocalizationStrings[592]; | |
3290 break; | |
3291 case 3u: | |
3292 v124 = 63; | |
3293 a4 = pGlobalTXT_LocalizationStrings[4]; | |
3294 break; | |
3295 case 4u: | |
3296 v52 = pGlobalTXT_LocalizationStrings[220]; | |
3297 goto LABEL_100; | |
3298 case 5u: | |
3299 v52 = pGlobalTXT_LocalizationStrings[162]; | |
3300 LABEL_100: | |
3301 a4 = v52; | |
3302 v124 = 81; | |
3303 break; | |
3304 case 6u: | |
3305 v53 = pGlobalTXT_LocalizationStrings[593]; | |
3306 v124 = 35; | |
3307 goto LABEL_103; | |
3308 case 8u: | |
3309 v53 = pGlobalTXT_LocalizationStrings[608]; | |
3310 v124 = 62; | |
3311 LABEL_103: | |
3312 a4 = v53; | |
3313 break; | |
3314 case 7u: | |
3315 case 9u: | |
3316 a4 = 0; | |
3317 v124 = 0; | |
3318 goto LABEL_119; | |
3319 case 0xAu: | |
3320 v124 = 47; | |
3321 a4 = pGlobalTXT_LocalizationStrings[221]; | |
3322 break; | |
3323 case 0xBu: | |
3324 v124 = 66; | |
3325 a4 = pGlobalTXT_LocalizationStrings[607]; | |
3326 break; | |
3327 case 0xCu: | |
3328 v124 = 85; | |
3329 a4 = pGlobalTXT_LocalizationStrings[610]; | |
3330 break; | |
3331 case 0xDu: | |
3332 v124 = 86; | |
3333 a4 = pGlobalTXT_LocalizationStrings[609]; | |
3334 break; | |
3335 case 0xEu: | |
3336 v124 = 17; | |
3337 a4 = pGlobalTXT_LocalizationStrings[279]; | |
3338 break; | |
3339 case 0xFu: | |
3340 v124 = 38; | |
3341 a4 = pGlobalTXT_LocalizationStrings[442]; | |
3342 break; | |
3343 case 0x10u: | |
3344 v124 = 46; | |
3345 a4 = pGlobalTXT_LocalizationStrings[443]; | |
3346 break; | |
3347 case 0x11u: | |
3348 v124 = 51; | |
3349 a4 = pGlobalTXT_LocalizationStrings[440]; | |
3350 break; | |
3351 case 0x12u: | |
3352 v124 = 5; | |
3353 a4 = pGlobalTXT_LocalizationStrings[441]; | |
3354 break; | |
3355 case 0x13u: | |
3356 v124 = 95; | |
3357 a4 = pGlobalTXT_LocalizationStrings[229]; | |
3358 break; | |
3359 case 0x14u: | |
3360 v124 = 73; | |
3361 a4 = pGlobalTXT_LocalizationStrings[228]; | |
3362 break; | |
3363 default: | |
3364 a4 = 0; | |
3365 break; | |
3366 } | |
3367 if ( a4 ) | |
3368 { | |
3369 v54 = a4; | |
3370 v55 = GetSpellColor(v124); | |
3371 a1->DrawText((GUIFont *)a2, 28, v50, v55, v54, 0, 0, 0); | |
3372 v50 = v50 + BYTE5(a2->pConditions[0]) - 3; | |
3373 v51 = v120; | |
3374 } | |
3375 } | |
3376 LABEL_119: | |
3377 ++v51; | |
3378 v222 = (IDirectDrawSurface *)((char *)v222 + 1); | |
3379 v120 = v51; | |
3380 | |
3381 __debugbreak(); // fix condition | |
3382 } | |
3383 //while ( (signed int)((char *)&v222->lpVtbl + 1) < 22 ); | |
3384 while (true); | |
3385 if ( !a4 ) | |
3386 { | |
3387 v78 = 0; | |
3388 v74 = 0; | |
3389 v69 = 0; | |
3390 v66 = pGlobalTXT_LocalizationStrings[153]; | |
3391 LABEL_123: | |
3392 a1->DrawText((GUIFont *)a2, 28, v50, a5, v66, v69, v74, v78); | |
3393 } | |
3394 v56 = pFontSmallnum; | |
3395 a4 = (char *)v106.uViewportY; | |
3396 if ( v119 ) | |
3397 { | |
241 | 3398 sprintf(pTmpBuf, "%s\f%05u\t100%d\n", pGlobalTXT_LocalizationStrings[108], 0, v121->pMonsterInfo.uHP); |
0 | 3399 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); |
3400 a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; | |
3401 v79 = v121->pMonsterInfo.uAC; | |
3402 v75 = 0; | |
3403 v70 = pGlobalTXT_LocalizationStrings[12]; | |
241 | 3404 v67 = "%s\f%05u\t100%d\n"; |
0 | 3405 } |
3406 else | |
3407 { | |
241 | 3408 sprintf(pTmpBuf, "%s\f%05u\t100%s\n", pGlobalTXT_LocalizationStrings[108], 0, pGlobalTXT_LocalizationStrings[630]); |
0 | 3409 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); |
3410 v79 = (unsigned int)pGlobalTXT_LocalizationStrings[630]; | |
3411 v75 = 0; | |
3412 v70 = pGlobalTXT_LocalizationStrings[12]; | |
3413 a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; | |
241 | 3414 v67 = "%s\f%05u\t100%s\n"; |
0 | 3415 } |
3416 sprintf(pTmpBuf, v67, v70, v75, v79); | |
3417 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); | |
3418 a4 = &a4[LOBYTE(v56->uFontHeight) - 6] + LOBYTE(v56->uFontHeight); | |
241 | 3419 v95[0] = pGlobalTXT_LocalizationStrings[87]; |
3420 v95[1] = pGlobalTXT_LocalizationStrings[6]; | |
3421 v95[2] = pGlobalTXT_LocalizationStrings[240]; | |
3422 v95[3] = pGlobalTXT_LocalizationStrings[70]; | |
3423 v95[4] = pGlobalTXT_LocalizationStrings[624]; | |
3424 v95[5] = pGlobalTXT_LocalizationStrings[138]; | |
3425 v95[6] = pGlobalTXT_LocalizationStrings[214]; | |
3426 v95[7] = pGlobalTXT_LocalizationStrings[142]; | |
3427 v95[8] = pGlobalTXT_LocalizationStrings[29]; | |
3428 v95[9] = pGlobalTXT_LocalizationStrings[133]; | |
3429 v95[10] = pGlobalTXT_LocalizationStrings[54]; | |
0 | 3430 if ( v116 ) |
3431 { | |
241 | 3432 sprintf(pTmpBuf, "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, v95[v121->pMonsterInfo.uAttack1Type]); |
0 | 3433 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); |
3434 a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; | |
3435 v57 = v121->pMonsterInfo.uAttack1DamageBonus; | |
3436 if ( v57 ) | |
3437 sprintf( | |
3438 pTmpBuf, | |
241 | 3439 "%s\f%05u\t080%dd%d+%d\n", |
0 | 3440 pGlobalTXT_LocalizationStrings[53], |
3441 0, | |
3442 v121->pMonsterInfo.uAttack1DamageDiceRolls, | |
3443 v121->pMonsterInfo.uAttack1DamageDiceSides, | |
3444 v57); | |
3445 else | |
3446 sprintf( | |
3447 pTmpBuf, | |
241 | 3448 "%s\f%05u\t080%dd%d\n", |
0 | 3449 pGlobalTXT_LocalizationStrings[53], |
3450 0, | |
3451 v121->pMonsterInfo.uAttack1DamageDiceRolls, | |
3452 v121->pMonsterInfo.uAttack1DamageDiceSides); | |
3453 } | |
3454 else | |
3455 { | |
241 | 3456 sprintf(pTmpBuf, "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, pGlobalTXT_LocalizationStrings[630]); |
0 | 3457 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); |
3458 a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; | |
241 | 3459 sprintf(pTmpBuf, "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[53], 0, pGlobalTXT_LocalizationStrings[630]); |
0 | 3460 } |
3461 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); | |
3462 v58 = LOBYTE(v56->uFontHeight); | |
3463 a4 = &a4[v58 - 6] + v58; | |
3464 if ( !i ) | |
3465 { | |
3466 v80 = pGlobalTXT_LocalizationStrings[630]; | |
3467 v76 = 0; | |
3468 v71 = pGlobalTXT_LocalizationStrings[628]; | |
241 | 3469 v68 = "%s\f%05u\t080%s\n"; |
0 | 3470 goto LABEL_144; |
3471 } | |
3472 v120 = (SpellBuff *)pGlobalTXT_LocalizationStrings[628]; | |
3473 v59 = v121; | |
3474 v114 = v121->pMonsterInfo.uSpell1ID; | |
3475 if ( v114 && v121->pMonsterInfo.uSpell2ID ) | |
3476 v120 = (SpellBuff *)pGlobalTXT_LocalizationStrings[629]; | |
3477 if ( v114 ) | |
3478 { | |
241 | 3479 sprintf(pTmpBuf, "%s\f%05u\t060%s\n", v120, 0, pSpellStats->pInfos[v114].pShortName); |
0 | 3480 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); |
3481 v58 = LOBYTE(v56->uFontHeight); | |
3482 a4 = &a4[v58 - 3]; | |
3483 v59 = v121; | |
3484 } | |
3485 v60 = v59->pMonsterInfo.uSpell2ID; | |
3486 if ( v60 ) | |
3487 { | |
241 | 3488 sprintf(pTmpBuf, "\f%05u\t060%s\n", 0, pSpellStats->pInfos[v60].pShortName); |
0 | 3489 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); |
3490 v58 = LOBYTE(v56->uFontHeight); | |
3491 a4 = &a4[v58 - 3]; | |
3492 v59 = v121; | |
3493 } | |
3494 if ( !v59->pMonsterInfo.uSpell1ID && !v59->pMonsterInfo.uSpell2ID ) | |
3495 { | |
3496 v80 = pGlobalTXT_LocalizationStrings[153]; | |
3497 v76 = 0; | |
3498 v71 = pGlobalTXT_LocalizationStrings[628]; | |
241 | 3499 v68 = "%s\f%05u\t060%s\n"; |
0 | 3500 LABEL_144: |
3501 sprintf(pTmpBuf, v68, v71, v76, v80); | |
3502 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); | |
3503 v58 = LOBYTE(v56->uFontHeight); | |
3504 a4 = &a4[v58 - 3]; | |
3505 } | |
3506 a4 = &a4[v58 - 3]; | |
3507 a1->DrawText(v56, 150, (int)a4, a5, pGlobalTXT_LocalizationStrings[626], 0, 0, 0); | |
3508 a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; | |
241 | 3509 v85[0] = pGlobalTXT_LocalizationStrings[87]; |
3510 v85[1] = pGlobalTXT_LocalizationStrings[6]; | |
3511 v85[2] = pGlobalTXT_LocalizationStrings[240]; | |
3512 v85[3] = pGlobalTXT_LocalizationStrings[70]; | |
3513 v85[4] = pGlobalTXT_LocalizationStrings[142]; | |
3514 v85[5] = pGlobalTXT_LocalizationStrings[214]; | |
3515 v85[6] = pGlobalTXT_LocalizationStrings[29]; | |
3516 v85[7] = pGlobalTXT_LocalizationStrings[133]; | |
3517 v85[8] = pGlobalTXT_LocalizationStrings[54]; | |
3518 v85[9] = pGlobalTXT_LocalizationStrings[624]; | |
3519 v95[1] = (char *)v121->pMonsterInfo.uResFire; | |
3520 v95[2] = (char *)v121->pMonsterInfo.uResAir; | |
3521 v95[3] = (char *)v121->pMonsterInfo.uResWater; | |
3522 v95[4] = (char *)v121->pMonsterInfo.uResEarth; | |
3523 v95[5] = (char *)v121->pMonsterInfo.uResMind; | |
3524 v95[6] = (char *)v121->pMonsterInfo.uResSpirit; | |
3525 v95[7] = (char *)v121->pMonsterInfo.uResBody; | |
3526 v95[8] = (char *)v121->pMonsterInfo.uResLight; | |
3527 v95[9] = (char *)v121->pMonsterInfo.uResPhysical; | |
3528 v95[10] = (char *)v121->pMonsterInfo.uResDark; | |
0 | 3529 if ( v112 ) |
3530 { | |
3531 v124 = 0; | |
3532 do | |
3533 { | |
241 | 3534 v62 = v95[v124+1]; |
0 | 3535 if ( v62 == (char *)200 ) |
3536 { | |
3537 v81 = pGlobalTXT_LocalizationStrings[625]; | |
3538 } | |
3539 else | |
3540 { | |
3541 if ( v62 ) | |
3542 v81 = pGlobalTXT_LocalizationStrings[627]; | |
3543 else | |
3544 v81 = pGlobalTXT_LocalizationStrings[153]; | |
3545 } | |
241 | 3546 sprintf(pTmpBuf, "%s\f%05u\t070%s\n", v85[v124], 0, v81); |
0 | 3547 a1->DrawText(v56, 170, (int)a4, a5, pTmpBuf, 0, 0, 0); |
3548 v63 = LOBYTE(v56->uFontHeight); | |
3549 v124 += 4; | |
3550 result = &a4[v63 - 3]; | |
3551 a4 = result; | |
3552 } | |
3553 while ( v124 < 40 ); | |
3554 } | |
3555 else | |
3556 { | |
3557 i = 0; | |
3558 do | |
3559 { | |
241 | 3560 sprintf(pTmpBuf, "%s\f%05u\t070%s\n", v85[i], 0, pGlobalTXT_LocalizationStrings[630]); // "?" |
0 | 3561 a1->DrawText(v56, 170, (int)a4, a5, pTmpBuf, 0, 0, 0); |
3562 v65 = LOBYTE(v56->uFontHeight); | |
3563 ++i; | |
3564 result = &a4[v65 - 3]; | |
3565 a4 = result; | |
3566 } | |
3567 while ( i < 10 ); | |
3568 } | |
3569 if ( (signed __int64)pParty->pPartyBuffs[3].uExpireTime > 0 ) | |
3570 { | |
3571 sprintf(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[650], v121->sCurrentHP); | |
3572 pFontSmallnum->GetLineWidth(pTmpBuf); | |
3573 result = a1->DrawTitleText( | |
3574 pFontSmallnum, | |
3575 0, | |
3576 a1->uFrameHeight - LOBYTE(pFontSmallnum->uFontHeight) - 12, | |
3577 0, | |
3578 pTmpBuf, | |
3579 3u); | |
3580 } | |
3581 return result; | |
3582 } | |
3583 | |
3584 | |
3585 | |
3586 //----- (0041F54A) -------------------------------------------------------- | |
3587 void __cdecl LoadActualSkyFrame() | |
3588 { | |
3589 if ( pTexture_RestUI_CurrentSkyFrame ) | |
3590 pTexture_RestUI_CurrentSkyFrame->Release(); | |
3591 if ( pTexture_RestUI_CurrentHourglassFrame ) | |
3592 pTexture_RestUI_CurrentHourglassFrame->Release(); | |
3593 pIcons_LOD->_40F9C5(); | |
3594 sprintf(pTmpBuf, "TERRA%03d", pParty->uCurrentMinute / 6 + 10 * pParty->uCurrentHour); | |
3595 pTexture_RestUI_CurrentSkyFrame = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pTmpBuf, TEXTURE_16BIT_PALETTE)]; | |
3596 } | |
3597 | |
3598 //----- (0041F5BE) -------------------------------------------------------- | |
3599 void __cdecl Sleep6Hours() | |
3600 { | |
3601 if ( _506F18_num_hours_to_sleep < 6 ) | |
3602 { | |
3603 pParty->pPlayers[3].pConditions[2] = 0i64; | |
3604 pParty->pPlayers[2].pConditions[2] = 0i64; | |
3605 pParty->pPlayers[1].pConditions[2] = 0i64; | |
3606 pParty->pPlayers[0].pConditions[2] = 0i64; | |
3607 if ( _506F18_num_hours_to_sleep ) | |
3608 { | |
3609 Rest(_506F18_num_hours_to_sleep); | |
3610 _506F18_num_hours_to_sleep = 0; | |
3611 LoadActualSkyFrame(); | |
3612 } | |
3613 if ( dword_506F14 == 2 ) | |
3614 { | |
3615 pGUIWindow_CurrentMenu->Release(); | |
3616 pEventTimer->Resume(); | |
3617 if ( pTexture_RestUI_CurrentSkyFrame ) | |
3618 pTexture_RestUI_CurrentSkyFrame->Release(); | |
3619 if ( pTexture_RestUI_CurrentHourglassFrame ) | |
3620 pTexture_RestUI_CurrentHourglassFrame->Release(); | |
3621 pTexture_RestUI_CurrentHourglassFrame = 0; | |
3622 pTexture_RestUI_CurrentSkyFrame = 0; | |
3623 pIcons_LOD->_4114F2(); | |
3624 pIcons_LOD->_40F9C5(); | |
151 | 3625 pCurrentScreen = SCREEN_GAME; |
0 | 3626 viewparams->bRedrawGameUI = 1; |
3627 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
3628 { | |
3629 pOutdoor->UpdateSunlightVectors(); | |
3630 pOutdoor->UpdateFog(); | |
3631 } | |
3632 } | |
3633 dword_506F14 = 0; | |
3634 } | |
3635 else | |
3636 { | |
3637 Rest(6u); | |
3638 _506F18_num_hours_to_sleep -= 6; | |
3639 LoadActualSkyFrame(); | |
3640 } | |
3641 viewparams->bRedrawGameUI = 1; | |
3642 } | |
3643 | |
3644 //----- (0041F6C1) -------------------------------------------------------- | |
3645 void __cdecl RestUI_Initialize() | |
3646 { | |
89 | 3647 Player *v0; // eax@10 |
0 | 3648 |
3649 if ( !dword_506F14 ) | |
3650 pAudioPlayer->StopChannels(-1, -1); | |
3651 if ( pCurrentScreen ) | |
3652 { | |
3653 pGUIWindow_CurrentMenu->Release(); | |
151 | 3654 pCurrentScreen = SCREEN_GAME; |
0 | 3655 viewparams->bRedrawGameUI = 1; |
3656 } | |
3657 pEventTimer->Pause(); | |
3658 if ( dword_506F14 != 2 ) | |
3659 GUIWindow::Create(518u, 450u, 0, 0, (enum WindowType)90, (int)pBtn_Rest, 0); | |
3660 _506F18_num_hours_to_sleep = 0; | |
3661 dword_506F14 = 0; | |
3662 uRestUI_FoodRequiredToRest = 2; | |
3663 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
3664 uRestUI_FoodRequiredToRest = pOutdoor->GetNumFoodRequiredToRestInCurrentPos( | |
3665 pParty->vPosition.x, | |
3666 pParty->vPosition.y, | |
3667 pParty->vPosition.z); | |
248 | 3668 if ( PartyHasDragon() ) |
0 | 3669 { |
89 | 3670 v0 = pParty->pPlayers;//[0].uClass; |
3671 while ( v0 <= &pParty->pPlayers[3] ) | |
3672 { | |
3673 ++v0; | |
3674 if ( v0 > &pParty->pPlayers[3] ) | |
3675 break; | |
3676 } | |
255 | 3677 if(v0->classType == PLAYER_CLASS_WARLOCK) |
89 | 3678 ++uRestUI_FoodRequiredToRest; |
3679 } | |
0 | 3680 if ( CheckHiredNPCSpeciality(0x1Du) ) |
3681 --uRestUI_FoodRequiredToRest; | |
3682 if ( CheckHiredNPCSpeciality(0x1Eu) ) | |
3683 uRestUI_FoodRequiredToRest -= 2; | |
3684 if ( CheckHiredNPCSpeciality(0x30u) ) | |
3685 --uRestUI_FoodRequiredToRest; | |
3686 if ( uRestUI_FoodRequiredToRest < 1 ) | |
3687 uRestUI_FoodRequiredToRest = 1; | |
3688 if ( !_strcmpi(pCurrentMapName, "d29.blv") && (unsigned __int16)_449B57_test_bit(pParty->_award_bits, 98) ) | |
3689 uRestUI_FoodRequiredToRest = 0; | |
3690 ++pIcons_LOD->uTexturePacksCount; | |
3691 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | |
3692 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
151 | 3693 pCurrentScreen = SCREEN_REST; |
0 | 3694 _507CD4_RestUI_hourglass_anim_controller = 0; |
3695 uTextureID_RestUI_restmain = pIcons_LOD->LoadTexture("restmain", TEXTURE_16BIT_PALETTE); | |
3696 uTextureID_RestUI_restb1 = pIcons_LOD->LoadTexture("restb1", TEXTURE_16BIT_PALETTE); | |
3697 uTextureID_RestUI_restb2 = pIcons_LOD->LoadTexture("restb2", TEXTURE_16BIT_PALETTE); | |
3698 uTextureID_RestUI_restb3 = pIcons_LOD->LoadTexture("restb3", TEXTURE_16BIT_PALETTE); | |
3699 uTextureID_RestUI_restb4 = pIcons_LOD->LoadTexture("restb4", TEXTURE_16BIT_PALETTE); | |
3700 uTextureID_RestUI_restexit = pIcons_LOD->LoadTexture("restexit", TEXTURE_16BIT_PALETTE); | |
3701 LoadActualSkyFrame(); | |
3702 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640u, 480u, (enum WindowType)16, 0, 0); | |
3703 pButton_RestUI_Exit = pGUIWindow_CurrentMenu->CreateButton( | |
3704 280u, | |
3705 297u, | |
3706 154u, | |
3707 37u, | |
3708 1, | |
3709 0, | |
3710 0xA7u, | |
3711 0, | |
3712 0, | |
3713 "", | |
3714 (Texture *)(uTextureID_RestUI_restexit != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restexit] : 0), | |
3715 0); | |
3716 pButton_RestUI_Main = pGUIWindow_CurrentMenu->CreateButton( | |
3717 24u, | |
3718 154u, | |
3719 225u, | |
3720 37u, | |
3721 1, | |
3722 0, | |
3723 0x61u, | |
3724 0, | |
3725 0x52u, | |
3726 "", | |
3727 (Texture *)(uTextureID_RestUI_restb4 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb4] : 0), | |
3728 0); | |
3729 pButton_RestUI_WaitUntilDawn = pGUIWindow_CurrentMenu->CreateButton( | |
3730 61u, | |
3731 232u, | |
3732 154u, | |
3733 33u, | |
3734 1, | |
3735 0, | |
3736 0x6Du, | |
3737 0, | |
3738 0x44u, | |
3739 "", | |
3740 (Texture *)(uTextureID_RestUI_restb1 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb1] : 0), | |
3741 0); | |
3742 pButton_RestUI_Wait1Hour = pGUIWindow_CurrentMenu->CreateButton( | |
3743 61u, | |
3744 264u, | |
3745 154u, | |
3746 33u, | |
3747 1, | |
3748 0, | |
3749 0x60u, | |
3750 0, | |
3751 0x48u, | |
3752 "", | |
3753 (Texture *)(uTextureID_RestUI_restb2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb2] : 0), | |
3754 0); | |
3755 pButton_RestUI_Wait5Minutes = pGUIWindow_CurrentMenu->CreateButton( | |
3756 61u, | |
3757 296u, | |
3758 154u, | |
3759 33u, | |
3760 1, | |
3761 0, | |
3762 0x5Fu, | |
3763 0, | |
3764 0x4Du, | |
3765 "", | |
3766 (Texture *)(uTextureID_RestUI_restb3 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb3] : 0), | |
3767 0); | |
3768 } | |
3769 | |
3770 //----- (0041FA01) -------------------------------------------------------- | |
3771 void __cdecl RestUI_Draw() | |
3772 { | |
3773 int v0; // esi@1 | |
3774 Player **ppPlayers; // ecx@1 | |
3775 Player *pPlayer; // eax@2 | |
3776 unsigned int v3; // eax@15 | |
3777 char v4; // al@17 | |
3778 bool v5; // eax@21 | |
3779 GUIButton Dst; // [sp+8h] [bp-DCh]@19 | |
3780 //double v7; // [sp+C4h] [bp-20h]@17 | |
3781 float v8; // [sp+CCh] [bp-18h]@17 | |
3782 __int64 v9; // [sp+D0h] [bp-14h]@17 | |
3783 unsigned int v10; // [sp+D8h] [bp-Ch]@9 | |
3784 __int16 a9[2]; // [sp+DCh] [bp-8h]@1 | |
3785 int a5; // [sp+E0h] [bp-4h]@1 | |
3786 | |
3787 v0 = 0; | |
3788 a5 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xAu, 0, 0); | |
3789 *(int *)a9 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE6u, 0xD6u, 0xC1u); | |
3790 ppPlayers = &pPlayers[1]; | |
3791 do | |
3792 { | |
3793 pPlayer = *ppPlayers; | |
3794 if ( !(*ppPlayers)->pConditions[14] && !pPlayer->pConditions[16] && pPlayer->sHealth > 0 ) | |
3795 ++v0; | |
3796 ++ppPlayers; | |
3797 } | |
3798 while ( (signed int)ppPlayers <= (signed int)&pPlayers[4] ); | |
3799 if ( v0 ) | |
3800 { | |
3801 pRenderer->DrawTextureIndexed( | |
3802 8u, | |
3803 8u, | |
3804 (Texture *)(uTextureID_RestUI_restmain != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restmain] : 0)); | |
3805 v10 = pParty->uCurrentHour; | |
3806 dword_506F1C = pGUIWindow_CurrentMenu->pCurrentPosActiveItem; | |
3807 if ( (signed int)pParty->uCurrentHour <= 12 ) | |
3808 { | |
3809 if ( !v10 ) | |
3810 v10 = 12; | |
3811 } | |
3812 else | |
3813 { | |
3814 v10 -= 12; | |
3815 } | |
3816 pRenderer->DrawTextureIndexed(16u, 26u, pTexture_RestUI_CurrentSkyFrame); | |
3817 if ( pTexture_RestUI_CurrentHourglassFrame ) | |
3818 { | |
3819 pTexture_RestUI_CurrentHourglassFrame->Release(); | |
3820 pIcons_LOD->_40F9C5(); | |
3821 } | |
3822 v3 = pEventTimer->uTimeElapsed + _507CD4_RestUI_hourglass_anim_controller; | |
3823 _507CD4_RestUI_hourglass_anim_controller += pEventTimer->uTimeElapsed; | |
3824 if ( (unsigned int)_507CD4_RestUI_hourglass_anim_controller >= 512 ) | |
3825 { | |
3826 v3 = 0; | |
3827 _507CD4_RestUI_hourglass_anim_controller = 0; | |
3828 } | |
3829 v9 = v3; | |
3830 v8 = (double)v3 * 0.001953125 * 120.0; | |
3831 //v7 = v8 + 6.7553994e15; | |
3832 HIDWORD(v9) = floorf(v8 + 0.5f);//LODWORD(v7); | |
3833 v4 = (int)floorf(v8 + 0.5f) % 256 + 1;//LOBYTE(v7) + 1; | |
3834 byte_4E2BC8 = v4; | |
3835 if ( (unsigned __int8)(v4) >= 0x78u ) | |
3836 { | |
3837 v4 = 1; | |
3838 byte_4E2BC8 = 1; | |
3839 } | |
3840 sprintf(pTmpBuf, "hglas%03d", (unsigned __int8)v4); | |
3841 pTexture_RestUI_CurrentHourglassFrame = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pTmpBuf, TEXTURE_16BIT_PALETTE)]; | |
3842 pRenderer->DrawTextureIndexed(0x10Bu, 0x9Fu, pTexture_RestUI_CurrentHourglassFrame); | |
3843 memset(&Dst, 0, 0xBCu); | |
3844 Dst.uX = 24; | |
3845 Dst.uY = 154; | |
3846 Dst.uWidth = 171; | |
3847 Dst.uHeight = 37; | |
3848 Dst.uZ = 194; | |
3849 Dst.uW = 190; | |
3850 Dst.pParent = pButton_RestUI_WaitUntilDawn->pParent; | |
3851 Dst.DrawLabel(pGlobalTXT_LocalizationStrings[183], pFontCreate, a5, *(int **)a9); | |
3852 Dst.pParent = 0; | |
3853 sprintf(pTmpBuf, "\r408%d", uRestUI_FoodRequiredToRest); | |
3854 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 0, 164, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); | |
3855 pButton_RestUI_WaitUntilDawn->DrawLabel( | |
3856 pGlobalTXT_LocalizationStrings[237], | |
3857 pFontCreate, | |
3858 a5, | |
3859 *(int **)a9); | |
3860 pButton_RestUI_Wait1Hour->DrawLabel(pGlobalTXT_LocalizationStrings[239], pFontCreate, a5, *(int **)a9); | |
3861 pButton_RestUI_Wait5Minutes->DrawLabel(pGlobalTXT_LocalizationStrings[238], pFontCreate, a5, *(int **)a9); | |
3862 pButton_RestUI_Exit->DrawLabel(pGlobalTXT_LocalizationStrings[81], pFontCreate, a5, *(int **)a9); | |
3863 memset(&Dst, 0, 0xBCu); | |
3864 Dst.uX = 45; | |
3865 Dst.uY = 199; | |
3866 Dst.uWidth = 185; | |
3867 Dst.uHeight = 30; | |
3868 Dst.uZ = 229; | |
3869 Dst.uW = 228; | |
3870 Dst.pParent = pButton_RestUI_WaitUntilDawn->pParent; | |
3871 Dst.DrawLabel(pGlobalTXT_LocalizationStrings[236], pFontCreate, a5, *(int **)a9); | |
3872 Dst.pParent = 0; | |
3873 v5 = pParty->uCurrentHour >= 0xC && pParty->uCurrentHour < 0x18; | |
3874 sprintf(pTmpBuf, "%d:%02d %s", v10, pParty->uCurrentMinute, aAMPMNames[v5]); | |
3875 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 368, 168, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); | |
3876 sprintf(pTmpBuf, "%s\r190%d", pGlobalTXT_LocalizationStrings[56], pParty->uDaysPlayed + 1); | |
3877 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 190, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); | |
3878 sprintf(pTmpBuf, "%s\r190%d", pGlobalTXT_LocalizationStrings[146], pParty->uCurrentMonth + 1); | |
3879 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 222, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); | |
3880 sprintf(pTmpBuf, "%s\r190%d", pGlobalTXT_LocalizationStrings[245], pParty->uCurrentYear); | |
3881 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 254, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); | |
3882 if ( dword_506F14 ) | |
3883 Sleep6Hours(); | |
3884 } | |
3885 else | |
3886 { | |
3887 GUIWindow::Create( | |
3888 pButton_RestUI_Exit->uX, | |
3889 pButton_RestUI_Exit->uY, | |
3890 0, | |
3891 0, | |
3892 (enum WindowType)96, | |
3893 (int)pButton_RestUI_Exit, | |
3894 (int)pGlobalTXT_LocalizationStrings[81]); | |
3895 } | |
3896 } | |
3897 // 4E2BC8: using guessed type char byte_4E2BC8; | |
3898 // 506F14: using guessed type int dword_506F14; | |
3899 // 506F1C: using guessed type int dword_506F1C; | |
3900 // 50765C: using guessed type int uTextureID_RestUI_restmain; | |
3901 // 507CD4: using guessed type int 507CD4_RestUI_hourglass_anim_controller; | |
3902 | |
3903 //----- (0041FE71) -------------------------------------------------------- | |
3904 int Chest::CanPlaceItemAt(signed int a1, int a2, unsigned int uChestID) | |
3905 { | |
3906 int v3; // eax@1 | |
3907 unsigned int v4; // eax@1 | |
3908 Texture *v5; // ecx@1 | |
3909 signed int v6; // eax@1 | |
3910 signed int v7; // edi@3 | |
3911 signed int v8; // eax@3 | |
3912 int v9; // edi@3 | |
3913 int v10; // ebx@5 | |
3914 int v11; // esi@9 | |
3915 int v12; // edx@10 | |
3916 int v13; // ecx@11 | |
3917 char *v14; // eax@12 | |
3918 int v16; // [sp+Ch] [bp-Ch]@1 | |
3919 signed int v17; // [sp+10h] [bp-8h]@1 | |
3920 signed int v18; // [sp+14h] [bp-4h]@1 | |
3921 | |
3922 v17 = a1; | |
3923 v3 = pChests[uChestID].uChestBitmapID; | |
3924 v16 = pChestHeightsByType[v3]; | |
3925 v18 = pChestWidthsByType[v3]; | |
3926 v4 = pIcons_LOD->LoadTexture(pItemsTable->pItems[a2].pIconName, TEXTURE_16BIT_PALETTE); | |
3927 v5 = (Texture *)(v4 != -1 ? (int)&pIcons_LOD->pTextures[v4] : 0); | |
3928 v6 = (v4 != -1 ? pIcons_LOD->pTextures[v4].uTextureWidth : 24); | |
3929 if ( v6 < 14 ) | |
3930 v6 = 14; | |
3931 v7 = v6 - 14; | |
3932 v8 = v5->uTextureHeight; | |
3933 v9 = (v7 >> 5) + 1; | |
3934 if ( v8 < 14 ) | |
3935 v8 = 14; | |
3936 v10 = ((v8 - 14) >> 5) + 1; | |
3937 if ( !areWeLoadingTexture ) | |
3938 { | |
3939 v5->Release(); | |
3940 pIcons_LOD->_40F9C5(); | |
3941 } | |
3942 if ( v9 + v17 % v18 <= v18 && v10 + v17 / v18 <= v16 ) | |
3943 { | |
3944 v11 = 0; | |
3945 if ( v10 <= 0 ) | |
3946 return 1; | |
3947 v12 = 0; | |
3948 while ( 1 ) | |
3949 { | |
3950 v13 = 0; | |
3951 if ( v9 > 0 ) | |
3952 break; | |
3953 LABEL_15: | |
3954 v12 += v18; | |
3955 ++v11; | |
3956 if ( v11 >= v10 ) | |
3957 return 1; | |
3958 } | |
3959 v14 = (char *)&pChests[0].pInventoryIndices[v17 + v12 + 2662 * uChestID]; | |
3960 while ( !*(short *)v14 ) | |
3961 { | |
3962 ++v13; | |
3963 v14 += 2; | |
3964 if ( v13 >= v9 ) | |
3965 goto LABEL_15; | |
3966 } | |
3967 } | |
3968 return 0; | |
3969 } | |
3970 // 506128: using guessed type int areWeLoadingTexture; | |
3971 | |
3972 //----- (0041FF64) -------------------------------------------------------- | |
3973 int Chest::_41FF64(unsigned int uChestID) | |
3974 { | |
3975 unsigned int v1; // ecx@1 | |
3976 signed int result; // eax@1 | |
3977 int v3; // edx@1 | |
3978 ItemGen *pItem; // ecx@2 | |
3979 | |
3980 v1 = uChestID; | |
3981 result = 0; | |
3982 v3 = pChestWidthsByType[pChests[v1].uChestBitmapID] * pChestHeightsByType[pChests[v1].uChestBitmapID]; | |
3983 if ( v3 <= 0 ) | |
3984 { | |
3985 LABEL_5: | |
3986 result = -1; | |
3987 } | |
3988 else | |
3989 { | |
3990 pItem = pChests[v1].mm7__vector_pItems; | |
3991 while ( pItem->uItemID ) | |
3992 { | |
3993 ++result; | |
3994 ++pItem; | |
3995 if ( result >= v3 ) | |
3996 goto LABEL_5; | |
3997 } | |
3998 } | |
3999 return result; | |
4000 } | |
4001 | |
4002 //----- (0041FFA2) -------------------------------------------------------- | |
4003 int Chest::_41FFA2(int a1, ItemGen *a2, unsigned int uChestID) | |
4004 { | |
4005 int v3; // eax@1 | |
4006 ItemGen *v4; // edi@1 | |
4007 int v5; // esi@1 | |
4008 int result; // eax@11 | |
4009 unsigned int v7; // eax@12 | |
4010 int v8; // edx@12 | |
4011 int v9; // ecx@12 | |
4012 signed int v10; // eax@12 | |
4013 signed int v11; // edi@14 | |
4014 unsigned int v12; // esi@14 | |
4015 int v13; // edi@16 | |
4016 void *v14; // edi@21 | |
4017 int v15; // edi@21 | |
4018 int i; // ecx@21 | |
4019 ItemGen *Src; // [sp+Ch] [bp-18h]@1 | |
4020 signed int v18; // [sp+10h] [bp-14h]@2 | |
4021 int v19; // [sp+14h] [bp-10h]@1 | |
4022 int v20; // [sp+18h] [bp-Ch]@19 | |
4023 signed int v21; // [sp+1Ch] [bp-8h]@1 | |
4024 signed int v22; // [sp+20h] [bp-4h]@3 | |
4025 int v23; // [sp+20h] [bp-4h]@19 | |
4026 | |
4027 v21 = 0; | |
4028 v3 = pChests[uChestID].uChestBitmapID; | |
4029 v4 = a2; | |
4030 v5 = pChestWidthsByType[v3] * pChestHeightsByType[v3]; | |
4031 Src = a2; | |
4032 v19 = pChestWidthsByType[v3]; | |
4033 if ( a1 == -1 ) | |
4034 { | |
4035 v18 = _41FF64(uChestID); | |
4036 if ( v18 == -1 ) | |
4037 return 0; | |
4038 v22 = 0; | |
4039 if ( v5 > 0 ) | |
4040 { | |
4041 while ( !Chest::CanPlaceItemAt(v22, v4->uItemID, (unsigned int)pChestWindow->ptr_1C) ) | |
4042 { | |
4043 ++v22; | |
4044 if ( v22 >= v5 ) | |
4045 goto LABEL_8; | |
4046 } | |
4047 v21 = v22; | |
4048 } | |
4049 LABEL_8: | |
4050 if ( v22 == v5 ) | |
4051 { | |
4052 if ( uActiveCharacter ) | |
201 | 4053 pPlayers[uActiveCharacter]->PlaySound(SPEECH_NoRoom, 0); |
0 | 4054 return 0; |
4055 } | |
4056 v7 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v4->uItemID].pIconName, TEXTURE_16BIT_PALETTE); | |
4057 HIWORD(v8) = 0; | |
4058 v9 = v7 != -1 ? (int)&pIcons_LOD->pTextures[v7] : 0; | |
4059 v10 = (v7 != -1 ? pIcons_LOD->pTextures[v7].uTextureWidth : 24); | |
4060 if ( v10 < 14 ) | |
4061 v10 = 14; | |
4062 v11 = *(short *)(v9 + 26); | |
4063 v12 = ((v10 - 14) >> 5) + 1; | |
4064 if ( v11 < 14 ) | |
4065 v11 = 14; | |
4066 v13 = ((v11 - 14) >> 5) + 1; | |
4067 if ( !areWeLoadingTexture ) | |
4068 { | |
4069 ((Texture *)v9)->Release(); | |
4070 pIcons_LOD->_40F9C5(); | |
4071 } | |
4072 if ( v13 > 0 ) | |
4073 { | |
4074 v23 = 0; | |
4075 v20 = v13; | |
4076 do | |
4077 { | |
4078 if ( (signed int)v12 > 0 ) | |
4079 { | |
4080 v14 = &pChests[0].pInventoryIndices[v21 + v23 + 2662 * uChestID]; | |
4081 LOWORD(v8) = -1 - v21; | |
4082 v8 <<= 16; | |
4083 LOWORD(v8) = -1 - v21; | |
4084 memset32(v14, v8, v12 >> 1); | |
4085 v15 = (int)((char *)v14 + 4 * (v12 >> 1)); | |
4086 for ( i = v12 & 1; i; --i ) | |
4087 { | |
4088 *(short *)v15 = v8; | |
4089 v15 += 2; | |
4090 } | |
4091 } | |
4092 v23 += v19; | |
4093 --v20; | |
4094 } | |
4095 while ( v20 ); | |
4096 } | |
4097 pChests[0].pInventoryIndices[v21 + 2662 * uChestID] = v18 + 1; | |
4098 memcpy(&pChests[uChestID].mm7__vector_pItems[v18], Src, 0x24u); | |
4099 result = v21 + 1; | |
4100 } | |
4101 else | |
4102 { | |
4103 result = 1; | |
4104 } | |
4105 return result; | |
4106 } | |
4107 // 506128: using guessed type int areWeLoadingTexture; | |
4108 | |
4109 //----- (0042013E) -------------------------------------------------------- | |
4110 unsigned int Chest::PlaceItemAt(unsigned int a1, unsigned int uItemIdx, unsigned int uChestID) | |
4111 { | |
4112 int v3; // esi@1 | |
4113 unsigned int v4; // ebx@1 | |
4114 int uItemID; // edi@1 | |
4115 int v6; // edx@4 | |
4116 unsigned int v7; // eax@5 | |
4117 Texture *v8; // ecx@5 | |
4118 signed int v9; // eax@5 | |
4119 signed int v10; // edi@7 | |
4120 unsigned int v11; // ebx@7 | |
4121 int v12; // edi@9 | |
4122 int v13; // edx@12 | |
4123 void *v14; // edi@14 | |
4124 int v15; // edi@14 | |
4125 int i; // ecx@14 | |
4126 unsigned int result; // eax@18 | |
4127 __int16 v18; // [sp+Ch] [bp-10h]@1 | |
4128 int v19; // [sp+10h] [bp-Ch]@11 | |
4129 int v20; // [sp+14h] [bp-8h]@12 | |
4130 unsigned int v21; // [sp+18h] [bp-4h]@1 | |
4131 | |
4132 v3 = 5324 * uChestID; | |
4133 v21 = a1; | |
4134 v4 = 5324 * uChestID + 36 * uItemIdx; | |
4135 v18 = uItemIdx; | |
4136 uItemID = *(unsigned int *)((char *)&pChests[0].mm7__vector_pItems[0].uItemID + v4); | |
4137 pItemsTable->SetSpecialBonus((ItemGen *)((char *)pChests[0].mm7__vector_pItems + v4)); | |
4138 if ( uItemID >= 135 && uItemID <= 159 && !*(int *)((char *)&pChests[0].mm7__vector_pItems[0].uNumCharges + v4) ) | |
4139 { | |
4140 v6 = rand() % 21 + 10; | |
4141 *(int *)((char *)&pChests[0].mm7__vector_pItems[0].uNumCharges + v4) = v6; | |
4142 *(&pChests[0].mm7__vector_pItems[0].uMaxCharges + v4) = v6; | |
4143 } | |
4144 v7 = pIcons_LOD->LoadTexture(pItemsTable->pItems[uItemID].pIconName, TEXTURE_16BIT_PALETTE); | |
4145 v8 = (Texture *)(v7 != -1 ? (int)&pIcons_LOD->pTextures[v7] : 0); | |
4146 v9 = (v7 != -1 ? pIcons_LOD->pTextures[v7].uTextureWidth : 24); | |
4147 if ( v9 < 14 ) | |
4148 v9 = 14; | |
4149 v10 = v8->uTextureHeight; | |
4150 v11 = ((v9 - 14) >> 5) + 1; | |
4151 if ( v10 < 14 ) | |
4152 v10 = 14; | |
4153 v12 = ((v10 - 14) >> 5) + 1; | |
4154 if ( !areWeLoadingTexture ) | |
4155 { | |
4156 v8->Release(); | |
4157 pIcons_LOD->_40F9C5(); | |
4158 } | |
4159 v19 = pChestWidthsByType[*(unsigned __int16 *)((char *)&pChests[0].uChestBitmapID + v3)]; | |
4160 if ( v12 > 0 ) | |
4161 { | |
4162 v13 = 0; | |
4163 v20 = v12; | |
4164 do | |
4165 { | |
4166 if ( (signed int)v11 > 0 ) | |
4167 { | |
4168 v14 = &pChests[0].pInventoryIndices[v21 + v13 + 2662 * uChestID]; | |
4169 LOWORD(v3) = -1 - v21; | |
4170 v3 <<= 16; | |
4171 LOWORD(v3) = -1 - v21; | |
4172 memset32(v14, v3, v11 >> 1); | |
4173 v15 = (int)((char *)v14 + 4 * (v11 >> 1)); | |
4174 for ( i = v11 & 1; i; --i ) | |
4175 { | |
4176 *(short *)v15 = v3; | |
4177 v15 += 2; | |
4178 } | |
4179 } | |
4180 v13 += v19; | |
4181 --v20; | |
4182 } | |
4183 while ( v20 ); | |
4184 } | |
4185 result = v21 + 2662 * uChestID; | |
4186 pChests[0].pInventoryIndices[result] = v18 + 1; | |
4187 return result; | |
4188 } | |
4189 // 506128: using guessed type int areWeLoadingTexture; | |
4190 | |
4191 //----- (00420284) -------------------------------------------------------- | |
4192 char *Chest::_420284(unsigned int uChestID) | |
4193 { | |
4194 int v1; // ebx@1 | |
4195 unsigned int v2; // esi@1 | |
4196 unsigned int v3; // esi@1 | |
4197 int uChestArea; // edi@1 | |
4198 int v5; // eax@2 | |
4199 int v6; // ebx@11 | |
4200 char *result; // eax@18 | |
4201 char Dst[144]; // [sp+Ch] [bp-A0h]@1 | |
4202 int v9; // [sp+9Ch] [bp-10h]@10 | |
4203 unsigned int v10; // [sp+A0h] [bp-Ch]@1 | |
4204 unsigned int v11; // [sp+A4h] [bp-8h]@8 | |
82 | 4205 ItemGen *v12; // [sp+A8h] [bp-4h]@9 |
0 | 4206 |
4207 v1 = 0; | |
4208 v2 = uChestID; | |
4209 v10 = uChestID; | |
4210 pRenderer->ClearZBuffer(0, 479); | |
4211 v3 = v2; | |
4212 uChestArea = pChestWidthsByType[pChests[v3].uChestBitmapID] * pChestHeightsByType[pChests[v3].uChestBitmapID]; | |
4213 memset(Dst, 0, 0x90u); | |
4214 if ( uChestArea > 0 ) | |
4215 { | |
4216 do | |
4217 { | |
4218 do | |
4219 v5 = (unsigned __int8)rand(); | |
4220 while ( v5 >= uChestArea ); | |
4221 while ( Dst[v5] ) | |
4222 { | |
4223 ++v5; | |
4224 if ( v5 == uChestArea ) | |
4225 v5 = 0; | |
4226 } | |
4227 Dst[v5] = v1++; | |
4228 } | |
4229 while ( v1 < uChestArea ); | |
4230 } | |
4231 v11 = 0; | |
4232 if ( uChestArea > 0 ) | |
4233 { | |
82 | 4234 v12 = pChests[v3].mm7__vector_pItems;//&pChests[v3].mm7__vector_pItems[0].uAttributes; |
0 | 4235 do |
4236 { | |
82 | 4237 v9 = v12->uItemID; |
0 | 4238 if ( v9 ) |
4239 { | |
4240 v6 = 0; | |
4241 while ( !Chest::CanPlaceItemAt((unsigned __int8)Dst[v6], v9, v10) ) | |
4242 { | |
4243 ++v6; | |
4244 if ( v6 >= uChestArea ) | |
82 | 4245 break; |
0 | 4246 } |
82 | 4247 if(v6<uChestArea) |
4248 { | |
4249 Chest::PlaceItemAt((unsigned __int8)Dst[v6], v11, v10); | |
4250 if ( pChests[v3].uFlags & 4 ) | |
315 | 4251 v12->SetIdentified(); |
82 | 4252 } |
4253 } | |
0 | 4254 ++v11; |
82 | 4255 ++v12; |
0 | 4256 } |
4257 while ( (signed int)v11 < uChestArea ); | |
4258 } | |
4259 result = (char *)&pChests[v3].uFlags; | |
4260 pChests[v3].uFlags = pChests[v3].uFlags & 0xFFFB | 2; | |
4261 return result; | |
4262 } | |
4263 // 420284: using guessed type char Dst[144]; | |
4264 | |
4265 //----- (0042038D) -------------------------------------------------------- | |
4266 void __cdecl sub_42038D() | |
4267 { | |
4268 POINT *v0; // esi@2 | |
4269 int v1; // ecx@2 | |
4270 const char *v2; // eax@3 | |
4271 POINT v3; // [sp+0h] [bp-10h]@2 | |
4272 POINT a2; // [sp+8h] [bp-8h]@1 | |
4273 | |
4274 if ( pMouse->GetCursorPos(&a2)->y < 350 ) | |
4275 { | |
4276 v0 = pMouse->GetCursorPos(&a2); | |
4277 v1 = pRenderer->pActiveZBuffer[v0->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v3)->y]]; | |
4278 if ( v1 ) | |
4279 { | |
4280 auto _w = (ItemGen *)(&pOtherOverlayList->pOverlays[49].field_4 + 2662 * (unsigned int)pChestWindow->ptr_1C | |
4281 + 18 * *((short *)&pChests[0].mm7__vector_pItems[139].uExpireTime | |
4282 + v1 + 2662 * (unsigned int)pChestWindow->ptr_1C + 3)); | |
4283 v2 = _w->GetDisplayName(); | |
4284 sub_41C0B8_set_status_string(v2); | |
4285 } | |
4286 } | |
4287 } | |
4288 | |
4289 //----- (0042041E) -------------------------------------------------------- | |
4290 bool Chest::Open(unsigned int uChestID) | |
4291 { | |
4292 char *v1; // edi@5 | |
4293 unsigned int v2; // eax@8 | |
4294 GUIWindow *v3; // eax@15 | |
4295 int v5; // edx@16 | |
4296 int v6; // eax@16 | |
4297 ODMFace *v7; // eax@19 | |
4298 int v8; // edx@19 | |
4299 int v9; // edi@19 | |
4300 signed int v10; // ebx@19 | |
4301 int v11; // ecx@19 | |
4302 int v12; // eax@19 | |
4303 BLVFace *v13; // eax@20 | |
4304 int v14; // ebx@21 | |
4305 int v15; // edi@21 | |
4306 int v16; // ecx@22 | |
4307 __int64 v17; // qax@22 | |
4308 double v18; // st7@23 | |
4309 double v19; // st6@23 | |
4310 double v20; // st7@23 | |
4311 int v21; // ecx@26 | |
4312 char v22[12]; // ST4C_12@28 | |
4313 unsigned int *v23; // edi@28 | |
4314 unsigned __int16 v24; // di@28 | |
4315 signed int v25; // ecx@28 | |
4316 char *v26; // edx@29 | |
4317 unsigned __int16 v27; // ax@32 | |
4318 //LayingItem a1; // [sp+14h] [bp-B0h]@28 | |
4319 int v29; // [sp+84h] [bp-40h]@16 | |
4320 int v30; // [sp+88h] [bp-3Ch]@16 | |
4321 int v31; // [sp+8Ch] [bp-38h]@16 | |
4322 int v32; // [sp+90h] [bp-34h]@16 | |
4323 float v33; // [sp+94h] [bp-30h]@23 | |
4324 char *v34; // [sp+98h] [bp-2Ch]@5 | |
4325 int v35; // [sp+9Ch] [bp-28h]@16 | |
4326 Vec3_int_ pOut; // [sp+A0h] [bp-24h]@28 | |
4327 int a4; // [sp+ACh] [bp-18h]@1 | |
4328 int v38; // [sp+B0h] [bp-14h]@21 | |
4329 int sRotX; // [sp+B4h] [bp-10h]@23 | |
4330 float v40; // [sp+B8h] [bp-Ch]@23 | |
4331 float v41; // [sp+BCh] [bp-8h]@23 | |
4332 int sRotY; // [sp+C0h] [bp-4h]@8 | |
4333 | |
4334 a4 = uChestID; | |
4335 if ( (uChestID & 0x80000000u) != 0 || (signed int)uChestID >= 20 ) | |
4336 return 0; | |
4337 ++pIcons_LOD->uTexturePacksCount; | |
4338 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | |
4339 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
4340 v1 = (char *)&pChests[uChestID].uFlags; | |
4341 v34 = v1; | |
4342 if ( !(*v1 & CHEST_ITEMS_PLACED) ) | |
4343 Chest::_420284(uChestID); | |
4344 if ( !uActiveCharacter ) | |
4345 return 0; | |
4346 *(float *)&sRotY = 0.0; | |
4347 v2 = pMapStats->GetMapInfo(pCurrentMapName); | |
4348 if ( !(*v1 & 1) || !v2 ) | |
4349 goto LABEL_12; | |
237 | 4350 if ( pPlayers[uActiveCharacter]->GetDisarmTrap() < 2 * pMapStats->pInfos[v2].LockX5 ) |
0 | 4351 { |
4352 v29 = 811; | |
4353 v30 = 812; | |
4354 v31 = 813; | |
4355 v32 = 814; | |
4356 v5 = rand() % 4; | |
4357 v6 = dword_5B5920 >> 3; | |
4358 v35 = v5; | |
141 | 4359 if ( (dword_5B5920 & 7) == OBJECT_Decoration) |
0 | 4360 { |
4361 v16 = v6; | |
4362 v14 = pLevelDecorations[v6].vPosition.x; | |
4363 v38 = pLevelDecorations[v6].vPosition.y; | |
4364 v17 = pDecorationList->pDecorations[pLevelDecorations[v6].uDecorationDescID].uDecorationHeight; | |
4365 v15 = pLevelDecorations[v16].vPosition.z + (((signed int)v17 - HIDWORD(v17)) >> 1); | |
4366 } | |
4367 else | |
4368 { | |
141 | 4369 if ( (dword_5B5920 & 7) != OBJECT_BModel) |
0 | 4370 goto LABEL_12; |
4371 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
4372 { | |
4373 v7 = &pOutdoor->pBModels[dword_5B5920 >> 9].pFaces[(dword_5B5920 >> 3) & 0x3F]; | |
4374 v8 = v7->pBoundingBox.y1; | |
4375 v9 = v7->pBoundingBox.z2; | |
4376 v10 = v7->pBoundingBox.x1 + v7->pBoundingBox.x2; | |
4377 v11 = v7->pBoundingBox.y2; | |
4378 v12 = v7->pBoundingBox.z1; | |
4379 } | |
4380 else | |
4381 { | |
4382 v13 = &pIndoor->pFaces[v6]; | |
4383 v8 = v13->pBounding.y1; | |
4384 v9 = v13->pBounding.z2; | |
4385 v10 = v13->pBounding.x1 + v13->pBounding.x2; | |
4386 v11 = v13->pBounding.y2; | |
4387 v12 = v13->pBounding.z1; | |
4388 } | |
4389 v14 = v10 >> 1; | |
4390 v38 = (v8 + v11) >> 1; | |
4391 v15 = (v12 + v9) >> 1; | |
4392 } | |
4393 v18 = (double)pParty->vPosition.x - (double)v14; | |
4394 *(float *)&a4 = v18; | |
4395 v19 = (double)pParty->vPosition.y - (double)v38; | |
4396 v33 = v19; | |
4397 v41 = (double)pParty->sEyelevel + (double)pParty->vPosition.z - (double)v15; | |
4398 *(float *)&sRotY = v19 * v19; | |
4399 *(float *)&sRotX = v18 * v18; | |
4400 v20 = sqrt(v41 * v41 + *(float *)&sRotX + *(float *)&sRotY); | |
4401 v40 = v20; | |
4402 if ( v20 <= 1.0 ) | |
4403 { | |
4404 *(float *)&sRotX = 0.0; | |
4405 *(float *)&sRotY = 0.0; | |
4406 } | |
4407 else | |
4408 { | |
4409 sRotY = (signed __int64)sqrt(*(float *)&sRotX + *(float *)&sRotY); | |
4410 sRotX = stru_5C6E00->Atan2((signed __int64)*(float *)&a4, (signed __int64)v33); | |
4411 sRotY = stru_5C6E00->Atan2(sRotY, (signed __int64)v41); | |
4412 } | |
4413 v21 = 256; | |
4414 if ( v40 < 256.0 ) | |
4415 v21 = (signed __int64)v40 / 4; | |
4416 *(int *)&v22[8] = v15; | |
4417 *(_QWORD *)v22 = __PAIR__(v38, v14); | |
4418 Vec3_int_::Rotate(v21, sRotX, sRotY, *(Vec3_int_ *)v22, &pOut.x, &pOut.z, &pOut.y); | |
4419 v23 = (unsigned int *)(&v29 + v35); | |
4420 sub_42F7EB_DropItemAt(*v23, pOut.x, pOut.z, pOut.y, 0, 1, 0, 0x30u, 0); | |
4421 | |
4422 LayingItem a1; // [sp+14h] [bp-B0h]@28 | |
4423 //LayingItem::LayingItem(&a1); | |
4424 | |
4425 a1.stru_24.Reset(); | |
4426 v24 = *(short *)v23; | |
4427 v25 = 0; | |
4428 a1.field_50 = 0; | |
4429 a1.field_4C = 0; | |
4430 a1.field_48 = 0; | |
4431 a1.field_54 = 0; | |
4432 a1.uItemType = v24; | |
4433 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
4434 { | |
4435 LABEL_32: | |
4436 v27 = 0; | |
4437 } | |
4438 else | |
4439 { | |
4440 v26 = (char *)&pObjectList->pObjects->uObjectID; | |
4441 while ( v24 != *(short *)v26 ) | |
4442 { | |
4443 ++v25; | |
4444 v26 += 56; | |
4445 if ( v25 >= (signed int)pObjectList->uNumObjects ) | |
4446 goto LABEL_32; | |
4447 } | |
4448 v27 = v25; | |
4449 } | |
4450 a1.uObjectDescID = v27; | |
4451 a1.vPosition.y = pOut.z; | |
4452 a1.vPosition.x = pOut.x; | |
4453 a1.vPosition.z = pOut.y; | |
4454 a1.uSoundID = 0; | |
4455 a1.uAttributes = 48; | |
4456 a1.uSectorID = pIndoor->GetSector(pOut.x, pOut.z, pOut.y); | |
4457 a1.uSpriteFrameID = 0; | |
303 | 4458 a1.field_58_pid = 0; |
0 | 4459 a1.field_5C = 0; |
4460 a1.uFacing = 0; | |
4461 a1.Create(0, 0, 0, 0); | |
4462 pAudioPlayer->PlaySound(SOUND_8, 0, 0, -1, 0, 0, 0, 0); | |
4463 a1._438E35(); | |
4464 *v34 &= 0xFEu; | |
4465 if ( uActiveCharacter && !qword_A750D8 && !dword_507CD8 ) | |
4466 { | |
4467 qword_A750D8 = 256i64; | |
4468 word_A750E0 = 5; | |
4469 word_A750E2 = uActiveCharacter; | |
4470 } | |
4471 pIcons_LOD->_4114F2(); | |
4472 dword_507CD8 = 0; | |
4473 return 0; | |
4474 } | |
4475 *v1 &= 0xFEu; | |
4476 sRotY = 1; | |
4477 LABEL_12: | |
4478 pAudioPlayer->StopChannels(-1, -1); | |
4479 pAudioPlayer->PlaySound((SoundID)208, 0, 0, -1, 0, 0, 0, 0); | |
4480 if ( *(float *)&sRotY != 0.0 ) | |
4481 { | |
4482 if ( !dword_507CD8 ) | |
187 | 4483 pPlayers[uActiveCharacter]->PlaySound(SPEECH_4, 0); |
0 | 4484 } |
4485 dword_507CD8 = 0; | |
4486 v3 = GUIWindow::Create(0, 0, 640u, 480u, WINDOW_Chest, a4, 0); | |
4487 pGUIWindow_CurrentMenu = v3; | |
4488 pChestWindow = v3; | |
4489 pBtn_ExitCancel = v3->CreateButton( | |
4490 0x1D7u, | |
4491 0x1BDu, | |
4492 0xA9u, | |
4493 0x23u, | |
4494 1, | |
4495 0, | |
4496 0x71u, | |
4497 0, | |
4498 0, | |
4499 pGlobalTXT_LocalizationStrings[79],// Exit | |
4500 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0), | |
4501 0); | |
4502 pChestWindow->CreateButton(7u, 8u, 460u, 343u, 1, 0, 0xCu, 0, 0, "", 0); | |
151 | 4503 pCurrentScreen = SCREEN_CHEST; |
0 | 4504 pEventTimer->Pause(); |
4505 return 1; | |
4506 } | |
4507 | |
4508 //----- (0042092D) -------------------------------------------------------- | |
4509 void Chest::DrawChestUI(unsigned int uChestID) | |
4510 { | |
4511 Render *v1; // edi@1 | |
4512 unsigned int v2; // ebx@1 | |
4513 unsigned int v3; // ebx@1 | |
4514 int v4; // eax@1 | |
4515 unsigned int v5; // eax@1 | |
4516 int v6; // ecx@3 | |
4517 unsigned int v7; // eax@4 | |
4518 Texture *v8; // esi@4 | |
4519 signed int v9; // ecx@4 | |
4520 signed int v10; // edx@4 | |
4521 signed int v11; // eax@4 | |
4522 int v12; // eax@6 | |
4523 int v13; // eax@6 | |
4524 unsigned int v14; // ST34_4@8 | |
4525 int v15; // edi@8 | |
4526 int *v16; // [sp+Ch] [bp-28h]@1 | |
4527 int v17; // [sp+10h] [bp-24h]@4 | |
4528 int v18; // [sp+14h] [bp-20h]@1 | |
4529 signed int v19; // [sp+18h] [bp-1Ch]@1 | |
4530 int v20; // [sp+1Ch] [bp-18h]@1 | |
4531 signed int v21; // [sp+20h] [bp-14h]@1 | |
4532 char *v22; // [sp+2Ch] [bp-8h]@2 | |
4533 signed int v23; // [sp+30h] [bp-4h]@1 | |
4534 | |
4535 v1 = pRenderer; | |
4536 v2 = uChestID; | |
4537 v16 = pRenderer->pActiveZBuffer; | |
4538 pRenderer->ClearZBuffer(0, 479); | |
4539 v3 = v2; | |
4540 v4 = pChests[v3].uChestBitmapID; | |
4541 v20 = pChestSmthn1ByType[v4]; | |
4542 v18 = pChestSmthn2ByType[v4]; | |
4543 v21 = pChestWidthsByType[v4]; | |
4544 v19 = pChestHeightsByType[v4]; | |
4545 sprintf(pTmpBuf, "chest%02d", pChestList->pChests[pChests[v3].uChestBitmapID].uTextureID); | |
4546 v5 = pIcons_LOD->LoadTexture(pTmpBuf, TEXTURE_16BIT_PALETTE); | |
4547 pRenderer->DrawTextureIndexed(8u, 8u, (Texture *)(v5 != -1 ? (int)&pIcons_LOD->pTextures[v5] : 0)); | |
4548 v23 = 0; | |
4549 if ( v21 * v19 > 0 ) | |
4550 { | |
4551 v22 = (char *)pChests[v3].pInventoryIndices; | |
4552 do | |
4553 { | |
4554 v6 = *(short *)v22; | |
4555 if ( v6 > 0 ) | |
4556 { | |
4557 v17 = v18 + 32 * v23 / v19; | |
4558 v7 = pIcons_LOD->LoadTexture( | |
4559 pItemsTable->pItems[*(int *)((char *)&pOtherOverlayList->pOverlays[49].field_4 + 36 * v6 + v3 * 5324)].pIconName, | |
4560 TEXTURE_16BIT_PALETTE); | |
4561 v8 = (Texture *)(v7 != -1 ? &pIcons_LOD->pTextures[v7] : 0); | |
4562 v9 = (v7 != -1 ? pIcons_LOD->pTextures[v7].uTextureWidth : 24); | |
4563 v10 = (v7 != -1 ? pIcons_LOD->pTextures[v7].uTextureHeight : 26); | |
4564 v11 = (v7 != -1 ? pIcons_LOD->pTextures[v7].uTextureWidth : 24); | |
4565 if ( v9 < 14 ) | |
4566 v11 = 14; | |
4567 v12 = v11 - 14; | |
4568 LOBYTE(v12) = v12 & 0xE0; | |
4569 v13 = v12 + 32; | |
4570 if ( (signed int)v8->uTextureHeight < 14 ) | |
4571 v10 = 14; | |
4572 v14 = v20 + 32 * v23 % v21 + ((v13 - v9) >> 1); | |
4573 v15 = v17 + ((((v10 - 14) & 0xFFFFFFE0) - v8->uTextureHeight + 32) >> 1); | |
4574 pRenderer->DrawTextureTransparent( | |
4575 v14, | |
4576 v17 + ((((v10 - 14) & 0xFFFFFFE0) - v8->uTextureHeight + 32) >> 1), | |
4577 v8); | |
4578 sub_40F92A(&v16[v14 + pSRZBufferLineOffsets[v15]], v8, v23 + 1); | |
4579 v1 = pRenderer; | |
4580 } | |
4581 ++v23; | |
4582 v22 += 2; | |
4583 } | |
4584 while ( v23 < v21 * v19 ); | |
4585 } | |
24 | 4586 pRenderer->DrawTextureIndexed(pBtn_ExitCancel->uX, pBtn_ExitCancel->uY, |
0 | 4587 (Texture *)(uTextureID_506438 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_506438] : 0)); |
4588 } | |
4589 | |
4590 //----- (00420B13) -------------------------------------------------------- | |
4591 void __fastcall sub_420B13(int a1, int a2) | |
4592 { | |
4593 void *v2; // eax@1 | |
4594 ItemGen *v3; // ebx@1 | |
4595 unsigned int v4; // eax@1 | |
4596 Texture *v5; // ecx@1 | |
4597 signed int v6; // eax@1 | |
4598 signed int v7; // edi@3 | |
4599 signed int v8; // eax@3 | |
4600 int v9; // edi@3 | |
4601 int v10; // eax@5 | |
4602 int v11; // esi@8 | |
4603 unsigned int v12; // ecx@10 | |
4604 void *v13; // edi@10 | |
4605 unsigned __int8 v14; // cf@10 | |
4606 int v15; // edi@10 | |
4607 int i; // ecx@10 | |
4608 int v17; // [sp+Ch] [bp-14h]@1 | |
4609 int v18; // [sp+10h] [bp-10h]@3 | |
4610 int v19; // [sp+14h] [bp-Ch]@1 | |
4611 void *v20; // [sp+18h] [bp-8h]@1 | |
4612 int v21; // [sp+1Ch] [bp-4h]@5 | |
4613 int v22; // [sp+1Ch] [bp-4h]@8 | |
4614 | |
4615 v19 = a2; | |
4616 v2 = pChestWindow->ptr_1C; | |
4617 v20 = v2; | |
4618 v2 = (void *)(5324 * (int)v2); | |
4619 v3 = (ItemGen *)((char *)v2 + 36 * a1 + (int)((char *)pChests + 4)); | |
4620 v17 = pChestWidthsByType[*(short *)((char *)v2 + (int)pChests)]; | |
4621 v4 = pIcons_LOD->LoadTexture(pItemsTable->pItems[v3->uItemID].pIconName, TEXTURE_16BIT_PALETTE); | |
4622 v5 = (Texture *)(v4 != -1 ? (int)&pIcons_LOD->pTextures[v4] : 0); | |
4623 v6 = (v4 != -1 ? pIcons_LOD->pTextures[v4].uTextureWidth : 24); | |
4624 if ( v6 < 14 ) | |
4625 v6 = 14; | |
4626 v7 = v6 - 14; | |
4627 v8 = v5->uTextureHeight; | |
4628 v9 = (v7 >> 5) + 1; | |
4629 v18 = v9; | |
4630 if ( v8 < 14 ) | |
4631 v8 = 14; | |
4632 v10 = ((v8 - 14) >> 5) + 1; | |
4633 v21 = v10; | |
4634 if ( !areWeLoadingTexture ) | |
4635 { | |
4636 v5->Release(); | |
4637 pIcons_LOD->_40F9C5(); | |
4638 v10 = v21; | |
4639 } | |
4640 if ( v10 > 0 ) | |
4641 { | |
4642 v11 = 0; | |
4643 v22 = v10; | |
4644 do | |
4645 { | |
4646 if ( v9 > 0 ) | |
4647 { | |
4648 v12 = v9; | |
4649 v13 = &pChests[0].pInventoryIndices[v19 + v11 + 2662 * (int)v20]; | |
4650 v14 = v12 & 1; | |
4651 v12 >>= 1; | |
4652 memset(v13, 0, 4 * v12); | |
4653 v15 = (int)((char *)v13 + 4 * v12); | |
4654 for ( i = v14; i; --i ) | |
4655 { | |
4656 *(short *)v15 = 0; | |
4657 v15 += 2; | |
4658 } | |
4659 v9 = v18; | |
4660 } | |
4661 v11 += v17; | |
4662 --v22; | |
4663 } | |
4664 while ( v22 ); | |
4665 } | |
4666 v3->Reset(); | |
4667 } | |
4668 // 506128: using guessed type int areWeLoadingTexture; | |
4669 | |
4670 //----- (00420C05) -------------------------------------------------------- | |
4671 void __fastcall party_finds_gold(unsigned int uNumGold, int _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal) | |
4672 { | |
4673 unsigned int v2; // edi@1 | |
4674 int v3; // ebp@1 | |
4675 unsigned int v4; // esi@1 | |
4676 int v5; // ecx@6 | |
4677 NPCData *v6; // eax@6 | |
4678 signed int v7; // edx@8 | |
4679 signed int v8; // ebx@10 | |
4680 char *v9; // edi@11 | |
4681 signed int v10; // ecx@17 | |
4682 int v11; // eax@21 | |
4683 NPCData *v12; // ecx@21 | |
4684 unsigned int v13; // ecx@23 | |
4685 signed int v14; // [sp+Ch] [bp-4h]@6 | |
4686 | |
4687 v2 = 0; | |
4688 v3 = 0; | |
4689 v4 = uNumGold; | |
4690 if ( _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal ) | |
4691 { | |
4692 if ( _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal == 1 ) | |
4693 { | |
4694 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[467], uNumGold);// You found %lu gold! | |
4695 } | |
4696 else | |
4697 { | |
4698 if ( _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal == 2 ) | |
4699 pTmpBuf2[0] = 0; | |
4700 } | |
4701 } | |
4702 else | |
4703 { | |
4704 v14 = 0; | |
4705 v5 = 0; | |
4706 v6 = pParty->pHirelings; | |
4707 do | |
4708 { | |
4709 if ( v6->pName ) | |
4710 { | |
4711 v7 = v14++; | |
4712 pTmpBuf[v7] = v5; | |
4713 } | |
4714 ++v6; | |
4715 ++v5; | |
4716 } | |
4717 while ( (signed int)v6 < (signed int)&pParty->pPickedItem ); | |
4718 v8 = 0; | |
4719 if ( (signed int)pNPCStats->uNumNewNPCs > 0 ) | |
4720 { | |
4721 v9 = (char *)pNPCStats->pNewNPCData; | |
4722 do | |
4723 { | |
4724 if ( v9[8] & 0x80 | |
4725 && (!pParty->pHirelings[0].pName || strcmp(*(const char **)v9, pParty->pHirelings[0].pName)) | |
4726 && (!pParty->pHirelings[1].pName || strcmp(*(const char **)v9, pParty->pHirelings[1].pName)) ) | |
4727 { | |
4728 v10 = v14++; | |
4729 pTmpBuf[v10] = v8 + 2; | |
4730 } | |
4731 ++v8; | |
4732 v9 += 76; | |
4733 } | |
4734 while ( v8 < (signed int)pNPCStats->uNumNewNPCs ); | |
4735 v2 = 0; | |
4736 } | |
4737 if ( v14 > 0 ) | |
4738 { | |
4739 do | |
4740 { | |
4741 v11 = (unsigned __int8)pTmpBuf[v2]; | |
4742 v12 = &pNPCStats->pNPCData[v11 + 499]; | |
33 | 4743 if ( (unsigned __int8)pTmpBuf[v2] < 2 ) |
0 | 4744 v12 = &pParty->pHirelings[v11]; |
4745 v13 = v12->uProfession; | |
4746 if ( v13 ) | |
291 | 4747 v3 += pNPCStats->pProfessions[v13].uHirePrice;//*(&pNPCStats->field_13A58 + 5 * v13); |
0 | 4748 ++v2; |
4749 } | |
4750 while ( (signed int)v2 < v14 ); | |
4751 } | |
4752 if ( CheckHiredNPCSpeciality(0x1Fu) ) | |
4753 v4 += (signed int)(10 * v4) / 100; | |
4754 if ( CheckHiredNPCSpeciality(0x20u) ) | |
4755 v4 += (signed int)(20 * v4) / 100; | |
4756 if ( CheckHiredNPCSpeciality(0x2Du) ) | |
4757 v4 += (signed int)(10 * v4) / 100; | |
4758 if ( v3 ) | |
4759 { | |
4760 v3 = (signed int)(v4 * v3 / 100) / 100; | |
4761 if ( v3 < 1 ) | |
4762 v3 = 1; | |
4763 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[466], v4, v3);// You found %lu gold (followers take %lu)! | |
4764 } | |
4765 else | |
4766 { | |
4767 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[467], v4);// You found %lu gold! | |
4768 } | |
4769 v2 = 0; | |
4770 } | |
4771 pParty->uNumGold += v4 - v3; | |
4772 pUIAnim_Gold->uAnimTime = v2; | |
4773 pUIAnim_Gold->uAnimLength = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Gold->uIconID].uAnimLength; | |
4774 if ( pTmpBuf2[0] ) | |
4775 ShowStatusBarString(pTmpBuf2, 2u); | |
4776 pAudioPlayer->PlaySound(SOUND_GoldReceived, v2, v2, -1, v2, v2, v2, v2); | |
4777 } | |
4778 | |
4779 //----- (00420E01) -------------------------------------------------------- | |
4780 void __cdecl sub_420E01() | |
4781 { | |
4782 void *v0; // edi@1 | |
4783 POINT *v1; // esi@2 | |
4784 int v2; // eax@2 | |
4785 int v3; // ebx@4 | |
4786 int v4; // esi@6 | |
4787 int v5; // ecx@6 | |
4788 //LayingItem v6; // [sp+Ch] [bp-80h]@1 | |
4789 char v7; // [sp+7Ch] [bp-10h]@2 | |
4790 POINT a2; // [sp+84h] [bp-8h]@2 | |
4791 | |
4792 LayingItem v6; // [sp+Ch] [bp-80h]@1 | |
4793 //LayingItem::LayingItem(&v6); | |
4794 | |
4795 v0 = pGUIWindow_CurrentMenu->ptr_1C; | |
4796 if ( pParty->pPickedItem.uItemID ) | |
4797 { | |
4798 if ( Chest::_41FFA2(-1, &pParty->pPickedItem, (unsigned int)pGUIWindow_CurrentMenu->ptr_1C) ) | |
4799 pMouse->RemoveHoldingItem(); | |
4800 } | |
4801 else | |
4802 { | |
4803 v1 = pMouse->GetCursorPos(&a2); | |
4804 v2 = pRenderer->pActiveZBuffer[v1->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v7)->y]] & 0xFFFF; | |
4805 if ( v2 ) | |
4806 { | |
4807 if ( v2 ) | |
4808 v3 = v2 - 1; | |
4809 else | |
4810 v3 = -1; | |
4811 v4 = pChests[0].pInventoryIndices[v3 + 2662 * (int)v0] - 1; | |
4812 v5 = 5324 * (int)v0 + 36 * v4; | |
4813 if ( pItemsTable->pItems[*(unsigned int *)((char *)&pChests[0].mm7__vector_pItems[0].uItemID + v5)].uEquipType == 18 ) | |
4814 { | |
4815 party_finds_gold(*(int *)((char *)&pChests[0].mm7__vector_pItems[0].uAdditionalValue + v5), 0); | |
4816 viewparams->bRedrawGameUI = 1; | |
4817 } | |
4818 else | |
4819 { | |
4820 pParty->SetHoldingItem((ItemGen *)((char *)pChests[0].mm7__vector_pItems + v5)); | |
4821 } | |
4822 sub_420B13(v4, v3); | |
4823 } | |
4824 } | |
4825 } | |
4826 | |
4827 //----- (00420EFF) -------------------------------------------------------- | |
4828 void __cdecl GameUI_WritePointedObjectStatusString() | |
4829 { | |
4830 int v1; // ebx@6 | |
8 | 4831 GUIWindow *pWindow; // edi@7 |
4832 GUIButton *pButton; // ecx@11 | |
4833 Player *pPlayer; // eax@19 | |
0 | 4834 char v5; // cl@19 |
4835 unsigned int v6; // eax@19 | |
4836 int v7; // ecx@19 | |
4837 __int16 v8; // fps@23 | |
4838 unsigned __int8 v9; // c0@23 | |
4839 unsigned __int8 v10; // c3@23 | |
8 | 4840 enum UIMessageType pMessageType1; // esi@24 |
0 | 4841 int v12; // edx@25 |
4842 char *v13; // ecx@28 | |
4843 int v14; // eax@41 | |
8 | 4844 ItemGen *pItemGen; // ecx@44 |
0 | 4845 int v16; // ecx@46 |
4846 const char *v17; // eax@49 | |
4847 signed int v18; // eax@55 | |
4848 signed int v19; // ecx@63 | |
4849 BLVFace *pFace; // eax@69 | |
4850 __int16 v21; // ax@70 | |
4851 const char *v22; // eax@72 | |
4852 LevelDecoration *v23; // ecx@75 | |
4853 LevelDecoration *v24; // esi@75 | |
4854 __int16 v25; // ax@75 | |
4855 const char *v26; // ecx@79 | |
4856 Actor *pActor; // ecx@82 | |
4857 char *v28; // esi@82 | |
4858 int v29; // eax@82 | |
4859 signed int v30; // ecx@88 | |
4860 const char *v31; // eax@91 | |
4861 __int16 v32; // fps@109 | |
14 | 4862 //unsigned __int8 v33; // c0@109 |
4863 //unsigned __int8 v34; // c3@109 | |
8 | 4864 enum UIMessageType pMessageType2; // esi@110 |
0 | 4865 int v36; // edx@111 |
8 | 4866 enum UIMessageType pMessageType3; // edx@117 |
0 | 4867 int v38; // ecx@118 |
4868 const char *v39; // [sp-8h] [bp-E8h]@20 | |
4869 char *v40; // [sp-8h] [bp-E8h]@83 | |
4870 int v41; // [sp-4h] [bp-E4h]@20 | |
4871 char Str1[200]; // [sp+Ch] [bp-D4h]@129 | |
4872 unsigned int pX; // [sp+D4h] [bp-Ch]@1 | |
4873 unsigned int pY; // [sp+D8h] [bp-8h]@1 | |
4874 unsigned int v45; // [sp+DCh] [bp-4h]@21 | |
4875 | |
4876 v13 = nullptr; | |
4877 | |
4878 pMouse->uPointingObjectID = 0; | |
4879 pMouse->GetClickPos(&pX, &pY); | |
14 | 4880 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 | 4881 return; |
323 | 4882 if (pCurrentScreen == SCREEN_GAME) |
0 | 4883 { |
4884 if ( (signed int)pX > 467 || (signed int)pY > 351 ) | |
4885 goto _click_on_game_ui; | |
4886 if ( pRenderer->pRenderD3D ) | |
4887 { | |
4888 v18 = pGame->pVisInstance->get_picked_object_zbuf_val(); | |
4889 if ( (signed int)pX < (signed int)pViewport->uScreenX | |
4890 || (signed int)pX > (signed int)pViewport->uScreenZ | |
4891 || (signed int)pY < (signed int)pViewport->uScreenY | |
4892 || (signed int)pY > (signed int)pViewport->uScreenW ) | |
4893 v18 = -1; | |
4894 if ( v18 == -1 ) | |
8 | 4895 //goto LABEL_61; |
4896 { | |
4897 pMouse->uPointingObjectID = 0; | |
4898 if ( pMouse->uPointingObjectID == 0 ) | |
4899 { | |
4900 if ( uLastPointedObjectID != 0 ) | |
4901 { | |
4902 pStatusBarString[0] = 0; | |
4903 bForceDrawStatusBar = 1; | |
4904 } | |
4905 } | |
4906 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4907 return; | |
4908 } | |
0 | 4909 } |
4910 else | |
4911 { | |
4912 v18 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; | |
4913 } | |
4914 pMouse->uPointingObjectID = (unsigned __int16)v18; | |
4915 v19 = (signed int)(unsigned __int16)v18 >> 3; | |
4916 if ( (v18 & 7) == OBJECT_Item ) | |
4917 { | |
4918 v30 = v19; | |
4919 if ( pObjectList->pObjects[pLayingItems[v30].uObjectDescID].uFlags & 0x10 ) | |
8 | 4920 //goto LABEL_73; |
4921 { | |
4922 pMouse->uPointingObjectID = 0; | |
4923 //goto LABEL_50; | |
4924 uLastPointedObjectID = 1; | |
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 } | |
0 | 4936 if ( v18 >= (signed int)0x2000000u || pParty->pPickedItem.uItemID ) |
4937 { | |
4938 v22 = pLayingItems[v30].stru_24.GetDisplayName(); | |
8 | 4939 //LABEL_93: |
0 | 4940 v26 = v22; |
8 | 4941 //goto LABEL_87; |
4942 sub_41C0B8_set_status_string(v26); | |
4943 if ( pMouse->uPointingObjectID == 0 ) | |
4944 { | |
4945 if ( uLastPointedObjectID != 0 ) | |
4946 { | |
4947 pStatusBarString[0] = 0; | |
4948 bForceDrawStatusBar = 1; | |
4949 } | |
4950 } | |
4951 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4952 return; | |
0 | 4953 } |
4954 v31 = pLayingItems[v30].stru_24.GetDisplayName(); | |
4955 v28 = pTmpBuf; | |
4956 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[470], v31);// "Get %s" | |
4957 } | |
4958 else | |
4959 { | |
4960 if ( (v18 & 7) != OBJECT_Actor ) | |
4961 { | |
4962 if ( (v18 & 7) == OBJECT_Decoration ) | |
4963 { | |
4964 v23 = &pLevelDecorations[v19]; | |
4965 v24 = v23; | |
4966 v25 = v23->field_16_event_id; | |
4967 if ( !v25 ) | |
4968 { | |
4969 if ( v23->IsInteractive() ) | |
4970 v26 = pNPCTopics[stru_5E4C90._decor_events[v24->_idx_in_stru123 - 75] + 379].pTopic; | |
4971 else | |
4972 v26 = pDecorationList->pDecorations[v24->uDecorationDescID].field_20; | |
8 | 4973 //goto LABEL_87; |
4974 sub_41C0B8_set_status_string(v26); | |
4975 if ( pMouse->uPointingObjectID == 0 ) | |
4976 { | |
4977 if ( uLastPointedObjectID != 0 ) | |
4978 { | |
4979 pStatusBarString[0] = 0; | |
4980 bForceDrawStatusBar = 1; | |
4981 } | |
4982 } | |
4983 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4984 return; | |
0 | 4985 } |
4986 v22 = _444732_GetEventHintString(v25); | |
4987 if ( !v22 ) | |
8 | 4988 //goto _return; |
4989 { | |
4990 if ( pMouse->uPointingObjectID == 0 ) | |
4991 { | |
4992 if ( uLastPointedObjectID != 0 ) | |
4993 { | |
4994 pStatusBarString[0] = 0; | |
4995 bForceDrawStatusBar = 1; | |
4996 } | |
4997 } | |
4998 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4999 return; | |
5000 } | |
5001 //goto LABEL_93; | |
5002 v26 = v22; | |
5003 //goto LABEL_87; | |
5004 sub_41C0B8_set_status_string(v26); | |
5005 if ( pMouse->uPointingObjectID == 0 ) | |
5006 { | |
5007 if ( uLastPointedObjectID != 0 ) | |
5008 { | |
5009 pStatusBarString[0] = 0; | |
5010 bForceDrawStatusBar = 1; | |
5011 } | |
5012 } | |
5013 uLastPointedObjectID = pMouse->uPointingObjectID; | |
5014 return; | |
0 | 5015 } |
141 | 5016 if ( (v18 & 7) == OBJECT_BModel) |
0 | 5017 { |
5018 if ( v18 < (signed int)0x2000000u ) | |
5019 { | |
5020 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor) | |
5021 { | |
5022 v21 = pOutdoor->pBModels[(signed int)(unsigned __int16)v18 >> 9].pFaces[v19 & 0x3F].sCogTriggeredID; | |
8 | 5023 //goto LABEL_71; |
5024 if ( !v21 || (v22 = _444732_GetEventHintString(v21)) == 0 ) | |
5025 //goto LABEL_73; | |
5026 { | |
5027 pMouse->uPointingObjectID = 0; | |
5028 //goto LABEL_50; | |
5029 uLastPointedObjectID = 1; | |
5030 if ( pMouse->uPointingObjectID == 0 ) | |
5031 { | |
5032 if ( uLastPointedObjectID != 0 ) | |
5033 { | |
5034 pStatusBarString[0] = 0; | |
5035 bForceDrawStatusBar = 1; | |
5036 } | |
5037 } | |
5038 uLastPointedObjectID = pMouse->uPointingObjectID; | |
5039 return; | |
5040 } | |
5041 //goto LABEL_93; | |
5042 v26 = v22; | |
5043 //goto LABEL_87; | |
5044 sub_41C0B8_set_status_string(v26); | |
5045 if ( pMouse->uPointingObjectID == 0 ) | |
5046 { | |
5047 if ( uLastPointedObjectID != 0 ) | |
5048 { | |
5049 pStatusBarString[0] = 0; | |
5050 bForceDrawStatusBar = 1; | |
5051 } | |
5052 } | |
5053 uLastPointedObjectID = pMouse->uPointingObjectID; | |
5054 return; | |
0 | 5055 } |
5056 pFace = &pIndoor->pFaces[v19]; | |
5057 if ( BYTE3(pFace->uAttributes) & 6 ) | |
5058 { | |
5059 v21 = pIndoor->pFaceExtras[pFace->uFaceExtraID].uEventID; | |
8 | 5060 //LABEL_71: |
0 | 5061 if ( !v21 || (v22 = _444732_GetEventHintString(v21)) == 0 ) |
8 | 5062 //goto LABEL_73; |
5063 { | |
5064 pMouse->uPointingObjectID = 0; | |
5065 //goto LABEL_50; | |
5066 uLastPointedObjectID = 1; | |
5067 if ( pMouse->uPointingObjectID == 0 ) | |
5068 { | |
5069 if ( uLastPointedObjectID != 0 ) | |
5070 { | |
5071 pStatusBarString[0] = 0; | |
5072 bForceDrawStatusBar = 1; | |
5073 } | |
5074 } | |
5075 uLastPointedObjectID = pMouse->uPointingObjectID; | |
5076 return; | |
5077 } | |
5078 //goto LABEL_93; | |
5079 v26 = v22; | |
5080 //goto LABEL_87; | |
5081 sub_41C0B8_set_status_string(v26); | |
5082 if ( pMouse->uPointingObjectID == 0 ) | |
5083 { | |
5084 if ( uLastPointedObjectID != 0 ) | |
5085 { | |
5086 pStatusBarString[0] = 0; | |
5087 bForceDrawStatusBar = 1; | |
5088 } | |
5089 } | |
5090 uLastPointedObjectID = pMouse->uPointingObjectID; | |
5091 return; | |
0 | 5092 } |
5093 } | |
8 | 5094 //LABEL_73: |
0 | 5095 pMouse->uPointingObjectID = 0; |
8 | 5096 //goto LABEL_50; |
5097 uLastPointedObjectID = 1; | |
5098 if ( pMouse->uPointingObjectID == 0 ) | |
5099 { | |
5100 if ( uLastPointedObjectID != 0 ) | |
5101 { | |
5102 pStatusBarString[0] = 0; | |
5103 bForceDrawStatusBar = 1; | |
5104 } | |
5105 } | |
5106 uLastPointedObjectID = pMouse->uPointingObjectID; | |
5107 return; | |
0 | 5108 } |
8 | 5109 //LABEL_61: |
0 | 5110 pMouse->uPointingObjectID = 0; |
8 | 5111 //goto _return; |
5112 if ( pMouse->uPointingObjectID == 0 ) | |
5113 { | |
5114 if ( uLastPointedObjectID != 0 ) | |
5115 { | |
5116 pStatusBarString[0] = 0; | |
5117 bForceDrawStatusBar = 1; | |
5118 } | |
5119 } | |
5120 uLastPointedObjectID = pMouse->uPointingObjectID; | |
5121 return; | |
0 | 5122 } |
5123 if ( v18 >= 335544320 ) | |
8 | 5124 //goto LABEL_61; |
5125 { | |
5126 pMouse->uPointingObjectID = 0; | |
5127 if ( pMouse->uPointingObjectID == 0 ) | |
5128 { | |
5129 if ( uLastPointedObjectID != 0 ) | |
5130 { | |
5131 pStatusBarString[0] = 0; | |
5132 bForceDrawStatusBar = 1; | |
5133 } | |
5134 } | |
5135 uLastPointedObjectID = pMouse->uPointingObjectID; | |
5136 return; | |
5137 } | |
0 | 5138 pActor = &pActors[v19]; |
5139 v28 = pTmpBuf; | |
5140 v29 = pActor->dword_000334_unique_name; | |
5141 if ( v29 ) | |
237 | 5142 v40 = pMonsterStats->pPlaceStrings[v29]; |
0 | 5143 else |
5144 v40 = pMonsterStats->pInfos[pActor->pMonsterInfo.uID].pName; | |
5145 strncpy(pTmpBuf, v40, 0x7D0u); | |
5146 } | |
5147 v26 = v28; | |
8 | 5148 //LABEL_87: |
0 | 5149 sub_41C0B8_set_status_string(v26); |
8 | 5150 //goto _return; |
5151 if ( pMouse->uPointingObjectID == 0 ) | |
5152 { | |
5153 if ( uLastPointedObjectID != 0 ) | |
5154 { | |
5155 pStatusBarString[0] = 0; | |
5156 bForceDrawStatusBar = 1; | |
5157 } | |
5158 } | |
5159 uLastPointedObjectID = pMouse->uPointingObjectID; | |
5160 return; | |
0 | 5161 } |
5162 v1 = uNumVisibleWindows; | |
5163 if ( uNumVisibleWindows <= 0 ) | |
5164 { | |
5165 LABEL_38: | |
151 | 5166 if ( pCurrentScreen == SCREEN_CHEST ) |
0 | 5167 { |
5168 sub_42038D(); | |
8 | 5169 //goto _return; |
5170 if ( pMouse->uPointingObjectID == 0 ) | |
5171 { | |
5172 if ( uLastPointedObjectID != 0 ) | |
5173 { | |
5174 pStatusBarString[0] = 0; | |
5175 bForceDrawStatusBar = 1; | |
5176 } | |
5177 } | |
5178 uLastPointedObjectID = pMouse->uPointingObjectID; | |
5179 return; | |
0 | 5180 } |
151 | 5181 if ( pCurrentScreen == SCREEN_HOUSE ) |
0 | 5182 { |
5183 if ( dword_F8B19C != 2 | |
5184 || (v16 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]], v16 == 0) | |
5185 || v16 == -65536 ) | |
8 | 5186 //goto _return; |
5187 { | |
5188 if ( pMouse->uPointingObjectID == 0 ) | |
5189 { | |
5190 if ( uLastPointedObjectID != 0 ) | |
5191 { | |
5192 pStatusBarString[0] = 0; | |
5193 bForceDrawStatusBar = 1; | |
5194 } | |
5195 } | |
5196 uLastPointedObjectID = pMouse->uPointingObjectID; | |
5197 return; | |
5198 } | |
336 | 5199 pItemGen = (ItemGen *)((char *)&pParty->pPickedItem + 36 * (v16 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 4); |
8 | 5200 //LABEL_49: |
5201 v17 = pItemGen->GetDisplayName(); | |
0 | 5202 sub_41C0B8_set_status_string(v17); |
8 | 5203 //LABEL_50: |
0 | 5204 uLastPointedObjectID = 1; |
8 | 5205 //_return: |
0 | 5206 if ( pMouse->uPointingObjectID == 0 ) |
5207 { | |
5208 if ( uLastPointedObjectID != 0 ) | |
5209 { | |
5210 pStatusBarString[0] = 0; | |
5211 bForceDrawStatusBar = 1; | |
5212 } | |
5213 } | |
5214 uLastPointedObjectID = pMouse->uPointingObjectID; | |
5215 return; | |
5216 } | |
5217 if ( (signed int)pY < 350 ) | |
5218 { | |
5219 v14 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; | |
5220 if ( v14 == 0 || v14 == -65536 || (unsigned int)v14 >= 0x1388 ) | |
8 | 5221 //goto _return; |
5222 { | |
5223 if ( pMouse->uPointingObjectID == 0 ) | |
5224 { | |
5225 if ( uLastPointedObjectID != 0 ) | |
5226 { | |
5227 pStatusBarString[0] = 0; | |
5228 bForceDrawStatusBar = 1; | |
5229 } | |
5230 } | |
5231 uLastPointedObjectID = pMouse->uPointingObjectID; | |
5232 return; | |
5233 } | |
232 | 5234 pItemGen = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItems[v14-1]; |
8 | 5235 //goto LABEL_49; |
5236 v17 = pItemGen->GetDisplayName(); | |
5237 sub_41C0B8_set_status_string(v17); | |
5238 uLastPointedObjectID = 1; | |
5239 if ( pMouse->uPointingObjectID == 0 ) | |
5240 { | |
5241 if ( uLastPointedObjectID != 0 ) | |
5242 { | |
5243 pStatusBarString[0] = 0; | |
5244 bForceDrawStatusBar = 1; | |
5245 } | |
5246 } | |
5247 uLastPointedObjectID = pMouse->uPointingObjectID; | |
5248 return; | |
0 | 5249 } |
5250 _click_on_game_ui: | |
5251 if ( (signed int)pX >= (signed int)pWindowList[0].uFrameX | |
5252 && (signed int)pX <= (signed int)pWindowList[0].uFrameZ | |
5253 && (signed int)pY >= (signed int)pWindowList[0].uFrameY | |
5254 && (signed int)pY <= (signed int)pWindowList[0].uFrameW ) | |
5255 { | |
8 | 5256 for ( pButton = pWindowList[0].pControlsHead; pButton != (GUIButton *)0; pButton = pButton->pNext ) |
5257 { | |
5258 if ( pButton->uButtonType == 1 ) | |
0 | 5259 { |
8 | 5260 if ( (signed int)pX >= (signed int)pButton->uX |
5261 && (signed int)pX <= (signed int)pButton->uZ | |
5262 && (signed int)pY >= (signed int)pButton->uY | |
5263 && (signed int)pY <= (signed int)pButton->uW ) | |
0 | 5264 { |
8 | 5265 pMessageType3 = (UIMessageType)pButton->field_1C; |
17 | 5266 if ( pMessageType3 == 0 ) // For books |
8 | 5267 //goto LABEL_28; |
5268 { | |
5269 v13 = pButton->pButtonName; | |
5270 sub_41C0B8_set_status_string(v13); | |
5271 uLastPointedObjectID = 1; | |
5272 return; | |
5273 } | |
5274 v38 = pButton->uControlParam; | |
0 | 5275 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) |
5276 { | |
8 | 5277 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType3; |
0 | 5278 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v38; |
5279 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
5280 ++pMessageQueue_50CBD0->uNumMessages; | |
5281 } | |
8 | 5282 //goto LABEL_131; |
0 | 5283 uLastPointedObjectID = 1; |
5284 return; | |
5285 } | |
5286 } | |
5287 else | |
5288 { | |
8 | 5289 if ( pButton->uButtonType == 2 ) |
0 | 5290 { |
8 | 5291 v45 = pX - pButton->uX; |
5292 v45 = pY - pButton->uY; | |
5293 | |
5294 if (pX >= pButton->uX && pX <= pButton->uZ && | |
5295 pY >= pButton->uY && pY <= pButton->uW) | |
5296 if ( (double)(signed int)pButton->uWidth != 0.0 ) | |
0 | 5297 { |
8 | 5298 if ( (double)(signed int)pButton->uHeight != 0.0 ) |
0 | 5299 { |
8 | 5300 //UNDEF(v32); |
14 | 5301 //if ( v33 | v34 ) |
5302 //{ | |
8 | 5303 pMessageType2 = (UIMessageType)pButton->field_1C; |
5304 if ( pMessageType2 != 0 ) | |
5305 { | |
5306 v36 = pButton->uControlParam; | |
5307 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
5308 { | |
5309 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType2; | |
5310 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v36; | |
5311 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
5312 //goto LABEL_27; | |
5313 ++pMessageQueue_50CBD0->uNumMessages; | |
5314 v13 = pButton->pButtonName; | |
5315 sub_41C0B8_set_status_string(v13); | |
5316 uLastPointedObjectID = 1; | |
5317 return; | |
5318 } | |
5319 } | |
5320 //goto LABEL_28; | |
5321 v13 = pButton->pButtonName; | |
5322 sub_41C0B8_set_status_string(v13); | |
5323 uLastPointedObjectID = 1; | |
5324 return; | |
14 | 5325 //} |
0 | 5326 } |
5327 } | |
5328 } | |
8 | 5329 else |
0 | 5330 { |
8 | 5331 if ( pButton->uButtonType == 3 |
5332 && (signed int)pX >= (signed int)pButton->uX | |
5333 && (signed int)pX <= (signed int)pButton->uZ | |
5334 && (signed int)pY >= (signed int)pButton->uY | |
5335 && (signed int)pY <= (signed int)pButton->uW ) | |
5336 //goto LABEL_19; | |
0 | 5337 { |
8 | 5338 pPlayer = pPlayers[uActiveCharacter]; |
5339 v5 = LOBYTE(pPlayer->pActiveSkills[pButton->uControlParam]); | |
5340 v6 = pPlayer->uSkillPoints; | |
0 | 5341 v7 = (v5 & 0x3F) + 1; |
5342 if ( v6 < v7 ) | |
5343 { | |
5344 v41 = v7 - v6; | |
5345 v39 = pGlobalTXT_LocalizationStrings[469];// "You need %d more Skill Points to advance here" | |
5346 } | |
5347 else | |
5348 { | |
5349 v41 = v7; | |
5350 v39 = pGlobalTXT_LocalizationStrings[468];// "Clicking here will spend %d Skill Points" | |
5351 } | |
5352 sprintf(Str1, v39, v41); | |
5353 v13 = Str1; | |
8 | 5354 //goto _set_status_and_ret; |
5355 sub_41C0B8_set_status_string(v13); | |
5356 uLastPointedObjectID = 1; | |
5357 return; | |
0 | 5358 } |
5359 } | |
5360 } | |
5361 } | |
5362 } | |
8 | 5363 pMouse->uPointingObjectID = sub_46A99B(); |
5364 //goto _return; | |
5365 if ( pMouse->uPointingObjectID == 0 ) | |
5366 { | |
5367 if ( uLastPointedObjectID != 0 ) | |
5368 { | |
5369 pStatusBarString[0] = 0; | |
5370 bForceDrawStatusBar = 1; | |
5371 } | |
5372 } | |
5373 uLastPointedObjectID = pMouse->uPointingObjectID; | |
5374 return; | |
5375 } | |
5376 while ( 1 ) // some other fullscreen ui | |
5377 { | |
5378 pWindow = &pWindowList[pVisibleWindowsIdxs[v1] - 1]; | |
5379 if ( (signed int)pX >= (signed int)pWindow->uFrameX | |
5380 && (signed int)pX <= (signed int)pWindow->uFrameZ | |
5381 && (signed int)pY >= (signed int)pWindow->uFrameY | |
5382 && (signed int)pY <= (signed int)pWindow->uFrameW ) | |
5383 { | |
5384 for ( pButton = pWindow->pControlsHead; ; pButton = pButton->pNext ) | |
5385 { | |
5386 if ( !pButton ) | |
5387 break; | |
5388 if ( pButton->uButtonType == 1 ) | |
5389 { | |
5390 if ( (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_24: | |
5396 pMessageType1 = (UIMessageType)pButton->field_1C; | |
5397 if ( pMessageType1 ) | |
5398 { | |
5399 v12 = pButton->uControlParam; | |
5400 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
5401 { | |
5402 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType1; | |
5403 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v12; | |
5404 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
5405 //LABEL_27: | |
5406 ++pMessageQueue_50CBD0->uNumMessages; | |
5407 } | |
5408 } | |
5409 //LABEL_28: | |
5410 v13 = pButton->pButtonName; | |
5411 //_set_status_and_ret: | |
5412 sub_41C0B8_set_status_string(v13); | |
5413 //LABEL_131: | |
5414 uLastPointedObjectID = 1; | |
5415 return; | |
5416 } | |
5417 } | |
5418 else | |
5419 { | |
5420 if ( pButton->uButtonType == 2 ) | |
5421 { | |
5422 v45 = pX - pButton->uX; | |
5423 v45 = pY - pButton->uY; | |
5424 if ( (double)(signed int)pButton->uWidth != 0.0 ) | |
5425 { | |
5426 if ( (double)(signed int)pButton->uHeight != 0.0 ) | |
5427 { | |
5428 //UNDEF(v8); | |
14 | 5429 //if ( v9 | v10 ) |
8 | 5430 //goto LABEL_24; |
14 | 5431 //{ |
8 | 5432 pMessageType1 = (UIMessageType)pButton->field_1C; |
5433 if ( pMessageType1 ) | |
5434 { | |
5435 v12 = pButton->uControlParam; | |
5436 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
5437 { | |
5438 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType1; | |
5439 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v12; | |
5440 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
5441 ++pMessageQueue_50CBD0->uNumMessages; | |
5442 } | |
5443 } | |
5444 v13 = pButton->pButtonName; | |
5445 sub_41C0B8_set_status_string(v13); | |
5446 uLastPointedObjectID = 1; | |
5447 return; | |
14 | 5448 //} |
8 | 5449 } |
5450 } | |
5451 } | |
5452 else // click on skill | |
5453 { | |
5454 if ( pButton->uButtonType == 3 | |
5455 && (signed int)pX >= (signed int)pButton->uX | |
5456 && (signed int)pX <= (signed int)pButton->uZ | |
5457 && (signed int)pY >= (signed int)pButton->uY | |
5458 && (signed int)pY <= (signed int)pButton->uW ) | |
5459 { | |
5460 //LABEL_19: | |
5461 pPlayer = pPlayers[uActiveCharacter]; | |
5462 v5 = LOBYTE(pPlayer->pActiveSkills[pButton->uControlParam]); | |
5463 v6 = pPlayer->uSkillPoints; | |
5464 v7 = (v5 & 0x3F) + 1; | |
5465 if ( v6 < v7 ) | |
5466 { | |
5467 v41 = v7 - v6; | |
5468 v39 = pGlobalTXT_LocalizationStrings[469];// "You need %d more Skill Points to advance here" | |
5469 } | |
5470 else | |
5471 { | |
5472 v41 = v7; | |
5473 v39 = pGlobalTXT_LocalizationStrings[468];// "Clicking here will spend %d Skill Points" | |
5474 } | |
5475 sprintf(Str1, v39, v41); | |
5476 v13 = Str1; | |
5477 //goto _set_status_and_ret; | |
5478 sub_41C0B8_set_status_string(v13); | |
5479 uLastPointedObjectID = 1; | |
5480 return; | |
5481 } | |
5482 } | |
5483 } | |
5484 } | |
5485 } | |
5486 if ( pWindow->uFrameHeight == 480 ) | |
0 | 5487 break; |
5488 --v1; | |
5489 if ( v1 <= 0 ) | |
5490 { | |
5491 goto LABEL_38; | |
5492 } | |
5493 } | |
5494 } | |
5495 | |
5496 | |
5497 //----- (00421626) -------------------------------------------------------- | |
5498 GUIWindow *GameUI_InitializeCharacterWindow(unsigned int _this) | |
5499 { | |
5500 unsigned int v1; // edi@1 | |
11 | 5501 GUIWindow *pWindow; // edi@3 |
0 | 5502 |
5503 ++pIcons_LOD->uTexturePacksCount; | |
5504 v1 = _this; | |
5505 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | |
5506 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
5507 pEventTimer->Pause(); | |
5508 pAudioPlayer->StopChannels(-1, -1); | |
5509 bRingsShownInCharScreen = 0; | |
5510 CharacterUI_LoadPaperdollTextures(); | |
5511 pCurrentScreen = v1; | |
11 | 5512 pWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_CharacterRecord, uActiveCharacter, 0); |
5513 pCharacterScreen_StatsBtn = pWindow->CreateButton(pViewport->uViewportX + 12, pViewport->uViewportY + 308, | |
0 | 5514 (papredoll_dbrds[9] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[9]].uTextureWidth : 24), |
5515 (papredoll_dbrds[9] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[9]].uTextureHeight : 26), | |
11 | 5516 1, 0, 0x73u, 0, 0x53u, pGlobalTXT_LocalizationStrings[216],// Stats |
0 | 5517 (Texture *)(papredoll_dbrds[10] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[10]] : 0), |
11 | 5518 papredoll_dbrds[9] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[9]] : 0, 0); |
5519 pCharacterScreen_SkillsBtn = pWindow->CreateButton(pViewport->uViewportX + 102, pViewport->uViewportY + 308, | |
0 | 5520 (papredoll_dbrds[7] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[7]].uTextureWidth : 24), |
5521 (papredoll_dbrds[7] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[7]].uTextureHeight : 26), | |
11 | 5522 1, 0, 0x72u, 0, 0x4Bu, pGlobalTXT_LocalizationStrings[205],//Skills |
0 | 5523 (Texture *)(papredoll_dbrds[8] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[8]] : 0), |
11 | 5524 papredoll_dbrds[7] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[7]] : 0, 0); |
5525 pCharacterScreen_InventoryBtn = pWindow->CreateButton(pViewport->uViewportX + 192, pViewport->uViewportY + 308, | |
0 | 5526 (papredoll_dbrds[5] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[5]].uTextureWidth : 24), |
5527 (papredoll_dbrds[5] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[5]].uTextureHeight : 26), | |
11 | 5528 1, 0, 0x74u, 0, 0x49u, pGlobalTXT_LocalizationStrings[120], //Inventory |
0 | 5529 (Texture *)(papredoll_dbrds[6] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[6]] : 0), |
11 | 5530 papredoll_dbrds[5] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[5]] : 0, 0); |
5531 pCharacterScreen_AwardsBtn = pWindow->CreateButton(pViewport->uViewportX + 282, pViewport->uViewportY + 308, | |
0 | 5532 (papredoll_dbrds[3] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[3]].uTextureWidth : 24), |
5533 (papredoll_dbrds[3] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[3]].uTextureHeight : 26), | |
11 | 5534 1, 0, 0x75u, 0, 0x41u, pGlobalTXT_LocalizationStrings[22], //Awards |
0 | 5535 (Texture *)(papredoll_dbrds[4] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[4]] : 0), |
11 | 5536 papredoll_dbrds[3] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[3]] : 0, 0); |
5537 pCharacterScreen_ExitBtn = pWindow->CreateButton(pViewport->uViewportX + 371, pViewport->uViewportY + 308, | |
0 | 5538 (papredoll_dbrds[1] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[1]].uTextureWidth : 24), |
5539 (papredoll_dbrds[1] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[1]].uTextureHeight : 26), | |
11 | 5540 1, 0, 0xA8u, 0, 0, pGlobalTXT_LocalizationStrings[79],//Exit |
0 | 5541 (Texture *)(papredoll_dbrds[2] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[2]] : 0), |
11 | 5542 papredoll_dbrds[1] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[1]] : 0, 0); |
5543 pWindow->CreateButton(0, 0, 0x1DCu, 0x159u, 1, 122, 0x78u, 0, 0, "", 0); | |
5544 pCharacterScreen_DetalizBtn = pWindow->CreateButton(0x258u, 0x12Cu, 0x1Eu, 0x1Eu, 1, 0, 0x55u, 0, 0, pGlobalTXT_LocalizationStrings[64], 0); | |
5545 pCharacterScreen_DollBtn = pWindow->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, 0x85u, 0, 0, "", 0); | |
5546 pWindow->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0); | |
5547 pWindow->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0); | |
5548 pWindow->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0); | |
5549 pWindow->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0); | |
5550 pWindow->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, "", 0); | |
0 | 5551 sub_419100(); |
11 | 5552 return pWindow; |
0 | 5553 } |
5554 | |
5555 | |
5556 | |
5557 //----- (004219BE) -------------------------------------------------------- | |
5558 GUIWindow *stru277::sub_4219BE() | |
5559 { | |
5560 int v1; // esi@1 | |
5561 GUIWindow *v2; // ebx@1 | |
5562 | |
5563 auto a4 = this; | |
5564 v1 = (int)a4; | |
5565 pEventTimer->Pause(); | |
5566 pAudioPlayer->StopChannels(-1, -1); | |
5567 bRingsShownInCharScreen = 0; | |
5568 CharacterUI_LoadPaperdollTextures(); | |
151 | 5569 pCurrentScreen = SCREEN_CASTING; |
0 | 5570 v2 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|WINDOW_Options), v1, 0); |
5571 pCharacterScreen_ExitBtn = v2->CreateButton( | |
5572 394u, | |
5573 318u, | |
5574 75u, | |
5575 33u, | |
5576 1, | |
5577 0, | |
5578 0xA8u, | |
5579 0, | |
5580 0, | |
5581 pGlobalTXT_LocalizationStrings[79], | |
5582 (Texture *)(papredoll_dbrds[2] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[2]] : 0), | |
5583 papredoll_dbrds[1] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[1]] : 0, | |
5584 0); | |
5585 v2->CreateButton(0, 0, 0x1DCu, 0x159u, 1, 122, 0x78u, 0, 0, "", 0); | |
5586 pCharacterScreen_DollBtn = v2->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, 0x85u, 0, 0, "", 0); | |
5587 v2->CreateButton(61u, 424u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0); | |
5588 v2->CreateButton(177u, 424u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0); | |
5589 v2->CreateButton(292u, 424u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0); | |
5590 v2->CreateButton(407u, 424u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0); | |
5591 return v2; | |
5592 } | |
5593 | |
5594 | |
5595 //----- (00421B2C) -------------------------------------------------------- | |
5596 bool __cdecl sub_421B2C_PlaceInInventory_or_DropPickedItem() | |
5597 { | |
5598 unsigned int v0; // eax@2 | |
5599 Texture *v1; // ebx@2 | |
5600 int v2; // eax@3 | |
5601 Player *v3; // esi@5 | |
5602 int v4; // eax@6 | |
5603 unsigned __int16 v5; // dx@11 | |
5604 signed int v6; // eax@11 | |
5605 char *v7; // edi@12 | |
5606 __int16 v8; // ax@16 | |
5607 LayingItem a1; // [sp+4h] [bp-78h]@11 | |
5608 int v11; // [sp+74h] [bp-8h]@2 | |
5609 int v12; // [sp+78h] [bp-4h]@5 | |
5610 | |
5611 if ( !pParty->pPickedItem.uItemID ) | |
5612 return 1; | |
5613 v0 = pIcons_LOD->LoadTexture( | |
5614 pItemsTable->pItems[pParty->pPickedItem.uItemID].pIconName, | |
5615 TEXTURE_16BIT_PALETTE); | |
5616 v1 = (Texture *)(v0 != -1 ? (int)&pIcons_LOD->pTextures[v0] : 0); | |
5617 v11 = areWeLoadingTexture; | |
5618 if ( uActiveCharacter | |
5619 && (v2 = pPlayers[uActiveCharacter]->AddItem(0xFFFFFFFFu, pParty->pPickedItem.uItemID)) != 0 ) | |
5620 { | |
232 | 5621 memcpy(&pPlayers[uActiveCharacter]->pInventoryItems[v2-1], &pParty->pPickedItem, 0x24u); |
244 | 5622 pMouse->RemoveHoldingItem(); |
0 | 5623 } |
5624 else | |
5625 { | |
5626 v12 = 0; | |
5627 v3 = pParty->pPlayers; | |
244 | 5628 while ( v3 <= &pParty->pPlayers[3] ) |
0 | 5629 { |
5630 v4 = v3->AddItem(0xFFFFFFFFu, pParty->pPickedItem.uItemID); | |
5631 if ( v4 ) | |
244 | 5632 { |
5633 memcpy(&pParty->pPlayers[v12].pInventoryItems[v4], &pParty->pPickedItem, 0x24u); | |
5634 pMouse->RemoveHoldingItem(); | |
5635 break; | |
5636 } | |
5637 ++v12; | |
0 | 5638 ++v3; |
244 | 5639 } |
5640 if ( v12 == 4 ) | |
5641 { | |
5642 v5 = pItemsTable->pItems[pParty->pPickedItem.uItemID].uSpriteID; | |
5643 v6 = 0; | |
5644 a1.uItemType = pItemsTable->pItems[pParty->pPickedItem.uItemID].uSpriteID; | |
5645 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
5646 { | |
5647 LOWORD(v6) = 0; | |
5648 } | |
5649 else | |
5650 { | |
5651 v7 = (char *)&pObjectList->pObjects->uObjectID; | |
5652 while ( v5 != *(short *)v7 ) | |
5653 { | |
5654 ++v6; | |
5655 v7 += 56; | |
5656 if ( v6 >= (signed int)pObjectList->uNumObjects ) | |
5657 { | |
5658 LOWORD(v6) = 0; | |
5659 break; | |
5660 } | |
5661 } | |
5662 } | |
303 | 5663 a1.field_58_pid = OBJECT_Player; |
244 | 5664 a1.uObjectDescID = v6; |
5665 a1.vPosition.y = pParty->vPosition.y; | |
5666 a1.vPosition.x = pParty->vPosition.x; | |
5667 a1.vPosition.z = pParty->sEyelevel + pParty->vPosition.z; | |
5668 a1.uSoundID = 0; | |
5669 a1.uFacing = 0; | |
5670 a1.uAttributes = 8; | |
5671 v8 = pIndoor->GetSector( | |
5672 pParty->vPosition.x, | |
5673 pParty->vPosition.y, | |
5674 pParty->sEyelevel + pParty->vPosition.z); | |
5675 a1.uSpriteFrameID = 0; | |
5676 a1.uSectorID = v8; | |
5677 memcpy(&a1.stru_24, &pParty->pPickedItem, sizeof(a1.stru_24)); | |
5678 a1.Create(pParty->sRotationY, 184, 200, 0); | |
5679 pMouse->RemoveHoldingItem(); | |
5680 } | |
5681 } | |
0 | 5682 if ( !v11 ) |
5683 { | |
5684 v1->Release(); | |
5685 pIcons_LOD->_40F9C5(); | |
5686 } | |
5687 return 1; | |
5688 } | |
5689 | |
5690 | |
5691 //----- (00421D00) -------------------------------------------------------- | |
5692 void __fastcall GameUI_OnPlayerPortraitLeftClick(unsigned int uPlayerID) | |
5693 { | |
201 | 5694 //unsigned int v1; // esi@1 |
5695 //int v2; // eax@2 | |
5696 //Player *v3; // ecx@2 | |
5697 //Player *v4; // ecx@5 | |
0 | 5698 unsigned int v5; // [sp-4h] [bp-10h]@21 |
5699 | |
201 | 5700 //v1 = uPlayerID; |
5701 auto player = &pParty->pPlayers[uPlayerID - 1]; | |
5702 if (pParty->pPickedItem.uItemID) | |
5703 { | |
5704 //v3 = player; | |
5705 if (auto slot = player->AddItem(0xFFFFFFFFu, pParty->pPickedItem.uItemID)) | |
5706 { | |
232 | 5707 memcpy(&player->pInventoryItems[slot-1], &pParty->pPickedItem, 0x24u); |
201 | 5708 viewparams->bRedrawGameUI = true; |
0 | 5709 pMouse->RemoveHoldingItem(); |
5710 return; | |
5711 } | |
201 | 5712 |
5713 if (!player->CanAct()) | |
5714 { | |
5715 if ( pPlayers[uActiveCharacter]->CanAct()) | |
0 | 5716 goto LABEL_9; |
201 | 5717 player = pPlayers[uActiveCharacter]; |
5718 } | |
5719 player->PlaySound(SPEECH_NoRoom, 0); | |
5720 } | |
5721 | |
0 | 5722 LABEL_9: |
201 | 5723 if (pCurrentScreen == SCREEN_GAME) |
5724 { | |
5725 viewparams->bRedrawGameUI = true; | |
5726 if ( uActiveCharacter != uPlayerID ) | |
11 | 5727 //goto LABEL_27; |
5728 { | |
201 | 5729 if ( pPlayers[uPlayerID]->uTimeToRecovery ) |
11 | 5730 return; |
201 | 5731 |
5732 uActiveCharacter = uPlayerID; | |
11 | 5733 return; |
5734 } | |
0 | 5735 v5 = 7; |
11 | 5736 //LABEL_22: |
0 | 5737 pGUIWindow_CurrentMenu = GameUI_InitializeCharacterWindow(v5); |
5738 return; | |
5739 } | |
151 | 5740 if ( pCurrentScreen == SCREEN_SPELL_BOOK ) |
0 | 5741 return; |
151 | 5742 if ( pCurrentScreen == SCREEN_CHEST ) |
0 | 5743 { |
11 | 5744 //LABEL_23: |
201 | 5745 viewparams->bRedrawGameUI = true; |
5746 if ( uActiveCharacter == uPlayerID ) | |
0 | 5747 { |
5748 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; | |
151 | 5749 pCurrentScreen = SCREEN_F; |
11 | 5750 //goto LABEL_28; |
201 | 5751 uActiveCharacter = uPlayerID; |
11 | 5752 return; |
5753 } | |
5754 //LABEL_27: | |
201 | 5755 if ( pPlayers[uPlayerID]->uTimeToRecovery ) |
0 | 5756 return; |
11 | 5757 //goto LABEL_28; |
201 | 5758 uActiveCharacter = uPlayerID; |
11 | 5759 return; |
0 | 5760 } |
151 | 5761 if ( pCurrentScreen != SCREEN_HOUSE ) |
5762 { | |
5763 if ( pCurrentScreen == SCREEN_E ) | |
0 | 5764 { |
11 | 5765 //LABEL_28: |
201 | 5766 uActiveCharacter = uPlayerID; |
0 | 5767 return; |
5768 } | |
151 | 5769 if ( pCurrentScreen != SCREEN_F ) |
0 | 5770 { |
201 | 5771 viewparams->bRedrawGameUI = true; |
5772 uActiveCharacter = uPlayerID; | |
0 | 5773 if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 102 ) |
5774 sub_419100(); | |
5775 return; | |
5776 } | |
11 | 5777 //goto LABEL_23; |
201 | 5778 viewparams->bRedrawGameUI = true; |
5779 if ( uActiveCharacter == uPlayerID ) | |
11 | 5780 { |
5781 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; | |
151 | 5782 pCurrentScreen = SCREEN_F; |
11 | 5783 //goto LABEL_28; |
201 | 5784 uActiveCharacter = uPlayerID; |
11 | 5785 return; |
5786 } | |
5787 //LABEL_27: | |
201 | 5788 if ( pPlayers[uPlayerID]->uTimeToRecovery ) |
11 | 5789 return; |
5790 //goto LABEL_28; | |
201 | 5791 uActiveCharacter = uPlayerID; |
11 | 5792 return; |
0 | 5793 } |
336 | 5794 if ( window_SpeakInHouse->field_40 == 1 ) |
0 | 5795 return; |
201 | 5796 viewparams->bRedrawGameUI = true; |
5797 if ( uActiveCharacter != uPlayerID ) | |
11 | 5798 //goto LABEL_28; |
201 | 5799 uActiveCharacter = uPlayerID; |
11 | 5800 return; |
0 | 5801 if ( dword_F8B19C == 2 || dword_F8B19C == 6 ) |
5802 { | |
5803 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; | |
5804 v5 = 14; | |
11 | 5805 //goto LABEL_22; |
5806 pGUIWindow_CurrentMenu = GameUI_InitializeCharacterWindow(v5); | |
5807 return; | |
0 | 5808 } |
5809 } | |
5810 // 4E28F8: using guessed type int pCurrentScreen; | |
5811 // F8B19C: using guessed type int dword_F8B19C; | |
5812 | |
5813 //----- (00421EA6) -------------------------------------------------------- | |
5814 void __cdecl sub_421EA6_OnInventoryLeftClick() | |
5815 { | |
5816 Player *v0; // ebx@1 | |
5817 signed int v1; // eax@2 | |
5818 signed int v2; // ecx@2 | |
5819 int v3; // eax@2 | |
5820 char v4; // sf@2 | |
5821 int v5; // eax@2 | |
5822 unsigned int v6; // eax@7 | |
5823 unsigned int v7; // esi@12 | |
5824 unsigned int v8; // eax@12 | |
5825 unsigned int v9; // eax@16 | |
5826 unsigned int v10; // eax@18 | |
5827 ItemGen this_; // [sp+Ch] [bp-3Ch]@1 | |
5828 POINT a2; // [sp+30h] [bp-18h]@4 | |
5829 unsigned int v13; // [sp+38h] [bp-10h]@13 | |
5830 unsigned int pY; // [sp+3Ch] [bp-Ch]@2 | |
5831 unsigned int pX; // [sp+40h] [bp-8h]@2 | |
5832 int a4; // [sp+44h] [bp-4h]@2 | |
5833 | |
5834 v0 = pPlayers[uActiveCharacter]; | |
5835 if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] != 103 | |
5836 || (pMouse->GetClickPos(&pX, &pY), | |
5837 v1 = pY - 17, | |
5838 v2 = pX - 14, | |
5839 pY = v1, | |
5840 pX = v2, | |
5841 v3 = 14 * (v1 >> 5), | |
5842 v2 >>= 5, | |
5843 v4 = v2 + v3 < 0, | |
5844 v5 = v2 + v3, | |
5845 a4 = v5, | |
5846 v4) | |
5847 || v5 > 126 | |
5848 || pMouse->GetCursorPos(&a2)->x >= 462 | |
5849 || pMouse->GetCursorPos(&a2)->x < 14 ) | |
5850 return; | |
5851 if ( unk_50C9A0 ) | |
5852 { | |
5853 v6 = v0->GetItemIDAtInventoryIndex(&a4); | |
5854 if ( v6 ) | |
5855 { | |
5856 *((char *)pGUIWindow_Settings->ptr_1C + 8) &= 0x7Fu; | |
5857 *((short *)pGUIWindow_Settings->ptr_1C + 2) = uActiveCharacter - 1; | |
5858 *((int *)pGUIWindow_Settings->ptr_1C + 3) = v6 - 1; | |
5859 *((short *)pGUIWindow_Settings->ptr_1C + 3) = a4; | |
232 | 5860 ptr_50C9A4 = (ItemGen *)&v0->pInventoryItems[v6-1]; |
0 | 5861 unk_50C9A0 = 0; |
5862 if ( pMessageQueue_50CBD0->uNumMessages ) | |
5863 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
5864 pMouse->SetCursorBitmap("MICON1"); | |
5865 dword_50C9D0 = 113; | |
5866 dword_50C9D4 = 0; | |
5867 dword_50C9D8 = 256; | |
5868 } | |
5869 return; | |
5870 } | |
5871 if ( ptr_50C9A4 ) | |
5872 return; | |
5873 v7 = pParty->pPickedItem.uItemID; | |
5874 v8 = v0->GetItemIDAtInventoryIndex(&a4); | |
5875 if ( !v7 ) | |
5876 { | |
5877 if ( !v8 ) | |
5878 return; | |
232 | 5879 memcpy(&pParty->pPickedItem, &v0->pInventoryItems[v8-1], sizeof(pParty->pPickedItem)); |
0 | 5880 v0->RemoveItemAtInventoryIndex(a4); |
5881 v9 = pParty->pPickedItem.uItemID; | |
5882 goto LABEL_24; | |
5883 } | |
5884 v13 = v8; | |
5885 if ( v8 ) | |
5886 { | |
232 | 5887 a2.y = (LONG)&v0->pInventoryItems[v8-1]; |
0 | 5888 memcpy(&this_, (const void *)a2.y, sizeof(this_)); |
5889 v0->RemoveItemAtInventoryIndex(a4); | |
5890 pX = v0->AddItem2(a4, &pParty->pPickedItem); | |
5891 if ( !pX ) | |
5892 { | |
5893 pX = v0->AddItem2(0xFFFFFFFFu, &pParty->pPickedItem); | |
5894 if ( !pX ) | |
5895 { | |
5896 v0->_49298B(&this_, v13 - 1, a4); | |
5897 memcpy((void *)a2.y, &this_, sizeof(ItemGen)); | |
5898 return; | |
5899 } | |
5900 } | |
5901 v9 = this_.uItemID; | |
5902 memcpy(&pParty->pPickedItem, &this_, sizeof(pParty->pPickedItem)); | |
5903 LABEL_24: | |
5904 pMouse->SetCursorBitmap(pItemsTable->pItems[v9].pIconName); | |
5905 return; | |
5906 } | |
5907 v10 = v0->AddItem(a4, v7); | |
5908 pX = v10; | |
5909 if ( v10 || (v10 = v0->AddItem(0xFFFFFFFFu, pParty->pPickedItem.uItemID), (pX = v10) != 0) ) | |
5910 { | |
232 | 5911 memcpy(&v0->pInventoryItems[v10-1], &pParty->pPickedItem, 0x24u); |
0 | 5912 pMouse->RemoveHoldingItem(); |
5913 } | |
5914 } | |
5915 | |
5916 | |
5917 //----- (0042213C) -------------------------------------------------------- | |
5918 void __cdecl OnGameViewportClick() | |
5919 { | |
5920 signed int v0; // ebx@2 | |
5921 POINT *v1; // esi@3 | |
5922 signed int v2; // eax@9 | |
5923 BLVFace *v3; // eax@10 | |
5924 unsigned int v4; // eax@11 | |
5925 unsigned __int16 v5; // dx@14 | |
5926 signed int v6; // eax@14 | |
5927 char *v7; // esi@15 | |
5928 int *v8; // eax@19 | |
5929 int v9; // eax@19 | |
5930 unsigned int v10; // eax@19 | |
5931 int v11; // ecx@21 | |
5932 ODMFace *v12; // eax@22 | |
5933 LevelDecoration *v13; // esi@24 | |
5934 __int16 v14; // ax@25 | |
5935 int v15; // ecx@29 | |
5936 signed int v16; // edx@30 | |
5937 Actor *v17; // esi@30 | |
5938 int v18; // ebx@47 | |
5939 unsigned __int16 v19; // ax@50 | |
5940 const char *v20; // eax@51 | |
5941 signed int v21; // eax@58 | |
5942 ItemGen *v22; // esi@62 | |
5943 unsigned int v23; // eax@62 | |
5944 LayingItem a1; // [sp+Ch] [bp-80h]@1 | |
5945 POINT v25; // [sp+7Ch] [bp-10h]@3 | |
5946 POINT a2; // [sp+84h] [bp-8h]@3 | |
5947 | |
5948 if ( pRenderer->pRenderD3D ) | |
5949 { | |
5950 v0 = pGame->pVisInstance->get_picked_object_zbuf_val(); | |
5951 } | |
5952 else | |
5953 { | |
5954 v1 = pMouse->GetCursorPos(&a2); | |
5955 v0 = pRenderer->pActiveZBuffer[v1->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v25)->y]]; | |
5956 } | |
141 | 5957 if ( (v0 & 7) == OBJECT_Item) |
0 | 5958 { |
5959 a2.y = (signed int)(unsigned __int16)v0 >> 3; | |
5960 v21 = (signed int)(unsigned __int16)v0 >> 3; | |
5961 if ( !(pObjectList->pObjects[pLayingItems[v21].uObjectDescID].uFlags & 0x10) | |
5962 && a2.y < 1000 | |
5963 && pLayingItems[v21].uObjectDescID | |
5964 && (unsigned int)v0 < 0x2000000 ) | |
5965 { | |
5966 v22 = &pLayingItems[v21].stru_24; | |
5967 v23 = pLayingItems[v21].stru_24.uItemID; | |
5968 if ( pItemsTable->pItems[v23].uEquipType == 18 ) | |
5969 { | |
5970 party_finds_gold(v22->uAdditionalValue, 0); | |
5971 viewparams->bRedrawGameUI = 1; | |
5972 } | |
5973 else | |
5974 { | |
5975 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[v23].pUnidentifiedName); | |
5976 ShowStatusBarString(pTmpBuf2, 2u); | |
5977 if ( v22->uItemID == 506 ) | |
5978 _449B7E_toggle_bit(pParty->_award_bits, 184, 1u); | |
5979 if ( v22->uItemID == 455 ) | |
5980 _449B7E_toggle_bit(pParty->_award_bits, 185, 1u); | |
5981 if ( !pParty->AddItem(v22) ) | |
5982 pParty->SetHoldingItem(v22); | |
5983 } | |
5984 LayingItem::_42F933(a2.y); | |
5985 return; | |
5986 } | |
5987 goto LABEL_13; | |
5988 } | |
141 | 5989 if ( (v0 & 7) != OBJECT_Actor) |
5990 { | |
5991 if ( (v0 & 7) == OBJECT_Decoration) | |
0 | 5992 { |
5993 v13 = &pLevelDecorations[(signed int)(unsigned __int16)v0 >> 3]; | |
5994 if ( (signed int)(((unsigned int)v0 >> 16) - pDecorationList->pDecorations[v13->uDecorationDescID].uRadius) >= 512 ) | |
5995 goto LABEL_13; | |
5996 v14 = v13->field_16_event_id; | |
5997 if ( !v14 ) | |
5998 { | |
5999 if ( pLevelDecorations[(signed int)(unsigned __int16)v0 >> 3].IsInteractive() ) | |
6000 { | |
6001 v15 = stru_5E4C90._decor_events[v13->_idx_in_stru123 - 75] + 380; | |
6002 _5C3420_pDecoration = &pLevelDecorations[(signed int)(unsigned __int16)v0 >> 3]; | |
6003 EventProcessor(v15, 0, 1); | |
6004 _5C3420_pDecoration = 0; | |
6005 } | |
6006 return; | |
6007 } | |
6008 v11 = v14; | |
6009 } | |
6010 else | |
6011 { | |
141 | 6012 if ( (v0 & 7) != OBJECT_BModel || (unsigned int)v0 >= 0x2000000 ) |
0 | 6013 goto LABEL_13; |
6014 v2 = (signed int)(unsigned __int16)v0 >> 3; | |
6015 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
6016 { | |
6017 v3 = &pIndoor->pFaces[v2]; | |
6018 if ( !(v3->uAttributes & 0x2000000) ) | |
6019 { | |
6020 LABEL_11: | |
6021 v4 = pParty->pPickedItem.uItemID; | |
6022 if ( pParty->pPickedItem.uItemID ) | |
6023 { | |
6024 LABEL_14: | |
6025 v5 = pItemsTable->pItems[v4].uSpriteID; | |
6026 v6 = 0; | |
6027 a1.uItemType = v5; | |
6028 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
6029 { | |
6030 LABEL_18: | |
6031 LOWORD(v6) = 0; | |
6032 } | |
6033 else | |
6034 { | |
6035 v7 = (char *)&pObjectList->pObjects->uObjectID; | |
6036 while ( v5 != *(short *)v7 ) | |
6037 { | |
6038 ++v6; | |
6039 v7 += 56; | |
6040 if ( v6 >= (signed int)pObjectList->uNumObjects ) | |
6041 goto LABEL_18; | |
6042 } | |
6043 } | |
6044 a1.uObjectDescID = v6; | |
6045 a1.vPosition.y = pParty->vPosition.y; | |
303 | 6046 a1.field_58_pid = OBJECT_Player; |
0 | 6047 a1.vPosition.x = pParty->vPosition.x; |
6048 a1.vPosition.z = pParty->sEyelevel + pParty->vPosition.z; | |
6049 a1.uSoundID = 0; | |
6050 a1.uFacing = 0; | |
6051 a1.uAttributes = 8; | |
6052 a1.uSectorID = pIndoor->GetSector( | |
6053 pParty->vPosition.x, | |
6054 pParty->vPosition.y, | |
6055 pParty->sEyelevel + pParty->vPosition.z); | |
6056 a1.uSpriteFrameID = 0; | |
6057 memcpy(&a1.stru_24, &pParty->pPickedItem, 0x24u); | |
6058 v8 = (int *)pMouse->GetCursorPos(&v25); | |
6059 v9 = UnprojectX(*v8); | |
6060 a1.Create(pParty->sRotationY + v9, 184, 200, 0); | |
6061 v10 = pIcons_LOD->LoadTexture( | |
6062 pItemsTable->pItems[pParty->pPickedItem.uItemID].pIconName, | |
6063 TEXTURE_16BIT_PALETTE); | |
6064 if (v10 != -1) | |
6065 pIcons_LOD->pTextures[v10].Release(); | |
6066 pMouse->RemoveHoldingItem(); | |
6067 pIcons_LOD->_40F9C5(); | |
6068 return; | |
6069 } | |
6070 ShowNothingHereStatus(); | |
6071 LABEL_13: | |
6072 v4 = pParty->pPickedItem.uItemID; | |
6073 if ( !pParty->pPickedItem.uItemID ) | |
6074 return; | |
6075 goto LABEL_14; | |
6076 } | |
6077 v11 = pIndoor->pFaceExtras[v3->uFaceExtraID].uEventID; | |
6078 } | |
6079 else | |
6080 { | |
6081 v12 = &pOutdoor->pBModels[(signed int)(unsigned __int16)v0 >> 9].pFaces[v2 & 0x3F]; | |
6082 if ( !(v12->uAttributes & 0x2000000) ) | |
6083 goto LABEL_11; | |
6084 v11 = v12->sCogTriggeredID; | |
6085 } | |
6086 } | |
6087 EventProcessor(v11, (unsigned __int16)v0, 1); | |
6088 return; | |
6089 } | |
6090 v16 = (signed int)(unsigned __int16)v0 >> 3; | |
6091 a2.y = v16; | |
6092 v17 = &pActors[v16]; | |
6093 if ( v17->uAIState == 5 ) | |
6094 { | |
6095 if ( (unsigned int)v0 < 0x2000000 ) | |
6096 { | |
6097 stru_50C198.LootActor(&pActors[v16]); | |
6098 return; | |
6099 } | |
6100 goto LABEL_13; | |
6101 } | |
6102 if ( GetAsyncKeyState(VK_SHIFT) >= 0 ) | |
6103 { | |
6104 if ( !v17->GetActorsRelation(0) && !(BYTE2(v17->uAttributes) & 8) ) | |
6105 { | |
6106 if ( (unsigned int)v0 >= 0x2000000 ) | |
6107 goto LABEL_13; | |
6108 if ( !v17->CanAct() ) | |
6109 return; | |
6110 v18 = a2.y; | |
6111 Actor::FaceObject(a2.y, 4u, 0, 0); | |
6112 if ( !v17->uNPC_ID ) | |
6113 { | |
6114 v19 = pNPCStats->pGroups_copy[v17->uGroup]; | |
6115 if ( v19 ) | |
6116 { | |
6117 v20 = pNPCStats->pCatchPhrases[v19]; | |
6118 if ( v20 ) | |
6119 { | |
6120 pParty->uFlags |= 2u; | |
6121 strcpy(byte_5B0938, v20); | |
6122 sub_4451A8_press_any_key(0, 0, 0); | |
6123 } | |
6124 } | |
6125 return; | |
6126 } | |
6127 if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) | |
6128 return; | |
6129 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)161; | |
6130 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v18; | |
6131 LABEL_42: | |
6132 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
6133 ++pMessageQueue_50CBD0->uNumMessages; | |
6134 return; | |
6135 } | |
6136 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 3 ) | |
6137 { | |
6138 pTurnEngine->field_18 |= 8u; | |
6139 return; | |
6140 } | |
6141 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
6142 { | |
6143 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)23; | |
6144 goto LABEL_41; | |
6145 } | |
6146 } | |
6147 else | |
6148 { | |
6149 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 3 ) | |
6150 { | |
6151 pParty->uFlags |= 8u; | |
6152 return; | |
6153 } | |
6154 if ( uActiveCharacter | |
6155 && sub_427769_spell(pPlayers[uActiveCharacter]->uQuickSpell) | |
6156 && (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
6157 { | |
6158 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)25; | |
6159 LABEL_41: | |
6160 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
6161 goto LABEL_42; | |
6162 } | |
6163 } | |
6164 } | |
6165 | |
6166 //----- (004226C2) -------------------------------------------------------- | |
265 | 6167 bool PauseGameDrawing() |
0 | 6168 { |
265 | 6169 if ( pCurrentScreen != SCREEN_GAME |
151 | 6170 && pCurrentScreen != SCREEN_NPC_DIALOGUE |
6171 && pCurrentScreen != SCREEN_CHANGE_LOCATION ) | |
6172 { | |
6173 if ( pCurrentScreen == SCREEN_INPUT_BLV ) | |
0 | 6174 return pVideoPlayer->pSmackerMovie != 0; |
151 | 6175 if ( pCurrentScreen != SCREEN_BRANCHLESS_NPC_DIALOG ) |
265 | 6176 return true; |
6177 } | |
6178 return false; | |
0 | 6179 } |
6180 // 4E28F8: using guessed type int pCurrentScreen; | |
6181 | |
6182 //----- (004226EF) -------------------------------------------------------- | |
6183 void __fastcall SetUserInterface(int a1, bool bReplace) | |
6184 { | |
6185 int v2; // ecx@2 | |
6186 unsigned int v3; // eax@7 | |
6187 unsigned __int16 v4; // dx@7 | |
6188 unsigned __int16 v5; // cx@7 | |
6189 unsigned __int16 v6; // [sp-4h] [bp-14h]@7 | |
6190 | |
6191 if ( a1 ) | |
6192 { | |
6193 v2 = a1 - 1; | |
6194 if ( v2 ) | |
6195 { | |
6196 if ( v2 != 1 ) | |
6197 return; | |
6198 if ( bReplace ) | |
6199 { | |
6200 pTexture_RightFrame->Reload("ib-r-C.pcx"); | |
6201 pTexture_BottomFrame->Reload("ib-b-C.pcx"); | |
6202 pTexture_TopFrame->Reload("ib-t-C.pcx"); | |
6203 pTexture_LeftFrame->Reload("ib-l-C.pcx"); | |
6204 pTexture_StatusBar->Reload("IB-Foot-c.pcx"); | |
6205 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_right_panel], "ib-mb-C", 2); | |
6206 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D8], "ib-autmask-c", 2); | |
6207 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079B4], "IB-COMP-C", 2); | |
6208 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D0], "IB-InitG-c", 2); | |
6209 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079C8], "IB-InitY-c", 2); | |
6210 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079CC], "IB-InitR-c", 2); | |
319 | 6211 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-C", 2); |
6212 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-C", 2); | |
6213 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-C", 2); | |
6214 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-C", 2); | |
0 | 6215 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50C98C], "IB-selec-C", 2); |
319 | 6216 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-c", 2); |
6217 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-c", 2); | |
6218 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-c", 2); | |
6219 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-c", 2); | |
0 | 6220 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50796C], "isg-01-c", 2); |
6221 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507968], "isg-02-c", 2); | |
6222 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507964], "isg-03-c", 2); | |
6223 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507960], "isg-04-c", 2); | |
6224 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeC"); | |
6225 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
6226 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchC"); | |
6227 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
6228 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_506438], "ib-bcu-c", 2); | |
6229 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc-c", 2); | |
6230 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507958], "fr_inven-c", 2); | |
6231 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Parchment], "parchment", 2); | |
6232 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B4], "cornr_ll-c", 2); | |
6233 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B0], "cornr_lr-c", 2); | |
6234 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076AC], "cornr_ul-c", 2); | |
6235 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A8], "cornr_ur-c", 2); | |
6236 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A4], "edge_btm-c", 2); | |
6237 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A0], "edge_lf-c", 2); | |
6238 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50769C], "edge_rt-c", 2); | |
6239 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507698], "edge_top-c", 2); | |
6240 pIcons_LOD->ReloadTexture(pTexture_591428, "endcap-c", 2); | |
6241 } | |
6242 else | |
6243 { | |
6244 pTexture_RightFrame->Load("ib-r-C.pcx", 0); | |
6245 pTexture_BottomFrame->Load("ib-b-c.pcx", 0); | |
6246 pTexture_TopFrame->Load("ib-t-C.pcx", 0); | |
6247 pTexture_LeftFrame->Load("ib-l-C.pcx", 0); | |
6248 pTexture_StatusBar->Load("IB-Foot-c.pcx", 0); | |
6249 uTextureID_right_panel = pIcons_LOD->LoadTexture("ib-mb-C", TEXTURE_16BIT_PALETTE); | |
6250 dword_5079D8 = pIcons_LOD->LoadTexture("ib-autmask-c", TEXTURE_16BIT_PALETTE); | |
6251 dword_5079B4 = pIcons_LOD->LoadTexture("IB-COMP-C", TEXTURE_16BIT_PALETTE); | |
6252 dword_5079D0 = pIcons_LOD->LoadTexture("IB-InitG-c", TEXTURE_16BIT_PALETTE); | |
6253 dword_5079C8 = pIcons_LOD->LoadTexture("IB-InitY-c", TEXTURE_16BIT_PALETTE); | |
6254 dword_5079CC = pIcons_LOD->LoadTexture("IB-InitR-c", TEXTURE_16BIT_PALETTE); | |
319 | 6255 uTextureID_Btn_NPCLeft = pIcons_LOD->LoadTexture("IB-NPCLD-C", TEXTURE_16BIT_PALETTE); |
6256 uTextureID_Btn_NPCRight = pIcons_LOD->LoadTexture("IB-NPCRD-C", TEXTURE_16BIT_PALETTE); | |
328 | 6257 uTextureID_Btn_ZoomIn = pIcons_LOD->LoadTexture("ib-autout-C", TEXTURE_16BIT_PALETTE); |
319 | 6258 uTextureID_Btn_ZoomOut = pIcons_LOD->LoadTexture("ib-autin-C", TEXTURE_16BIT_PALETTE); |
0 | 6259 dword_50C98C = pIcons_LOD->LoadTexture("IB-selec-C", TEXTURE_16BIT_PALETTE); |
319 | 6260 uTextureID_Btn_CastSpell = pIcons_LOD->LoadTexture("ib-m1d-c", TEXTURE_16BIT_PALETTE); |
6261 uTextureID_Btn_Rest = pIcons_LOD->LoadTexture("ib-m2d-c", TEXTURE_16BIT_PALETTE); | |
6262 uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-c", TEXTURE_16BIT_PALETTE); | |
6263 uTextureID_Btn_GameSettings = pIcons_LOD->LoadTexture("ib-m4d-c", TEXTURE_16BIT_PALETTE); | |
0 | 6264 uTextureID_506438 = pIcons_LOD->LoadTexture("ib-bcu-c", TEXTURE_16BIT_PALETTE); |
6265 dword_50796C = pIcons_LOD->LoadTexture("isg-01-c", TEXTURE_16BIT_PALETTE); | |
6266 dword_507968 = pIcons_LOD->LoadTexture("isg-02-c", TEXTURE_16BIT_PALETTE); | |
6267 dword_507964 = pIcons_LOD->LoadTexture("isg-03-c", TEXTURE_16BIT_PALETTE); | |
6268 dword_507960 = pIcons_LOD->LoadTexture("isg-04-c", TEXTURE_16BIT_PALETTE); | |
6269 uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc-c", TEXTURE_16BIT_PALETTE); | |
6270 uTextureID_507958 = pIcons_LOD->LoadTexture("fr_inven", TEXTURE_16BIT_PALETTE); | |
6271 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeC"); | |
6272 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
6273 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchC"); | |
6274 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
6275 } | |
6276 v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xC8u, 0, 0); | |
6277 v4 = 0; | |
6278 v6 = 0; | |
6279 v5 = 10; | |
6280 } | |
6281 else | |
6282 { | |
6283 if ( bReplace ) | |
6284 { | |
6285 pTexture_RightFrame->Reload("ib-r-a.pcx"); | |
6286 pTexture_BottomFrame->Reload("ib-b-a.pcx"); | |
6287 pTexture_TopFrame->Reload("ib-t-a.pcx"); | |
6288 pTexture_LeftFrame->Reload("ib-l-a.pcx"); | |
6289 pTexture_StatusBar->Reload("IB-Foot-a.pcx"); | |
6290 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_right_panel], "ib-mb-a", 2); | |
6291 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D8], "ib-autmask-a", 2); | |
6292 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079B4], "IB-COMP-a", 2); | |
6293 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D0], "IB-InitG-a", 2); | |
6294 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079C8], "IB-InitY-a", 2); | |
6295 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079CC], "IB-InitR-a", 2); | |
319 | 6296 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-a", 2); |
6297 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-a", 2); | |
6298 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-a", 2); | |
6299 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-a", 2); | |
0 | 6300 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50C98C], "IB-selec-a", 2); |
319 | 6301 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-a", 2); |
6302 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-a", 2); | |
6303 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-a", 2); | |
6304 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-a", 2); | |
0 | 6305 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50796C], "isg-01-a", 2); |
6306 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507968], "isg-02-a", 2); | |
6307 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507964], "isg-03-a", 2); | |
6308 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507960], "isg-04-a", 2); | |
6309 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeA"); | |
6310 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
6311 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchA"); | |
6312 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
6313 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_506438], "ib-bcu-a", 2); | |
6314 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc", 2); | |
6315 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507958], "fr_inven", 2); | |
6316 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Parchment], "parchment", 2); | |
6317 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B4], "cornr_ll", 2); | |
6318 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B0], "cornr_lr", 2); | |
6319 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076AC], "cornr_ul", 2); | |
6320 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A8], "cornr_ur", 2); | |
6321 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A4], "edge_btm", 2); | |
6322 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A0], "edge_lf", 2); | |
6323 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50769C], "edge_rt", 2); | |
6324 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507698], "edge_top", 2); | |
6325 pIcons_LOD->ReloadTexture(pTexture_591428, "endcap", 2); | |
6326 } | |
6327 else | |
6328 { | |
6329 pTexture_RightFrame->Load("ib-r-A.pcx", 0); | |
6330 pTexture_BottomFrame->Load("ib-b-A.pcx", 0); | |
6331 pTexture_TopFrame->Load("ib-t-A.pcx", 0); | |
6332 pTexture_LeftFrame->Load("ib-l-A.pcx", 0); | |
6333 pTexture_StatusBar->Load("IB-Foot-a.pcx", 0); | |
6334 uTextureID_right_panel = pIcons_LOD->LoadTexture("ib-mb-A", TEXTURE_16BIT_PALETTE); | |
6335 dword_5079D8 = pIcons_LOD->LoadTexture("ib-autmask-a", TEXTURE_16BIT_PALETTE); | |
6336 dword_5079B4 = pIcons_LOD->LoadTexture("IB-COMP-A", TEXTURE_16BIT_PALETTE); | |
6337 dword_5079D0 = pIcons_LOD->LoadTexture("IB-InitG-a", TEXTURE_16BIT_PALETTE); | |
6338 dword_5079C8 = pIcons_LOD->LoadTexture("IB-InitY-a", TEXTURE_16BIT_PALETTE); | |
6339 dword_5079CC = pIcons_LOD->LoadTexture("IB-InitR-a", TEXTURE_16BIT_PALETTE); | |
319 | 6340 uTextureID_Btn_NPCLeft = pIcons_LOD->LoadTexture("IB-NPCLD-A", TEXTURE_16BIT_PALETTE); |
6341 uTextureID_Btn_NPCRight = pIcons_LOD->LoadTexture("IB-NPCRD-A", TEXTURE_16BIT_PALETTE); | |
0 | 6342 dword_50C98C = pIcons_LOD->LoadTexture("IB-selec-A", TEXTURE_16BIT_PALETTE); |
319 | 6343 uTextureID_Btn_CastSpell = pIcons_LOD->LoadTexture("ib-m1d-a", TEXTURE_16BIT_PALETTE); |
6344 uTextureID_Btn_Rest = pIcons_LOD->LoadTexture("ib-m2d-a", TEXTURE_16BIT_PALETTE); | |
6345 uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-a", TEXTURE_16BIT_PALETTE); | |
6346 uTextureID_Btn_GameSettings = pIcons_LOD->LoadTexture("ib-m4d-a", TEXTURE_16BIT_PALETTE); | |
328 | 6347 uTextureID_Btn_ZoomIn = pIcons_LOD->LoadTexture("ib-autout-a", TEXTURE_16BIT_PALETTE); |
319 | 6348 uTextureID_Btn_ZoomOut = pIcons_LOD->LoadTexture("ib-autin-a", TEXTURE_16BIT_PALETTE); |
0 | 6349 uTextureID_506438 = pIcons_LOD->LoadTexture("ib-bcu-a", TEXTURE_16BIT_PALETTE); |
6350 dword_50796C = pIcons_LOD->LoadTexture("isg-01-a", TEXTURE_16BIT_PALETTE); | |
6351 dword_507968 = pIcons_LOD->LoadTexture("isg-02-a", TEXTURE_16BIT_PALETTE); | |
6352 dword_507964 = pIcons_LOD->LoadTexture("isg-03-a", TEXTURE_16BIT_PALETTE); | |
6353 dword_507960 = pIcons_LOD->LoadTexture("isg-04-a", TEXTURE_16BIT_PALETTE); | |
6354 uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc", TEXTURE_16BIT_PALETTE); | |
6355 uTextureID_507958 = pIcons_LOD->LoadTexture("fr_inven", TEXTURE_16BIT_PALETTE); | |
6356 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeA"); | |
6357 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
6358 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchA"); | |
6359 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
6360 uTextureID_Parchment = pIcons_LOD->LoadTexture("parchment", TEXTURE_16BIT_PALETTE); | |
6361 uTextureID_5076B4 = pIcons_LOD->LoadTexture("cornr_ll", TEXTURE_16BIT_PALETTE); | |
6362 uTextureID_5076B0 = pIcons_LOD->LoadTexture("cornr_lr", TEXTURE_16BIT_PALETTE); | |
6363 uTextureID_5076AC = pIcons_LOD->LoadTexture("cornr_ul", TEXTURE_16BIT_PALETTE); | |
6364 uTextureID_5076A8 = pIcons_LOD->LoadTexture("cornr_ur", TEXTURE_16BIT_PALETTE); | |
6365 uTextureID_5076A4 = pIcons_LOD->LoadTexture("edge_btm", TEXTURE_16BIT_PALETTE); | |
6366 uTextureID_5076A0 = pIcons_LOD->LoadTexture("edge_lf", TEXTURE_16BIT_PALETTE); | |
6367 uTextureID_50769C = pIcons_LOD->LoadTexture("edge_rt", TEXTURE_16BIT_PALETTE); | |
6368 uTextureID_507698 = pIcons_LOD->LoadTexture("edge_top", TEXTURE_16BIT_PALETTE); | |
6369 pTexture_591428 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("endcap", TEXTURE_16BIT_PALETTE)]; | |
6370 | |
6371 } | |
6372 v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xAu, 0, 0); | |
6373 v4 = 214; | |
6374 v5 = 230; | |
6375 v6 = 193; | |
6376 } | |
6377 } | |
6378 else | |
6379 { | |
6380 if ( bReplace ) | |
6381 { | |
6382 pTexture_RightFrame->Reload("ib-r-B.pcx"); | |
6383 pTexture_BottomFrame->Reload("ib-b-B.pcx"); | |
6384 pTexture_TopFrame->Reload("ib-t-B.pcx"); | |
6385 pTexture_LeftFrame->Reload("ib-l-B.pcx"); | |
6386 pTexture_StatusBar->Reload("IB-Foot-b.pcx"); | |
6387 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_right_panel], "ib-mb-B", 2); | |
6388 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D8], "ib-autmask-b", 2); | |
6389 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079B4], "IB-COMP-B", 2); | |
6390 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D0], "IB-InitG-b", 2); | |
6391 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079C8], "IB-InitY-b", 2); | |
6392 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079CC], "IB-InitR-b", 2); | |
319 | 6393 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-B", 2); |
6394 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-B", 2); | |
6395 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-B", 2); | |
6396 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-B", 2); | |
0 | 6397 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50C98C], "IB-selec-B", 2); |
319 | 6398 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-b", 2); |
6399 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-b", 2); | |
6400 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-b", 2); | |
6401 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-b", 2); | |
0 | 6402 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50796C], "isg-01-b", 2); |
6403 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507968], "isg-02-b", 2); | |
6404 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507964], "isg-03-b", 2); | |
6405 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_507960], "isg-04-b", 2); | |
6406 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeB"); | |
6407 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
6408 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchB"); | |
6409 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
6410 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_506438], "ib-bcu-b", 2); | |
6411 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc-b", 2); | |
6412 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507958], "fr_inven-b", 2); | |
6413 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Parchment], "parchment", 2); | |
6414 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B4], "cornr_ll-b", 2); | |
6415 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B0], "cornr_lr-b", 2); | |
6416 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076AC], "cornr_ul-b", 2); | |
6417 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A8], "cornr_ur-b", 2); | |
6418 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A4], "edge_btm-b", 2); | |
6419 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A0], "edge_lf-b", 2); | |
6420 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50769C], "edge_rt-b", 2); | |
6421 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507698], "edge_top-b", 2); | |
6422 pIcons_LOD->ReloadTexture(pTexture_591428, "endcap-b", 2); | |
6423 } | |
6424 v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0xC8u); | |
6425 v5 = 255; | |
6426 v4 = 225; | |
6427 v6 = 255; | |
6428 } | |
6429 uGameUIFontMain = v3; | |
6430 uGameUIFontShadow = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v5, v4, v6); | |
6431 } | |
6432 | |
6433 | |
6434 | |
6435 //----- (00423AEE) -------------------------------------------------------- | |
6436 void __cdecl reset_some_strus_flt_2Cs() | |
6437 { | |
6438 float *v0; // eax@1 | |
6439 signed int v1; // ecx@1 | |
6440 signed int v2; // edx@1 | |
6441 float *v3; // eax@3 | |
6442 signed int v4; // edx@3 | |
6443 float *v5; // eax@5 | |
6444 signed int v6; // edx@5 | |
6445 float *v7; // eax@7 | |
6446 signed int v8; // edx@7 | |
6447 float *v9; // eax@9 | |
6448 | |
6449 v0 = &array_50AC10[0].flt_2C; | |
6450 v1 = 50; | |
6451 v2 = 50; | |
6452 do | |
6453 { | |
6454 *v0 = 0.0; | |
6455 v0 += 12; | |
6456 --v2; | |
6457 } | |
6458 while ( v2 ); | |
6459 v3 = &array_50A2B0[0].flt_2C; | |
6460 v4 = 50; | |
6461 do | |
6462 { | |
6463 *v3 = 0.0; | |
6464 v3 += 12; | |
6465 --v4; | |
6466 } | |
6467 while ( v4 ); | |
6468 v5 = &array_509950[0].flt_2C; | |
6469 v6 = 50; | |
6470 do | |
6471 { | |
6472 *v5 = 0.0; | |
6473 v5 += 12; | |
6474 --v6; | |
6475 } | |
6476 while ( v6 ); | |
6477 v7 = &array_508FF0[0].flt_2C; | |
6478 v8 = 50; | |
6479 do | |
6480 { | |
6481 *v7 = 0.0; | |
6482 v7 += 12; | |
6483 --v8; | |
6484 } | |
6485 while ( v8 ); | |
6486 v9 = &array_508690[0].flt_2C; | |
6487 do | |
6488 { | |
6489 *v9 = 0.0; | |
6490 v9 += 12; | |
6491 --v1; | |
6492 } | |
6493 while ( v1 ); | |
6494 } | |
6495 | |
6496 //----- (00423B4A) -------------------------------------------------------- | |
6497 void __cdecl sub_423B4A() | |
6498 { | |
6499 float *v0; // eax@1 | |
6500 signed int v1; // ecx@1 | |
6501 | |
6502 v0 = &array_507D30[0].flt_2C; | |
6503 v1 = 50; | |
6504 do | |
6505 { | |
6506 *v0 = 0.0; | |
6507 v0 += 12; | |
6508 --v1; | |
6509 } | |
6510 while ( v1 ); | |
6511 } | |
6512 | |
6513 //----- (00423B5D) -------------------------------------------------------- | |
6514 int __fastcall sub_423B5D(unsigned int uFaceID) | |
6515 { | |
6516 BLVFace *v1; // ebx@1 | |
6517 Vec3_short_ *v2; // esi@1 | |
6518 //int v3; // ST28_4@1 | |
6519 __int16 v4; // ST2C_2@1 | |
6520 //signed int v5; // esi@1 | |
6521 //Vec3_short_ *v6; // eax@4 | |
6522 //signed int v7; // edi@5 | |
6523 //signed int v8; // eax@5 | |
6524 //signed int i_; // ecx@10 | |
6525 int v10; // eax@10 | |
6526 int v11; // edx@11 | |
6527 int v12; // ST28_4@12 | |
6528 signed int v13; // edx@12 | |
6529 signed __int64 v14; // qtt@12 | |
6530 int *v15; // ebx@12 | |
6531 int v16; // ST28_4@14 | |
6532 signed int v17; // eax@14 | |
6533 signed __int64 v18; // qtt@14 | |
6534 signed int v19; // edx@15 | |
6535 signed int v20; // edx@17 | |
6536 signed int v21; // ebx@19 | |
6537 signed int v22; // esi@20 | |
6538 int v23; // edi@21 | |
6539 int v24; // eax@21 | |
6540 int v25; // eax@22 | |
6541 int v26; // eax@22 | |
6542 signed int v27; // ST30_4@24 | |
6543 signed __int64 v28; // qtt@24 | |
6544 int v29; // ST18_4@25 | |
6545 int v30; // eax@26 | |
6546 int v31; // eax@27 | |
6547 int v32; // eax@27 | |
6548 signed int v33; // ST30_4@29 | |
6549 signed __int64 v34; // qtt@29 | |
6550 int v35; // ST30_4@30 | |
6551 signed int v36; // edi@31 | |
6552 unsigned int v37; // eax@31 | |
6553 bool v38; // edx@31 | |
6554 int v39; // ecx@31 | |
6555 int v40; // ecx@32 | |
6556 int v41; // esi@32 | |
6557 int v42; // eax@34 | |
6558 signed int v43; // ebx@41 | |
6559 unsigned int v44; // eax@41 | |
6560 signed int v45; // ecx@42 | |
6561 int v46; // esi@42 | |
6562 int v47; // eax@44 | |
6563 signed int v48; // edi@51 | |
6564 unsigned int v49; // eax@51 | |
6565 bool v50; // edx@51 | |
6566 int v51; // ecx@51 | |
6567 int v52; // ecx@52 | |
6568 signed int v53; // esi@52 | |
6569 int v54; // eax@54 | |
6570 int v55; // ebx@61 | |
6571 unsigned int v56; // eax@61 | |
6572 signed int v57; // ecx@62 | |
6573 int v58; // esi@62 | |
6574 int v59; // eax@64 | |
6575 char v61; // zf@72 | |
6576 signed int v62; // edx@75 | |
6577 int v63; // ecx@76 | |
6578 int v64; // esi@76 | |
6579 int v65; // ecx@83 | |
6580 //signed int v66; // [sp+14h] [bp-14h]@3 | |
6581 int v67; // [sp+14h] [bp-14h]@34 | |
6582 int v68; // [sp+14h] [bp-14h]@44 | |
6583 int v69; // [sp+14h] [bp-14h]@54 | |
6584 int v70; // [sp+14h] [bp-14h]@64 | |
6585 signed int v71; // [sp+14h] [bp-14h]@75 | |
6586 bool thisa; // [sp+18h] [bp-10h]@9 | |
6587 int thisb; // [sp+18h] [bp-10h]@12 | |
6588 int thisc; // [sp+18h] [bp-10h]@20 | |
6589 bool thisd; // [sp+18h] [bp-10h]@41 | |
6590 bool thise; // [sp+18h] [bp-10h]@61 | |
6591 int thisf; // [sp+18h] [bp-10h]@74 | |
6592 signed int v79; // [sp+1Ch] [bp-Ch]@9 | |
6593 int v80; // [sp+1Ch] [bp-Ch]@76 | |
6594 bool v81; // [sp+20h] [bp-8h]@10 | |
6595 bool v82; // [sp+20h] [bp-8h]@32 | |
6596 bool v83; // [sp+20h] [bp-8h]@42 | |
6597 bool v84; // [sp+20h] [bp-8h]@52 | |
6598 bool v85; // [sp+20h] [bp-8h]@62 | |
6599 //signed int i; // [sp+24h] [bp-4h]@9 | |
6600 signed int ia; // [sp+24h] [bp-4h]@19 | |
6601 signed int ib; // [sp+24h] [bp-4h]@31 | |
6602 signed int ic; // [sp+24h] [bp-4h]@41 | |
6603 signed int id; // [sp+24h] [bp-4h]@51 | |
6604 signed int ie; // [sp+24h] [bp-4h]@61 | |
6605 | |
6606 v1 = &pIndoor->pFaces[uFaceID]; | |
6607 //this = pGame->pIndoorCameraD3D; | |
6608 v2 = &pIndoor->pVertices[v1->pVertexIDs[0]]; | |
6609 //v3 = *(_DWORD *)&v2->x; | |
6610 v4 = v2->z; | |
6611 //v5 = 0; | |
6612 if ( v1->pFacePlane_old.vNormal.x * (v2->x - pBLVRenderParams->vPartyPos.x) | |
6613 + v1->pFacePlane_old.vNormal.y * (v2->y - pBLVRenderParams->vPartyPos.y) | |
6614 + v1->pFacePlane_old.vNormal.z * (v2->z - pBLVRenderParams->vPartyPos.z) < 0 ) | |
6615 { | |
6616 dword_50B700 = 1; | |
6617 } | |
6618 else | |
6619 { | |
6620 dword_50B700 = 0; | |
315 | 6621 if ( !v1->TwoSided() ) |
0 | 6622 return 0; |
6623 } | |
6624 //v66 = v1->uNumVertices; | |
6625 for (uint i = 0; i < v1->uNumVertices; ++i) | |
6626 { | |
6627 auto v6 = &pIndoor->pVertices[v1->pVertexIDs[i]]; | |
6628 pGame->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible( | |
6629 v6->x, | |
6630 v6->y, | |
6631 v6->z, | |
6632 &_50B924_view_transformed_xs[i], | |
6633 &_50B834_view_transformed_zs[i], | |
6634 &_50B744_view_transformed_ys[i], | |
6635 0); | |
6636 } | |
6637 | |
6638 //v7 = v1->uNumVertices; | |
6639 //v8 = 0; | |
6640 if (v1->uNumVertices <= 0) | |
6641 return 0; | |
6642 | |
6643 bool bFound = false; | |
6644 for (uint i = 0; i < v1->uNumVertices; ++i) | |
6645 if (_50B924_view_transformed_xs[i] >= 0x80000u) | |
6646 { | |
6647 bFound = true; | |
6648 break; | |
6649 } | |
6650 if (!bFound) | |
6651 return 0; | |
6652 | |
6653 v79 = 0; | |
6654 _50B924_view_transformed_xs[v1->uNumVertices] = _50B924_view_transformed_xs[0]; | |
6655 _50B834_view_transformed_zs[v1->uNumVertices] = _50B834_view_transformed_zs[0]; | |
6656 _50B744_view_transformed_ys[v1->uNumVertices] = _50B744_view_transformed_ys[0]; | |
6657 thisa = _50B924_view_transformed_xs[0] >= 0x80000u; | |
6658 //int i = 1; | |
6659 for (uint i = 1; i < v1->uNumVertices; ++i) | |
6660 { | |
6661 v10 = _50B924_view_transformed_xs[i]; | |
6662 v81 = v10 >= (signed int)0x80000u; | |
6663 if ( thisa ^ v81 ) | |
6664 { | |
6665 v11 = _50B924_view_transformed_xs[i - 1]; | |
6666 if ( v10 >= (signed int)0x80000u ) | |
6667 { | |
6668 v12 = v10 - v11; | |
6669 v13 = 0x80000 - v11; | |
6670 LODWORD(v14) = v13 << 16; | |
6671 HIDWORD(v14) = v13 >> 16; | |
6672 v15 = &_50B744_view_transformed_ys[i - 1]; | |
6673 dword_50B828[v79] = ((unsigned __int64)((_50B834_view_transformed_zs[i] - _50B834_view_transformed_zs[i - 1]) | |
6674 * v14 | |
6675 / v12) >> 16) | |
6676 + _50B834_view_transformed_zs[i - 1]; | |
6677 thisb = (unsigned __int64)((_50B744_view_transformed_ys[i] - _50B744_view_transformed_ys[i - 1]) * v14 / v12) >> 16; | |
6678 } | |
6679 else | |
6680 { | |
6681 v16 = v11 - v10; | |
6682 v17 = 0x80000 - v10; | |
6683 LODWORD(v18) = v17 << 16; | |
6684 HIDWORD(v18) = v17 >> 16; | |
6685 v15 = &_50B744_view_transformed_ys[i]; | |
108 | 6686 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 | 6687 thisb = (unsigned __int64)((_50B744_view_transformed_ys[i - 1] - _50B744_view_transformed_ys[i]) * v18 / v16) >> 16; |
6688 } | |
6689 v19 = v79++; | |
6690 //v7 = v66; | |
6691 dword_50B738[v19] = thisb + *v15; | |
6692 dword_50B918[v19] = 0x80000u; | |
6693 } | |
6694 if ( v81 ) | |
6695 { | |
6696 v20 = v79++; | |
6697 dword_50B918[v20] = _50B924_view_transformed_xs[i]; | |
6698 dword_50B828[v20] = _50B834_view_transformed_zs[i]; | |
6699 dword_50B738[v20] = _50B744_view_transformed_ys[i]; | |
6700 } | |
6701 //++i; | |
6702 thisa = v81; | |
6703 } | |
6704 ia = 0; | |
6705 v21 = v79; | |
6706 dword_50B918[v79] = dword_50B918[0]; | |
6707 dword_50B828[v79] = dword_50B828[0]; | |
6708 for ( dword_50B738[v79] = dword_50B738[0]; ia < v79; dword_50BA08[v22] = pBLVRenderParams->uViewportCenterY - v35 ) | |
6709 { | |
6710 v22 = ia; | |
6711 thisc = abs(dword_50B918[ia]); | |
6712 if ( abs(dword_50B828[ia]) >> 13 <= thisc ) | |
6713 { | |
6714 v27 = dword_50B828[v22]; | |
6715 LODWORD(v28) = v27 << 16; | |
6716 HIDWORD(v28) = v27 >> 16; | |
6717 v26 = v28 / dword_50B918[v22]; | |
6718 v23 = 0; | |
6719 } | |
6720 else | |
6721 { | |
6722 v23 = 0; | |
6723 v24 = 0; | |
6724 if ( dword_50B828[v22] >= 0 ) | |
6725 { | |
6726 LOBYTE(v24) = dword_50B918[v22] >= 0; | |
6727 v26 = ((v24 - 1) & 0xFF800000) + 0x400000; | |
6728 } | |
6729 else | |
6730 { | |
6731 LOBYTE(v24) = dword_50B918[v22] >= 0; | |
6732 v25 = v24 - 1; | |
6733 v26 = (v25 & 0x800000) - 0x400000; | |
6734 } | |
6735 } | |
6736 v29 = dword_50B738[v22]; | |
6737 dword_50BAF4_xs[v22 + 1] = v26; | |
6738 if ( abs(v29) >> 13 <= thisc ) | |
6739 { | |
6740 v33 = dword_50B738[v22]; | |
6741 LODWORD(v34) = v33 << 16; | |
6742 HIDWORD(v34) = v33 >> 16; | |
6743 v32 = v34 / dword_50B918[v22]; | |
6744 } | |
6745 else | |
6746 { | |
6747 v30 = 0; | |
6748 if ( dword_50B738[v22] >= v23 ) | |
6749 { | |
6750 LOBYTE(v30) = dword_50B918[v22] >= v23; | |
6751 v32 = ((v30 - 1) & 0xFF800000) + 0x400000; | |
6752 } | |
6753 else | |
6754 { | |
6755 LOBYTE(v30) = dword_50B918[v22] >= v23; | |
6756 v31 = v30 - 1; | |
6757 v32 = (v31 & 0x800000) - 0x400000; | |
6758 } | |
6759 } | |
6760 dword_50BA08[v22] = v32; | |
6761 dword_50BAF4_xs[v22 + 1] = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) | |
6762 * (signed __int64)dword_50BAF4_xs[v22 + 1]) >> 16; | |
6763 v35 = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) * (signed __int64)dword_50BA08[v22]) >> 16; | |
6764 dword_50BAF4_xs[v22 + 1] = pBLVRenderParams->uViewportCenterX - dword_50BAF4_xs[v22 + 1]; | |
6765 ++ia; | |
6766 } | |
6767 v36 = 0; | |
6768 dword_50BAF4_xs[v21 + 1] = dword_50BAF4_xs[1]; | |
6769 dword_50BA08[v21] = dword_50BA08[0]; | |
6770 v37 = pBLVRenderParams->uViewportX; | |
6771 v38 = dword_50BAF4_xs[1] < (signed int)pBLVRenderParams->uViewportX; | |
6772 LOBYTE(v38) = dword_50BAF4_xs[1] >= (signed int)pBLVRenderParams->uViewportX; | |
6773 v39 = 1; | |
6774 ib = 1; | |
6775 if ( v79 < 1 ) | |
6776 return 0; | |
6777 do | |
6778 { | |
6779 v40 = v39; | |
6780 v41 = dword_50BAF4_xs[v40 + 1]; | |
6781 v82 = v41 >= (signed int)v37; | |
6782 if ( v38 ^ v82 ) | |
6783 { | |
6784 if ( v41 >= (signed int)v37 ) | |
6785 { | |
6786 v67 = (signed int)(v37 - dword_50BAF4_xs[v40]) | |
6787 * (signed __int64)(dword_50BA08[v40] - dword_50B9F8[v40 + 3]) | |
6788 / (v41 - dword_50BAF4_xs[v40]); | |
6789 v42 = dword_50B9F8[v40 + 3]; | |
6790 } | |
6791 else | |
6792 { | |
6793 v67 = (signed int)(v37 - v41) | |
6794 * (signed __int64)(dword_50B9F8[v40 + 3] - dword_50BA08[v40]) | |
6795 / (dword_50BAF4_xs[v40] - v41); | |
6796 v42 = dword_50BA08[v40]; | |
6797 } | |
6798 ++v36; | |
6799 dword_50B9F8[v36] = v67 + v42; | |
6800 v37 = pBLVRenderParams->uViewportX; | |
6801 dword_50BAE8_xs[v36] = pBLVRenderParams->uViewportX; | |
6802 } | |
6803 v38 = v82; | |
6804 if ( v82 ) | |
6805 { | |
6806 dword_50BAE8_xs[v36 + 1] = dword_50BAF4_xs[v40 + 1]; | |
6807 dword_50B9F8[v36++ + 1] = dword_50BA08[v40]; | |
6808 } | |
6809 v39 = ib++ + 1; | |
6810 } | |
6811 while ( ib <= v79 ); | |
6812 | |
6813 if ( !v36 | |
6814 || (v43 = 0, | |
6815 dword_50BAE8_xs[v36 + 1] = dword_50BAE8_xs[1], | |
6816 dword_50B9F8[v36 + 1] = dword_50B9F8[1], | |
6817 v44 = pBLVRenderParams->uViewportZ, | |
6818 thisd = dword_50BAE8_xs[1] <= (signed int)pBLVRenderParams->uViewportZ, | |
6819 ic = 1, | |
6820 v36 < 1) ) | |
6821 return 0; | |
6822 | |
6823 do | |
6824 { | |
6825 v45 = ic; | |
6826 v46 = dword_50BAE8_xs[ic + 1]; | |
6827 v83 = v46 <= (signed int)v44; | |
6828 if ( thisd ^ v83 ) | |
6829 { | |
6830 if ( v46 <= (signed int)v44 ) | |
6831 { | |
6832 v68 = (signed int)(v44 - dword_50BAE8_xs[v45]) | |
6833 * (signed __int64)(dword_50B9F8[v45 + 1] - dword_50B9F8[v45]) | |
6834 / (v46 - dword_50BAE8_xs[v45]); | |
6835 v47 = dword_50B9F8[v45]; | |
6836 } | |
6837 else | |
6838 { | |
6839 v68 = (signed int)(v44 - v46) | |
6840 * (signed __int64)(dword_50B9F8[v45] - dword_50B9F8[v45 + 1]) | |
6841 / (dword_50BAE8_xs[v45] - v46); | |
6842 v47 = dword_50B9F8[v45 + 1]; | |
6843 } | |
6844 ++v43; | |
6845 dword_50B9EC[v43] = v68 + v47; | |
6846 v44 = pBLVRenderParams->uViewportZ; | |
6847 dword_50BADC_xs[v43] = pBLVRenderParams->uViewportZ; | |
6848 } | |
6849 if ( v83 ) | |
6850 { | |
6851 dword_50BAE0[v43] = dword_50BAE8_xs[v45 + 1]; | |
6852 dword_50B9F0[v43++] = dword_50B9F8[v45 + 1]; | |
6853 } | |
6854 ++ic; | |
6855 thisd = v83; | |
6856 } | |
6857 while ( ic <= v36 ); | |
6858 if ( !v43 | |
6859 || (v48 = 0, | |
6860 dword_50BAE0[v43] = dword_50BAE0[0], | |
6861 dword_50B9F0[v43] = dword_50B9F0[0], | |
6862 v49 = pBLVRenderParams->uViewportY, | |
6863 v50 = dword_50B9F0[0] < (signed int)pBLVRenderParams->uViewportY, | |
6864 LOBYTE(v50) = dword_50B9F0[0] >= (signed int)pBLVRenderParams->uViewportY, | |
6865 v51 = 1, | |
6866 id = 1, | |
6867 v43 < 1) ) | |
6868 return 0; | |
6869 do | |
6870 { | |
6871 v52 = v51; | |
6872 v53 = dword_50B9F0[v52]; | |
6873 v84 = v53 >= (signed int)v49; | |
6874 if ( v50 ^ v84 ) | |
6875 { | |
6876 if ( v53 >= (signed int)v49 ) | |
6877 { | |
6878 v69 = (signed int)(v49 - dword_50B9EC[v52]) | |
6879 * (signed __int64)(dword_50BAE0[v52] - dword_50BADC_xs[v52]) | |
6880 / (v53 - dword_50B9EC[v52]); | |
6881 v54 = dword_50BADC_xs[v52]; | |
6882 } | |
6883 else | |
6884 { | |
6885 v69 = (signed int)(v49 - v53) | |
6886 * (signed __int64)(dword_50BADC_xs[v52] - dword_50BAE0[v52]) | |
6887 / (dword_50B9EC[v52] - v53); | |
6888 v54 = dword_50BAE0[v52]; | |
6889 } | |
6890 ++v48; | |
6891 dword_50BAD0[v48] = v69 + v54; | |
6892 v49 = pBLVRenderParams->uViewportY; | |
6893 dword_50B9E0_ys[v48] = pBLVRenderParams->uViewportY; | |
6894 } | |
6895 v50 = v84; | |
6896 if ( v84 ) | |
6897 { | |
6898 dword_50BAD4[v48] = dword_50BAE0[v52]; | |
6899 dword_50B9E0_ys[v48++ + 1] = dword_50B9F0[v52]; | |
6900 } | |
6901 v51 = id++ + 1; | |
6902 } | |
6903 while ( id <= v43 ); | |
6904 if ( !v48 | |
6905 || (v55 = 0, | |
6906 dword_50BAD4[v48] = dword_50BAD4[0], | |
6907 dword_50B9E0_ys[v48 + 1] = dword_50B9E0_ys[1], | |
6908 v56 = pBLVRenderParams->uViewportW, | |
6909 thise = dword_50B9E0_ys[1] <= (signed int)pBLVRenderParams->uViewportW, | |
6910 ie = 1, | |
6911 v48 < 1) ) | |
6912 return 0; | |
6913 do | |
6914 { | |
6915 v57 = ie; | |
6916 v58 = dword_50B9E0_ys[ie + 1]; | |
6917 v85 = v58 <= (signed int)v56; | |
6918 if ( thise ^ v85 ) | |
6919 { | |
6920 if ( v58 <= (signed int)v56 ) | |
6921 { | |
6922 v70 = (signed int)(v56 - dword_50B9E0_ys[v57]) | |
6923 * (signed __int64)(dword_50BAD4[v57] - dword_50BAD0[v57]) | |
6924 / (v58 - dword_50B9E0_ys[v57]); | |
6925 v59 = dword_50BAD0[v57]; | |
6926 } | |
6927 else | |
6928 { | |
6929 v70 = (signed int)(v56 - v58) | |
6930 * (signed __int64)(dword_50BAD0[v57] - dword_50BAD4[v57]) | |
6931 / (dword_50B9E0_ys[v57] - v58); | |
6932 v59 = dword_50BAD4[v57]; | |
6933 } | |
6934 ++v55; | |
6935 dword_50BAC4[v55] = v70 + v59; | |
6936 v56 = pBLVRenderParams->uViewportW; | |
6937 unk_50B9D4[v55] = pBLVRenderParams->uViewportW; | |
6938 } | |
6939 if ( v85 ) | |
6940 { | |
6941 dword_50BAC8[v55] = dword_50BAD4[v57]; | |
6942 dword_50B9D8_ys[v55++] = dword_50B9E0_ys[v57 + 1]; | |
6943 } | |
6944 ++ie; | |
6945 thise = v85; | |
6946 } | |
6947 while ( ie <= v48 ); | |
6948 if ( !v55 ) | |
6949 return 0; | |
6950 v61 = pRenderer->pRenderD3D == 0; | |
6951 dword_50BAC8[v55] = dword_50BAC8[0]; | |
6952 dword_50B9D8_ys[v55] = dword_50B9D8_ys[0]; | |
6953 if ( v61 && v55 > 3 ) | |
6954 { | |
6955 dword_50BAC8[v55 + 1] = dword_50BAC8[1]; | |
6956 dword_50B9D8_ys[v55 + 1] = dword_50B9D8_ys[1]; | |
6957 thisf = 2 * (dword_50B700 != 0) - 1; | |
6958 if ( v55 > 0 ) | |
6959 { | |
6960 v62 = 1; | |
6961 v71 = 1; | |
6962 do | |
6963 { | |
6964 v63 = v62 - 1; | |
6965 v64 = v62 + 1; | |
6966 v80 = v62 + 1; | |
6967 if ( v62 - 1 >= v55 ) | |
6968 v63 -= v55; | |
6969 if ( v62 >= v55 ) | |
6970 v62 -= v55; | |
6971 if ( v64 >= v55 ) | |
6972 v64 -= v55; | |
6973 if ( thisf | |
6974 * ((dword_50B9D8_ys[v64] - dword_50B9D8_ys[v63]) * (dword_50BAC8[v62] - dword_50BAC8[v63]) | |
6975 - (dword_50B9D8_ys[v62] - dword_50B9D8_ys[v63]) * (dword_50BAC8[v64] - dword_50BAC8[v63])) < 0 ) | |
6976 { | |
6977 v62 = v80; | |
6978 v71 = v80; | |
6979 } | |
6980 else | |
6981 { | |
6982 v62 = v71; | |
6983 v65 = v71; | |
6984 if ( v71 < v55 || (v65 = v71 - v55, v71 - v55 < v55) ) | |
6985 { | |
6986 memcpy(&dword_50B9D8_ys[v65], &dword_50B9D8_ys[v65 + 1], 4 * ((unsigned int)(4 * (v55 - v65)) >> 2)); | |
6987 memcpy(&dword_50BAC8[v65], &dword_50BAC8[v65 + 1], 4 * ((unsigned int)(4 * (v55 - v65)) >> 2)); | |
6988 } | |
6989 --v55; | |
6990 } | |
6991 } | |
6992 while ( v62 - 1 < v55 ); | |
6993 } | |
6994 dword_50BAC8[v55] = dword_50BAC8[0]; | |
6995 dword_50B9D8_ys[v55] = dword_50B9D8_ys[0]; | |
6996 } | |
6997 return v55; | |
6998 } | |
6999 | |
7000 | |
7001 //----- (00424579) -------------------------------------------------------- | |
7002 int __fastcall sub_424579(int uFaceID, stru320 *a2) | |
7003 { | |
7004 __debugbreak(); | |
7005 return 0; | |
7006 /*BLVFace *v2; // eax@1 | |
7007 Vec3_short_ *v3; // ebx@1 | |
7008 Vec3_short_ *v4; // esi@1 | |
7009 unsigned int v5; // esi@3 | |
7010 int v7; // ST1C_4@5 | |
7011 int v8; // ST1C_4@5 | |
7012 int v9; // ST1C_4@5 | |
7013 int v10; // ST1C_4@5 | |
7014 int v11; // esi@5 | |
7015 int v12; // ST1C_4@5 | |
7016 unsigned int v15; // ecx@8 | |
7017 unsigned int v19; // ecx@13 | |
7018 signed int v20; // ecx@16 | |
7019 signed int result; // eax@20 | |
7020 signed int v24; // edx@22 | |
7021 unsigned int v25; // [sp+Ch] [bp-1Ch]@3 | |
7022 float v26; // [sp+14h] [bp-14h]@3 | |
7023 float v27; // [sp+1Ch] [bp-Ch]@3 | |
7024 float v28; // [sp+20h] [bp-8h]@3 | |
7025 signed int v29; // [sp+24h] [bp-4h]@3 | |
7026 | |
7027 v2 = &pIndoor->pFaces[uFaceID]; | |
7028 v3 = pIndoor->pVertices; | |
7029 v4 = &pIndoor->pVertices[*v2->pVertexIDs]; | |
7030 if ( v2->pFacePlane_old.vNormal.x * ((signed __int16)*(int *)&v4->x - pBLVRenderParams->vPartyPos.x) | |
7031 + v2->pFacePlane_old.vNormal.y * ((signed __int16)(*(int *)&v4->x >> 16) - pBLVRenderParams->vPartyPos.y) | |
7032 + v2->pFacePlane_old.vNormal.z * (v4->z - pBLVRenderParams->vPartyPos.z) < 0 ) | |
7033 { | |
7034 dword_50B700 = 1; | |
7035 } | |
7036 else | |
7037 { | |
7038 dword_50B700 = 0; | |
7039 if ( !(v2->uAttributes & 1) ) | |
7040 return 0; | |
7041 } | |
7042 v29 = 0; | |
7043 v5 = v2->uNumVertices; | |
7044 __asm { fld pBLVRenderParams->fCosineY } | |
7045 v28 = pBLVRenderParams->fSineY; | |
7046 v26 = pBLVRenderParams->fCosineNegX; | |
7047 v27 = pBLVRenderParams->fSineNegX; | |
7048 v25 = v5; | |
7049 if ( (signed int)v5 > 0 ) | |
7050 { | |
7051 _ECX = (char *)&array_50AC10[0].vWorldPosition.z; | |
7052 do | |
7053 { | |
7054 v7 = v3[v2->pVertexIDs[v29]].x; | |
7055 __asm | |
7056 { | |
7057 fild [ebp+var_10] | |
7058 fstp dword ptr [ecx-8] | |
7059 } | |
7060 v8 = v3[v2->pVertexIDs[v29]].y; | |
7061 __asm | |
7062 { | |
7063 fild [ebp+var_10] | |
7064 fstp dword ptr [ecx-4] | |
7065 } | |
7066 v9 = v3[v2->pVertexIDs[v29]].z; | |
7067 __asm | |
7068 { | |
7069 fild [ebp+var_10] | |
7070 fstp dword ptr [ecx] | |
7071 } | |
7072 _ECX += 48; | |
7073 v10 = a2->pDeltaUV[0] + v2->pVertexUIDs[v29]; | |
7074 __asm | |
7075 { | |
7076 fild [ebp+var_10] | |
7077 fstp dword ptr [ecx-14h] | |
7078 } | |
7079 v11 = a2->pDeltaUV[1] + v2->pVertexVIDs[v29++]; | |
7080 v12 = v11; | |
7081 v5 = v25; | |
7082 __asm | |
7083 { | |
7084 fild [ebp+var_10] | |
7085 fstp dword ptr [ecx-10h] | |
7086 } | |
7087 } | |
7088 while ( v29 < (signed int)v25 ); | |
7089 } | |
7090 _EDX = (char *)&array_50AC10[0].vWorldViewPosition; | |
7091 if ( pBLVRenderParams->sPartyRotX ) | |
7092 { | |
7093 if ( (signed int)v5 > 0 ) | |
7094 { | |
7095 __asm | |
7096 { | |
7097 fild pBLVRenderParams->vPartyPos.x | |
7098 fild pBLVRenderParams->vPartyPos.y | |
7099 fild pBLVRenderParams->vPartyPos.z | |
7100 } | |
7101 _EAX = (char *)&array_50AC10[0].vWorldPosition.z; | |
7102 v15 = v5; | |
7103 do | |
7104 { | |
7105 __asm | |
7106 { | |
7107 fld dword ptr [eax-8] | |
7108 fsub st, st(3) | |
7109 fld dword ptr [eax-4] | |
7110 fsub st, st(3) | |
7111 fld st(1) | |
7112 fmul st, st(6) | |
7113 fld st(1) | |
7114 fmul [ebp+var_8] | |
7115 fsubp st(1), st | |
7116 fstp [ebp+var_4] | |
7117 fld dword ptr [eax] | |
7118 fsub st, st(3) | |
7119 } | |
7120 _EAX += 48; | |
7121 --v15; | |
7122 __asm | |
7123 { | |
7124 fstp [ebp+var_10] | |
7125 fld [ebp+var_4] | |
7126 fmul [ebp+var_14] | |
7127 fld [ebp+var_10] | |
7128 fmul [ebp+var_C] | |
7129 fsubp st(1), st | |
7130 fstp dword ptr [eax-2Ch] | |
7131 fld st(1) | |
7132 fmul [ebp+var_8] | |
7133 fld st(1) | |
7134 fmul st, st(7) | |
7135 faddp st(1), st | |
7136 fstp dword ptr [eax-28h] | |
7137 fstp st | |
7138 fstp st | |
7139 fld [ebp+var_4] | |
7140 fmul [ebp+var_C] | |
7141 fld [ebp+var_10] | |
7142 fmul [ebp+var_14] | |
7143 faddp st(1), st | |
7144 fstp dword ptr [eax-24h] | |
7145 } | |
7146 } | |
7147 while ( v15 ); | |
7148 LABEL_15: | |
7149 __asm | |
7150 { | |
7151 fstp st | |
7152 fstp st | |
7153 fstp st | |
7154 } | |
7155 goto LABEL_16; | |
7156 } | |
7157 } | |
7158 else | |
7159 { | |
7160 if ( (signed int)v5 > 0 ) | |
7161 { | |
7162 __asm | |
7163 { | |
7164 fild pBLVRenderParams->vPartyPos.x | |
7165 fild pBLVRenderParams->vPartyPos.y | |
7166 fild pBLVRenderParams->vPartyPos.z | |
7167 } | |
7168 _EAX = (char *)&array_50AC10[0].vWorldViewPosition; | |
7169 v19 = v5; | |
7170 do | |
7171 { | |
7172 __asm | |
7173 { | |
7174 fld dword ptr [eax-0Ch] | |
7175 fsub st, st(3) | |
7176 fld dword ptr [eax-8] | |
7177 fsub st, st(3) | |
7178 fld st(1) | |
7179 fmul st, st(6) | |
7180 fld st(1) | |
7181 fmul [ebp+var_8] | |
7182 fsubp st(1), st | |
7183 fstp dword ptr [eax] | |
7184 fld st(1) | |
7185 fmul [ebp+var_8] | |
7186 fld st(1) | |
7187 fmul st, st(7) | |
7188 } | |
7189 _EAX += 48; | |
7190 --v19; | |
7191 __asm | |
7192 { | |
7193 faddp st(1), st | |
7194 fstp dword ptr [eax-2Ch] | |
7195 fstp st | |
7196 fstp st | |
7197 fld dword ptr [eax-34h] | |
7198 fsub st, st(1) | |
7199 fstp dword ptr [eax-28h] | |
7200 } | |
7201 } | |
7202 while ( v19 ); | |
7203 goto LABEL_15; | |
7204 } | |
7205 } | |
7206 LABEL_16: | |
7207 v20 = 0; | |
7208 __asm { fstp st } | |
7209 if ( (signed int)v5 <= 0 ) | |
7210 return 0; | |
7211 do | |
7212 { | |
7213 __asm | |
7214 { | |
7215 fld dword ptr [edx] | |
7216 fcomp ds:flt_4D8524 | |
7217 fnstsw ax | |
7218 } | |
7219 if ( !(HIBYTE(_AX) & 1) ) | |
7220 break; | |
7221 ++v20; | |
7222 _EDX += 48; | |
7223 } | |
7224 while ( v20 < (signed int)v5 ); | |
7225 if ( v20 >= (signed int)v5 ) | |
7226 return 0; | |
7227 result = sr_424CD7(v5); | |
7228 if ( result > 0 ) | |
7229 { | |
7230 __asm { fild pBLVRenderParams->field_40 } | |
7231 _ECX = (char *)&array_507D30[0].vWorldViewPosition; | |
7232 v24 = result; | |
7233 __asm | |
7234 { | |
7235 fmul ds:flt_4D84A4 | |
7236 fild pBLVRenderParams->uViewportCenterX | |
7237 fild pBLVRenderParams->uViewportCenterY | |
7238 } | |
7239 do | |
7240 { | |
7241 __asm | |
7242 { | |
7243 fld1 | |
7244 fdiv dword ptr [ecx] | |
7245 } | |
7246 _ECX += 48; | |
7247 --v24; | |
7248 __asm | |
7249 { | |
7250 fld st | |
7251 fmul dword ptr [ecx-2Ch] | |
7252 fmul st, st(4) | |
7253 fsubr st, st(3) | |
7254 fstp dword ptr [ecx-24h] | |
7255 fmul dword ptr [ecx-28h] | |
7256 fmul st, st(3) | |
7257 fsubr st, st(1) | |
7258 fstp dword ptr [ecx-20h] | |
7259 } | |
7260 } | |
7261 while ( v24 ); | |
7262 __asm | |
7263 { | |
7264 fstp st | |
7265 fstp st | |
7266 fstp st | |
7267 } | |
7268 } | |
7269 memcpy(&array_507D30[result], array_507D30, sizeof(array_507D30[result])); | |
7270 return result;*/ | |
7271 } | |
7272 | |
7273 | |
7274 //----- (00424829) -------------------------------------------------------- | |
7275 bool sub_424829(int a1, BspRenderer_stru2 *a2, BspRenderer_stru2 *a3, int a4) | |
7276 { | |
7277 int v4; // edi@1 | |
7278 BspRenderer_stru2 *v5; // ebx@1 | |
7279 int v6; // eax@3 | |
7280 int v7; // esi@5 | |
7281 int v8; // edx@5 | |
7282 int v9; // ecx@6 | |
7283 int v10; // eax@12 | |
7284 int v11; // edi@13 | |
7285 int v12; // edx@18 | |
7286 int v13; // eax@22 | |
7287 int v14; // edi@28 | |
7288 int v15; // ecx@29 | |
7289 int v16; // edi@30 | |
7290 int v17; // edx@35 | |
7291 int v18; // eax@39 | |
7292 int v19; // eax@44 | |
7293 int v20; // ecx@44 | |
7294 int v21; // edi@45 | |
7295 int v22; // edi@46 | |
7296 __int16 *v23; // ecx@47 | |
7297 int v24; // edx@48 | |
7298 int v25; // eax@50 | |
7299 int v26; // eax@55 | |
7300 signed int v27; // edi@55 | |
7301 int v28; // edx@56 | |
7302 int v29; // edx@57 | |
7303 int v30; // eax@59 | |
7304 int v31; // eax@64 | |
7305 signed int v32; // edi@64 | |
7306 int v33; // edx@65 | |
7307 __int16 *v34; // eax@66 | |
7308 __int16 v35; // dx@66 | |
7309 __int16 v36; // dx@67 | |
7310 __int16 v37; // di@67 | |
7311 __int16 v38; // dx@67 | |
7312 BspRenderer_stru2 *v39; // ecx@69 | |
7313 int v40; // edx@69 | |
7314 int v41; // edi@70 | |
7315 __int16 *v42; // eax@76 | |
7316 __int16 *v43; // eax@81 | |
7317 __int16 *v45; // eax@87 | |
7318 int v46; // edx@87 | |
7319 __int16 v47; // cx@88 | |
7320 int v48; // eax@93 | |
7321 int v49; // esi@93 | |
7322 __int16 *v50; // ecx@94 | |
7323 int v51; // eax@95 | |
7324 int v52; // eax@97 | |
7325 int v53; // [sp+Ch] [bp-34h]@44 | |
7326 int v54; // [sp+10h] [bp-30h]@0 | |
7327 int v55; // [sp+14h] [bp-2Ch]@12 | |
7328 __int16 *v56; // [sp+14h] [bp-2Ch]@47 | |
7329 __int16 *v57; // [sp+14h] [bp-2Ch]@76 | |
7330 __int16 *v58; // [sp+14h] [bp-2Ch]@81 | |
7331 __int16 *v59; // [sp+14h] [bp-2Ch]@87 | |
7332 BspRenderer_stru2 *v60; // [sp+18h] [bp-28h]@1 | |
7333 int v61; // [sp+1Ch] [bp-24h]@29 | |
7334 int v62; // [sp+20h] [bp-20h]@0 | |
7335 signed int v63; // [sp+24h] [bp-1Ch]@3 | |
7336 signed int v64; // [sp+28h] [bp-18h]@3 | |
7337 int v65; // [sp+2Ch] [bp-14h]@5 | |
7338 int v66; // [sp+2Ch] [bp-14h]@39 | |
7339 int v67; // [sp+30h] [bp-10h]@22 | |
7340 int v68; // [sp+34h] [bp-Ch]@12 | |
7341 int v69; // [sp+34h] [bp-Ch]@29 | |
7342 int v70; // [sp+34h] [bp-Ch]@46 | |
7343 int v71; // [sp+34h] [bp-Ch]@75 | |
7344 int v72; // [sp+34h] [bp-Ch]@80 | |
7345 int v73; // [sp+38h] [bp-8h]@11 | |
7346 int v74; // [sp+3Ch] [bp-4h]@1 | |
7347 int a3a; // [sp+48h] [bp+8h]@76 | |
7348 int a3b; // [sp+48h] [bp+8h]@87 | |
7349 | |
7350 v4 = a1; | |
7351 v5 = a2; | |
7352 v74 = a1; | |
7353 v60 = a2; | |
7354 if ( !a1 | |
7355 || (!dword_50B700 ? (v64 = -1, v6 = 1, v63 = 1) : (v6 = 1, v63 = -1, v64 = 1), | |
7356 v7 = dword_50B9D8_ys[0], | |
7357 v65 = 0, | |
7358 v8 = dword_50B9D8_ys[0], | |
7359 a1 <= v6) ) | |
7360 return 0; | |
7361 do | |
7362 { | |
7363 v9 = dword_50B9D8_ys[v6]; | |
7364 if ( v9 >= v7 ) | |
7365 { | |
7366 if ( v9 > v8 ) | |
7367 v8 = dword_50B9D8_ys[v6]; | |
7368 } | |
7369 else | |
7370 { | |
7371 v65 = v6; | |
7372 v7 = dword_50B9D8_ys[v6]; | |
7373 } | |
7374 ++v6; | |
7375 } | |
7376 while ( v6 < v4 ); | |
7377 v73 = v8; | |
7378 if ( v8 == v7 ) | |
7379 return 0; | |
7380 v10 = v65; | |
7381 v68 = 0; | |
7382 v5->_viewport_space_y = v7; | |
7383 v5->_viewport_space_w = v8; | |
7384 v55 = v65; | |
7385 if ( v4 > 0 ) | |
7386 { | |
7387 v11 = v65; | |
7388 do | |
7389 { | |
7390 v10 += v64; | |
7391 if ( v10 < v74 ) | |
7392 { | |
7393 if ( v10 < 0 ) | |
7394 v10 += v74; | |
7395 } | |
7396 else | |
7397 { | |
7398 v10 -= v74; | |
7399 } | |
7400 v12 = dword_50B9D8_ys[v10]; | |
7401 if ( v12 <= dword_50B9D8_ys[v11] ) | |
7402 { | |
7403 v55 = v10; | |
7404 v11 = v10; | |
7405 } | |
7406 if ( v12 == v73 ) | |
7407 break; | |
7408 ++v68; | |
7409 } | |
7410 while ( v68 < v74 ); | |
7411 } | |
7412 v13 = v55 + v64; | |
7413 v67 = v55 + v64; | |
7414 if ( v55 + v64 < v74 ) | |
7415 { | |
7416 if ( v13 >= 0 ) | |
7417 goto LABEL_27; | |
7418 v13 += v74; | |
7419 } | |
7420 else | |
7421 { | |
7422 v13 -= v74; | |
7423 } | |
7424 v67 = v13; | |
7425 LABEL_27: | |
7426 if ( dword_50B9D8_ys[v13] != dword_50B9D8_ys[v55] ) | |
7427 { | |
7428 v14 = dword_50BAC8[v55]; | |
7429 v62 = v14 << 16; | |
7430 v54 = ((dword_50BAC8[v13] - v14) << 16) / (dword_50B9D8_ys[v13] - dword_50B9D8_ys[v55]); | |
7431 v5->array_18[v7] = LOWORD(dword_50BAC8[v55]); | |
7432 } | |
7433 v15 = v65; | |
7434 v69 = 0; | |
7435 v61 = v65; | |
7436 if ( v74 > 0 ) | |
7437 { | |
7438 v16 = v65; | |
7439 do | |
7440 { | |
7441 v15 += v63; | |
7442 if ( v15 < v74 ) | |
7443 { | |
7444 if ( v15 < 0 ) | |
7445 v15 += v74; | |
7446 } | |
7447 else | |
7448 { | |
7449 v15 -= v74; | |
7450 } | |
7451 v17 = dword_50B9D8_ys[v15]; | |
7452 if ( v17 <= dword_50B9D8_ys[v16] ) | |
7453 { | |
7454 v61 = v15; | |
7455 v16 = v15; | |
7456 } | |
7457 if ( v17 == v73 ) | |
7458 break; | |
7459 ++v69; | |
7460 } | |
7461 while ( v69 < v74 ); | |
7462 } | |
7463 v18 = v63 + v61; | |
7464 v66 = v63 + v61; | |
7465 if ( v63 + v61 < v74 ) | |
7466 { | |
7467 if ( v18 >= 0 ) | |
7468 goto LABEL_44; | |
7469 v18 += v74; | |
7470 } | |
7471 else | |
7472 { | |
7473 v18 -= v74; | |
7474 } | |
7475 v66 = v18; | |
7476 LABEL_44: | |
7477 v19 = v18; | |
7478 v20 = v61; | |
7479 v53 = dword_50B9D8_ys[v19] - dword_50B9D8_ys[v61]; | |
7480 if ( dword_50B9D8_ys[v19] != dword_50B9D8_ys[v61] ) | |
7481 { | |
7482 v21 = dword_50BAC8[v20]; | |
7483 v5 = v60; | |
7484 v61 = v21 << 16; | |
7485 v53 = ((dword_50BAC8[v19] - v21) << 16) / v53; | |
7486 v60->array_3D8[v73] = LOWORD(dword_50BAC8[v20]); | |
7487 } | |
7488 v22 = v7; | |
7489 v70 = v7; | |
7490 if ( v7 <= v73 ) | |
7491 { | |
7492 v56 = &v5->array_3D8[v7]; | |
7493 v23 = &v5->array_18[v7]; | |
7494 do | |
7495 { | |
7496 v24 = v67; | |
7497 if ( v22 < dword_50B9D8_ys[v67] || v22 == v73 ) | |
7498 goto LABEL_57; | |
7499 v25 = v64 + v67; | |
7500 v67 = v25; | |
7501 if ( v25 < v74 ) | |
7502 { | |
7503 if ( v25 >= 0 ) | |
7504 goto LABEL_55; | |
7505 v25 += v74; | |
7506 } | |
7507 else | |
7508 { | |
7509 v25 -= v74; | |
7510 } | |
7511 v67 = v25; | |
7512 LABEL_55: | |
7513 v26 = v25; | |
7514 v27 = dword_50B9D8_ys[v26] - dword_50B9D8_ys[v24]; | |
7515 if ( dword_50B9D8_ys[v26] - dword_50B9D8_ys[v24] > 0 ) | |
7516 { | |
7517 v28 = dword_50BAC8[v24]; | |
7518 v54 = ((dword_50BAC8[v26] - v28) << 16) / v27; | |
7519 v62 = v28 << 16; | |
7520 } | |
7521 LABEL_57: | |
7522 v29 = v66; | |
7523 if ( v70 >= dword_50B9D8_ys[v66] && v70 != v73 ) | |
7524 { | |
7525 v30 = v63 + v66; | |
7526 v66 += v63; | |
7527 if ( v66 >= v74 ) | |
7528 { | |
7529 v30 -= v74; | |
7530 goto LABEL_63; | |
7531 } | |
7532 if ( v30 < 0 ) | |
7533 { | |
7534 v30 += v74; | |
7535 LABEL_63: | |
7536 v66 = v30; | |
7537 } | |
7538 v31 = v30; | |
7539 v32 = dword_50B9D8_ys[v31] - dword_50B9D8_ys[v29]; | |
7540 if ( dword_50B9D8_ys[v31] - dword_50B9D8_ys[v29] > 0 ) | |
7541 { | |
7542 v33 = dword_50BAC8[v29]; | |
7543 v53 = ((dword_50BAC8[v31] - v33) << 16) / v32; | |
7544 v61 = v33 << 16; | |
7545 } | |
7546 } | |
7547 *(__int16 *)((char *)v56 + (int)(char *)v5->array_18 - (char *)v5->array_3D8) = HIWORD(v62); | |
7548 *v56 = HIWORD(v61); | |
7549 v34 = v23 + 480; | |
7550 v35 = v23[480]; | |
7551 if ( *v23 > v35 ) | |
7552 { | |
7553 v36 = *v23 ^ v35; | |
7554 v37 = *v34; | |
7555 *v23 = v36; | |
7556 v38 = v37 ^ v36; | |
7557 *v23 ^= v38; | |
7558 *v34 = v38; | |
7559 } | |
7560 ++v56; | |
7561 v62 += v54; | |
7562 v22 = v70 + 1; | |
7563 v61 += v53; | |
7564 ++v23; | |
7565 ++v70; | |
7566 } | |
7567 while ( v70 <= v73 ); | |
7568 } | |
7569 v39 = a3; | |
7570 v40 = v73; | |
7571 if ( v73 < a3->_viewport_space_y || (v41 = a3->_viewport_space_w, v7 > v41) ) | |
7572 return 0; | |
7573 if ( v7 < a3->_viewport_space_y ) | |
7574 v7 = a3->_viewport_space_y; | |
7575 if ( v73 > v41 ) | |
7576 { | |
7577 v40 = a3->_viewport_space_w; | |
7578 v73 = a3->_viewport_space_w; | |
7579 } | |
7580 v71 = v7; | |
7581 if ( v7 <= v40 ) | |
7582 { | |
7583 a3a = (char *)v5 - (char *)a3; | |
7584 v57 = &v5->array_18[v7]; | |
7585 v42 = &v39->array_3D8[v7]; | |
7586 do | |
7587 { | |
7588 if ( *(__int16 *)((char *)v42 + a3a) >= *(v42 - 480) && *v57 <= *v42 ) | |
7589 break; | |
7590 ++v57; | |
7591 ++v7; | |
7592 ++v71; | |
7593 ++v42; | |
7594 } | |
7595 while ( v71 <= v40 ); | |
7596 } | |
7597 v72 = v40; | |
7598 if ( v40 < v7 ) | |
7599 return 0; | |
7600 v58 = &v5->array_18[v40]; | |
7601 v43 = &v39->array_3D8[v40]; | |
7602 do | |
7603 { | |
7604 if ( *(__int16 *)((char *)v43 + (int)(char *)v5 - (char *)v39) >= *(v43 - 480) && *v58 <= *v43 ) | |
7605 break; | |
7606 --v58; | |
7607 --v40; | |
7608 --v72; | |
7609 --v43; | |
7610 v73 = v40; | |
7611 } | |
7612 while ( v72 >= v7 ); | |
7613 if ( v7 >= v40 ) | |
7614 return 0; | |
7615 a3b = (char *)v39 - (char *)v5; | |
7616 v59 = &v39->array_3D8[v7]; | |
7617 v45 = &v5->array_18[v7]; | |
7618 v46 = v73 - v7 + 1; | |
7619 do | |
7620 { | |
7621 v47 = *(__int16 *)((char *)v45 + a3b); | |
7622 if ( *v45 < v47 ) | |
7623 *v45 = v47; | |
7624 if ( v45[480] > *v59 ) | |
7625 v45[480] = *v59; | |
7626 ++v59; | |
7627 ++v45; | |
7628 --v46; | |
7629 } | |
7630 while ( v46 ); | |
7631 v5->_viewport_space_y = v7; | |
7632 v5->_viewport_space_w = v73; | |
7633 v5->field_8 = v5->array_18[v7]; | |
7634 v48 = v5->array_3D8[v7]; | |
7635 v5->field_10 = v7; | |
7636 v5->field_14 = v7; | |
7637 v49 = v7 + 1; | |
7638 v5->field_C = v48; | |
7639 if ( v49 <= v73 ) | |
7640 { | |
7641 v50 = &v5->array_3D8[v49]; | |
7642 do | |
7643 { | |
7644 v51 = *(v50 - 480); | |
7645 if ( v51 < v5->field_8 ) | |
7646 { | |
7647 v5->field_8 = v51; | |
7648 v5->field_10 = v49; | |
7649 } | |
7650 v52 = *v50; | |
7651 if ( v52 > v5->field_C ) | |
7652 { | |
7653 v5->field_C = v52; | |
7654 v5->field_14 = v49; | |
7655 } | |
7656 ++v49; | |
7657 ++v50; | |
7658 } | |
7659 while ( v49 <= v73 ); | |
7660 } | |
7661 return 1; | |
7662 } | |
7663 // 50B700: using guessed type int dword_50B700; | |
7664 | |
7665 //----- (00424CD7) -------------------------------------------------------- | |
7666 signed int __fastcall sr_424CD7(unsigned int uVertexID) | |
7667 { | |
7668 unsigned int v1; // edx@1 | |
7669 signed int v2; // edi@1 | |
7670 char *v3; // esi@4 | |
7671 char *v4; // ecx@4 | |
7672 unsigned int v5; // eax@4 | |
7673 char *v6; // edx@4 | |
7674 double v7; // st6@10 | |
7675 double v8; // st5@10 | |
7676 double v9; // st6@11 | |
7677 unsigned __int8 v10; // c2@15 | |
7678 unsigned __int8 v11; // c3@15 | |
7679 RenderVertexSoft *v12; // edi@22 | |
7680 char *v13; // eax@22 | |
7681 double v14; // st6@22 | |
7682 signed int result; // eax@24 | |
7683 unsigned int v16; // [sp+8h] [bp-28h]@4 | |
7684 bool v17; // [sp+Ch] [bp-24h]@6 | |
7685 char *v18; // [sp+10h] [bp-20h]@4 | |
7686 char *v19; // [sp+14h] [bp-1Ch]@4 | |
7687 signed int v20; // [sp+18h] [bp-18h]@1 | |
7688 RenderVertexSoft *v21; // [sp+1Ch] [bp-14h]@4 | |
7689 char *v22; // [sp+20h] [bp-10h]@4 | |
7690 char *v23; // [sp+24h] [bp-Ch]@4 | |
7691 char *v24; // [sp+28h] [bp-8h]@4 | |
7692 char *v25; // [sp+2Ch] [bp-4h]@4 | |
7693 | |
7694 v1 = uVertexID; | |
7695 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); | |
7696 v2 = 0; | |
7697 v20 = 0; | |
7698 if ( array_50AC10[0].vWorldViewPosition.x >= 8.0 ) | |
7699 v2 = 1; | |
7700 if ( (signed int)(uVertexID + 1) <= 1 ) | |
7701 return 0; | |
7702 v3 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
7703 v4 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
7704 v5 = v1; | |
168 | 7705 v23 = (char *)&array_507D30[0]._rhw; |
0 | 7706 v21 = array_507D30; |
7707 v18 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
7708 v19 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
7709 v22 = (char *)&array_507D30[0].vWorldViewPosition; | |
7710 v24 = (char *)&array_507D30[0].v; | |
7711 v25 = (char *)&array_507D30[0].u; | |
7712 v6 = (char *)&array_50AC10[0].v; | |
7713 v16 = v5; | |
7714 do | |
7715 { | |
7716 v17 = *((float *)v6 + 5) >= 8.0; | |
7717 if ( v2 != v17 ) | |
7718 { | |
7719 if ( v17 ) | |
7720 { | |
7721 v7 = (8.0 - *((float *)v6 - 7)) / (*((float *)v6 + 5) - *((float *)v6 - 7)); | |
7722 *(float *)v4 = (*((float *)v6 + 6) - *((float *)v6 - 6)) * v7 + *((float *)v6 - 6); | |
7723 *(float *)v3 = (*((float *)v6 + 7) - *((float *)v6 - 5)) * v7 + *((float *)v6 - 5); | |
7724 *(float *)v25 = (*((float *)v6 + 11) - *((float *)v6 - 1)) * v7 + *((float *)v6 - 1); | |
7725 v8 = (*((float *)v6 + 12) - *(float *)v6) * v7 + *(float *)v6; | |
7726 } | |
7727 else | |
7728 { | |
7729 v9 = (8.0 - *((float *)v6 + 5)) / (*((float *)v6 - 7) - *((float *)v6 + 5)); | |
7730 *(float *)v4 = (*((float *)v6 - 6) - *((float *)v6 + 6)) * v9 + *((float *)v6 + 6); | |
7731 *(float *)v3 = (*((float *)v6 - 5) - *((float *)v6 + 7)) * v9 + *((float *)v6 + 7); | |
7732 *(float *)v25 = (*((float *)v6 - 1) - *((float *)v6 + 11)) * v9 + *((float *)v6 + 11); | |
7733 v8 = (*(float *)v6 - *((float *)v6 + 12)) * v9 + *((float *)v6 + 12); | |
7734 } | |
7735 *(float *)v24 = v8; | |
7736 *(float *)v22 = 8.0; | |
7737 *(int *)v23 = 0x3E000000u; | |
7738 if ( v2 ) | |
7739 { | |
7740 if ( 8.0 == *((float *)v6 - 7) && *(float *)v4 == *((float *)v6 - 6) ) | |
7741 { | |
7742 v10 = 0; | |
7743 v11 = *(float *)v3 == *((float *)v6 - 5); | |
7744 goto LABEL_19; | |
7745 } | |
7746 } | |
7747 else | |
7748 { | |
7749 if ( 8.0 == *((float *)v6 + 5) && *(float *)v4 == *((float *)v6 + 6) ) | |
7750 { | |
7751 v10 = 0; | |
7752 v11 = *(float *)v3 == *((float *)v6 + 7); | |
7753 LABEL_19: | |
7754 if ( v11 | v10 ) | |
7755 goto LABEL_21; | |
7756 goto LABEL_20; | |
7757 } | |
7758 } | |
7759 LABEL_20: | |
7760 ++v21; | |
7761 v22 += 48; | |
7762 v24 += 48; | |
7763 v25 += 48; | |
7764 v4 += 48; | |
7765 v3 += 48; | |
7766 ++v20; | |
7767 v23 += 48; | |
7768 v19 = v4; | |
7769 v18 = v3; | |
7770 } | |
7771 LABEL_21: | |
7772 if ( v17 ) | |
7773 { | |
7774 v12 = v21; | |
7775 v13 = v23; | |
7776 v19 += 48; | |
7777 v18 += 48; | |
7778 v14 = 1.0 / (*((float *)v6 + 5) + 0.0000001); | |
7779 ++v20; | |
7780 v25 += 48; | |
7781 v24 += 48; | |
7782 v22 += 48; | |
7783 ++v21; | |
7784 v23 += 48; | |
7785 memcpy(v12, v6 + 8, 0x30u); | |
7786 v4 = v19; | |
7787 v3 = v18; | |
7788 *(float *)v13 = v14; | |
7789 } | |
7790 v2 = v17; | |
7791 v6 += 48; | |
7792 --v16; | |
7793 } | |
7794 while ( v16 ); | |
7795 result = v20; | |
7796 if ( v20 < 3 ) | |
7797 return 0; | |
7798 return result; | |
7799 } |