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