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