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