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