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