Mercurial > mm7
annotate mm7_1.cpp @ 615:8a0ec99a5177
Слияние
author | Ritor1 |
---|---|
date | Fri, 08 Mar 2013 18:00:43 +0600 |
parents | 5bf285f56fa8 cfca6297e4ae |
children | 0e368c04acfb |
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 { | |
586 | 1936 switch(v26) |
585 | 1937 { |
586 | 1938 case VK_LEFT: |
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 ) | |
585 | 1952 { |
586 | 1953 break; |
1954 } | |
1955 v9 = pWindowList[v3].pControlsHead; | |
1956 v13 = pWindowList[v3].pCurrentPosActiveItem; | |
1957 if ( v13 > (signed int)v1 ) | |
1958 { | |
1959 do | |
1960 { | |
1961 v9 = v9->pNext; | |
1962 --v13; | |
1963 } | |
1964 while ( v13 ); | |
1965 } | |
1966 v11 = v9->uControlParam; | |
1967 /*if ( (signed int)v2 < 40 ) | |
1968 { | |
1969 pMessageQueue_50CBD0->pMessages[v2].eType = (UIMessageType)v9->uControlID; | |
1970 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v11; | |
1971 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = v1; | |
1972 v2 = pMessageQueue_50CBD0->uNumMessages + 1; | |
1973 ++pMessageQueue_50CBD0->uNumMessages; | |
1974 }*/ | |
1975 pMessageQueue_50CBD0->AddMessage((UIMessageType)v9->uControlID, v11, v1); | |
1976 break; | |
585 | 1977 } |
586 | 1978 case VK_RIGHT: |
1979 { | |
1980 v7 = pWindowList[v3].pCurrentPosActiveItem + pWindowList[v3].field_34; | |
1981 if ( v7 < pWindowList[v3].pNumPresenceButton + pWindowList[v3].pStartingPosActiveItem ) | |
585 | 1982 { |
586 | 1983 v8 = pCurrentScreen == SCREEN_PARTY_CREATION; |
1984 pWindowList[v3].pCurrentPosActiveItem = v7; | |
1985 if ( v8 ) | |
1986 { | |
1987 pAudioPlayer->PlaySound(SOUND_Button, v1, v1, -1, v1, v1, v1, v1); | |
1988 v2 = pMessageQueue_50CBD0->uNumMessages; | |
1989 } | |
1990 } | |
1991 if ( pWindowList[v3].field_30 != v1 ) | |
1992 { | |
1993 break; | |
585 | 1994 } |
586 | 1995 v9 = pWindowList[v3].pControlsHead; |
1996 v10 = pWindowList[v3].pCurrentPosActiveItem; | |
1997 if ( v10 > (signed int)v1 ) | |
585 | 1998 { |
586 | 1999 do |
2000 { | |
2001 v9 = v9->pNext; | |
2002 --v10; | |
2003 } | |
2004 while ( v10 ); | |
2005 } | |
2006 v11 = v9->uControlParam; | |
2007 pMessageQueue_50CBD0->AddMessage((UIMessageType)v9->uControlID, v11, v1); | |
2008 break; | |
585 | 2009 } |
586 | 2010 case VK_DOWN: |
585 | 2011 { |
586 | 2012 v17 = pWindowList[v3].pStartingPosActiveItem; |
2013 v18 = pWindowList[v3].pCurrentPosActiveItem; | |
2014 if ( v18 >= pWindowList[v3].pNumPresenceButton + v17 - 1 ) | |
2015 pWindowList[v3].pCurrentPosActiveItem = v17; | |
2016 else | |
2017 pWindowList[v3].pCurrentPosActiveItem = v18 + 1; | |
2018 if ( pWindowList[v3].field_30 != v1 ) | |
2019 return 1; | |
2020 v19 = pWindowList[v3].pControlsHead; | |
2021 v20 = pWindowList[v3].pCurrentPosActiveItem; | |
2022 if ( v20 > (signed int)v1 ) | |
2023 { | |
585 | 2024 do |
2025 { | |
586 | 2026 v19 = v19->pNext; |
2027 --v20; | |
585 | 2028 } |
586 | 2029 while ( v20 ); |
585 | 2030 } |
586 | 2031 v21 = v19->uControlParam; |
2032 pMessageQueue_50CBD0->AddMessage((UIMessageType)v19->uControlID, v21, v1); | |
585 | 2033 return 1; |
586 | 2034 } |
2035 case VK_SELECT: | |
2036 { | |
2037 pMouse->GetClickPos(&uClickX, &uClickY); | |
2038 v4 = pWindowList[v3].pStartingPosActiveItem; | |
2039 v28 = v4 + pWindowList[v3].pNumPresenceButton; | |
2040 if ( v4 < v4 + pWindowList[v3].pNumPresenceButton ) | |
2041 { | |
2042 while ( 1 ) | |
2043 { | |
2044 v5 = pWindowList[v3].pControlsHead; | |
2045 if ( v4 > 0 ) | |
2046 { | |
2047 v6 = v4; | |
2048 do | |
2049 { | |
2050 v5 = v5->pNext; | |
2051 --v6; | |
2052 } | |
2053 while ( v6 ); | |
2054 } | |
2055 if ( (signed int)uClickX >= (signed int)v5->uX | |
2056 && (signed int)uClickX <= (signed int)v5->uZ | |
2057 && (signed int)uClickY >= (signed int)v5->uY | |
2058 && (signed int)uClickY <= (signed int)v5->uW ) | |
2059 break; | |
2060 ++v4; | |
2061 if ( v4 >= v28 ) | |
2062 { | |
2063 v1 = 0; | |
2064 v2 = pMessageQueue_50CBD0->uNumMessages; | |
2065 --v27; | |
2066 if ( v27 < 0 ) | |
2067 return 0; | |
2068 continue; | |
2069 } | |
2070 } | |
2071 pWindowList[v3].pCurrentPosActiveItem = v4; | |
2072 return 1; | |
2073 } | |
2074 v2 = pMessageQueue_50CBD0->uNumMessages; | |
2075 break; | |
2076 } | |
2077 case VK_UP: | |
2078 { | |
2079 v22 = pWindowList[v3].pCurrentPosActiveItem; | |
2080 v23 = pWindowList[v3].pStartingPosActiveItem; | |
2081 if ( v22 <= v23 ) | |
2082 v24 = pWindowList[v3].pNumPresenceButton + v23 - 1; | |
2083 else | |
2084 v24 = v22 - 1; | |
2085 v8 = pWindowList[v3].field_30 == v1; | |
2086 pWindowList[v3].pCurrentPosActiveItem = v24; | |
2087 if ( !v8 ) | |
2088 return 1; | |
2089 v19 = pWindowList[v3].pControlsHead; | |
2090 v25 = pWindowList[v3].pCurrentPosActiveItem; | |
2091 if ( v25 > (signed int)v1 ) | |
585 | 2092 { |
586 | 2093 do |
2094 { | |
2095 v19 = v19->pNext; | |
2096 --v25; | |
2097 } | |
2098 while ( v25 ); | |
585 | 2099 } |
586 | 2100 v21 = v19->uControlParam; |
2101 /*if ( (signed int)v2 < 40 ) | |
2102 { | |
2103 pMessageQueue_50CBD0->pMessages[v2].eType = (UIMessageType)v19->uControlID; | |
2104 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v21; | |
2105 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = v1; | |
2106 ++pMessageQueue_50CBD0->uNumMessages; | |
2107 }*/ | |
2108 pMessageQueue_50CBD0->AddMessage((UIMessageType)v19->uControlID, v21, v1); | |
585 | 2109 return 1; |
586 | 2110 } |
2111 case VK_NEXT: | |
2112 { | |
2113 if ( pWindowList[v3].field_30 != v1 ) | |
2114 { | |
2115 pMouse->GetClickPos(&uClickX, &uClickY); | |
2116 v4 = pWindowList[v3].pStartingPosActiveItem; | |
2117 v29 = v4 + pWindowList[v3].pNumPresenceButton; | |
2118 if ( v4 < v4 + pWindowList[v3].pNumPresenceButton ) | |
2119 { | |
2120 while ( 1 ) | |
2121 { | |
2122 v14 = pWindowList[v3].pControlsHead; | |
2123 if ( v4 > 0 ) | |
2124 { | |
2125 v15 = v4; | |
2126 do | |
2127 { | |
2128 v14 = v14->pNext; | |
2129 --v15; | |
2130 } | |
2131 while ( v15 ); | |
2132 } | |
2133 if ( (signed int)uClickX >= (signed int)v14->uX | |
2134 && (signed int)uClickX <= (signed int)v14->uZ | |
2135 && (signed int)uClickY >= (signed int)v14->uY | |
2136 && (signed int)uClickY <= (signed int)v14->uW ) | |
2137 { | |
2138 pWindowList[v3].pCurrentPosActiveItem = v4; | |
2139 return 1; | |
2140 } | |
2141 ++v4; | |
2142 if ( v4 >= v29 ) | |
2143 { | |
2144 v1 = 0; | |
2145 v2 = pMessageQueue_50CBD0->uNumMessages; | |
2146 break; | |
2147 } | |
2148 } | |
2149 } | |
2150 else | |
2151 { | |
2152 v2 = pMessageQueue_50CBD0->uNumMessages; | |
2153 } | |
2154 } | |
585 | 2155 break; |
586 | 2156 } |
2157 default: | |
2158 { | |
2159 break; | |
2160 } | |
2161 | |
585 | 2162 } |
2163 } | |
0 | 2164 --v27; |
2165 if ( v27 < 0 ) | |
2166 return 0; | |
2167 } | |
585 | 2168 |
0 | 2169 } |
2170 | |
2171 //----- (0041D20D) -------------------------------------------------------- | |
2172 char __fastcall sub_41D20D_buff_remaining_time_string(int ecx0, GUIWindow *edx0, __int64 a3, GUIFont *a2) | |
2173 { | |
2174 unsigned int v4; // edi@1 | |
2175 unsigned int v5; // esi@1 | |
2176 unsigned int v6; // ebp@1 | |
2177 unsigned int v7; // ebx@1 | |
2178 signed __int64 v8; // ST34_8@1 | |
2179 signed __int64 v9; // kr00_8@1 | |
2180 char *v10; // eax@2 | |
2181 char *v11; // eax@7 | |
2182 char *v12; // eax@13 | |
2183 char *v13; // eax@19 | |
2184 int uY; // [sp+0h] [bp-20h]@1 | |
2185 GUIWindow *a1; // [sp+4h] [bp-1Ch]@1 | |
2186 signed __int64 v17; // [sp+10h] [bp-10h]@1 | |
2187 signed __int64 v18; // [sp+18h] [bp-8h]@1 | |
2188 unsigned int v19; // [sp+24h] [bp+4h]@1 | |
2189 | |
2190 a1 = edx0; | |
2191 uY = ecx0; | |
2192 v4 = (unsigned __int64)(signed __int64)((double)a3 * 0.234375) >> 32; | |
2193 v5 = (signed __int64)((double)a3 * 0.234375); | |
2194 v6 = (unsigned __int64)((signed __int64)((double)a3 * 0.234375) / 60) >> 32; | |
2195 v7 = (signed __int64)((double)a3 * 0.234375) / 60; | |
2196 v8 = (signed __int64)((double)a3 * 0.234375) / 60 / 60; | |
2197 v19 = (unsigned int)v8 / 0x18; | |
2198 v18 = (signed __int64)__PAIR__(v4, v5) % 60; | |
2199 v17 = (signed __int64)__PAIR__(v6, v7) % 60; | |
2200 v9 = v8 % 24; | |
2201 strcpy(pTmpBuf, "\r020"); | |
2202 if ( (unsigned int)v8 / 0x18 ) | |
2203 { | |
2204 v10 = pGlobalTXT_LocalizationStrings[57]; // Days | |
2205 if ( v19 <= 1 ) | |
2206 v10 = pGlobalTXT_LocalizationStrings[56]; // Day | |
2207 sprintf(pTmpBuf2, "%d %s ", v19, v10); | |
2208 strcat(pTmpBuf, pTmpBuf2); | |
2209 } | |
2210 if ( v9 ) | |
2211 { | |
2212 if ( v9 <= 1 ) | |
2213 v11 = pGlobalTXT_LocalizationStrings[109];// Hour | |
2214 else | |
2215 v11 = pGlobalTXT_LocalizationStrings[110];// Hours | |
2216 sprintf(pTmpBuf2, "%d %s ", v9, v11); | |
2217 strcat(pTmpBuf, pTmpBuf2); | |
2218 } | |
2219 if ( v17 && !v19 ) | |
2220 { | |
2221 if ( v17 <= 1 ) | |
2222 v12 = pGlobalTXT_LocalizationStrings[437];// Minute | |
2223 else | |
2224 v12 = pGlobalTXT_LocalizationStrings[436];// Minutes | |
2225 sprintf(pTmpBuf2, "%d %s ", v17, v12); | |
2226 strcat(pTmpBuf, pTmpBuf2); | |
2227 } | |
2228 if ( v18 && !v9 ) | |
2229 { | |
2230 if ( v18 <= 1 ) | |
2231 v13 = pGlobalTXT_LocalizationStrings[439];// Second | |
2232 else | |
2233 v13 = pGlobalTXT_LocalizationStrings[438];// Seconds | |
2234 sprintf(pTmpBuf2, "%d %s ", v18, v13); | |
2235 strcat(pTmpBuf, pTmpBuf2); | |
2236 } | |
2237 return a1->DrawText(a2, 32, uY, 0, pTmpBuf, 0, 0, 0); | |
2238 } | |
2239 | |
2240 | |
2241 //----- (0041D895) -------------------------------------------------------- | |
549 | 2242 void GameUI_DrawItemInfo( struct ItemGen* inspect_item ) |
2243 { | |
0 | 2244 ItemGen *v1; // esi@1 |
2245 unsigned int v2; // eax@3 | |
315 | 2246 //char *v3; // edi@5 |
2247 //unsigned int v4; // eax@5 | |
2248 //unsigned int v5; // esi@5 | |
0 | 2249 signed int v6; // eax@5 |
2250 int v7; // edx@5 | |
315 | 2251 //unsigned int v9; // eax@12 |
0 | 2252 char v10; // zf@16 |
2253 ItemGen *v11; // eax@16 | |
2254 ItemGen *v12; // eax@25 | |
315 | 2255 //unsigned int v13; // ecx@32 |
2256 //unsigned int v14; // eax@32 | |
2257 //Render *v15; // edi@33 | |
0 | 2258 const char *v16; // eax@34 |
2259 int v17; // eax@36 | |
2260 int v18; // esi@37 | |
2261 unsigned __int16 v19; // ax@37 | |
315 | 2262 //char v20; // al@40 |
0 | 2263 char v21; // al@44 |
315 | 2264 //char v22; // al@48 |
2265 //char v23; // al@51 | |
0 | 2266 int v24; // eax@52 |
2267 int v25; // eax@57 | |
2268 int v26; // eax@60 | |
2269 int v27; // eax@67 | |
2270 const char *v28; // edi@69 | |
2271 int v29; // eax@70 | |
549 | 2272 char v30; // edi@78 |
0 | 2273 const char *v31; // eax@78 |
2274 int v32; // ecx@81 | |
2275 unsigned int v33; // eax@81 | |
2276 int v34; // esi@81 | |
2277 const char *v35; // eax@85 | |
2278 const char *v36; // eax@87 | |
2279 unsigned int v37; // eax@109 | |
2280 unsigned int v38; // eax@109 | |
2281 int v39; // eax@113 | |
2282 GUIFont *v40; // edx@113 | |
2283 signed int v41; // [sp-20h] [bp-298h]@113 | |
2284 int v42; // [sp-1Ch] [bp-294h]@113 | |
315 | 2285 //char *v43; // [sp-18h] [bp-290h]@46 |
0 | 2286 unsigned int v44; // [sp-18h] [bp-290h]@113 |
315 | 2287 //int v45; // [sp-14h] [bp-28Ch]@46 |
0 | 2288 const char *v46; // [sp-14h] [bp-28Ch]@58 |
2289 char *v47; // [sp-14h] [bp-28Ch]@110 | |
315 | 2290 //char *v48; // [sp-10h] [bp-288h]@46 |
0 | 2291 const char *v49; // [sp-10h] [bp-288h]@56 |
2292 char *v50; // [sp-10h] [bp-288h]@58 | |
2293 int v51; // [sp-10h] [bp-288h]@110 | |
2294 const char *v52; // [sp-Ch] [bp-284h]@36 | |
315 | 2295 //int v53; // [sp-Ch] [bp-284h]@46 |
0 | 2296 char *v54; // [sp-Ch] [bp-284h]@56 |
2297 int v55; // [sp-Ch] [bp-284h]@58 | |
2298 int v56; // [sp-Ch] [bp-284h]@110 | |
2299 unsigned int v57; // [sp-8h] [bp-280h]@36 | |
315 | 2300 //int v58; // [sp-8h] [bp-280h]@46 |
0 | 2301 int v59; // [sp-8h] [bp-280h]@56 |
2302 int v60; // [sp-8h] [bp-280h]@58 | |
2303 unsigned int v61; // [sp-8h] [bp-280h]@110 | |
549 | 2304 char out_text[300]; // [sp+8h] [bp-270h]@40 |
309 | 2305 //char Dest[100]; // [sp+6Ch] [bp-20Ch]@40 |
2306 //char v64[100]; // [sp+D0h] [bp-1A8h]@40 | |
0 | 2307 char v65[120]; // [sp+134h] [bp-144h]@92 |
2308 char Source[40]; // [sp+1ACh] [bp-CCh]@49 | |
351 | 2309 stru351_summoned_item v67; |
2310 //int v67; // [sp+1D4h] [bp-A4h]@91 | |
2311 //int v68; // [sp+1D8h] [bp-A0h]@106 | |
2312 //int v69; // [sp+1DCh] [bp-9Ch]@101 | |
2313 //int v70; // [sp+1E0h] [bp-98h]@97 | |
2314 //int v71; // [sp+1E8h] [bp-90h]@93 | |
2315 //int v72; // [sp+1ECh] [bp-8Ch]@91 | |
0 | 2316 int var88; // [sp+1F0h] [bp-88h]@1 |
2317 Texture *v73; // [sp+1F4h] [bp-84h]@5 | |
315 | 2318 //unsigned int v75; // [sp+1F8h] [bp-80h]@5 |
2319 //char *v76; // [sp+1FCh] [bp-7Ch]@5 | |
0 | 2320 int v77; // [sp+200h] [bp-78h]@12 |
2321 int v78; // [sp+204h] [bp-74h]@5 | |
549 | 2322 GUIWindow wHintWindow; // [sp+208h] [bp-70h]@2 |
0 | 2323 POINT a2; // [sp+25Ch] [bp-1Ch]@2 |
2324 int v81; // [sp+264h] [bp-14h]@5 | |
549 | 2325 // GUIFont *pFontComic; // [sp+268h] [bp-10h]@1 |
2326 PlayerSpeech v83; // [sp+26Ch] [bp-Ch]@18 | |
2327 char* v84; | |
2328 int v85; | |
0 | 2329 char *Str; // [sp+270h] [bp-8h]@65 |
549 | 2330 |
2331 v1 = inspect_item; | |
0 | 2332 var88 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); |
549 | 2333 if (!inspect_item->uItemID) |
306 | 2334 return; |
2335 | |
549 | 2336 wHintWindow.Hint = 0; |
2337 wHintWindow.uFrameWidth = 384; | |
2338 wHintWindow.uFrameHeight = 180; | |
2339 wHintWindow.uFrameY = 40; | |
0 | 2340 if ( pMouse->GetCursorPos(&a2)->x <= 320 ) |
2341 v2 = pMouse->GetCursorPos(&a2)->x + 30; | |
2342 else | |
549 | 2343 v2 = pMouse->GetCursorPos(&a2)->x - wHintWindow.uFrameWidth - 30; |
2344 wHintWindow.uFrameX = v2; | |
2345 auto item_desc = &pItemsTable->pItems[inspect_item->uItemID]; | |
315 | 2346 //v3 = (char *)&pItemsTable->pItems[_this->uItemID].pIconName; |
2347 //v76 = v3; | |
2348 //v4 = pIcons_LOD->LoadTexture(pItemsTable->pItems[_this->uItemID].pIconName, TEXTURE_16BIT_PALETTE); | |
2349 //v5 = v4; | |
2350 //v4 *= 72; | |
2351 //v75 = v4; | |
2352 //v73 = &pIcons_LOD->pTextures[v4]; | |
2353 v73 = pIcons_LOD->LoadTexturePtr(item_desc->pIconName, TEXTURE_16BIT_PALETTE); | |
2354 v6 = 100 - v73->uTextureWidth; | |
0 | 2355 v7 = v73->uTextureHeight; |
2356 v78 = v6; | |
2357 v81 = 144 - v7; | |
2358 if ( v6 > 0 ) | |
2359 v78 = v6 >> 1; | |
2360 if ( v81 <= 0 ) | |
2361 v81 = 0; | |
2362 else | |
2363 v81 >>= 1; | |
315 | 2364 if ( !item_desc->uItemID_Rep_St ) |
549 | 2365 inspect_item->SetIdentified(); |
315 | 2366 //v9 = v8->uAttributes; |
0 | 2367 v77 = 0; |
315 | 2368 //a2.y = v8->uAttributes & 2; |
549 | 2369 if (pItemsTable->pItems[inspect_item->uItemID].uEquipType == EQUIP_GOLD) |
2370 v77 = inspect_item->uSpecEnchantmentType; | |
0 | 2371 if ( uActiveCharacter ) |
2372 { | |
549 | 2373 //try to identify |
2374 if (!inspect_item->Identified()) | |
0 | 2375 { |
549 | 2376 |
2377 v11 = inspect_item; | |
2378 if ( pPlayers[uActiveCharacter]->CanIdentify(inspect_item) == 1 ) | |
2379 inspect_item->SetIdentified(); | |
2380 v83 = SPEECH_9; | |
2381 if ( !inspect_item->Identified() ) | |
0 | 2382 { |
549 | 2383 ShowStatusBarString(pGlobalTXT_LocalizationStrings[446], 2u);//"Identify Failed" |
0 | 2384 } |
2385 else | |
2386 { | |
549 | 2387 v83 = SPEECH_8; |
2388 if ( inspect_item->GetValue() < 100 * (pPlayers[uActiveCharacter]->uLevel + 5) ) | |
2389 v83 = SPEECH_7; | |
0 | 2390 } |
2391 if ( dword_4E455C ) | |
2392 { | |
187 | 2393 pPlayers[uActiveCharacter]->PlaySound((PlayerSpeech)(int)v83, 0); |
0 | 2394 dword_4E455C = 0; |
2395 } | |
2396 } | |
549 | 2397 inspect_item->UpdateTempBonus(pParty->uTimePlayed); |
2398 if (inspect_item->Broken()) | |
0 | 2399 { |
549 | 2400 if ( pPlayers[uActiveCharacter]->CanRepair(inspect_item) == 1 ) |
2401 inspect_item->uAttributes = inspect_item->uAttributes & 0xFFFFFFFD | 1; | |
2402 v83 = SPEECH_11; | |
2403 if ( !inspect_item->Broken() ) | |
2404 v83 = SPEECH_10; | |
0 | 2405 else |
549 | 2406 ShowStatusBarString(pGlobalTXT_LocalizationStrings[448], 2u);//"Repair Failed" |
0 | 2407 if ( dword_4E455C ) |
2408 { | |
549 | 2409 pPlayers[uActiveCharacter]->PlaySound(v83, 0); |
0 | 2410 dword_4E455C = 0; |
2411 } | |
2412 } | |
2413 } | |
315 | 2414 //v13 = _this->uAttributes; |
2415 //v14 = _this->Identified(); | |
549 | 2416 //a2.y = inspect_item->Identified(); |
2417 if (inspect_item->Broken()) | |
0 | 2418 { |
549 | 2419 wHintWindow.DrawMessageBox(0); |
0 | 2420 //v15 = &; |
549 | 2421 pRenderer->Clip(wHintWindow.uFrameX + 12, wHintWindow.uFrameY + 12, |
2422 wHintWindow.uFrameX + wHintWindow.uFrameWidth - 12, | |
2423 wHintWindow.uFrameY + wHintWindow.uFrameHeight - 12); | |
2424 wHintWindow.uFrameWidth -= 24; | |
2425 wHintWindow.uFrameHeight -= 12; | |
2426 wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1; | |
2427 wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1; | |
2428 pRenderer->DrawTransparentRedShade(wHintWindow.uFrameX + v78, v81 + wHintWindow.uFrameY + 30, v73); | |
2429 if ( inspect_item->Identified()) | |
2430 v16 = inspect_item->GetIdentifiedName(); | |
0 | 2431 else |
315 | 2432 v16 = item_desc->pUnidentifiedName; |
549 | 2433 wHintWindow.DrawTitleText(pFontArrus, 0, 0xCu, var88, v16, 3u); |
2434 v17 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[32], &wHintWindow, 0, 0); //"Broken Item" | |
0 | 2435 v18 = v17 >> 1; |
2436 v19 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0x19u, 0x19u); | |
549 | 2437 wHintWindow.DrawTitleText(pFontArrus, 0x64u, ((signed int)wHintWindow.uFrameHeight >> 1) - v18, v19, pGlobalTXT_LocalizationStrings[32], 3); //"Broken Item" |
586 | 2438 pRenderer->ResetClip(); |
2439 if ( !areWeLoadingTexture ) | |
2440 { | |
2441 v73->Release(); | |
2442 pIcons_LOD->_40F9C5(); | |
2443 } | |
2444 return; | |
549 | 2445 } |
2446 if (!inspect_item->Identified()) | |
2447 { | |
2448 wHintWindow.DrawMessageBox(0); | |
2449 pRenderer->Clip(wHintWindow.uFrameX + 12, wHintWindow.uFrameY + 12, | |
2450 wHintWindow.uFrameX + wHintWindow.uFrameWidth - 12, | |
2451 wHintWindow.uFrameY + wHintWindow.uFrameHeight - 12); | |
2452 wHintWindow.uFrameWidth -= 24; | |
2453 wHintWindow.uFrameHeight -= 12; | |
2454 wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1; | |
2455 wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1; | |
2456 pRenderer->DrawTextureTransparent(wHintWindow.uFrameX + v78, v81 + wHintWindow.uFrameY + 30, v73); | |
2457 wHintWindow.DrawTitleText(pFontArrus, 0, 0xCu, var88, item_desc->pUnidentifiedName, 3u); | |
2458 v17 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[232], &wHintWindow, 0, 0); ///"Not Identified" | |
2459 v18 = v17 >> 1; | |
2460 v19 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0x19u, 0x19u); | |
2461 wHintWindow.DrawTitleText(pFontArrus, 0x64u, ((signed int)wHintWindow.uFrameHeight >> 1) - v18, v19, pGlobalTXT_LocalizationStrings[232], 3); | |
586 | 2462 pRenderer->ResetClip(); |
2463 if ( !areWeLoadingTexture ) | |
2464 { | |
2465 v73->Release(); | |
2466 pIcons_LOD->_40F9C5(); | |
2467 } | |
2468 return; | |
0 | 2469 } |
315 | 2470 |
549 | 2471 sprintfex(out_text, pGlobalTXT_LocalizationStrings[463], item_desc->pUnidentifiedName); //"Type: %s" |
2472 out_text[100] = 0; | |
2473 out_text[200] = 0; | |
315 | 2474 //v20 = item_desc->uEquipType; |
2475 switch (item_desc->uEquipType) | |
2476 { | |
2477 case EQUIP_ONE_OR_TWO_HANDS: | |
2478 case EQUIP_TWO_HANDED: | |
549 | 2479 sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[LOCSTR_ATTACK], |
2480 (int)item_desc->uDamageMod, pGlobalTXT_LocalizationStrings[53], (int)item_desc->uDamageDice, (int)item_desc->uDamageRoll); //"Damage" | |
315 | 2481 if (item_desc->uDamageMod) |
0 | 2482 { |
315 | 2483 char mod[16]; |
2484 sprintf(mod, "+%d", (int)item_desc->uDamageMod); | |
549 | 2485 strcat(out_text + 100, mod); |
315 | 2486 } |
2487 break; | |
2488 | |
2489 case EQUIP_BOW: | |
549 | 2490 sprintfex(out_text + 100, "%s: +%d %s: %dd%d", pGlobalTXT_LocalizationStrings[203], //"Shoot" |
2491 (int)item_desc->uDamageMod, pGlobalTXT_LocalizationStrings[53], //"Damage" | |
2492 (int)item_desc->uDamageDice, (int)item_desc->uDamageRoll); | |
315 | 2493 if (item_desc->uDamageMod) |
2494 { | |
2495 char mod[16]; | |
2496 sprintf(mod, "+%d", (int)item_desc->uDamageMod); | |
549 | 2497 strcat(out_text + 100, mod); |
0 | 2498 } |
315 | 2499 break; |
2500 | |
2501 case EQUIP_ARMOUR: | |
2502 case EQUIP_SHIELD: | |
2503 case EQUIP_HELMET: | |
2504 case EQUIP_BELT: | |
2505 case EQUIP_CLOAK: | |
2506 case EQUIP_GAUNTLETS: | |
2507 case EQUIP_BOOTS: | |
2508 case EQUIP_RING: | |
2509 case EQUIP_AMULET: | |
549 | 2510 if (item_desc->uDamageDice) //"Armor" |
2511 sprintfex(out_text + 100, "%s: +%d", pGlobalTXT_LocalizationStrings[11], item_desc->uDamageDice + item_desc->uDamageMod); | |
315 | 2512 break; |
600 | 2513 |
315 | 2514 } |
2515 | |
586 | 2516 if ( !v77 ) |
2517 { | |
600 | 2518 if (item_desc->uEquipType ==EQUIP_POTION) //this is CORRECT! do not move to switch! |
2519 { | |
2520 if ( inspect_item->uEnchantmentType ) | |
2521 sprintf(out_text + 200, "%s: %d",pGlobalTXT_LocalizationStrings[449] , inspect_item->uEnchantmentType); //"Power" | |
2522 } | |
2523 else if (item_desc->uEquipType == EQUIP_REAGENT) | |
2524 { | |
2525 sprintf(out_text + 200, "%s: %d", pGlobalTXT_LocalizationStrings[449], pItemsTable->pItems[inspect_item->uItemID].uDamageDice); //"Power" | |
2526 } | |
2527 | |
2528 else if ( inspect_item->uEnchantmentType ) | |
586 | 2529 { |
2530 sprintf(out_text + 200, "%s: %s +%d", pGlobalTXT_LocalizationStrings[210], | |
595 | 2531 pItemsTable->pEnchantments[inspect_item->uEnchantmentType-1].pBonusStat, inspect_item->_bonus_strength); //"Special" |
586 | 2532 } |
2533 else if ( inspect_item->uSpecEnchantmentType ) | |
2534 { | |
2535 sprintf(out_text + 200, "%s: %s", pGlobalTXT_LocalizationStrings[210], | |
2536 pItemsTable->pSpecialEnchantments[inspect_item->uSpecEnchantmentType-1].pBonusStatement, inspect_item->_bonus_strength); | |
2537 } | |
583 | 2538 |
586 | 2539 else if ( inspect_item->uNumCharges ) |
2540 { | |
2541 sprintf(out_text + 200, "%s: %lu", pGlobalTXT_LocalizationStrings[464], inspect_item->uNumCharges); //"Charges" | |
2542 | |
2543 } | |
2544 } | |
549 | 2545 wHintWindow.uFrameWidth -= 12; |
2546 v85 = 3; | |
2547 wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1; | |
2548 wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1; | |
2549 Str = (char *)(3 * (LOBYTE(pFontArrus->uFontHeight) + 8)); | |
2550 v84 = &out_text[0]; | |
2551 do | |
2552 { | |
2553 if ( *v84 ) | |
2554 { | |
2555 v27 = pFontComic->CalcTextHeight(v84, &wHintWindow, 100, 0); | |
2556 Str += v27 + 3; | |
2557 } | |
2558 v84 += 100; | |
2559 --v85; | |
2560 } | |
2561 while ( v85 ); | |
2562 v28 = item_desc->pDescription; | |
2563 if ( *v28 ) | |
2564 { | |
2565 v29 = pFontSmallnum->CalcTextHeight(v28, &wHintWindow, 100, 0); | |
2566 Str += v29; | |
2567 } | |
2568 wHintWindow.uFrameHeight = v73->uTextureHeight + v81 + 54; | |
2569 if ( (signed int)Str > (signed int)wHintWindow.uFrameHeight ) | |
2570 wHintWindow.uFrameHeight = (unsigned int)Str; | |
595 | 2571 if ( inspect_item->uAttributes & 8 && (inspect_item->uSpecEnchantmentType || inspect_item->uEnchantmentType) ) |
549 | 2572 wHintWindow.uFrameHeight += LOBYTE(pFontComic->uFontHeight); |
2573 v85 = 0; | |
2574 if ( pFontArrus->uFontHeight ) | |
2575 { | |
2576 wHintWindow.uFrameWidth -= 24; | |
2577 v30 = pFontArrus->uFontHeight; | |
2578 v31 = inspect_item->GetIdentifiedName(); | |
2579 if ( pFontArrus->CalcTextHeight(v31, &wHintWindow, 0, 0) / (signed int)v30 ) | |
2580 v85 = v30; | |
2581 wHintWindow.uFrameWidth += 24; | |
2582 } | |
2583 wHintWindow.uFrameWidth += 12; | |
2584 wHintWindow.uFrameHeight += (unsigned int)v85; | |
2585 wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1; | |
2586 wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1; | |
2587 wHintWindow.DrawMessageBox(0); | |
2588 //v15 = pRenderer; | |
2589 pRenderer->Clip(wHintWindow.uFrameX + 12, wHintWindow.uFrameY + 12, | |
2590 wHintWindow.uFrameX + wHintWindow.uFrameWidth - 12, wHintWindow.uFrameY + wHintWindow.uFrameHeight - 12); | |
2591 wHintWindow.uFrameWidth -= 12; | |
2592 v32 = v73->uTextureHeight; | |
2593 v33 = wHintWindow.uFrameHeight; | |
2594 wHintWindow.uFrameHeight -= 12; | |
2595 wHintWindow.uFrameZ = wHintWindow.uFrameX + wHintWindow.uFrameWidth - 1; | |
2596 wHintWindow.uFrameW = wHintWindow.uFrameY + wHintWindow.uFrameHeight - 1; | |
2597 pRenderer->DrawTextureTransparent( | |
2598 wHintWindow.uFrameX + v78, | |
2599 wHintWindow.uFrameY + (signed int)(v33 - v32) / 2, | |
2600 v73); | |
2601 | |
2602 v34 = (int)(v85 + 35); | |
2603 v85 = 3; | |
2604 Str = out_text; | |
2605 do | |
2606 { | |
2607 if ( *Str ) | |
2608 { | |
2609 wHintWindow.DrawText(pFontComic, 100, v34, 0, Str, 0, 0, 0); | |
2610 v34 += pFontComic->CalcTextHeight(Str, &wHintWindow, 100, 0) + 3; | |
2611 } | |
2612 Str += 100; | |
2613 --v85; | |
2614 } | |
2615 while (v85 ); | |
2616 v35 = item_desc->pDescription; | |
2617 if ( *v35 ) | |
2618 wHintWindow.DrawText(pFontSmallnum, 100, v34, 0, v35, 0, 0, 0); | |
2619 wHintWindow.uFrameX += 12; | |
2620 wHintWindow.uFrameWidth -= 24; | |
2621 v36 = inspect_item->GetIdentifiedName(); | |
2622 wHintWindow.DrawTitleText(pFontArrus, 0, 0xCu, var88, v36, 3u); | |
2623 wHintWindow.uFrameWidth += 24; | |
2624 wHintWindow.uFrameX -= 12; | |
2625 if ( v77 ) | |
2626 { | |
2627 sprintf(pTmpBuf, "%s: %lu", pGlobalTXT_LocalizationStrings[465], v77);//"Value" | |
2628 v40 = pFontComic; | |
2629 v61 = 0; | |
2630 v56 = 0; | |
2631 v51 = 0; | |
2632 v47 = pTmpBuf; | |
2633 v44 = 0; | |
2634 v42 = wHintWindow.uFrameHeight - LOBYTE(pFontComic->uFontHeight); | |
2635 v41 = 100; | |
2636 } | |
2637 else | |
2638 { | |
595 | 2639 if ( (inspect_item->uAttributes & 8) && (inspect_item->uSpecEnchantmentType || inspect_item->uEnchantmentType) ) |
549 | 2640 { |
2641 sub_493F79(&v67, inspect_item->uExpireTime - pParty->uTimePlayed); | |
2642 strcpy(pTmpBuf, "Duration:"); | |
2643 Str = (char *)(v67.field_18_expire_year - game_starting_year); | |
2644 if (v67.field_18_expire_year != 1168 ) | |
2645 { | |
2646 sprintf(v65, " %d:yr", v67.field_18_expire_year - game_starting_year); | |
2647 strcat(pTmpBuf, v65); | |
2648 } | |
2649 if ( (((v67.field_14_exprie_month || Str) && | |
2650 ((sprintf(v65, " %d:mo", v67.field_14_exprie_month), strcat(pTmpBuf, v65), v67.field_14_exprie_month) || Str) | |
2651 || v67.field_C_expire_day) | |
2652 && ((sprintf(v65, " %d:dy", v67.field_C_expire_day), strcat(pTmpBuf, v65), v67.field_14_exprie_month) || Str || | |
2653 v67.field_C_expire_day) | |
2654 || v67.field_8_expire_hour) | |
2655 && ((sprintf(v65, " %d:hr", v67.field_8_expire_hour), strcat(pTmpBuf, v65), v67.field_14_exprie_month) || Str || | |
2656 v67.field_C_expire_day || v67.field_8_expire_hour) | |
2657 || v67.field_4_expire_minute ) | |
2658 { | |
2659 sprintf(v65, " %d:mn", v67.field_4_expire_minute); | |
2660 strcat(pTmpBuf, v65); | |
2661 } | |
2662 wHintWindow.DrawText(pFontComic, 100, wHintWindow.uFrameHeight - 2 * LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf, 0, 0, 0); | |
2663 } | |
2664 v37 = inspect_item->GetValue(); | |
2665 sprintf(pTmpBuf, "%s: %lu", pGlobalTXT_LocalizationStrings[465], v37); | |
2666 wHintWindow.DrawText(pFontComic, 100, wHintWindow.uFrameHeight - LOBYTE(pFontComic->uFontHeight), 0, pTmpBuf, 0, 0, 0); | |
2667 v38 = inspect_item->uAttributes; | |
2668 if ( BYTE1(v38) & 1 ) | |
2669 { | |
2670 v61 = 0; | |
2671 v56 = 0; | |
2672 v51 = 0; | |
2673 v47 = pGlobalTXT_LocalizationStrings[187]; //"Stolen" | |
2674 } | |
2675 else | |
2676 { | |
2677 if ( !(BYTE1(v38) & 2) ) | |
586 | 2678 { |
2679 pRenderer->ResetClip(); | |
2680 if ( !areWeLoadingTexture ) | |
2681 { | |
2682 v73->Release(); | |
2683 pIcons_LOD->_40F9C5(); | |
2684 } | |
2685 return; | |
2686 } | |
549 | 2687 v61 = 0; |
2688 v56 = 0; | |
2689 v51 = 0; | |
2690 v47 = pGlobalTXT_LocalizationStrings[651]; //"Hardened" | |
2691 } | |
2692 LOWORD(v38) = LOWORD(pRenderer->uTargetRMask); | |
2693 v44 = v38; | |
2694 v42 = wHintWindow.uFrameHeight - LOBYTE(pFontComic->uFontHeight); | |
2695 v39 = pFontComic->GetLineWidth(pTmpBuf); | |
2696 v40 = pFontComic; | |
2697 v41 = v39 + 132; | |
2698 } | |
2699 wHintWindow.DrawText(v40, v41, v42, v44, v47, v51, v56, v61); | |
2700 pRenderer->ResetClip(); | |
2701 if ( !areWeLoadingTexture ) | |
2702 { | |
2703 v73->Release(); | |
2704 pIcons_LOD->_40F9C5(); | |
2705 } | |
2706 return; | |
0 | 2707 } |
2708 // 4E455C: using guessed type int dword_4E455C; | |
2709 // 506128: using guessed type int areWeLoadingTexture; | |
2710 | |
549 | 2711 |
0 | 2712 //----- (0041E360) -------------------------------------------------------- |
2713 char *__fastcall MonsterPopup_Draw(unsigned int uActorID, GUIWindow *edx0) | |
2714 { | |
2715 unsigned int v2; // esi@1 | |
2716 Actor *v3; // esi@3 | |
2717 int v4; // eax@3 | |
2718 unsigned int v5; // ecx@3 | |
2719 NPCData *v6; // eax@3 | |
2720 unsigned __int16 v7; // cx@3 | |
2721 int v8; // eax@4 | |
2722 unsigned __int16 v9; // dx@4 | |
2723 SpriteFrame *v10; // edi@17 | |
243 | 2724 LODSprite *v11; // esi@17 |
0 | 2725 unsigned int v12; // ecx@17 |
2726 Sprite *v13; // edi@18 | |
2727 int v14; // ecx@18 | |
2728 int v15; // edx@18 | |
2729 int v16; // edx@18 | |
2730 int v17; // eax@18 | |
2731 unsigned int v18; // ecx@19 | |
2732 unsigned int v19; // eax@21 | |
2733 char *v20; // esi@28 | |
2734 int v21; // edx@29 | |
2735 unsigned __int16 *v22; // ecx@29 | |
2736 int v23; // eax@29 | |
2737 int v24; // eax@32 | |
2738 int v25; // esi@32 | |
2739 char *v26; // edx@34 | |
2740 unsigned __int8 v27; // sf@36 | |
2741 unsigned __int8 v28; // of@36 | |
2742 int v29; // esi@40 | |
2743 char *v30; // ecx@40 | |
2744 int v31; // eax@40 | |
2745 int v32; // esi@43 | |
2746 unsigned __int16 v33; // ax@45 | |
2747 int v34; // edx@45 | |
2748 int v35; // eax@45 | |
2749 int v36; // eax@49 | |
2750 char *v37; // eax@52 | |
2751 int v38; // eax@55 | |
2752 unsigned __int16 v39; // ax@59 | |
2753 SpellBuff *v40; // eax@60 | |
2754 int v41; // edi@61 | |
2755 unsigned int v42; // eax@61 | |
2756 int v43; // eax@62 | |
2757 int v44; // eax@63 | |
2758 signed int v45; // edi@65 | |
2759 unsigned __int16 v46; // ax@73 | |
2760 Player *v47; // ecx@77 | |
2761 unsigned int v48; // eax@85 | |
2762 GUIFont *v49; // edi@90 | |
2763 int v50; // edi@90 | |
2764 SpellBuff *v51; // eax@91 | |
2765 char *v52; // ecx@98 | |
2766 char *v53; // ecx@101 | |
2767 char *v54; // ST0C_4@118 | |
2768 unsigned int v55; // eax@118 | |
2769 GUIFont *v56; // edi@124 | |
2770 unsigned __int8 v57; // al@128 | |
2771 int v58; // eax@132 | |
2772 Actor *v59; // ecx@133 | |
2773 unsigned __int8 v60; // dl@138 | |
2774 char *v62; // eax@147 | |
2775 int v63; // eax@152 | |
2776 char *result; // eax@152 | |
2777 int v65; // eax@155 | |
2778 const char *v66; // [sp-10h] [bp-1FCh]@121 | |
2779 const char *v67; // [sp-10h] [bp-1FCh]@125 | |
2780 const char *v68; // [sp-10h] [bp-1FCh]@142 | |
2781 int v69; // [sp-Ch] [bp-1F8h]@121 | |
2782 char *v70; // [sp-Ch] [bp-1F8h]@125 | |
2783 char *v71; // [sp-Ch] [bp-1F8h]@142 | |
2784 char *v72; // [sp-8h] [bp-1F4h]@54 | |
2785 int v73; // [sp-8h] [bp-1F4h]@79 | |
2786 int v74; // [sp-8h] [bp-1F4h]@121 | |
2787 int v75; // [sp-8h] [bp-1F4h]@125 | |
2788 int v76; // [sp-8h] [bp-1F4h]@142 | |
2789 size_t v77; // [sp-4h] [bp-1F0h]@54 | |
2790 unsigned int v78; // [sp-4h] [bp-1F0h]@121 | |
2791 unsigned int v79; // [sp-4h] [bp-1F0h]@125 | |
2792 char *v80; // [sp-4h] [bp-1F0h]@142 | |
2793 char *v81; // [sp-4h] [bp-1F0h]@148 | |
2794 DDBLTFX Dst; // [sp+Ch] [bp-1E0h]@18 | |
2795 DDSURFACEDESC2 pDesc; // [sp+70h] [bp-17Ch]@18 | |
2796 RECT v84; // [sp+ECh] [bp-100h]@26 | |
241 | 2797 char *v85[10]; // [sp+FCh] [bp-F0h]@145 |
2798 char *v95[11]; // [sp+124h] [bp-C8h]@127 | |
0 | 2799 RenderBillboardTransform_local0 v106; // [sp+150h] [bp-9Ch]@3 |
2800 unsigned int v107; // [sp+1A0h] [bp-4Ch]@18 | |
2801 unsigned __int16 *v108; // [sp+1A4h] [bp-48h]@34 | |
2802 unsigned int v109; // [sp+1A8h] [bp-44h]@32 | |
2803 LPVOID v110; // [sp+1ACh] [bp-40h]@28 | |
2804 unsigned int v111; // [sp+1B0h] [bp-3Ch]@29 | |
2805 char **v112; // [sp+1B4h] [bp-38h]@3 | |
2806 IDirectDrawSurface *v222; // [sp+1B8h] [bp-34h]@18 | |
2807 unsigned __int8 v114; // [sp+1BFh] [bp-2Dh]@133 | |
2808 int v115; // [sp+1C0h] [bp-2Ch]@3 | |
2809 unsigned int v116; // [sp+1C4h] [bp-28h]@18 | |
2810 int i; // [sp+1C8h] [bp-24h]@18 | |
2811 Player *a2; // [sp+1CCh] [bp-20h]@28 | |
2812 int v119; // [sp+1D0h] [bp-1Ch]@18 | |
2813 SpellBuff *v120; // [sp+1D4h] [bp-18h]@18 | |
2814 Actor *v121; // [sp+1D8h] [bp-14h]@3 | |
2815 int a5; // [sp+1DCh] [bp-10h]@3 | |
2816 GUIWindow *a1; // [sp+1E0h] [bp-Ch]@1 | |
2817 int v124; // [sp+1E4h] [bp-8h]@18 | |
2818 char *a4; // [sp+1E8h] [bp-4h]@18 | |
2819 | |
2820 a1 = edx0; | |
2821 v2 = uActorID; | |
2822 | |
2823 static Actor pMonsterInfoUI_Doll; | |
2824 /*if ( !(bMonsterInfoUI_bDollInitialized & 1) ) | |
2825 { | |
2826 bMonsterInfoUI_bDollInitialized |= 1u; | |
2827 Actor::Actor(&pMonsterInfoUI_Doll); | |
2828 atexit(nullsub_3); | |
2829 }*/ | |
2830 v106.uParentBillboardID = -1; | |
2831 v3 = &pActors[v2]; | |
2832 v121 = v3; | |
2833 v4 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE1u, 0xFFu, 0x9Bu); | |
602 | 2834 v5 = v3->sNPC_ID; |
0 | 2835 a5 = v4; |
2836 v6 = GetNPCData(v5); | |
2837 v7 = v3->pMonsterInfo.uID; | |
2838 v112 = (char **)v6; | |
2839 v115 = byte_4E2B70[((signed __int16)v7 - 1) / 3] - 40; | |
2840 if ( v7 == pMonsterInfoUI_Doll.pMonsterInfo.uID ) | |
2841 { | |
2842 v9 = pMonsterInfoUI_Doll.uCurrentActionLength; | |
2843 } | |
2844 else | |
2845 { | |
2846 memcpy(&pMonsterInfoUI_Doll, v3, sizeof(pMonsterInfoUI_Doll)); | |
305 | 2847 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Bored; |
0 | 2848 pMonsterInfoUI_Doll.uCurrentActionTime = 0; |
2849 v8 = rand(); | |
2850 v3 = v121; | |
2851 v9 = v8 % 256 + 128; | |
2852 pMonsterInfoUI_Doll.uCurrentActionLength = v8 % 256 + 128; | |
2853 } | |
2854 if ( (signed int)pMonsterInfoUI_Doll.uCurrentActionTime > (signed __int16)v9 ) | |
2855 { | |
2856 pMonsterInfoUI_Doll.uCurrentActionTime = 0; | |
305 | 2857 if ( pMonsterInfoUI_Doll.uCurrentActionAnimation == ANIM_Bored || pMonsterInfoUI_Doll.uCurrentActionAnimation == ANIM_AtkMelee) |
2858 { | |
2859 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Standing; | |
0 | 2860 pMonsterInfoUI_Doll.uCurrentActionLength = rand() % 128 + 128; |
2861 } | |
2862 else | |
2863 { | |
2864 rand(); | |
305 | 2865 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_Bored; |
0 | 2866 if ( (pMonsterInfoUI_Doll.pMonsterInfo.uID < 115 || pMonsterInfoUI_Doll.pMonsterInfo.uID > 186) |
2867 && (pMonsterInfoUI_Doll.pMonsterInfo.uID < 232 || pMonsterInfoUI_Doll.pMonsterInfo.uID > 249) | |
2868 && rand() % 30 < 100 ) | |
305 | 2869 pMonsterInfoUI_Doll.uCurrentActionAnimation = ANIM_AtkMelee; |
2870 pMonsterInfoUI_Doll.uCurrentActionLength = 8 * pSpriteFrameTable->pSpriteSFrames[v3->pSpriteIDs[(signed __int16)pMonsterInfoUI_Doll.uCurrentActionAnimation]].uAnimLength; | |
2871 } | |
2872 } | |
2873 v10 = pSpriteFrameTable->GetFrame( v3->pSpriteIDs[(signed __int16)pMonsterInfoUI_Doll.uCurrentActionAnimation], pMonsterInfoUI_Doll.uCurrentActionTime); | |
2874 v11 = &pSprites_LOD->pSpriteHeaders[v10->pHwSpriteIDs[0]];//40 * v10->pHwSpriteIDs[0] + 7218180; | |
0 | 2875 v106.pTarget = pRenderer->pTargetSurface; |
2876 v106.pTargetZ = pRenderer->pActiveZBuffer; | |
2877 v106.uTargetPitch = pRenderer->uTargetSurfacePitch; | |
2878 v12 = a1->uFrameY + 52; | |
2879 v106.uViewportX = a1->uFrameX + 13; | |
2880 v106.uViewportY = v12; | |
2881 v106.uViewportW = v12 + 128; | |
2882 v106.uViewportZ = v106.uViewportX + 128; | |
2883 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
|
2884 v106._screenspace_x_scaler_packedfloat = 65536; |
8ab4484c22e0
Billboard drawing's up (actors, decorations, misc sprites)
Nomad
parents:
141
diff
changeset
|
2885 v106._screenspace_y_scaler_packedfloat = 65536; |
243 | 2886 v106.uScreenSpaceY = v115 + v12 + v11->uHeight; |
0 | 2887 v106.pPalette = PaletteManager::Get_Dark_or_Red_LUT(v10->uPaletteIndex, 0, 1); |
2888 v106.sZValue = 0; | |
2889 v106.uFlags = 0; | |
2890 pRenderer->Clip_v2(0, 0, 0x27Fu, 0x1DFu); | |
2891 pRenderer->Line2D(v106.uViewportX - 1, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportY - 1, a5); | |
365 | 2892 pRenderer->Line2D( v106.uViewportX + 129, v106.uViewportY - 1, v106.uViewportX + 129, v106.uViewportW + 1, a5); |
0 | 2893 pRenderer->Line2D(v106.uViewportX + 129, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportW + 1, a5); |
2894 pRenderer->Line2D(v106.uViewportX - 1, v106.uViewportW + 1, v106.uViewportX - 1, v106.uViewportY - 1, a5); | |
2895 if ( pRenderer->pRenderD3D ) | |
2896 { | |
2897 v13 = &pSprites_LOD->pHardwareSprites[v10->pHwSpriteIDs[0]]; | |
2898 v106.uScreenSpaceY = v115 + v106.uViewportY + v13->uBufferHeight; | |
2899 v222 = (IDirectDrawSurface *)v13->pTextureSurface; | |
2900 memset(&Dst, 0, 0x64u); | |
2901 Dst.dwSize = 100; | |
2902 Dst.dwFillColor = 0; | |
2903 memset(&pDesc, 0, 0x7Cu); | |
2904 pDesc.dwSize = 124; | |
2905 v222->GetSurfaceDesc((LPDDSURFACEDESC)&pDesc); | |
2906 v14 = v13->uBufferHeight; | |
2907 v120 = (SpellBuff *)v13->uBufferWidth; | |
2908 v107 = 0; | |
2909 v15 = v13->uAreaX; | |
2910 v119 = (signed int)v120 / 2; | |
2911 i = 0; | |
2912 a4 = (char *)(v106.uScreenSpaceX + v15 - (signed int)v120 / 2); | |
2913 v115 = v13->uAreaY; | |
2914 v16 = v13->uAreaWidth + (signed int)v120 / 2 + v15 - (int)v120; | |
2915 v124 = v106.uScreenSpaceY + v115 - v14; | |
2916 v17 = v13->uAreaHeight + v115 - v14; | |
2917 v116 = v106.uScreenSpaceX + v16; | |
2918 v119 = v106.uScreenSpaceY + v17; | |
2919 if ( (signed int)a4 < (signed int)v106.uViewportX ) | |
2920 { | |
2921 v18 = v106.uViewportX - (int)a4; | |
2922 a4 = (char *)v106.uViewportX; | |
2923 v107 = v18; | |
2924 } | |
2925 if ( v124 < (signed int)v106.uViewportY ) | |
2926 { | |
2927 v19 = v106.uViewportY - v124; | |
2928 v124 = v106.uViewportY; | |
2929 i = v19; | |
2930 } | |
2931 if ( (signed int)v116 > (signed int)v106.uViewportZ ) | |
2932 v116 = v106.uViewportZ; | |
2933 if ( v119 > (signed int)v106.uViewportW ) | |
2934 v119 = v106.uViewportW; | |
499 | 2935 pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, |
0 | 2936 pRenderer->uTargetBMask | pRenderer->uTargetGMask); |
499 | 2937 pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, |
0 | 2938 pRenderer->uTargetBMask | pRenderer->uTargetGMask); |
2939 v84.left = v106.uViewportX; | |
2940 v84.top = v106.uViewportY; | |
2941 v84.right = v106.uViewportZ; | |
2942 v84.bottom = v106.uViewportW; | |
2943 ErrD3D(pRenderer->pBackBuffer4->Blt(&v84, 0, 0, 16778240u, &Dst)); | |
2944 if ( pRenderer->uTargetGBits == 5 ) | |
2945 { | |
2946 memset(&pDesc, 0, 0x7Cu); | |
2947 pDesc.dwSize = 124; | |
242 | 2948 if ( pRenderer->LockSurface_DDraw4((IDirectDrawSurface4 *)v222, &pDesc, DDLOCK_WAIT)) |
2949 { | |
2950 v20 = (char *)v124; | |
2951 v110 = pDesc.lpSurface; | |
2952 a2 = (Player *)v124; | |
2953 if ( v124 < v119 ) | |
2954 { | |
2955 v111 = 2 * pRenderer->uTargetSurfacePitch; | |
2956 v21 = (int)a4; | |
2957 v22 = &pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]]; | |
2958 v23 = i - v124; | |
2959 v120 = (SpellBuff *)&pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]]; | |
2960 v115 = i - v124; | |
2961 while ( 1 ) | |
2962 { | |
2963 v124 = v21; | |
2964 if ( v21 < (signed int)v116 ) | |
2965 { | |
2966 v24 = (int)&v20[v23]; | |
2967 v25 = v107 - v21; | |
2968 v109 = v24; | |
2969 for ( i = v107 - v21; ; v25 = i ) | |
2970 { | |
2971 v108 = (unsigned __int16 *)((pDesc.lPitch >> 1) * pDesc.dwHeight * v109 / v13->uAreaHeight); | |
2972 v26 = (char *)v108 + pDesc.dwWidth * (v25 + v124++) / v13->uAreaWidth; | |
2973 *v22 = *((short *)v110 + (int)v26); | |
2974 ++v22; | |
2975 if ( v124 >= (signed int)v116 ) | |
2976 break; | |
2977 } | |
2978 v23 = v115; | |
2979 } | |
2980 v22 = (unsigned __int16 *)((char *)v120 + v111); | |
2981 v20 = (char *)&a2->pConditions[0] + 1; | |
2982 v28 = __OFSUB__((int)&a2->pConditions[0] + 1, v119); | |
2983 v27 = (signed int)((char *)&a2->pConditions[0] + -v119 + 1) < 0; | |
2984 a2 = (Player *)((char *)a2 + 1); | |
2985 v120 = (SpellBuff *)((char *)v120 + v111); | |
2986 if ( !(v27 ^ v28) ) | |
2987 break; | |
2988 v21 = (int)a4; | |
2989 } | |
2990 } | |
2991 v222->Unlock(0); | |
2992 } | |
2993 } | |
2994 else | |
2995 { | |
2996 memset(&pDesc, 0, 0x7Cu); | |
2997 pDesc.dwSize = 124; | |
2998 if ( pRenderer->LockSurface_DDraw4((IDirectDrawSurface4 *)v222, &pDesc, DDLOCK_WAIT) ) | |
2999 { | |
3000 v108 = (unsigned __int16 *)pDesc.lpSurface; | |
3001 a2 = (Player *)v124; | |
306 | 3002 if ( v124 < v119 ) |
242 | 3003 { |
3004 v109 = 2 * pRenderer->uTargetSurfacePitch; | |
3005 v29 = (int)a4; | |
3006 v30 = (char *)&pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]]; | |
3007 v31 = i - v124; | |
3008 v120 = (SpellBuff *)&pRenderer->pTargetSurface[(int)&a4[v124 * pRenderer->uTargetSurfacePitch]]; | |
3009 v115 = i - v124; | |
3010 while ( 1 ) | |
3011 { | |
3012 v124 = v29; | |
3013 if ( v29 < (signed int)v116 ) | |
3014 { | |
3015 v32 = v107 - (int)a4; | |
3016 v111 = (unsigned int)((char *)a2 + v31); | |
3017 for ( i = v107 - (int)a4; ; v32 = i ) | |
3018 { | |
3019 v110 = (LPVOID)((pDesc.lPitch >> 1) * pDesc.dwHeight * v111 / v13->uAreaHeight); | |
3020 v33 = v108[(int)((char *)v110 + pDesc.dwWidth * (v32 + v124) / v13->uAreaWidth)]; | |
499 | 3021 v34 = v33 & 0x1F | 2 * (unsigned __int16)(v108[(int)((char *)v110 + pDesc.dwWidth * (v32 + v124++) / v13->uAreaWidth)] & 0xFFE0); |
242 | 3022 v35 = v124; |
3023 *(short *)v30 = v34; | |
3024 v30 += 2; | |
3025 if ( v35 >= (signed int)v116 ) | |
3026 break; | |
3027 } | |
3028 v31 = v115; | |
3029 } | |
3030 a2 = (Player *)((char *)a2 + 1); | |
3031 v30 = (char *)v120 + v109; | |
3032 v120 = (SpellBuff *)((char *)v120 + v109); | |
3033 if ( (signed int)a2 >= v119 ) | |
3034 break; | |
3035 v29 = (int)a4; | |
3036 } | |
3037 } | |
3038 v222->Unlock(0); | |
3039 } | |
3040 } | |
0 | 3041 } |
3042 else | |
3043 { | |
499 | 3044 pRenderer->FillRectFast(v106.uViewportX, v106.uViewportY, v106.uViewportZ - v106.uViewportX, v106.uViewportW - v106.uViewportY, 0); |
0 | 3045 v36 = v10->pHwSpriteIDs[0]; |
3046 if ( v36 >= 0 ) | |
3047 pSprites_LOD->pSpriteHeaders[v36]._4ACC38(&v106, 0); | |
3048 } | |
602 | 3049 if ( v121->sNPC_ID ) |
0 | 3050 { |
3051 v37 = v112[6]; | |
3052 if ( v37 ) | |
3053 { | |
264 | 3054 sprintfex(pTmpBuf, pGlobalTXT_LocalizationStrings[429], *v112, aNPCProfessionNames[(signed int)v37]); |
242 | 3055 } |
3056 else | |
3057 { | |
3058 v77 = 2000; | |
3059 v72 = *v112; | |
3060 } | |
0 | 3061 } |
3062 else | |
3063 { | |
3064 v38 = v121->dword_000334_unique_name; | |
3065 v77 = 2000; | |
3066 if ( v38 ) | |
237 | 3067 v72 = pMonsterStats->pPlaceStrings[v38]; |
0 | 3068 else |
3069 v72 = pMonsterStats->pInfos[v121->pMonsterInfo.uID].pName; | |
3070 } | |
602 | 3071 if(!v121->sNPC_ID || (v121->sNPC_ID && !v37)) |
242 | 3072 strncpy(pTmpBuf, v72, v77); |
0 | 3073 v39 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xFFu, 0xFFu, 0x9Bu); |
3074 a1->DrawTitleText(pFontComic, 0, 0xCu, v39, pTmpBuf, 3u); | |
3075 Actor::DrawHealthBar(v121, a1); | |
3076 v119 = 0; | |
3077 pMonsterInfoUI_Doll.uCurrentActionTime += pMiscTimer->uTimeElapsed; | |
3078 v115 = 0; | |
3079 v116 = 0; | |
3080 i = 0; | |
3081 v112 = 0; | |
3082 if ( !uActiveCharacter ) | |
3083 { | |
3084 v45 = 1; | |
242 | 3085 } |
3086 else | |
3087 { | |
3088 LOBYTE(v40) = pPlayers[uActiveCharacter]->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID); | |
3089 v120 = v40; | |
3090 if ( !v40 ) | |
499 | 3091 v45 = 1; |
242 | 3092 else |
3093 { | |
3094 v41 = (unsigned __int8)v40 & 0x3F; | |
3095 v42 = SkillToMastery((unsigned __int16)v40) - 1; | |
3096 if ( !v42 ) | |
3097 { | |
3098 if ( v41 + 10 >= v121->pMonsterInfo.uLevel ) | |
3099 { | |
3100 v45 = 1; | |
3101 v119 = 1; | |
3102 } | |
3103 else | |
499 | 3104 v45 = 1; |
242 | 3105 } |
3106 else | |
3107 { | |
3108 v43 = v42 - 1; | |
3109 if ( !v43 ) | |
3110 { | |
3111 if ( 2 * v41 + 10 >= v121->pMonsterInfo.uLevel ) | |
3112 { | |
3113 v45 = 1; | |
3114 v119 = 1; | |
3115 v116 = 1; | |
3116 } | |
3117 else | |
3118 v45 = 1; | |
3119 } | |
3120 else | |
3121 { | |
3122 v44 = v43 - 1; | |
3123 if ( !v44 ) | |
3124 { | |
3125 if ( 3 * v41 + 10 >= v121->pMonsterInfo.uLevel ) | |
3126 { | |
3127 v45 = 1; | |
3128 v119 = 1; | |
3129 v116 = 1; | |
3130 i = 1; | |
3131 } | |
3132 else | |
3133 { | |
3134 v45 = 1; | |
3135 } | |
3136 } | |
3137 else | |
3138 { | |
3139 if ( v44 != 1 ) | |
3140 v45 = 1; | |
3141 else | |
3142 { | |
3143 v45 = 1; | |
3144 v119 = 1; | |
3145 v116 = 1; | |
3146 i = 1; | |
3147 v112 = (char **)1; | |
3148 } | |
3149 } | |
3150 } | |
3151 } | |
3152 } | |
3153 // LABEL_73: | |
3154 v46 = v121->uAIState; | |
3155 if ( v46 != 5 && v46 != 4 && !dword_507BF0_is_there_popup_onscreen && v120 ) | |
3156 { | |
3157 v47 = pPlayers[uActiveCharacter]; | |
3158 if ( v119 | v116 | i | (unsigned int)v112 ) | |
3159 { | |
3160 if ( v121->pMonsterInfo.uLevel >= v47->uLevel - 5 ) | |
3161 v73 = SPEECH_105; | |
3162 else | |
3163 v73 = SPEECH_104; | |
3164 } | |
3165 else | |
3166 { | |
3167 v73 = SPEECH_106; | |
3168 } | |
3169 v47->PlaySound((PlayerSpeech)v73, 0); | |
3170 } | |
3171 } | |
0 | 3172 a2 = pParty->pPlayers; |
3173 do | |
3174 { | |
3175 LOBYTE(v48) = a2->GetActualSkillLevel(PLAYER_SKILL_MONSTER_ID); | |
3176 v111 = v48; | |
3177 v120 = (SpellBuff *)138; | |
3178 do | |
3179 { | |
3180 if ( (signed int)SkillToMastery(v111) >= 3 ) | |
3181 v115 = v45; | |
3182 v120 = (SpellBuff *)((char *)v120 - 1); | |
3183 } | |
3184 while ( v120 ); | |
3185 ++a2; | |
3186 } | |
3187 while ( (signed int)a2 < (signed int)pParty->pHirelings ); | |
3188 v49 = pFontSmallnum; | |
3189 a2 = (Player *)pFontSmallnum; | |
3190 a1->DrawText(pFontSmallnum, 12, 196, a5, pGlobalTXT_LocalizationStrings[631], 0, 0, 0); | |
3191 v50 = LOBYTE(v49->uFontHeight) + 193; | |
3192 if ( !v115 ) | |
3193 { | |
3194 v78 = 0; | |
3195 v74 = 0; | |
3196 v69 = 0; | |
3197 v66 = pGlobalTXT_LocalizationStrings[630]; | |
587 | 3198 a1->DrawText((GUIFont *)a2, 28, v50, a5, v66, v69, v74, v78); |
0 | 3199 } |
587 | 3200 else |
0 | 3201 { |
587 | 3202 a4 = 0; |
3203 v51 = &v121->pActorBuffs[1]; | |
3204 v222 = 0; | |
3205 v120 = &v121->pActorBuffs[1]; | |
3206 do | |
3207 { | |
3208 if ( (signed __int64)v51->uExpireTime > 0 ) | |
3209 { | |
3210 switch ( (int)v51 ) | |
3211 { | |
3212 case 0u: | |
3213 v124 = 60; | |
3214 a4 = pGlobalTXT_LocalizationStrings[591]; | |
3215 break; | |
3216 case 1u: | |
3217 v124 = 82; | |
3218 a4 = pGlobalTXT_LocalizationStrings[649]; | |
3219 break; | |
3220 case 2u: | |
3221 v124 = 92; | |
3222 a4 = pGlobalTXT_LocalizationStrings[592]; | |
3223 break; | |
3224 case 3u: | |
3225 v124 = 63; | |
3226 a4 = pGlobalTXT_LocalizationStrings[4]; | |
3227 break; | |
3228 case 4u: | |
3229 v52 = pGlobalTXT_LocalizationStrings[220]; | |
3230 a4 = v52; | |
3231 v124 = 81; | |
3232 break; | |
3233 case 5u: | |
3234 v52 = pGlobalTXT_LocalizationStrings[162]; | |
3235 a4 = v52; | |
3236 v124 = 81; | |
3237 break; | |
3238 case 6u: | |
3239 v53 = pGlobalTXT_LocalizationStrings[593]; | |
3240 v124 = 35; | |
3241 a4 = v53; | |
3242 break; | |
3243 case 8u: | |
3244 v53 = pGlobalTXT_LocalizationStrings[608]; | |
3245 v124 = 62; | |
3246 a4 = v53; | |
3247 break; | |
3248 case 7u: | |
3249 case 9u: | |
3250 a4 = 0; | |
3251 v124 = 0; | |
3252 ++v51; | |
3253 v222 = (IDirectDrawSurface *)((char *)v222 + 1); | |
3254 v120 = v51; | |
3255 __debugbreak(); // fix condition | |
3256 continue; | |
3257 case 0xAu: | |
3258 v124 = 47; | |
3259 a4 = pGlobalTXT_LocalizationStrings[221]; | |
3260 break; | |
3261 case 0xBu: | |
3262 v124 = 66; | |
3263 a4 = pGlobalTXT_LocalizationStrings[607]; | |
3264 break; | |
3265 case 0xCu: | |
3266 v124 = 85; | |
3267 a4 = pGlobalTXT_LocalizationStrings[610]; | |
3268 break; | |
3269 case 0xDu: | |
3270 v124 = 86; | |
3271 a4 = pGlobalTXT_LocalizationStrings[609]; | |
3272 break; | |
3273 case 0xEu: | |
3274 v124 = 17; | |
3275 a4 = pGlobalTXT_LocalizationStrings[279]; | |
3276 break; | |
3277 case 0xFu: | |
3278 v124 = 38; | |
3279 a4 = pGlobalTXT_LocalizationStrings[442]; | |
3280 break; | |
3281 case 0x10u: | |
3282 v124 = 46; | |
3283 a4 = pGlobalTXT_LocalizationStrings[443]; | |
3284 break; | |
3285 case 0x11u: | |
3286 v124 = 51; | |
3287 a4 = pGlobalTXT_LocalizationStrings[440]; | |
3288 break; | |
3289 case 0x12u: | |
3290 v124 = 5; | |
3291 a4 = pGlobalTXT_LocalizationStrings[441]; | |
3292 break; | |
3293 case 0x13u: | |
3294 v124 = 95; | |
3295 a4 = pGlobalTXT_LocalizationStrings[229]; | |
3296 break; | |
3297 case 0x14u: | |
3298 v124 = 73; | |
3299 a4 = pGlobalTXT_LocalizationStrings[228]; | |
3300 break; | |
3301 default: | |
3302 a4 = 0; | |
3303 break; | |
3304 } | |
3305 if ( a4 ) | |
3306 { | |
3307 v54 = a4; | |
3308 v55 = GetSpellColor(v124); | |
3309 a1->DrawText((GUIFont *)a2, 28, v50, v55, v54, 0, 0, 0); | |
3310 v50 = v50 + BYTE5(a2->pConditions[0]) - 3; | |
3311 v51 = v120; | |
3312 } | |
3313 } | |
3314 | |
3315 ++v51; | |
3316 v222 = (IDirectDrawSurface *)((char *)v222 + 1); | |
3317 v120 = v51; | |
3318 | |
3319 __debugbreak(); // fix condition | |
3320 } | |
3321 //while ( (signed int)((char *)&v222->lpVtbl + 1) < 22 ); | |
3322 while (true); | |
3323 if ( !a4 ) | |
3324 { | |
3325 v78 = 0; | |
3326 v74 = 0; | |
3327 v69 = 0; | |
3328 v66 = pGlobalTXT_LocalizationStrings[153]; | |
3329 a1->DrawText((GUIFont *)a2, 28, v50, a5, v66, v69, v74, v78); | |
3330 } | |
0 | 3331 } |
3332 v56 = pFontSmallnum; | |
3333 a4 = (char *)v106.uViewportY; | |
3334 if ( v119 ) | |
3335 { | |
241 | 3336 sprintf(pTmpBuf, "%s\f%05u\t100%d\n", pGlobalTXT_LocalizationStrings[108], 0, v121->pMonsterInfo.uHP); |
0 | 3337 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); |
3338 a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; | |
3339 v79 = v121->pMonsterInfo.uAC; | |
3340 v75 = 0; | |
3341 v70 = pGlobalTXT_LocalizationStrings[12]; | |
241 | 3342 v67 = "%s\f%05u\t100%d\n"; |
0 | 3343 } |
3344 else | |
3345 { | |
241 | 3346 sprintf(pTmpBuf, "%s\f%05u\t100%s\n", pGlobalTXT_LocalizationStrings[108], 0, pGlobalTXT_LocalizationStrings[630]); |
0 | 3347 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); |
3348 v79 = (unsigned int)pGlobalTXT_LocalizationStrings[630]; | |
3349 v75 = 0; | |
3350 v70 = pGlobalTXT_LocalizationStrings[12]; | |
3351 a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; | |
241 | 3352 v67 = "%s\f%05u\t100%s\n"; |
0 | 3353 } |
3354 sprintf(pTmpBuf, v67, v70, v75, v79); | |
3355 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); | |
3356 a4 = &a4[LOBYTE(v56->uFontHeight) - 6] + LOBYTE(v56->uFontHeight); | |
241 | 3357 v95[0] = pGlobalTXT_LocalizationStrings[87]; |
3358 v95[1] = pGlobalTXT_LocalizationStrings[6]; | |
3359 v95[2] = pGlobalTXT_LocalizationStrings[240]; | |
3360 v95[3] = pGlobalTXT_LocalizationStrings[70]; | |
3361 v95[4] = pGlobalTXT_LocalizationStrings[624]; | |
3362 v95[5] = pGlobalTXT_LocalizationStrings[138]; | |
3363 v95[6] = pGlobalTXT_LocalizationStrings[214]; | |
3364 v95[7] = pGlobalTXT_LocalizationStrings[142]; | |
3365 v95[8] = pGlobalTXT_LocalizationStrings[29]; | |
3366 v95[9] = pGlobalTXT_LocalizationStrings[133]; | |
3367 v95[10] = pGlobalTXT_LocalizationStrings[54]; | |
0 | 3368 if ( v116 ) |
3369 { | |
241 | 3370 sprintf(pTmpBuf, "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, v95[v121->pMonsterInfo.uAttack1Type]); |
0 | 3371 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); |
3372 a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; | |
3373 v57 = v121->pMonsterInfo.uAttack1DamageBonus; | |
3374 if ( v57 ) | |
499 | 3375 sprintf(pTmpBuf, "%s\f%05u\t080%dd%d+%d\n", pGlobalTXT_LocalizationStrings[53], |
3376 0, v121->pMonsterInfo.uAttack1DamageDiceRolls, v121->pMonsterInfo.uAttack1DamageDiceSides, v57); | |
0 | 3377 else |
499 | 3378 sprintf(pTmpBuf, "%s\f%05u\t080%dd%d\n", pGlobalTXT_LocalizationStrings[53], |
3379 0, v121->pMonsterInfo.uAttack1DamageDiceRolls, v121->pMonsterInfo.uAttack1DamageDiceSides); | |
0 | 3380 } |
3381 else | |
3382 { | |
241 | 3383 sprintf(pTmpBuf, "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[18], 0, pGlobalTXT_LocalizationStrings[630]); |
0 | 3384 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); |
3385 a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; | |
241 | 3386 sprintf(pTmpBuf, "%s\f%05u\t080%s\n", pGlobalTXT_LocalizationStrings[53], 0, pGlobalTXT_LocalizationStrings[630]); |
0 | 3387 } |
3388 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); | |
3389 v58 = LOBYTE(v56->uFontHeight); | |
3390 a4 = &a4[v58 - 6] + v58; | |
3391 if ( !i ) | |
3392 { | |
3393 v80 = pGlobalTXT_LocalizationStrings[630]; | |
3394 v76 = 0; | |
3395 v71 = pGlobalTXT_LocalizationStrings[628]; | |
241 | 3396 v68 = "%s\f%05u\t080%s\n"; |
0 | 3397 sprintf(pTmpBuf, v68, v71, v76, v80); |
3398 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); | |
3399 v58 = LOBYTE(v56->uFontHeight); | |
3400 a4 = &a4[v58 - 3]; | |
3401 } | |
587 | 3402 else |
3403 { | |
3404 v120 = (SpellBuff *)pGlobalTXT_LocalizationStrings[628]; | |
3405 v59 = v121; | |
3406 v114 = v121->pMonsterInfo.uSpell1ID; | |
3407 if ( v114 && v121->pMonsterInfo.uSpell2ID ) | |
3408 v120 = (SpellBuff *)pGlobalTXT_LocalizationStrings[629]; | |
3409 if ( v114 ) | |
3410 { | |
3411 sprintf(pTmpBuf, "%s\f%05u\t060%s\n", v120, 0, pSpellStats->pInfos[v114].pShortName); | |
3412 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); | |
3413 v58 = LOBYTE(v56->uFontHeight); | |
3414 a4 = &a4[v58 - 3]; | |
3415 v59 = v121; | |
3416 } | |
3417 v60 = v59->pMonsterInfo.uSpell2ID; | |
3418 if ( v60 ) | |
3419 { | |
3420 sprintf(pTmpBuf, "\f%05u\t060%s\n", 0, pSpellStats->pInfos[v60].pShortName); | |
3421 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); | |
3422 v58 = LOBYTE(v56->uFontHeight); | |
3423 a4 = &a4[v58 - 3]; | |
3424 v59 = v121; | |
3425 } | |
3426 if ( !v59->pMonsterInfo.uSpell1ID && !v59->pMonsterInfo.uSpell2ID ) | |
3427 { | |
3428 v80 = pGlobalTXT_LocalizationStrings[153]; | |
3429 v76 = 0; | |
3430 v71 = pGlobalTXT_LocalizationStrings[628]; | |
3431 v68 = "%s\f%05u\t060%s\n"; | |
3432 sprintf(pTmpBuf, v68, v71, v76, v80); | |
3433 a1->DrawText(v56, 150, (int)a4, a5, pTmpBuf, 0, 0, 0); | |
3434 v58 = LOBYTE(v56->uFontHeight); | |
3435 a4 = &a4[v58 - 3]; | |
3436 } | |
3437 } | |
0 | 3438 a4 = &a4[v58 - 3]; |
3439 a1->DrawText(v56, 150, (int)a4, a5, pGlobalTXT_LocalizationStrings[626], 0, 0, 0); | |
3440 a4 = &a4[LOBYTE(v56->uFontHeight) - 3]; | |
241 | 3441 v85[0] = pGlobalTXT_LocalizationStrings[87]; |
3442 v85[1] = pGlobalTXT_LocalizationStrings[6]; | |
3443 v85[2] = pGlobalTXT_LocalizationStrings[240]; | |
3444 v85[3] = pGlobalTXT_LocalizationStrings[70]; | |
3445 v85[4] = pGlobalTXT_LocalizationStrings[142]; | |
3446 v85[5] = pGlobalTXT_LocalizationStrings[214]; | |
3447 v85[6] = pGlobalTXT_LocalizationStrings[29]; | |
3448 v85[7] = pGlobalTXT_LocalizationStrings[133]; | |
3449 v85[8] = pGlobalTXT_LocalizationStrings[54]; | |
3450 v85[9] = pGlobalTXT_LocalizationStrings[624]; | |
3451 v95[1] = (char *)v121->pMonsterInfo.uResFire; | |
3452 v95[2] = (char *)v121->pMonsterInfo.uResAir; | |
3453 v95[3] = (char *)v121->pMonsterInfo.uResWater; | |
3454 v95[4] = (char *)v121->pMonsterInfo.uResEarth; | |
3455 v95[5] = (char *)v121->pMonsterInfo.uResMind; | |
3456 v95[6] = (char *)v121->pMonsterInfo.uResSpirit; | |
3457 v95[7] = (char *)v121->pMonsterInfo.uResBody; | |
3458 v95[8] = (char *)v121->pMonsterInfo.uResLight; | |
3459 v95[9] = (char *)v121->pMonsterInfo.uResPhysical; | |
3460 v95[10] = (char *)v121->pMonsterInfo.uResDark; | |
0 | 3461 if ( v112 ) |
3462 { | |
3463 v124 = 0; | |
3464 do | |
3465 { | |
241 | 3466 v62 = v95[v124+1]; |
0 | 3467 if ( v62 == (char *)200 ) |
3468 { | |
3469 v81 = pGlobalTXT_LocalizationStrings[625]; | |
3470 } | |
3471 else | |
3472 { | |
3473 if ( v62 ) | |
3474 v81 = pGlobalTXT_LocalizationStrings[627]; | |
3475 else | |
3476 v81 = pGlobalTXT_LocalizationStrings[153]; | |
3477 } | |
241 | 3478 sprintf(pTmpBuf, "%s\f%05u\t070%s\n", v85[v124], 0, v81); |
0 | 3479 a1->DrawText(v56, 170, (int)a4, a5, pTmpBuf, 0, 0, 0); |
3480 v63 = LOBYTE(v56->uFontHeight); | |
3481 v124 += 4; | |
3482 result = &a4[v63 - 3]; | |
3483 a4 = result; | |
3484 } | |
3485 while ( v124 < 40 ); | |
3486 } | |
3487 else | |
3488 { | |
3489 i = 0; | |
3490 do | |
3491 { | |
241 | 3492 sprintf(pTmpBuf, "%s\f%05u\t070%s\n", v85[i], 0, pGlobalTXT_LocalizationStrings[630]); // "?" |
0 | 3493 a1->DrawText(v56, 170, (int)a4, a5, pTmpBuf, 0, 0, 0); |
3494 v65 = LOBYTE(v56->uFontHeight); | |
3495 ++i; | |
3496 result = &a4[v65 - 3]; | |
3497 a4 = result; | |
3498 } | |
3499 while ( i < 10 ); | |
3500 } | |
3501 if ( (signed __int64)pParty->pPartyBuffs[3].uExpireTime > 0 ) | |
3502 { | |
3503 sprintf(pTmpBuf, "%s: %d", pGlobalTXT_LocalizationStrings[650], v121->sCurrentHP); | |
3504 pFontSmallnum->GetLineWidth(pTmpBuf); | |
499 | 3505 result = a1->DrawTitleText(pFontSmallnum, 0, a1->uFrameHeight - LOBYTE(pFontSmallnum->uFontHeight) - 12, 0, pTmpBuf, 3); |
0 | 3506 } |
3507 return result; | |
3508 } | |
3509 | |
3510 //----- (0041F54A) -------------------------------------------------------- | |
3511 void __cdecl LoadActualSkyFrame() | |
3512 { | |
3513 if ( pTexture_RestUI_CurrentSkyFrame ) | |
3514 pTexture_RestUI_CurrentSkyFrame->Release(); | |
3515 if ( pTexture_RestUI_CurrentHourglassFrame ) | |
3516 pTexture_RestUI_CurrentHourglassFrame->Release(); | |
3517 pIcons_LOD->_40F9C5(); | |
3518 sprintf(pTmpBuf, "TERRA%03d", pParty->uCurrentMinute / 6 + 10 * pParty->uCurrentHour); | |
3519 pTexture_RestUI_CurrentSkyFrame = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pTmpBuf, TEXTURE_16BIT_PALETTE)]; | |
3520 } | |
3521 | |
3522 //----- (0041F5BE) -------------------------------------------------------- | |
3523 void __cdecl Sleep6Hours() | |
3524 { | |
3525 if ( _506F18_num_hours_to_sleep < 6 ) | |
3526 { | |
3527 pParty->pPlayers[3].pConditions[2] = 0i64; | |
3528 pParty->pPlayers[2].pConditions[2] = 0i64; | |
3529 pParty->pPlayers[1].pConditions[2] = 0i64; | |
3530 pParty->pPlayers[0].pConditions[2] = 0i64; | |
3531 if ( _506F18_num_hours_to_sleep ) | |
3532 { | |
3533 Rest(_506F18_num_hours_to_sleep); | |
3534 _506F18_num_hours_to_sleep = 0; | |
3535 LoadActualSkyFrame(); | |
3536 } | |
3537 if ( dword_506F14 == 2 ) | |
3538 { | |
3539 pGUIWindow_CurrentMenu->Release(); | |
3540 pEventTimer->Resume(); | |
3541 if ( pTexture_RestUI_CurrentSkyFrame ) | |
3542 pTexture_RestUI_CurrentSkyFrame->Release(); | |
3543 if ( pTexture_RestUI_CurrentHourglassFrame ) | |
3544 pTexture_RestUI_CurrentHourglassFrame->Release(); | |
3545 pTexture_RestUI_CurrentHourglassFrame = 0; | |
3546 pTexture_RestUI_CurrentSkyFrame = 0; | |
3547 pIcons_LOD->_4114F2(); | |
3548 pIcons_LOD->_40F9C5(); | |
151 | 3549 pCurrentScreen = SCREEN_GAME; |
0 | 3550 viewparams->bRedrawGameUI = 1; |
3551 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
3552 { | |
3553 pOutdoor->UpdateSunlightVectors(); | |
3554 pOutdoor->UpdateFog(); | |
3555 } | |
3556 } | |
3557 dword_506F14 = 0; | |
3558 } | |
3559 else | |
3560 { | |
3561 Rest(6u); | |
3562 _506F18_num_hours_to_sleep -= 6; | |
3563 LoadActualSkyFrame(); | |
3564 } | |
3565 viewparams->bRedrawGameUI = 1; | |
3566 } | |
3567 | |
3568 //----- (0041F6C1) -------------------------------------------------------- | |
3569 void __cdecl RestUI_Initialize() | |
3570 { | |
89 | 3571 Player *v0; // eax@10 |
0 | 3572 |
3573 if ( !dword_506F14 ) | |
3574 pAudioPlayer->StopChannels(-1, -1); | |
3575 if ( pCurrentScreen ) | |
3576 { | |
3577 pGUIWindow_CurrentMenu->Release(); | |
151 | 3578 pCurrentScreen = SCREEN_GAME; |
0 | 3579 viewparams->bRedrawGameUI = 1; |
3580 } | |
3581 pEventTimer->Pause(); | |
3582 if ( dword_506F14 != 2 ) | |
3583 GUIWindow::Create(518u, 450u, 0, 0, (enum WindowType)90, (int)pBtn_Rest, 0); | |
3584 _506F18_num_hours_to_sleep = 0; | |
3585 dword_506F14 = 0; | |
3586 uRestUI_FoodRequiredToRest = 2; | |
3587 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
3588 uRestUI_FoodRequiredToRest = pOutdoor->GetNumFoodRequiredToRestInCurrentPos( | |
3589 pParty->vPosition.x, | |
3590 pParty->vPosition.y, | |
3591 pParty->vPosition.z); | |
248 | 3592 if ( PartyHasDragon() ) |
0 | 3593 { |
89 | 3594 v0 = pParty->pPlayers;//[0].uClass; |
3595 while ( v0 <= &pParty->pPlayers[3] ) | |
3596 { | |
3597 ++v0; | |
3598 if ( v0 > &pParty->pPlayers[3] ) | |
3599 break; | |
3600 } | |
255 | 3601 if(v0->classType == PLAYER_CLASS_WARLOCK) |
89 | 3602 ++uRestUI_FoodRequiredToRest; |
3603 } | |
0 | 3604 if ( CheckHiredNPCSpeciality(0x1Du) ) |
3605 --uRestUI_FoodRequiredToRest; | |
3606 if ( CheckHiredNPCSpeciality(0x1Eu) ) | |
3607 uRestUI_FoodRequiredToRest -= 2; | |
3608 if ( CheckHiredNPCSpeciality(0x30u) ) | |
3609 --uRestUI_FoodRequiredToRest; | |
3610 if ( uRestUI_FoodRequiredToRest < 1 ) | |
3611 uRestUI_FoodRequiredToRest = 1; | |
484 | 3612 if ( !_strcmpi(pCurrentMapName, "d29.blv") && (unsigned __int16)_449B57_test_bit(pParty->_quest_bits, 98) ) |
0 | 3613 uRestUI_FoodRequiredToRest = 0; |
3614 ++pIcons_LOD->uTexturePacksCount; | |
3615 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | |
3616 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
151 | 3617 pCurrentScreen = SCREEN_REST; |
0 | 3618 _507CD4_RestUI_hourglass_anim_controller = 0; |
3619 uTextureID_RestUI_restmain = pIcons_LOD->LoadTexture("restmain", TEXTURE_16BIT_PALETTE); | |
3620 uTextureID_RestUI_restb1 = pIcons_LOD->LoadTexture("restb1", TEXTURE_16BIT_PALETTE); | |
3621 uTextureID_RestUI_restb2 = pIcons_LOD->LoadTexture("restb2", TEXTURE_16BIT_PALETTE); | |
3622 uTextureID_RestUI_restb3 = pIcons_LOD->LoadTexture("restb3", TEXTURE_16BIT_PALETTE); | |
3623 uTextureID_RestUI_restb4 = pIcons_LOD->LoadTexture("restb4", TEXTURE_16BIT_PALETTE); | |
3624 uTextureID_RestUI_restexit = pIcons_LOD->LoadTexture("restexit", TEXTURE_16BIT_PALETTE); | |
3625 LoadActualSkyFrame(); | |
3626 pGUIWindow_CurrentMenu = GUIWindow::Create(0, 0, 640u, 480u, (enum WindowType)16, 0, 0); | |
3627 pButton_RestUI_Exit = pGUIWindow_CurrentMenu->CreateButton( | |
3628 280u, | |
3629 297u, | |
3630 154u, | |
3631 37u, | |
3632 1, | |
3633 0, | |
3634 0xA7u, | |
3635 0, | |
3636 0, | |
3637 "", | |
3638 (Texture *)(uTextureID_RestUI_restexit != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restexit] : 0), | |
3639 0); | |
3640 pButton_RestUI_Main = pGUIWindow_CurrentMenu->CreateButton( | |
3641 24u, | |
3642 154u, | |
3643 225u, | |
3644 37u, | |
3645 1, | |
3646 0, | |
3647 0x61u, | |
3648 0, | |
3649 0x52u, | |
3650 "", | |
3651 (Texture *)(uTextureID_RestUI_restb4 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb4] : 0), | |
3652 0); | |
3653 pButton_RestUI_WaitUntilDawn = pGUIWindow_CurrentMenu->CreateButton( | |
3654 61u, | |
3655 232u, | |
3656 154u, | |
3657 33u, | |
3658 1, | |
3659 0, | |
3660 0x6Du, | |
3661 0, | |
3662 0x44u, | |
3663 "", | |
3664 (Texture *)(uTextureID_RestUI_restb1 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb1] : 0), | |
3665 0); | |
3666 pButton_RestUI_Wait1Hour = pGUIWindow_CurrentMenu->CreateButton( | |
3667 61u, | |
3668 264u, | |
3669 154u, | |
3670 33u, | |
3671 1, | |
3672 0, | |
3673 0x60u, | |
3674 0, | |
3675 0x48u, | |
3676 "", | |
3677 (Texture *)(uTextureID_RestUI_restb2 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb2] : 0), | |
3678 0); | |
3679 pButton_RestUI_Wait5Minutes = pGUIWindow_CurrentMenu->CreateButton( | |
3680 61u, | |
3681 296u, | |
3682 154u, | |
3683 33u, | |
3684 1, | |
3685 0, | |
3686 0x5Fu, | |
3687 0, | |
3688 0x4Du, | |
3689 "", | |
3690 (Texture *)(uTextureID_RestUI_restb3 != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restb3] : 0), | |
3691 0); | |
3692 } | |
3693 | |
3694 //----- (0041FA01) -------------------------------------------------------- | |
3695 void __cdecl RestUI_Draw() | |
3696 { | |
3697 int v0; // esi@1 | |
3698 Player **ppPlayers; // ecx@1 | |
3699 Player *pPlayer; // eax@2 | |
3700 unsigned int v3; // eax@15 | |
3701 char v4; // al@17 | |
3702 bool v5; // eax@21 | |
3703 GUIButton Dst; // [sp+8h] [bp-DCh]@19 | |
3704 //double v7; // [sp+C4h] [bp-20h]@17 | |
3705 float v8; // [sp+CCh] [bp-18h]@17 | |
3706 __int64 v9; // [sp+D0h] [bp-14h]@17 | |
3707 unsigned int v10; // [sp+D8h] [bp-Ch]@9 | |
3708 __int16 a9[2]; // [sp+DCh] [bp-8h]@1 | |
3709 int a5; // [sp+E0h] [bp-4h]@1 | |
3710 | |
3711 v0 = 0; | |
3712 a5 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xAu, 0, 0); | |
3713 *(int *)a9 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xE6u, 0xD6u, 0xC1u); | |
3714 ppPlayers = &pPlayers[1]; | |
3715 do | |
3716 { | |
3717 pPlayer = *ppPlayers; | |
3718 if ( !(*ppPlayers)->pConditions[14] && !pPlayer->pConditions[16] && pPlayer->sHealth > 0 ) | |
3719 ++v0; | |
3720 ++ppPlayers; | |
3721 } | |
3722 while ( (signed int)ppPlayers <= (signed int)&pPlayers[4] ); | |
3723 if ( v0 ) | |
3724 { | |
3725 pRenderer->DrawTextureIndexed( | |
3726 8u, | |
3727 8u, | |
3728 (Texture *)(uTextureID_RestUI_restmain != -1 ? (int)&pIcons_LOD->pTextures[uTextureID_RestUI_restmain] : 0)); | |
3729 v10 = pParty->uCurrentHour; | |
3730 dword_506F1C = pGUIWindow_CurrentMenu->pCurrentPosActiveItem; | |
3731 if ( (signed int)pParty->uCurrentHour <= 12 ) | |
3732 { | |
3733 if ( !v10 ) | |
3734 v10 = 12; | |
3735 } | |
3736 else | |
3737 { | |
3738 v10 -= 12; | |
3739 } | |
3740 pRenderer->DrawTextureIndexed(16u, 26u, pTexture_RestUI_CurrentSkyFrame); | |
3741 if ( pTexture_RestUI_CurrentHourglassFrame ) | |
3742 { | |
3743 pTexture_RestUI_CurrentHourglassFrame->Release(); | |
3744 pIcons_LOD->_40F9C5(); | |
3745 } | |
3746 v3 = pEventTimer->uTimeElapsed + _507CD4_RestUI_hourglass_anim_controller; | |
3747 _507CD4_RestUI_hourglass_anim_controller += pEventTimer->uTimeElapsed; | |
3748 if ( (unsigned int)_507CD4_RestUI_hourglass_anim_controller >= 512 ) | |
3749 { | |
3750 v3 = 0; | |
3751 _507CD4_RestUI_hourglass_anim_controller = 0; | |
3752 } | |
3753 v9 = v3; | |
3754 v8 = (double)v3 * 0.001953125 * 120.0; | |
3755 //v7 = v8 + 6.7553994e15; | |
3756 HIDWORD(v9) = floorf(v8 + 0.5f);//LODWORD(v7); | |
3757 v4 = (int)floorf(v8 + 0.5f) % 256 + 1;//LOBYTE(v7) + 1; | |
3758 byte_4E2BC8 = v4; | |
3759 if ( (unsigned __int8)(v4) >= 0x78u ) | |
3760 { | |
3761 v4 = 1; | |
3762 byte_4E2BC8 = 1; | |
3763 } | |
3764 sprintf(pTmpBuf, "hglas%03d", (unsigned __int8)v4); | |
3765 pTexture_RestUI_CurrentHourglassFrame = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pTmpBuf, TEXTURE_16BIT_PALETTE)]; | |
3766 pRenderer->DrawTextureIndexed(0x10Bu, 0x9Fu, pTexture_RestUI_CurrentHourglassFrame); | |
3767 memset(&Dst, 0, 0xBCu); | |
3768 Dst.uX = 24; | |
3769 Dst.uY = 154; | |
3770 Dst.uWidth = 171; | |
3771 Dst.uHeight = 37; | |
3772 Dst.uZ = 194; | |
3773 Dst.uW = 190; | |
3774 Dst.pParent = pButton_RestUI_WaitUntilDawn->pParent; | |
3775 Dst.DrawLabel(pGlobalTXT_LocalizationStrings[183], pFontCreate, a5, *(int **)a9); | |
3776 Dst.pParent = 0; | |
3777 sprintf(pTmpBuf, "\r408%d", uRestUI_FoodRequiredToRest); | |
3778 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 0, 164, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); | |
3779 pButton_RestUI_WaitUntilDawn->DrawLabel( | |
3780 pGlobalTXT_LocalizationStrings[237], | |
3781 pFontCreate, | |
3782 a5, | |
3783 *(int **)a9); | |
3784 pButton_RestUI_Wait1Hour->DrawLabel(pGlobalTXT_LocalizationStrings[239], pFontCreate, a5, *(int **)a9); | |
3785 pButton_RestUI_Wait5Minutes->DrawLabel(pGlobalTXT_LocalizationStrings[238], pFontCreate, a5, *(int **)a9); | |
3786 pButton_RestUI_Exit->DrawLabel(pGlobalTXT_LocalizationStrings[81], pFontCreate, a5, *(int **)a9); | |
3787 memset(&Dst, 0, 0xBCu); | |
3788 Dst.uX = 45; | |
3789 Dst.uY = 199; | |
3790 Dst.uWidth = 185; | |
3791 Dst.uHeight = 30; | |
3792 Dst.uZ = 229; | |
3793 Dst.uW = 228; | |
3794 Dst.pParent = pButton_RestUI_WaitUntilDawn->pParent; | |
3795 Dst.DrawLabel(pGlobalTXT_LocalizationStrings[236], pFontCreate, a5, *(int **)a9); | |
3796 Dst.pParent = 0; | |
3797 v5 = pParty->uCurrentHour >= 0xC && pParty->uCurrentHour < 0x18; | |
3798 sprintf(pTmpBuf, "%d:%02d %s", v10, pParty->uCurrentMinute, aAMPMNames[v5]); | |
3799 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 368, 168, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); | |
3800 sprintf(pTmpBuf, "%s\r190%d", pGlobalTXT_LocalizationStrings[56], pParty->uDaysPlayed + 1); | |
3801 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 190, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); | |
3802 sprintf(pTmpBuf, "%s\r190%d", pGlobalTXT_LocalizationStrings[146], pParty->uCurrentMonth + 1); | |
3803 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 222, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); | |
3804 sprintf(pTmpBuf, "%s\r190%d", pGlobalTXT_LocalizationStrings[245], pParty->uCurrentYear); | |
3805 pGUIWindow_CurrentMenu->DrawText(pFontCreate, 350, 254, a5, pTmpBuf, 0, 0, *(unsigned int *)a9); | |
3806 if ( dword_506F14 ) | |
3807 Sleep6Hours(); | |
3808 } | |
3809 else | |
3810 { | |
3811 GUIWindow::Create( | |
3812 pButton_RestUI_Exit->uX, | |
3813 pButton_RestUI_Exit->uY, | |
3814 0, | |
3815 0, | |
3816 (enum WindowType)96, | |
3817 (int)pButton_RestUI_Exit, | |
3818 (int)pGlobalTXT_LocalizationStrings[81]); | |
3819 } | |
3820 } | |
421 | 3821 |
0 | 3822 |
3823 //----- (0042038D) -------------------------------------------------------- | |
3824 void __cdecl sub_42038D() | |
3825 { | |
3826 POINT *v0; // esi@2 | |
3827 int v1; // ecx@2 | |
3828 const char *v2; // eax@3 | |
3829 POINT v3; // [sp+0h] [bp-10h]@2 | |
3830 POINT a2; // [sp+8h] [bp-8h]@1 | |
3831 | |
3832 if ( pMouse->GetCursorPos(&a2)->y < 350 ) | |
3833 { | |
3834 v0 = pMouse->GetCursorPos(&a2); | |
3835 v1 = pRenderer->pActiveZBuffer[v0->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v3)->y]]; | |
3836 if ( v1 ) | |
3837 { | |
3838 auto _w = (ItemGen *)(&pOtherOverlayList->pOverlays[49].field_4 + 2662 * (unsigned int)pChestWindow->ptr_1C | |
526 | 3839 + 18 * *((short *)&pChests[0].igChestItems[139].uExpireTime |
0 | 3840 + v1 + 2662 * (unsigned int)pChestWindow->ptr_1C + 3)); |
3841 v2 = _w->GetDisplayName(); | |
3842 sub_41C0B8_set_status_string(v2); | |
3843 } | |
3844 } | |
3845 } | |
3846 | |
3847 | |
3848 //----- (00420C05) -------------------------------------------------------- | |
3849 void __fastcall party_finds_gold(unsigned int uNumGold, int _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal) | |
3850 { | |
3851 unsigned int v2; // edi@1 | |
3852 int v3; // ebp@1 | |
3853 unsigned int v4; // esi@1 | |
3854 int v5; // ecx@6 | |
3855 NPCData *v6; // eax@6 | |
3856 signed int v7; // edx@8 | |
3857 signed int v8; // ebx@10 | |
3858 char *v9; // edi@11 | |
3859 signed int v10; // ecx@17 | |
3860 int v11; // eax@21 | |
3861 NPCData *v12; // ecx@21 | |
3862 unsigned int v13; // ecx@23 | |
3863 signed int v14; // [sp+Ch] [bp-4h]@6 | |
3864 | |
3865 v2 = 0; | |
3866 v3 = 0; | |
3867 v4 = uNumGold; | |
3868 if ( _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal ) | |
3869 { | |
3870 if ( _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal == 1 ) | |
3871 { | |
3872 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[467], uNumGold);// You found %lu gold! | |
3873 } | |
3874 else | |
3875 { | |
3876 if ( _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal == 2 ) | |
3877 pTmpBuf2[0] = 0; | |
3878 } | |
3879 } | |
3880 else | |
3881 { | |
3882 v14 = 0; | |
3883 v5 = 0; | |
3884 v6 = pParty->pHirelings; | |
3885 do | |
3886 { | |
3887 if ( v6->pName ) | |
3888 { | |
3889 v7 = v14++; | |
3890 pTmpBuf[v7] = v5; | |
3891 } | |
3892 ++v6; | |
3893 ++v5; | |
3894 } | |
3895 while ( (signed int)v6 < (signed int)&pParty->pPickedItem ); | |
3896 v8 = 0; | |
3897 if ( (signed int)pNPCStats->uNumNewNPCs > 0 ) | |
3898 { | |
3899 v9 = (char *)pNPCStats->pNewNPCData; | |
3900 do | |
3901 { | |
3902 if ( v9[8] & 0x80 | |
3903 && (!pParty->pHirelings[0].pName || strcmp(*(const char **)v9, pParty->pHirelings[0].pName)) | |
3904 && (!pParty->pHirelings[1].pName || strcmp(*(const char **)v9, pParty->pHirelings[1].pName)) ) | |
3905 { | |
3906 v10 = v14++; | |
3907 pTmpBuf[v10] = v8 + 2; | |
3908 } | |
3909 ++v8; | |
3910 v9 += 76; | |
3911 } | |
3912 while ( v8 < (signed int)pNPCStats->uNumNewNPCs ); | |
3913 v2 = 0; | |
3914 } | |
3915 if ( v14 > 0 ) | |
3916 { | |
3917 do | |
3918 { | |
3919 v11 = (unsigned __int8)pTmpBuf[v2]; | |
3920 v12 = &pNPCStats->pNPCData[v11 + 499]; | |
33 | 3921 if ( (unsigned __int8)pTmpBuf[v2] < 2 ) |
0 | 3922 v12 = &pParty->pHirelings[v11]; |
3923 v13 = v12->uProfession; | |
3924 if ( v13 ) | |
291 | 3925 v3 += pNPCStats->pProfessions[v13].uHirePrice;//*(&pNPCStats->field_13A58 + 5 * v13); |
0 | 3926 ++v2; |
3927 } | |
3928 while ( (signed int)v2 < v14 ); | |
3929 } | |
3930 if ( CheckHiredNPCSpeciality(0x1Fu) ) | |
3931 v4 += (signed int)(10 * v4) / 100; | |
3932 if ( CheckHiredNPCSpeciality(0x20u) ) | |
3933 v4 += (signed int)(20 * v4) / 100; | |
3934 if ( CheckHiredNPCSpeciality(0x2Du) ) | |
3935 v4 += (signed int)(10 * v4) / 100; | |
3936 if ( v3 ) | |
3937 { | |
3938 v3 = (signed int)(v4 * v3 / 100) / 100; | |
3939 if ( v3 < 1 ) | |
3940 v3 = 1; | |
3941 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[466], v4, v3);// You found %lu gold (followers take %lu)! | |
3942 } | |
3943 else | |
3944 { | |
3945 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[467], v4);// You found %lu gold! | |
3946 } | |
3947 v2 = 0; | |
3948 } | |
3949 pParty->uNumGold += v4 - v3; | |
3950 pUIAnim_Gold->uAnimTime = v2; | |
3951 pUIAnim_Gold->uAnimLength = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Gold->uIconID].uAnimLength; | |
3952 if ( pTmpBuf2[0] ) | |
3953 ShowStatusBarString(pTmpBuf2, 2u); | |
3954 pAudioPlayer->PlaySound(SOUND_GoldReceived, v2, v2, -1, v2, v2, v2, v2); | |
3955 } | |
3956 | |
3957 //----- (00420E01) -------------------------------------------------------- | |
3958 void __cdecl sub_420E01() | |
3959 { | |
526 | 3960 int chest_id; // edi@1 |
0 | 3961 POINT *v1; // esi@2 |
3962 int v2; // eax@2 | |
3963 int v3; // ebx@4 | |
3964 int v4; // esi@6 | |
3965 int v5; // ecx@6 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
3966 //SpriteObject v6; // [sp+Ch] [bp-80h]@1 |
526 | 3967 POINT v7; // [sp+7Ch] [bp-10h]@2 |
0 | 3968 POINT a2; // [sp+84h] [bp-8h]@2 |
3969 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
3970 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
|
3971 //SpriteObject::SpriteObject(&v6); |
0 | 3972 |
526 | 3973 chest_id = pGUIWindow_CurrentMenu->par1C; |
0 | 3974 if ( pParty->pPickedItem.uItemID ) |
3975 { | |
526 | 3976 if ( Chest::PutItemInChest(-1, &pParty->pPickedItem, pGUIWindow_CurrentMenu->par1C) ) |
0 | 3977 pMouse->RemoveHoldingItem(); |
3978 } | |
3979 else | |
3980 { | |
3981 v1 = pMouse->GetCursorPos(&a2); | |
3982 v2 = pRenderer->pActiveZBuffer[v1->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v7)->y]] & 0xFFFF; | |
3983 if ( v2 ) | |
3984 { | |
3985 if ( v2 ) | |
3986 v3 = v2 - 1; | |
3987 else | |
3988 v3 = -1; | |
526 | 3989 v4 = pChests[chest_id].pInventoryIndices[v3] - 1; |
600 | 3990 if ( pItemsTable->pItems[pChests[chest_id].igChestItems[v4].uItemID].uEquipType == EQUIP_GOLD ) |
0 | 3991 { |
600 | 3992 party_finds_gold(pChests[chest_id].igChestItems[v4].uSpecEnchantmentType, 0); |
0 | 3993 viewparams->bRedrawGameUI = 1; |
3994 } | |
3995 else | |
3996 { | |
526 | 3997 pParty->SetHoldingItem(&pChests[chest_id].igChestItems[v4]); |
0 | 3998 } |
3999 sub_420B13(v4, v3); | |
4000 } | |
4001 } | |
4002 } | |
4003 | |
4004 //----- (00420EFF) -------------------------------------------------------- | |
4005 void __cdecl GameUI_WritePointedObjectStatusString() | |
4006 { | |
4007 int v1; // ebx@6 | |
8 | 4008 GUIWindow *pWindow; // edi@7 |
4009 GUIButton *pButton; // ecx@11 | |
4010 Player *pPlayer; // eax@19 | |
0 | 4011 char v5; // cl@19 |
4012 unsigned int v6; // eax@19 | |
4013 int v7; // ecx@19 | |
4014 __int16 v8; // fps@23 | |
4015 unsigned __int8 v9; // c0@23 | |
4016 unsigned __int8 v10; // c3@23 | |
8 | 4017 enum UIMessageType pMessageType1; // esi@24 |
0 | 4018 int v12; // edx@25 |
4019 char *v13; // ecx@28 | |
4020 int v14; // eax@41 | |
8 | 4021 ItemGen *pItemGen; // ecx@44 |
0 | 4022 int v16; // ecx@46 |
4023 const char *v17; // eax@49 | |
4024 signed int v18; // eax@55 | |
4025 signed int v19; // ecx@63 | |
4026 BLVFace *pFace; // eax@69 | |
4027 __int16 v21; // ax@70 | |
4028 const char *v22; // eax@72 | |
4029 LevelDecoration *v23; // ecx@75 | |
4030 LevelDecoration *v24; // esi@75 | |
4031 __int16 v25; // ax@75 | |
4032 const char *v26; // ecx@79 | |
4033 Actor *pActor; // ecx@82 | |
4034 char *v28; // esi@82 | |
4035 int v29; // eax@82 | |
4036 signed int v30; // ecx@88 | |
4037 const char *v31; // eax@91 | |
4038 __int16 v32; // fps@109 | |
14 | 4039 //unsigned __int8 v33; // c0@109 |
4040 //unsigned __int8 v34; // c3@109 | |
8 | 4041 enum UIMessageType pMessageType2; // esi@110 |
0 | 4042 int v36; // edx@111 |
8 | 4043 enum UIMessageType pMessageType3; // edx@117 |
0 | 4044 int v38; // ecx@118 |
4045 const char *v39; // [sp-8h] [bp-E8h]@20 | |
4046 char *v40; // [sp-8h] [bp-E8h]@83 | |
4047 int v41; // [sp-4h] [bp-E4h]@20 | |
4048 char Str1[200]; // [sp+Ch] [bp-D4h]@129 | |
4049 unsigned int pX; // [sp+D4h] [bp-Ch]@1 | |
4050 unsigned int pY; // [sp+D8h] [bp-8h]@1 | |
4051 unsigned int v45; // [sp+DCh] [bp-4h]@21 | |
4052 | |
4053 v13 = nullptr; | |
4054 | |
4055 pMouse->uPointingObjectID = 0; | |
4056 pMouse->GetClickPos(&pX, &pY); | |
14 | 4057 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 | 4058 return; |
323 | 4059 if (pCurrentScreen == SCREEN_GAME) |
0 | 4060 { |
4061 if ( (signed int)pX > 467 || (signed int)pY > 351 ) | |
4062 goto _click_on_game_ui; | |
4063 if ( pRenderer->pRenderD3D ) | |
4064 { | |
4065 v18 = pGame->pVisInstance->get_picked_object_zbuf_val(); | |
4066 if ( (signed int)pX < (signed int)pViewport->uScreenX | |
4067 || (signed int)pX > (signed int)pViewport->uScreenZ | |
4068 || (signed int)pY < (signed int)pViewport->uScreenY | |
4069 || (signed int)pY > (signed int)pViewport->uScreenW ) | |
4070 v18 = -1; | |
4071 if ( v18 == -1 ) | |
8 | 4072 //goto LABEL_61; |
4073 { | |
4074 pMouse->uPointingObjectID = 0; | |
4075 if ( pMouse->uPointingObjectID == 0 ) | |
4076 { | |
4077 if ( uLastPointedObjectID != 0 ) | |
4078 { | |
4079 pStatusBarString[0] = 0; | |
4080 bForceDrawStatusBar = 1; | |
4081 } | |
4082 } | |
4083 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4084 return; | |
4085 } | |
0 | 4086 } |
4087 else | |
4088 { | |
4089 v18 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; | |
4090 } | |
4091 pMouse->uPointingObjectID = (unsigned __int16)v18; | |
4092 v19 = (signed int)(unsigned __int16)v18 >> 3; | |
4093 if ( (v18 & 7) == OBJECT_Item ) | |
4094 { | |
4095 v30 = v19; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
4096 if ( pObjectList->pObjects[pSpriteObjects[v30].uObjectDescID].uFlags & 0x10 ) |
8 | 4097 //goto LABEL_73; |
4098 { | |
4099 pMouse->uPointingObjectID = 0; | |
4100 //goto LABEL_50; | |
4101 uLastPointedObjectID = 1; | |
4102 if ( pMouse->uPointingObjectID == 0 ) | |
4103 { | |
4104 if ( uLastPointedObjectID != 0 ) | |
4105 { | |
4106 pStatusBarString[0] = 0; | |
4107 bForceDrawStatusBar = 1; | |
4108 } | |
4109 } | |
4110 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4111 return; | |
4112 } | |
0 | 4113 if ( v18 >= (signed int)0x2000000u || pParty->pPickedItem.uItemID ) |
4114 { | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
4115 v22 = pSpriteObjects[v30].stru_24.GetDisplayName(); |
8 | 4116 //LABEL_93: |
0 | 4117 v26 = v22; |
8 | 4118 //goto LABEL_87; |
4119 sub_41C0B8_set_status_string(v26); | |
4120 if ( pMouse->uPointingObjectID == 0 ) | |
4121 { | |
4122 if ( uLastPointedObjectID != 0 ) | |
4123 { | |
4124 pStatusBarString[0] = 0; | |
4125 bForceDrawStatusBar = 1; | |
4126 } | |
4127 } | |
4128 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4129 return; | |
0 | 4130 } |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
4131 v31 = pSpriteObjects[v30].stru_24.GetDisplayName(); |
0 | 4132 v28 = pTmpBuf; |
4133 sprintf(pTmpBuf, pGlobalTXT_LocalizationStrings[470], v31);// "Get %s" | |
4134 } | |
4135 else | |
4136 { | |
4137 if ( (v18 & 7) != OBJECT_Actor ) | |
4138 { | |
4139 if ( (v18 & 7) == OBJECT_Decoration ) | |
4140 { | |
4141 v23 = &pLevelDecorations[v19]; | |
4142 v24 = v23; | |
4143 v25 = v23->field_16_event_id; | |
4144 if ( !v25 ) | |
4145 { | |
4146 if ( v23->IsInteractive() ) | |
4147 v26 = pNPCTopics[stru_5E4C90._decor_events[v24->_idx_in_stru123 - 75] + 379].pTopic; | |
4148 else | |
4149 v26 = pDecorationList->pDecorations[v24->uDecorationDescID].field_20; | |
8 | 4150 //goto LABEL_87; |
4151 sub_41C0B8_set_status_string(v26); | |
4152 if ( pMouse->uPointingObjectID == 0 ) | |
4153 { | |
4154 if ( uLastPointedObjectID != 0 ) | |
4155 { | |
4156 pStatusBarString[0] = 0; | |
4157 bForceDrawStatusBar = 1; | |
4158 } | |
4159 } | |
4160 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4161 return; | |
0 | 4162 } |
428 | 4163 v22 = GetEventHintString(v25); |
0 | 4164 if ( !v22 ) |
8 | 4165 //goto _return; |
4166 { | |
4167 if ( pMouse->uPointingObjectID == 0 ) | |
4168 { | |
4169 if ( uLastPointedObjectID != 0 ) | |
4170 { | |
4171 pStatusBarString[0] = 0; | |
4172 bForceDrawStatusBar = 1; | |
4173 } | |
4174 } | |
4175 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4176 return; | |
4177 } | |
4178 //goto LABEL_93; | |
4179 v26 = v22; | |
4180 //goto LABEL_87; | |
4181 sub_41C0B8_set_status_string(v26); | |
4182 if ( pMouse->uPointingObjectID == 0 ) | |
4183 { | |
4184 if ( uLastPointedObjectID != 0 ) | |
4185 { | |
4186 pStatusBarString[0] = 0; | |
4187 bForceDrawStatusBar = 1; | |
4188 } | |
4189 } | |
4190 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4191 return; | |
0 | 4192 } |
141 | 4193 if ( (v18 & 7) == OBJECT_BModel) |
0 | 4194 { |
4195 if ( v18 < (signed int)0x2000000u ) | |
4196 { | |
4197 if ( uCurrentlyLoadedLevelType != LEVEL_Indoor) | |
4198 { | |
4199 v21 = pOutdoor->pBModels[(signed int)(unsigned __int16)v18 >> 9].pFaces[v19 & 0x3F].sCogTriggeredID; | |
8 | 4200 //goto LABEL_71; |
428 | 4201 if ( !v21 || (v22 = GetEventHintString(v21)) == 0 ) |
8 | 4202 //goto LABEL_73; |
4203 { | |
4204 pMouse->uPointingObjectID = 0; | |
4205 //goto LABEL_50; | |
4206 uLastPointedObjectID = 1; | |
4207 if ( pMouse->uPointingObjectID == 0 ) | |
4208 { | |
4209 if ( uLastPointedObjectID != 0 ) | |
4210 { | |
4211 pStatusBarString[0] = 0; | |
4212 bForceDrawStatusBar = 1; | |
4213 } | |
4214 } | |
4215 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4216 return; | |
4217 } | |
4218 //goto LABEL_93; | |
4219 v26 = v22; | |
4220 //goto LABEL_87; | |
4221 sub_41C0B8_set_status_string(v26); | |
4222 if ( pMouse->uPointingObjectID == 0 ) | |
4223 { | |
4224 if ( uLastPointedObjectID != 0 ) | |
4225 { | |
4226 pStatusBarString[0] = 0; | |
4227 bForceDrawStatusBar = 1; | |
4228 } | |
4229 } | |
4230 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4231 return; | |
0 | 4232 } |
4233 pFace = &pIndoor->pFaces[v19]; | |
4234 if ( BYTE3(pFace->uAttributes) & 6 ) | |
4235 { | |
4236 v21 = pIndoor->pFaceExtras[pFace->uFaceExtraID].uEventID; | |
8 | 4237 //LABEL_71: |
428 | 4238 if ( !v21 || (v22 = GetEventHintString(v21)) == 0 ) |
8 | 4239 //goto LABEL_73; |
4240 { | |
4241 pMouse->uPointingObjectID = 0; | |
4242 //goto LABEL_50; | |
4243 uLastPointedObjectID = 1; | |
4244 if ( pMouse->uPointingObjectID == 0 ) | |
4245 { | |
4246 if ( uLastPointedObjectID != 0 ) | |
4247 { | |
4248 pStatusBarString[0] = 0; | |
4249 bForceDrawStatusBar = 1; | |
4250 } | |
4251 } | |
4252 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4253 return; | |
4254 } | |
4255 //goto LABEL_93; | |
4256 v26 = v22; | |
4257 //goto LABEL_87; | |
4258 sub_41C0B8_set_status_string(v26); | |
4259 if ( pMouse->uPointingObjectID == 0 ) | |
4260 { | |
4261 if ( uLastPointedObjectID != 0 ) | |
4262 { | |
4263 pStatusBarString[0] = 0; | |
4264 bForceDrawStatusBar = 1; | |
4265 } | |
4266 } | |
4267 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4268 return; | |
0 | 4269 } |
4270 } | |
8 | 4271 //LABEL_73: |
0 | 4272 pMouse->uPointingObjectID = 0; |
8 | 4273 //goto LABEL_50; |
4274 uLastPointedObjectID = 1; | |
4275 if ( pMouse->uPointingObjectID == 0 ) | |
4276 { | |
4277 if ( uLastPointedObjectID != 0 ) | |
4278 { | |
4279 pStatusBarString[0] = 0; | |
4280 bForceDrawStatusBar = 1; | |
4281 } | |
4282 } | |
4283 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4284 return; | |
0 | 4285 } |
8 | 4286 //LABEL_61: |
0 | 4287 pMouse->uPointingObjectID = 0; |
8 | 4288 //goto _return; |
4289 if ( pMouse->uPointingObjectID == 0 ) | |
4290 { | |
4291 if ( uLastPointedObjectID != 0 ) | |
4292 { | |
4293 pStatusBarString[0] = 0; | |
4294 bForceDrawStatusBar = 1; | |
4295 } | |
4296 } | |
4297 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4298 return; | |
0 | 4299 } |
4300 if ( v18 >= 335544320 ) | |
8 | 4301 //goto LABEL_61; |
4302 { | |
4303 pMouse->uPointingObjectID = 0; | |
4304 if ( pMouse->uPointingObjectID == 0 ) | |
4305 { | |
4306 if ( uLastPointedObjectID != 0 ) | |
4307 { | |
4308 pStatusBarString[0] = 0; | |
4309 bForceDrawStatusBar = 1; | |
4310 } | |
4311 } | |
4312 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4313 return; | |
4314 } | |
0 | 4315 pActor = &pActors[v19]; |
4316 v28 = pTmpBuf; | |
4317 v29 = pActor->dword_000334_unique_name; | |
4318 if ( v29 ) | |
237 | 4319 v40 = pMonsterStats->pPlaceStrings[v29]; |
0 | 4320 else |
4321 v40 = pMonsterStats->pInfos[pActor->pMonsterInfo.uID].pName; | |
4322 strncpy(pTmpBuf, v40, 0x7D0u); | |
4323 } | |
4324 v26 = v28; | |
8 | 4325 //LABEL_87: |
0 | 4326 sub_41C0B8_set_status_string(v26); |
8 | 4327 //goto _return; |
4328 if ( pMouse->uPointingObjectID == 0 ) | |
4329 { | |
4330 if ( uLastPointedObjectID != 0 ) | |
4331 { | |
4332 pStatusBarString[0] = 0; | |
4333 bForceDrawStatusBar = 1; | |
4334 } | |
4335 } | |
4336 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4337 return; | |
0 | 4338 } |
4339 v1 = uNumVisibleWindows; | |
587 | 4340 if ( uNumVisibleWindows > 0 ) |
0 | 4341 { |
587 | 4342 while ( 1 ) // some other fullscreen ui |
4343 { | |
4344 pWindow = &pWindowList[pVisibleWindowsIdxs[v1] - 1]; | |
4345 if ( (signed int)pX >= (signed int)pWindow->uFrameX | |
4346 && (signed int)pX <= (signed int)pWindow->uFrameZ | |
4347 && (signed int)pY >= (signed int)pWindow->uFrameY | |
4348 && (signed int)pY <= (signed int)pWindow->uFrameW ) | |
4349 { | |
4350 for ( pButton = pWindow->pControlsHead; ; pButton = pButton->pNext ) | |
4351 { | |
4352 if ( !pButton ) | |
4353 break; | |
4354 if ( pButton->uButtonType == 1 ) | |
4355 { | |
4356 if ( (signed int)pX >= (signed int)pButton->uX | |
4357 && (signed int)pX <= (signed int)pButton->uZ | |
4358 && (signed int)pY >= (signed int)pButton->uY | |
4359 && (signed int)pY <= (signed int)pButton->uW ) | |
4360 { | |
4361 //LABEL_24: | |
4362 pMessageType1 = (UIMessageType)pButton->field_1C; | |
4363 if ( pMessageType1 ) | |
4364 { | |
4365 v12 = pButton->uControlParam; | |
4366 pMessageQueue_50CBD0->AddMessage(pMessageType1, v12, 0); | |
4367 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
4368 { | |
4369 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType1; | |
4370 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v12; | |
4371 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
4372 //LABEL_27: | |
4373 ++pMessageQueue_50CBD0->uNumMessages; | |
4374 }*/ | |
4375 } | |
4376 //LABEL_28: | |
4377 v13 = pButton->pButtonName; | |
4378 //_set_status_and_ret: | |
4379 sub_41C0B8_set_status_string(v13); | |
4380 //LABEL_131: | |
4381 uLastPointedObjectID = 1; | |
4382 return; | |
4383 } | |
4384 } | |
4385 else | |
4386 { | |
4387 if ( pButton->uButtonType == 2 ) | |
4388 { | |
4389 v45 = pX - pButton->uX; | |
4390 v45 = pY - pButton->uY; | |
4391 if ( (double)(signed int)pButton->uWidth != 0.0 ) | |
4392 { | |
4393 if ( (double)(signed int)pButton->uHeight != 0.0 ) | |
4394 { | |
4395 //UNDEF(v8); | |
4396 //if ( v9 | v10 ) | |
4397 //goto LABEL_24; | |
4398 //{ | |
4399 pMessageType1 = (UIMessageType)pButton->field_1C; | |
4400 if ( pMessageType1 ) | |
4401 { | |
4402 v12 = pButton->uControlParam; | |
4403 pMessageQueue_50CBD0->AddMessage(pMessageType1, v12, 0); | |
4404 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
4405 { | |
4406 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType1; | |
4407 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v12; | |
4408 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
4409 ++pMessageQueue_50CBD0->uNumMessages; | |
4410 }*/ | |
4411 } | |
4412 v13 = pButton->pButtonName; | |
4413 sub_41C0B8_set_status_string(v13); | |
4414 uLastPointedObjectID = 1; | |
4415 return; | |
4416 //} | |
4417 } | |
4418 } | |
4419 } | |
4420 else // click on skill | |
4421 { | |
4422 if ( pButton->uButtonType == 3 | |
4423 && (signed int)pX >= (signed int)pButton->uX | |
4424 && (signed int)pX <= (signed int)pButton->uZ | |
4425 && (signed int)pY >= (signed int)pButton->uY | |
4426 && (signed int)pY <= (signed int)pButton->uW ) | |
4427 { | |
4428 //LABEL_19: | |
4429 pPlayer = pPlayers[uActiveCharacter]; | |
4430 v5 = LOBYTE(pPlayer->pActiveSkills[pButton->uControlParam]); | |
4431 v6 = pPlayer->uSkillPoints; | |
4432 v7 = (v5 & 0x3F) + 1; | |
4433 if ( v6 < v7 ) | |
4434 { | |
4435 v41 = v7 - v6; | |
4436 v39 = pGlobalTXT_LocalizationStrings[469];// "You need %d more Skill Points to advance here" | |
4437 } | |
4438 else | |
4439 { | |
4440 v41 = v7; | |
4441 v39 = pGlobalTXT_LocalizationStrings[468];// "Clicking here will spend %d Skill Points" | |
4442 } | |
4443 sprintf(Str1, v39, v41); | |
4444 v13 = Str1; | |
4445 //goto _set_status_and_ret; | |
4446 sub_41C0B8_set_status_string(v13); | |
4447 uLastPointedObjectID = 1; | |
4448 return; | |
4449 } | |
4450 } | |
4451 } | |
4452 } | |
4453 } | |
4454 if ( pWindow->uFrameHeight == 480 ) | |
4455 break; | |
4456 --v1; | |
4457 if ( v1 <= 0 ) | |
4458 { | |
4459 break; | |
4460 } | |
4461 } | |
4462 } | |
4463 if ( uNumVisibleWindows <= 0 || (uNumVisibleWindows > 0 && pWindow->uFrameHeight != 480 && v1 <= 0)) | |
4464 { | |
151 | 4465 if ( pCurrentScreen == SCREEN_CHEST ) |
0 | 4466 { |
4467 sub_42038D(); | |
8 | 4468 //goto _return; |
4469 if ( pMouse->uPointingObjectID == 0 ) | |
4470 { | |
4471 if ( uLastPointedObjectID != 0 ) | |
4472 { | |
4473 pStatusBarString[0] = 0; | |
4474 bForceDrawStatusBar = 1; | |
4475 } | |
4476 } | |
4477 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4478 return; | |
0 | 4479 } |
151 | 4480 if ( pCurrentScreen == SCREEN_HOUSE ) |
0 | 4481 { |
607 | 4482 if ( dialog_menu_id != 2 |
0 | 4483 || (v16 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]], v16 == 0) |
4484 || v16 == -65536 ) | |
8 | 4485 //goto _return; |
4486 { | |
4487 if ( pMouse->uPointingObjectID == 0 ) | |
4488 { | |
4489 if ( uLastPointedObjectID != 0 ) | |
4490 { | |
4491 pStatusBarString[0] = 0; | |
4492 bForceDrawStatusBar = 1; | |
4493 } | |
4494 } | |
4495 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4496 return; | |
4497 } | |
336 | 4498 pItemGen = (ItemGen *)((char *)&pParty->pPickedItem + 36 * (v16 + 12 * (unsigned int)window_SpeakInHouse->ptr_1C) + 4); |
8 | 4499 //LABEL_49: |
4500 v17 = pItemGen->GetDisplayName(); | |
0 | 4501 sub_41C0B8_set_status_string(v17); |
8 | 4502 //LABEL_50: |
0 | 4503 uLastPointedObjectID = 1; |
8 | 4504 //_return: |
0 | 4505 if ( pMouse->uPointingObjectID == 0 ) |
4506 { | |
4507 if ( uLastPointedObjectID != 0 ) | |
4508 { | |
4509 pStatusBarString[0] = 0; | |
4510 bForceDrawStatusBar = 1; | |
4511 } | |
4512 } | |
4513 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4514 return; | |
4515 } | |
4516 if ( (signed int)pY < 350 ) | |
4517 { | |
4518 v14 = pRenderer->pActiveZBuffer[pX + pSRZBufferLineOffsets[pY]]; | |
4519 if ( v14 == 0 || v14 == -65536 || (unsigned int)v14 >= 0x1388 ) | |
8 | 4520 //goto _return; |
4521 { | |
4522 if ( pMouse->uPointingObjectID == 0 ) | |
4523 { | |
4524 if ( uLastPointedObjectID != 0 ) | |
4525 { | |
4526 pStatusBarString[0] = 0; | |
4527 bForceDrawStatusBar = 1; | |
4528 } | |
4529 } | |
4530 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4531 return; | |
4532 } | |
232 | 4533 pItemGen = (ItemGen *)&pPlayers[uActiveCharacter]->pInventoryItems[v14-1]; |
8 | 4534 //goto LABEL_49; |
4535 v17 = pItemGen->GetDisplayName(); | |
4536 sub_41C0B8_set_status_string(v17); | |
4537 uLastPointedObjectID = 1; | |
4538 if ( pMouse->uPointingObjectID == 0 ) | |
4539 { | |
4540 if ( uLastPointedObjectID != 0 ) | |
4541 { | |
4542 pStatusBarString[0] = 0; | |
4543 bForceDrawStatusBar = 1; | |
4544 } | |
4545 } | |
4546 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4547 return; | |
0 | 4548 } |
4549 _click_on_game_ui: | |
4550 if ( (signed int)pX >= (signed int)pWindowList[0].uFrameX | |
4551 && (signed int)pX <= (signed int)pWindowList[0].uFrameZ | |
4552 && (signed int)pY >= (signed int)pWindowList[0].uFrameY | |
4553 && (signed int)pY <= (signed int)pWindowList[0].uFrameW ) | |
4554 { | |
8 | 4555 for ( pButton = pWindowList[0].pControlsHead; pButton != (GUIButton *)0; pButton = pButton->pNext ) |
4556 { | |
4557 if ( pButton->uButtonType == 1 ) | |
0 | 4558 { |
8 | 4559 if ( (signed int)pX >= (signed int)pButton->uX |
4560 && (signed int)pX <= (signed int)pButton->uZ | |
4561 && (signed int)pY >= (signed int)pButton->uY | |
4562 && (signed int)pY <= (signed int)pButton->uW ) | |
0 | 4563 { |
8 | 4564 pMessageType3 = (UIMessageType)pButton->field_1C; |
17 | 4565 if ( pMessageType3 == 0 ) // For books |
8 | 4566 //goto LABEL_28; |
4567 { | |
4568 v13 = pButton->pButtonName; | |
4569 sub_41C0B8_set_status_string(v13); | |
4570 uLastPointedObjectID = 1; | |
4571 return; | |
4572 } | |
4573 v38 = pButton->uControlParam; | |
437 | 4574 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) |
0 | 4575 { |
8 | 4576 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType3; |
0 | 4577 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v38; |
4578 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
4579 ++pMessageQueue_50CBD0->uNumMessages; | |
437 | 4580 }*/ |
4581 pMessageQueue_50CBD0->AddMessage(pMessageType3, v38, 0); | |
8 | 4582 //goto LABEL_131; |
0 | 4583 uLastPointedObjectID = 1; |
4584 return; | |
4585 } | |
4586 } | |
4587 else | |
4588 { | |
8 | 4589 if ( pButton->uButtonType == 2 ) |
0 | 4590 { |
8 | 4591 v45 = pX - pButton->uX; |
4592 v45 = pY - pButton->uY; | |
4593 | |
4594 if (pX >= pButton->uX && pX <= pButton->uZ && | |
4595 pY >= pButton->uY && pY <= pButton->uW) | |
4596 if ( (double)(signed int)pButton->uWidth != 0.0 ) | |
0 | 4597 { |
8 | 4598 if ( (double)(signed int)pButton->uHeight != 0.0 ) |
0 | 4599 { |
8 | 4600 //UNDEF(v32); |
14 | 4601 //if ( v33 | v34 ) |
4602 //{ | |
8 | 4603 pMessageType2 = (UIMessageType)pButton->field_1C; |
4604 if ( pMessageType2 != 0 ) | |
4605 { | |
4606 v36 = pButton->uControlParam; | |
4607 if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
4608 { | |
437 | 4609 pMessageQueue_50CBD0->AddMessage(pMessageType2, v36, 0); |
4610 /*pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = pMessageType2; | |
8 | 4611 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v36; |
4612 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
4613 //goto LABEL_27; | |
437 | 4614 ++pMessageQueue_50CBD0->uNumMessages;*/ |
8 | 4615 v13 = pButton->pButtonName; |
4616 sub_41C0B8_set_status_string(v13); | |
4617 uLastPointedObjectID = 1; | |
4618 return; | |
4619 } | |
4620 } | |
4621 //goto LABEL_28; | |
4622 v13 = pButton->pButtonName; | |
4623 sub_41C0B8_set_status_string(v13); | |
4624 uLastPointedObjectID = 1; | |
4625 return; | |
14 | 4626 //} |
0 | 4627 } |
4628 } | |
4629 } | |
8 | 4630 else |
0 | 4631 { |
8 | 4632 if ( pButton->uButtonType == 3 |
4633 && (signed int)pX >= (signed int)pButton->uX | |
4634 && (signed int)pX <= (signed int)pButton->uZ | |
4635 && (signed int)pY >= (signed int)pButton->uY | |
4636 && (signed int)pY <= (signed int)pButton->uW ) | |
4637 //goto LABEL_19; | |
0 | 4638 { |
8 | 4639 pPlayer = pPlayers[uActiveCharacter]; |
4640 v5 = LOBYTE(pPlayer->pActiveSkills[pButton->uControlParam]); | |
4641 v6 = pPlayer->uSkillPoints; | |
0 | 4642 v7 = (v5 & 0x3F) + 1; |
4643 if ( v6 < v7 ) | |
4644 { | |
4645 v41 = v7 - v6; | |
4646 v39 = pGlobalTXT_LocalizationStrings[469];// "You need %d more Skill Points to advance here" | |
4647 } | |
4648 else | |
4649 { | |
4650 v41 = v7; | |
4651 v39 = pGlobalTXT_LocalizationStrings[468];// "Clicking here will spend %d Skill Points" | |
4652 } | |
4653 sprintf(Str1, v39, v41); | |
4654 v13 = Str1; | |
8 | 4655 //goto _set_status_and_ret; |
4656 sub_41C0B8_set_status_string(v13); | |
4657 uLastPointedObjectID = 1; | |
4658 return; | |
0 | 4659 } |
4660 } | |
4661 } | |
4662 } | |
4663 } | |
8 | 4664 pMouse->uPointingObjectID = sub_46A99B(); |
4665 //goto _return; | |
4666 if ( pMouse->uPointingObjectID == 0 ) | |
4667 { | |
4668 if ( uLastPointedObjectID != 0 ) | |
4669 { | |
4670 pStatusBarString[0] = 0; | |
4671 bForceDrawStatusBar = 1; | |
4672 } | |
4673 } | |
4674 uLastPointedObjectID = pMouse->uPointingObjectID; | |
4675 return; | |
4676 } | |
0 | 4677 } |
4678 | |
4679 | |
4680 //----- (00421626) -------------------------------------------------------- | |
4681 GUIWindow *GameUI_InitializeCharacterWindow(unsigned int _this) | |
4682 { | |
4683 unsigned int v1; // edi@1 | |
11 | 4684 GUIWindow *pWindow; // edi@3 |
0 | 4685 |
4686 ++pIcons_LOD->uTexturePacksCount; | |
4687 v1 = _this; | |
4688 if ( !pIcons_LOD->uNumPrevLoadedFiles ) | |
4689 pIcons_LOD->uNumPrevLoadedFiles = pIcons_LOD->uNumLoadedFiles; | |
4690 pEventTimer->Pause(); | |
4691 pAudioPlayer->StopChannels(-1, -1); | |
4692 bRingsShownInCharScreen = 0; | |
4693 CharacterUI_LoadPaperdollTextures(); | |
4694 pCurrentScreen = v1; | |
11 | 4695 pWindow = GUIWindow::Create(0, 0, 640, 480, WINDOW_CharacterRecord, uActiveCharacter, 0); |
4696 pCharacterScreen_StatsBtn = pWindow->CreateButton(pViewport->uViewportX + 12, pViewport->uViewportY + 308, | |
0 | 4697 (papredoll_dbrds[9] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[9]].uTextureWidth : 24), |
4698 (papredoll_dbrds[9] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[9]].uTextureHeight : 26), | |
11 | 4699 1, 0, 0x73u, 0, 0x53u, pGlobalTXT_LocalizationStrings[216],// Stats |
0 | 4700 (Texture *)(papredoll_dbrds[10] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[10]] : 0), |
11 | 4701 papredoll_dbrds[9] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[9]] : 0, 0); |
4702 pCharacterScreen_SkillsBtn = pWindow->CreateButton(pViewport->uViewportX + 102, pViewport->uViewportY + 308, | |
0 | 4703 (papredoll_dbrds[7] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[7]].uTextureWidth : 24), |
4704 (papredoll_dbrds[7] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[7]].uTextureHeight : 26), | |
11 | 4705 1, 0, 0x72u, 0, 0x4Bu, pGlobalTXT_LocalizationStrings[205],//Skills |
0 | 4706 (Texture *)(papredoll_dbrds[8] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[8]] : 0), |
11 | 4707 papredoll_dbrds[7] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[7]] : 0, 0); |
4708 pCharacterScreen_InventoryBtn = pWindow->CreateButton(pViewport->uViewportX + 192, pViewport->uViewportY + 308, | |
0 | 4709 (papredoll_dbrds[5] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[5]].uTextureWidth : 24), |
4710 (papredoll_dbrds[5] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[5]].uTextureHeight : 26), | |
11 | 4711 1, 0, 0x74u, 0, 0x49u, pGlobalTXT_LocalizationStrings[120], //Inventory |
0 | 4712 (Texture *)(papredoll_dbrds[6] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[6]] : 0), |
11 | 4713 papredoll_dbrds[5] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[5]] : 0, 0); |
4714 pCharacterScreen_AwardsBtn = pWindow->CreateButton(pViewport->uViewportX + 282, pViewport->uViewportY + 308, | |
0 | 4715 (papredoll_dbrds[3] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[3]].uTextureWidth : 24), |
4716 (papredoll_dbrds[3] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[3]].uTextureHeight : 26), | |
11 | 4717 1, 0, 0x75u, 0, 0x41u, pGlobalTXT_LocalizationStrings[22], //Awards |
0 | 4718 (Texture *)(papredoll_dbrds[4] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[4]] : 0), |
11 | 4719 papredoll_dbrds[3] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[3]] : 0, 0); |
4720 pCharacterScreen_ExitBtn = pWindow->CreateButton(pViewport->uViewportX + 371, pViewport->uViewportY + 308, | |
0 | 4721 (papredoll_dbrds[1] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[1]].uTextureWidth : 24), |
4722 (papredoll_dbrds[1] != -1 ? pIcons_LOD->pTextures[papredoll_dbrds[1]].uTextureHeight : 26), | |
11 | 4723 1, 0, 0xA8u, 0, 0, pGlobalTXT_LocalizationStrings[79],//Exit |
0 | 4724 (Texture *)(papredoll_dbrds[2] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[2]] : 0), |
11 | 4725 papredoll_dbrds[1] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[1]] : 0, 0); |
4726 pWindow->CreateButton(0, 0, 0x1DCu, 0x159u, 1, 122, 0x78u, 0, 0, "", 0); | |
4727 pCharacterScreen_DetalizBtn = pWindow->CreateButton(0x258u, 0x12Cu, 0x1Eu, 0x1Eu, 1, 0, 0x55u, 0, 0, pGlobalTXT_LocalizationStrings[64], 0); | |
4728 pCharacterScreen_DollBtn = pWindow->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, 0x85u, 0, 0, "", 0); | |
4729 pWindow->CreateButton(0x3Du, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0); | |
4730 pWindow->CreateButton(0xB1u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0); | |
4731 pWindow->CreateButton(0x124u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0); | |
4732 pWindow->CreateButton(0x197u, 0x1A8u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0); | |
4733 pWindow->CreateButton(0, 0, 0, 0, 1, 0, 0xB0u, 0, 9u, "", 0); | |
521 | 4734 FillAwardsData(); |
11 | 4735 return pWindow; |
0 | 4736 } |
4737 | |
4738 | |
4739 | |
4740 //----- (004219BE) -------------------------------------------------------- | |
4741 GUIWindow *stru277::sub_4219BE() | |
4742 { | |
4743 int v1; // esi@1 | |
4744 GUIWindow *v2; // ebx@1 | |
4745 | |
4746 auto a4 = this; | |
4747 v1 = (int)a4; | |
4748 pEventTimer->Pause(); | |
4749 pAudioPlayer->StopChannels(-1, -1); | |
4750 bRingsShownInCharScreen = 0; | |
4751 CharacterUI_LoadPaperdollTextures(); | |
151 | 4752 pCurrentScreen = SCREEN_CASTING; |
0 | 4753 v2 = GUIWindow::Create(0, 0, 640, 480, (WindowType)(WINDOW_HouseInterior|WINDOW_Options), v1, 0); |
4754 pCharacterScreen_ExitBtn = v2->CreateButton( | |
4755 394u, | |
4756 318u, | |
4757 75u, | |
4758 33u, | |
4759 1, | |
4760 0, | |
4761 0xA8u, | |
4762 0, | |
4763 0, | |
4764 pGlobalTXT_LocalizationStrings[79], | |
4765 (Texture *)(papredoll_dbrds[2] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[2]] : 0), | |
4766 papredoll_dbrds[1] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[1]] : 0, | |
4767 0); | |
4768 v2->CreateButton(0, 0, 0x1DCu, 0x159u, 1, 122, 0x78u, 0, 0, "", 0); | |
4769 pCharacterScreen_DollBtn = v2->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, 0x85u, 0, 0, "", 0); | |
4770 v2->CreateButton(61u, 424u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0); | |
4771 v2->CreateButton(177u, 424u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0); | |
4772 v2->CreateButton(292u, 424u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0); | |
4773 v2->CreateButton(407u, 424u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0); | |
4774 return v2; | |
4775 } | |
4776 | |
4777 | |
4778 //----- (00421B2C) -------------------------------------------------------- | |
4779 bool __cdecl sub_421B2C_PlaceInInventory_or_DropPickedItem() | |
4780 { | |
4781 unsigned int v0; // eax@2 | |
4782 Texture *v1; // ebx@2 | |
4783 int v2; // eax@3 | |
4784 Player *v3; // esi@5 | |
4785 int v4; // eax@6 | |
4786 unsigned __int16 v5; // dx@11 | |
4787 signed int v6; // eax@11 | |
4788 char *v7; // edi@12 | |
4789 __int16 v8; // ax@16 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
4790 SpriteObject a1; // [sp+4h] [bp-78h]@11 |
0 | 4791 int v11; // [sp+74h] [bp-8h]@2 |
4792 int v12; // [sp+78h] [bp-4h]@5 | |
4793 | |
4794 if ( !pParty->pPickedItem.uItemID ) | |
4795 return 1; | |
4796 v0 = pIcons_LOD->LoadTexture( | |
4797 pItemsTable->pItems[pParty->pPickedItem.uItemID].pIconName, | |
4798 TEXTURE_16BIT_PALETTE); | |
4799 v1 = (Texture *)(v0 != -1 ? (int)&pIcons_LOD->pTextures[v0] : 0); | |
4800 v11 = areWeLoadingTexture; | |
4801 if ( uActiveCharacter | |
4802 && (v2 = pPlayers[uActiveCharacter]->AddItem(0xFFFFFFFFu, pParty->pPickedItem.uItemID)) != 0 ) | |
4803 { | |
232 | 4804 memcpy(&pPlayers[uActiveCharacter]->pInventoryItems[v2-1], &pParty->pPickedItem, 0x24u); |
244 | 4805 pMouse->RemoveHoldingItem(); |
0 | 4806 } |
4807 else | |
4808 { | |
4809 v12 = 0; | |
4810 v3 = pParty->pPlayers; | |
244 | 4811 while ( v3 <= &pParty->pPlayers[3] ) |
0 | 4812 { |
4813 v4 = v3->AddItem(0xFFFFFFFFu, pParty->pPickedItem.uItemID); | |
4814 if ( v4 ) | |
244 | 4815 { |
4816 memcpy(&pParty->pPlayers[v12].pInventoryItems[v4], &pParty->pPickedItem, 0x24u); | |
4817 pMouse->RemoveHoldingItem(); | |
4818 break; | |
4819 } | |
4820 ++v12; | |
0 | 4821 ++v3; |
244 | 4822 } |
4823 if ( v12 == 4 ) | |
4824 { | |
4825 v5 = pItemsTable->pItems[pParty->pPickedItem.uItemID].uSpriteID; | |
4826 v6 = 0; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
4827 a1.uType = pItemsTable->pItems[pParty->pPickedItem.uItemID].uSpriteID; |
244 | 4828 if ( (signed int)pObjectList->uNumObjects <= 0 ) |
4829 { | |
4830 LOWORD(v6) = 0; | |
4831 } | |
4832 else | |
4833 { | |
4834 v7 = (char *)&pObjectList->pObjects->uObjectID; | |
4835 while ( v5 != *(short *)v7 ) | |
4836 { | |
4837 ++v6; | |
4838 v7 += 56; | |
4839 if ( v6 >= (signed int)pObjectList->uNumObjects ) | |
4840 { | |
4841 LOWORD(v6) = 0; | |
4842 break; | |
4843 } | |
4844 } | |
4845 } | |
303 | 4846 a1.field_58_pid = OBJECT_Player; |
244 | 4847 a1.uObjectDescID = v6; |
4848 a1.vPosition.y = pParty->vPosition.y; | |
4849 a1.vPosition.x = pParty->vPosition.x; | |
4850 a1.vPosition.z = pParty->sEyelevel + pParty->vPosition.z; | |
4851 a1.uSoundID = 0; | |
4852 a1.uFacing = 0; | |
4853 a1.uAttributes = 8; | |
4854 v8 = pIndoor->GetSector( | |
4855 pParty->vPosition.x, | |
4856 pParty->vPosition.y, | |
4857 pParty->sEyelevel + pParty->vPosition.z); | |
4858 a1.uSpriteFrameID = 0; | |
4859 a1.uSectorID = v8; | |
4860 memcpy(&a1.stru_24, &pParty->pPickedItem, sizeof(a1.stru_24)); | |
4861 a1.Create(pParty->sRotationY, 184, 200, 0); | |
4862 pMouse->RemoveHoldingItem(); | |
4863 } | |
4864 } | |
0 | 4865 if ( !v11 ) |
4866 { | |
4867 v1->Release(); | |
4868 pIcons_LOD->_40F9C5(); | |
4869 } | |
4870 return 1; | |
4871 } | |
4872 | |
4873 | |
4874 //----- (00421D00) -------------------------------------------------------- | |
4875 void __fastcall GameUI_OnPlayerPortraitLeftClick(unsigned int uPlayerID) | |
4876 { | |
201 | 4877 //unsigned int v1; // esi@1 |
4878 //int v2; // eax@2 | |
4879 //Player *v3; // ecx@2 | |
4880 //Player *v4; // ecx@5 | |
0 | 4881 unsigned int v5; // [sp-4h] [bp-10h]@21 |
4882 | |
201 | 4883 //v1 = uPlayerID; |
4884 auto player = &pParty->pPlayers[uPlayerID - 1]; | |
4885 if (pParty->pPickedItem.uItemID) | |
4886 { | |
4887 //v3 = player; | |
4888 if (auto slot = player->AddItem(0xFFFFFFFFu, pParty->pPickedItem.uItemID)) | |
4889 { | |
232 | 4890 memcpy(&player->pInventoryItems[slot-1], &pParty->pPickedItem, 0x24u); |
201 | 4891 viewparams->bRedrawGameUI = true; |
0 | 4892 pMouse->RemoveHoldingItem(); |
4893 return; | |
4894 } | |
201 | 4895 |
4896 if (!player->CanAct()) | |
4897 { | |
4898 player = pPlayers[uActiveCharacter]; | |
4899 } | |
595 | 4900 if(player->CanAct() || !pPlayers[uActiveCharacter]->CanAct()) |
588 | 4901 player->PlaySound(SPEECH_NoRoom, 0); |
201 | 4902 } |
4903 | |
588 | 4904 //LABEL_9: |
201 | 4905 if (pCurrentScreen == SCREEN_GAME) |
4906 { | |
4907 viewparams->bRedrawGameUI = true; | |
4908 if ( uActiveCharacter != uPlayerID ) | |
11 | 4909 //goto LABEL_27; |
4910 { | |
201 | 4911 if ( pPlayers[uPlayerID]->uTimeToRecovery ) |
11 | 4912 return; |
201 | 4913 |
4914 uActiveCharacter = uPlayerID; | |
11 | 4915 return; |
4916 } | |
0 | 4917 v5 = 7; |
11 | 4918 //LABEL_22: |
0 | 4919 pGUIWindow_CurrentMenu = GameUI_InitializeCharacterWindow(v5); |
4920 return; | |
4921 } | |
151 | 4922 if ( pCurrentScreen == SCREEN_SPELL_BOOK ) |
0 | 4923 return; |
151 | 4924 if ( pCurrentScreen == SCREEN_CHEST ) |
0 | 4925 { |
11 | 4926 //LABEL_23: |
201 | 4927 viewparams->bRedrawGameUI = true; |
4928 if ( uActiveCharacter == uPlayerID ) | |
0 | 4929 { |
4930 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; | |
151 | 4931 pCurrentScreen = SCREEN_F; |
11 | 4932 //goto LABEL_28; |
201 | 4933 uActiveCharacter = uPlayerID; |
11 | 4934 return; |
4935 } | |
4936 //LABEL_27: | |
201 | 4937 if ( pPlayers[uPlayerID]->uTimeToRecovery ) |
0 | 4938 return; |
11 | 4939 //goto LABEL_28; |
201 | 4940 uActiveCharacter = uPlayerID; |
11 | 4941 return; |
0 | 4942 } |
151 | 4943 if ( pCurrentScreen != SCREEN_HOUSE ) |
4944 { | |
4945 if ( pCurrentScreen == SCREEN_E ) | |
0 | 4946 { |
11 | 4947 //LABEL_28: |
201 | 4948 uActiveCharacter = uPlayerID; |
0 | 4949 return; |
4950 } | |
151 | 4951 if ( pCurrentScreen != SCREEN_F ) |
0 | 4952 { |
201 | 4953 viewparams->bRedrawGameUI = true; |
4954 uActiveCharacter = uPlayerID; | |
0 | 4955 if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 102 ) |
521 | 4956 FillAwardsData(); |
0 | 4957 return; |
4958 } | |
11 | 4959 //goto LABEL_23; |
201 | 4960 viewparams->bRedrawGameUI = true; |
4961 if ( uActiveCharacter == uPlayerID ) | |
11 | 4962 { |
4963 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; | |
151 | 4964 pCurrentScreen = SCREEN_F; |
11 | 4965 //goto LABEL_28; |
201 | 4966 uActiveCharacter = uPlayerID; |
11 | 4967 return; |
4968 } | |
4969 //LABEL_27: | |
201 | 4970 if ( pPlayers[uPlayerID]->uTimeToRecovery ) |
11 | 4971 return; |
4972 //goto LABEL_28; | |
201 | 4973 uActiveCharacter = uPlayerID; |
11 | 4974 return; |
0 | 4975 } |
336 | 4976 if ( window_SpeakInHouse->field_40 == 1 ) |
0 | 4977 return; |
201 | 4978 viewparams->bRedrawGameUI = true; |
4979 if ( uActiveCharacter != uPlayerID ) | |
11 | 4980 //goto LABEL_28; |
201 | 4981 uActiveCharacter = uPlayerID; |
11 | 4982 return; |
607 | 4983 if ( dialog_menu_id == 2 || dialog_menu_id == 6 ) |
0 | 4984 { |
4985 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; | |
4986 v5 = 14; | |
11 | 4987 //goto LABEL_22; |
4988 pGUIWindow_CurrentMenu = GameUI_InitializeCharacterWindow(v5); | |
4989 return; | |
0 | 4990 } |
4991 } | |
4992 // 4E28F8: using guessed type int pCurrentScreen; | |
4993 // F8B19C: using guessed type int dword_F8B19C; | |
4994 | |
4995 //----- (00421EA6) -------------------------------------------------------- | |
4996 void __cdecl sub_421EA6_OnInventoryLeftClick() | |
4997 { | |
4998 Player *v0; // ebx@1 | |
4999 signed int v1; // eax@2 | |
5000 signed int v2; // ecx@2 | |
5001 int v3; // eax@2 | |
5002 char v4; // sf@2 | |
5003 int v5; // eax@2 | |
5004 unsigned int v6; // eax@7 | |
5005 unsigned int v7; // esi@12 | |
5006 unsigned int v8; // eax@12 | |
5007 unsigned int v9; // eax@16 | |
5008 unsigned int v10; // eax@18 | |
5009 ItemGen this_; // [sp+Ch] [bp-3Ch]@1 | |
5010 POINT a2; // [sp+30h] [bp-18h]@4 | |
5011 unsigned int v13; // [sp+38h] [bp-10h]@13 | |
5012 unsigned int pY; // [sp+3Ch] [bp-Ch]@2 | |
5013 unsigned int pX; // [sp+40h] [bp-8h]@2 | |
5014 int a4; // [sp+44h] [bp-4h]@2 | |
5015 | |
5016 v0 = pPlayers[uActiveCharacter]; | |
501 | 5017 if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 103 ) |
0 | 5018 { |
501 | 5019 pMouse->GetClickPos(&pX, &pY); |
5020 pY = pY - 17; | |
5021 v2 =pX - 14; | |
5022 pX = v2; | |
5023 v3 = 14 * (pY >> 5); | |
5024 v2 >>= 5; | |
5025 v4 = v2 + v3 < 0; | |
5026 v5 = v2 + v3; | |
5027 a4 = v5; | |
5028 if ( !v4 ) | |
0 | 5029 { |
501 | 5030 if ( v5 <= 126 && pMouse->GetCursorPos(&a2)->x < 462 |
5031 && pMouse->GetCursorPos(&a2)->x >= 14 ) | |
0 | 5032 { |
501 | 5033 if ( unk_50C9A0 ) |
5034 { | |
5035 v6 = v0->GetItemIDAtInventoryIndex(&a4); | |
5036 if ( v6 ) | |
5037 { | |
5038 *((char *)pGUIWindow_Settings->ptr_1C + 8) &= 0x7Fu; | |
5039 *((short *)pGUIWindow_Settings->ptr_1C + 2) = uActiveCharacter - 1; | |
5040 *((int *)pGUIWindow_Settings->ptr_1C + 3) = v6 - 1; | |
5041 *((short *)pGUIWindow_Settings->ptr_1C + 3) = a4; | |
5042 ptr_50C9A4 = (ItemGen *)&v0->pInventoryItems[v6-1]; | |
5043 unk_50C9A0 = 0; | |
5044 if ( pMessageQueue_50CBD0->uNumMessages ) | |
5045 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
5046 pMouse->SetCursorBitmap("MICON1"); | |
5047 dword_50C9D0 = 113; | |
5048 dword_50C9D4 = 0; | |
5049 dword_50C9D8 = 256; | |
5050 } | |
5051 return; | |
5052 } | |
5053 if ( ptr_50C9A4 ) | |
5054 return; | |
5055 v7 = pParty->pPickedItem.uItemID; | |
5056 v8 = v0->GetItemIDAtInventoryIndex(&a4); | |
5057 if ( !v7 ) | |
5058 { | |
5059 if ( !v8 ) | |
5060 return; | |
5061 memcpy(&pParty->pPickedItem, &v0->pInventoryItems[v8-1], sizeof(pParty->pPickedItem)); | |
5062 v0->RemoveItemAtInventoryIndex(a4); | |
5063 v9 = pParty->pPickedItem.uItemID; | |
588 | 5064 pMouse->SetCursorBitmap(pItemsTable->pItems[v9].pIconName); |
5065 return; | |
501 | 5066 } |
5067 v13 = v8; | |
5068 if ( v8 ) | |
5069 { | |
5070 a2.y = (LONG)&v0->pInventoryItems[v8-1]; | |
5071 memcpy(&this_, (const void *)a2.y, sizeof(this_)); | |
5072 v0->RemoveItemAtInventoryIndex(a4); | |
5073 pX = v0->AddItem2(a4, &pParty->pPickedItem); | |
5074 if ( !pX ) | |
5075 { | |
5076 pX = v0->AddItem2(0xFFFFFFFFu, &pParty->pPickedItem); | |
5077 if ( !pX ) | |
5078 { | |
5079 v0->_49298B(&this_, v13 - 1, a4); | |
5080 memcpy((void *)a2.y, &this_, sizeof(ItemGen)); | |
5081 return; | |
5082 } | |
5083 } | |
5084 v9 = this_.uItemID; | |
5085 memcpy(&pParty->pPickedItem, &this_, sizeof(pParty->pPickedItem)); | |
5086 pMouse->SetCursorBitmap(pItemsTable->pItems[v9].pIconName); | |
5087 return; | |
5088 } | |
5089 v10 = v0->AddItem(a4, v7); | |
5090 pX = v10; | |
5091 if ( v10 || (v10 = v0->AddItem(0xFFFFFFFFu, pParty->pPickedItem.uItemID), (pX = v10) != 0) ) | |
5092 { | |
5093 memcpy(&v0->pInventoryItems[v10-1], &pParty->pPickedItem, 0x24u); | |
5094 pMouse->RemoveHoldingItem(); | |
5095 } | |
0 | 5096 } |
5097 } | |
5098 } | |
5099 } | |
5100 | |
5101 //----- (0042213C) -------------------------------------------------------- | |
5102 void __cdecl OnGameViewportClick() | |
5103 { | |
5104 signed int v0; // ebx@2 | |
5105 POINT *v1; // esi@3 | |
5106 signed int v2; // eax@9 | |
5107 BLVFace *v3; // eax@10 | |
5108 unsigned int v4; // eax@11 | |
5109 unsigned __int16 v5; // dx@14 | |
5110 signed int v6; // eax@14 | |
5111 char *v7; // esi@15 | |
5112 int *v8; // eax@19 | |
5113 int v9; // eax@19 | |
5114 unsigned int v10; // eax@19 | |
5115 int v11; // ecx@21 | |
5116 ODMFace *v12; // eax@22 | |
5117 LevelDecoration *v13; // esi@24 | |
5118 __int16 v14; // ax@25 | |
5119 int v15; // ecx@29 | |
5120 signed int v16; // edx@30 | |
5121 Actor *v17; // esi@30 | |
5122 int v18; // ebx@47 | |
5123 unsigned __int16 v19; // ax@50 | |
5124 const char *v20; // eax@51 | |
5125 signed int v21; // eax@58 | |
5126 ItemGen *v22; // esi@62 | |
5127 unsigned int v23; // eax@62 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
5128 SpriteObject a1; // [sp+Ch] [bp-80h]@1 |
0 | 5129 POINT v25; // [sp+7Ch] [bp-10h]@3 |
5130 POINT a2; // [sp+84h] [bp-8h]@3 | |
5131 | |
5132 if ( pRenderer->pRenderD3D ) | |
5133 { | |
5134 v0 = pGame->pVisInstance->get_picked_object_zbuf_val(); | |
5135 } | |
5136 else | |
5137 { | |
5138 v1 = pMouse->GetCursorPos(&a2); | |
5139 v0 = pRenderer->pActiveZBuffer[v1->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v25)->y]]; | |
5140 } | |
141 | 5141 if ( (v0 & 7) == OBJECT_Item) |
0 | 5142 { |
5143 a2.y = (signed int)(unsigned __int16)v0 >> 3; | |
5144 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
|
5145 if ( !(pObjectList->pObjects[pSpriteObjects[v21].uObjectDescID].uFlags & 0x10) |
0 | 5146 && a2.y < 1000 |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
5147 && pSpriteObjects[v21].uObjectDescID |
0 | 5148 && (unsigned int)v0 < 0x2000000 ) |
5149 { | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
5150 v22 = &pSpriteObjects[v21].stru_24; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
5151 v23 = pSpriteObjects[v21].stru_24.uItemID; |
0 | 5152 if ( pItemsTable->pItems[v23].uEquipType == 18 ) |
5153 { | |
377 | 5154 party_finds_gold(v22->uSpecEnchantmentType, 0); |
0 | 5155 viewparams->bRedrawGameUI = 1; |
5156 } | |
5157 else | |
5158 { | |
5159 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[v23].pUnidentifiedName); | |
5160 ShowStatusBarString(pTmpBuf2, 2u); | |
5161 if ( v22->uItemID == 506 ) | |
484 | 5162 _449B7E_toggle_bit(pParty->_quest_bits, 184, 1u); |
0 | 5163 if ( v22->uItemID == 455 ) |
484 | 5164 _449B7E_toggle_bit(pParty->_quest_bits, 185, 1u); |
0 | 5165 if ( !pParty->AddItem(v22) ) |
5166 pParty->SetHoldingItem(v22); | |
5167 } | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
5168 SpriteObject::OnInteraction(a2.y); |
0 | 5169 return; |
5170 } | |
588 | 5171 v4 = pParty->pPickedItem.uItemID; |
5172 if ( !pParty->pPickedItem.uItemID ) | |
5173 return; | |
5174 goto LABEL_14; | |
0 | 5175 } |
141 | 5176 if ( (v0 & 7) != OBJECT_Actor) |
5177 { | |
5178 if ( (v0 & 7) == OBJECT_Decoration) | |
0 | 5179 { |
5180 v13 = &pLevelDecorations[(signed int)(unsigned __int16)v0 >> 3]; | |
5181 if ( (signed int)(((unsigned int)v0 >> 16) - pDecorationList->pDecorations[v13->uDecorationDescID].uRadius) >= 512 ) | |
588 | 5182 { |
5183 v4 = pParty->pPickedItem.uItemID; | |
5184 if ( !pParty->pPickedItem.uItemID ) | |
5185 return; | |
5186 goto LABEL_14; | |
5187 } | |
0 | 5188 v14 = v13->field_16_event_id; |
5189 if ( !v14 ) | |
5190 { | |
5191 if ( pLevelDecorations[(signed int)(unsigned __int16)v0 >> 3].IsInteractive() ) | |
5192 { | |
5193 v15 = stru_5E4C90._decor_events[v13->_idx_in_stru123 - 75] + 380; | |
520
35f28d4c0ff9
GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents:
515
diff
changeset
|
5194 activeLevelDecoration = &pLevelDecorations[(signed int)(unsigned __int16)v0 >> 3]; |
0 | 5195 EventProcessor(v15, 0, 1); |
520
35f28d4c0ff9
GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents:
515
diff
changeset
|
5196 activeLevelDecoration = NULL; |
0 | 5197 } |
5198 return; | |
5199 } | |
5200 v11 = v14; | |
5201 } | |
5202 else | |
5203 { | |
141 | 5204 if ( (v0 & 7) != OBJECT_BModel || (unsigned int)v0 >= 0x2000000 ) |
588 | 5205 { |
5206 v4 = pParty->pPickedItem.uItemID; | |
5207 if ( !pParty->pPickedItem.uItemID ) | |
5208 return; | |
5209 goto LABEL_14; | |
5210 } | |
0 | 5211 v2 = (signed int)(unsigned __int16)v0 >> 3; |
5212 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
5213 { | |
5214 v3 = &pIndoor->pFaces[v2]; | |
5215 if ( !(v3->uAttributes & 0x2000000) ) | |
5216 { | |
5217 LABEL_11: | |
588 | 5218 v4 = pParty->pPickedItem.uItemID; |
5219 if ( !pParty->pPickedItem.uItemID ) | |
5220 { | |
5221 ShowNothingHereStatus(); | |
5222 v4 = pParty->pPickedItem.uItemID; | |
5223 if ( !pParty->pPickedItem.uItemID ) | |
5224 return; | |
5225 } | |
0 | 5226 LABEL_14: |
588 | 5227 v5 = pItemsTable->pItems[v4].uSpriteID; |
5228 v6 = 0; | |
5229 a1.uType = v5; | |
5230 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
5231 { | |
5232 LOWORD(v6) = 0; | |
5233 } | |
5234 else | |
5235 { | |
5236 v7 = (char *)&pObjectList->pObjects->uObjectID; | |
5237 while ( v5 != *(short *)v7 ) | |
5238 { | |
5239 ++v6; | |
5240 v7 += 56; | |
5241 if ( v6 >= (signed int)pObjectList->uNumObjects ) | |
5242 { | |
5243 LOWORD(v6) = 0; | |
5244 break; | |
5245 } | |
5246 } | |
5247 } | |
5248 a1.uObjectDescID = v6; | |
5249 a1.vPosition.y = pParty->vPosition.y; | |
5250 a1.field_58_pid = OBJECT_Player; | |
5251 a1.vPosition.x = pParty->vPosition.x; | |
5252 a1.vPosition.z = pParty->sEyelevel + pParty->vPosition.z; | |
5253 a1.uSoundID = 0; | |
5254 a1.uFacing = 0; | |
5255 a1.uAttributes = 8; | |
5256 a1.uSectorID = pIndoor->GetSector( | |
5257 pParty->vPosition.x, | |
5258 pParty->vPosition.y, | |
5259 pParty->sEyelevel + pParty->vPosition.z); | |
5260 a1.uSpriteFrameID = 0; | |
5261 memcpy(&a1.stru_24, &pParty->pPickedItem, 0x24u); | |
5262 v8 = (int *)pMouse->GetCursorPos(&v25); | |
5263 v9 = UnprojectX(*v8); | |
5264 a1.Create(pParty->sRotationY + v9, 184, 200, 0); | |
5265 v10 = pIcons_LOD->LoadTexture( | |
5266 pItemsTable->pItems[pParty->pPickedItem.uItemID].pIconName, | |
5267 TEXTURE_16BIT_PALETTE); | |
5268 if (v10 != -1) | |
5269 pIcons_LOD->pTextures[v10].Release(); | |
5270 pMouse->RemoveHoldingItem(); | |
5271 pIcons_LOD->_40F9C5(); | |
5272 return; | |
0 | 5273 } |
5274 v11 = pIndoor->pFaceExtras[v3->uFaceExtraID].uEventID; | |
5275 } | |
5276 else | |
5277 { | |
5278 v12 = &pOutdoor->pBModels[(signed int)(unsigned __int16)v0 >> 9].pFaces[v2 & 0x3F]; | |
5279 if ( !(v12->uAttributes & 0x2000000) ) | |
5280 goto LABEL_11; | |
5281 v11 = v12->sCogTriggeredID; | |
5282 } | |
5283 } | |
5284 EventProcessor(v11, (unsigned __int16)v0, 1); | |
5285 return; | |
5286 } | |
5287 v16 = (signed int)(unsigned __int16)v0 >> 3; | |
5288 a2.y = v16; | |
5289 v17 = &pActors[v16]; | |
5290 if ( v17->uAIState == 5 ) | |
5291 { | |
5292 if ( (unsigned int)v0 < 0x2000000 ) | |
5293 { | |
5294 stru_50C198.LootActor(&pActors[v16]); | |
5295 return; | |
5296 } | |
588 | 5297 v4 = pParty->pPickedItem.uItemID; |
5298 if ( !pParty->pPickedItem.uItemID ) | |
5299 return; | |
5300 goto LABEL_14; | |
0 | 5301 } |
5302 if ( GetAsyncKeyState(VK_SHIFT) >= 0 ) | |
5303 { | |
5304 if ( !v17->GetActorsRelation(0) && !(BYTE2(v17->uAttributes) & 8) ) | |
5305 { | |
5306 if ( (unsigned int)v0 >= 0x2000000 ) | |
588 | 5307 { |
5308 v4 = pParty->pPickedItem.uItemID; | |
5309 if ( !pParty->pPickedItem.uItemID ) | |
5310 return; | |
5311 goto LABEL_14; | |
5312 } | |
0 | 5313 if ( !v17->CanAct() ) |
5314 return; | |
5315 v18 = a2.y; | |
5316 Actor::FaceObject(a2.y, 4u, 0, 0); | |
602 | 5317 if ( !v17->sNPC_ID ) |
0 | 5318 { |
5319 v19 = pNPCStats->pGroups_copy[v17->uGroup]; | |
5320 if ( v19 ) | |
5321 { | |
5322 v20 = pNPCStats->pCatchPhrases[v19]; | |
5323 if ( v20 ) | |
5324 { | |
5325 pParty->uFlags |= 2u; | |
5326 strcpy(byte_5B0938, v20); | |
5327 sub_4451A8_press_any_key(0, 0, 0); | |
5328 } | |
5329 } | |
5330 return; | |
5331 } | |
437 | 5332 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) |
0 | 5333 return; |
5334 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)161; | |
5335 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v18; | |
5336 LABEL_42: | |
5337 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
5338 ++pMessageQueue_50CBD0->uNumMessages; | |
437 | 5339 return;*/ |
5340 pMessageQueue_50CBD0->AddMessage(UIMSG_StartNPCDialogue, v18, 0); | |
0 | 5341 return; |
5342 } | |
5343 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 3 ) | |
5344 { | |
5345 pTurnEngine->field_18 |= 8u; | |
5346 return; | |
5347 } | |
437 | 5348 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) |
0 | 5349 { |
5350 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)23; | |
5351 goto LABEL_41; | |
437 | 5352 }*/ |
5353 pMessageQueue_50CBD0->AddMessage(UIMSG_Attack, 0, 0); | |
0 | 5354 } |
5355 else | |
5356 { | |
5357 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 3 ) | |
5358 { | |
569 | 5359 pParty->uFlags |= PARTY_FLAGS_1_FALLING; |
0 | 5360 return; |
5361 } | |
5362 if ( uActiveCharacter | |
437 | 5363 && sub_427769_spell(pPlayers[uActiveCharacter]->uQuickSpell)) |
0 | 5364 { |
437 | 5365 pMessageQueue_50CBD0->AddMessage(UIMSG_19, 0, 0); |
5366 /*&& (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
0 | 5367 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)25; |
5368 LABEL_41: | |
5369 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
437 | 5370 goto LABEL_42;*/ |
0 | 5371 } |
5372 } | |
5373 } | |
5374 | |
5375 //----- (004226C2) -------------------------------------------------------- | |
265 | 5376 bool PauseGameDrawing() |
0 | 5377 { |
265 | 5378 if ( pCurrentScreen != SCREEN_GAME |
151 | 5379 && pCurrentScreen != SCREEN_NPC_DIALOGUE |
5380 && pCurrentScreen != SCREEN_CHANGE_LOCATION ) | |
5381 { | |
5382 if ( pCurrentScreen == SCREEN_INPUT_BLV ) | |
0 | 5383 return pVideoPlayer->pSmackerMovie != 0; |
151 | 5384 if ( pCurrentScreen != SCREEN_BRANCHLESS_NPC_DIALOG ) |
265 | 5385 return true; |
5386 } | |
5387 return false; | |
0 | 5388 } |
5389 // 4E28F8: using guessed type int pCurrentScreen; | |
5390 | |
5391 //----- (004226EF) -------------------------------------------------------- | |
373 | 5392 void SetUserInterface(PartyAlignment align, bool bReplace) |
0 | 5393 { |
5394 unsigned int v3; // eax@7 | |
5395 unsigned __int16 v4; // dx@7 | |
5396 unsigned __int16 v5; // cx@7 | |
5397 unsigned __int16 v6; // [sp-4h] [bp-14h]@7 | |
5398 | |
373 | 5399 |
5400 if (align == PartyAlignment_Evil) | |
5401 { | |
0 | 5402 if ( bReplace ) |
5403 { | |
5404 pTexture_RightFrame->Reload("ib-r-C.pcx"); | |
5405 pTexture_BottomFrame->Reload("ib-b-C.pcx"); | |
5406 pTexture_TopFrame->Reload("ib-t-C.pcx"); | |
5407 pTexture_LeftFrame->Reload("ib-l-C.pcx"); | |
5408 pTexture_StatusBar->Reload("IB-Foot-c.pcx"); | |
5409 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_right_panel], "ib-mb-C", 2); | |
5410 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D8], "ib-autmask-c", 2); | |
5411 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079B4], "IB-COMP-C", 2); | |
5412 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D0], "IB-InitG-c", 2); | |
5413 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079C8], "IB-InitY-c", 2); | |
5414 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079CC], "IB-InitR-c", 2); | |
319 | 5415 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-C", 2); |
5416 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-C", 2); | |
5417 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-C", 2); | |
5418 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-C", 2); | |
0 | 5419 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50C98C], "IB-selec-C", 2); |
319 | 5420 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-c", 2); |
5421 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-c", 2); | |
5422 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-c", 2); | |
5423 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-c", 2); | |
569 | 5424 |
5425 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-c", 2); | |
5426 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-c", 2); | |
5427 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-c", 2); | |
5428 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-c", 2); | |
5429 | |
0 | 5430 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeC"); |
569 | 5431 pIconsFrameTable->InitializeAnimation(pUIAnim_WizardEye->uIconID); |
0 | 5432 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchC"); |
569 | 5433 pIconsFrameTable->InitializeAnimation(pUIAnum_Torchlight->uIconID); |
5434 | |
526 | 5435 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-c", 2); |
0 | 5436 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc-c", 2); |
5437 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507958], "fr_inven-c", 2); | |
5438 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Parchment], "parchment", 2); | |
5439 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B4], "cornr_ll-c", 2); | |
5440 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B0], "cornr_lr-c", 2); | |
5441 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076AC], "cornr_ul-c", 2); | |
5442 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A8], "cornr_ur-c", 2); | |
5443 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A4], "edge_btm-c", 2); | |
5444 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A0], "edge_lf-c", 2); | |
5445 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50769C], "edge_rt-c", 2); | |
5446 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507698], "edge_top-c", 2); | |
5447 pIcons_LOD->ReloadTexture(pTexture_591428, "endcap-c", 2); | |
5448 } | |
5449 else | |
5450 { | |
5451 pTexture_RightFrame->Load("ib-r-C.pcx", 0); | |
5452 pTexture_BottomFrame->Load("ib-b-c.pcx", 0); | |
5453 pTexture_TopFrame->Load("ib-t-C.pcx", 0); | |
5454 pTexture_LeftFrame->Load("ib-l-C.pcx", 0); | |
5455 pTexture_StatusBar->Load("IB-Foot-c.pcx", 0); | |
5456 uTextureID_right_panel = pIcons_LOD->LoadTexture("ib-mb-C", TEXTURE_16BIT_PALETTE); | |
5457 dword_5079D8 = pIcons_LOD->LoadTexture("ib-autmask-c", TEXTURE_16BIT_PALETTE); | |
5458 dword_5079B4 = pIcons_LOD->LoadTexture("IB-COMP-C", TEXTURE_16BIT_PALETTE); | |
5459 dword_5079D0 = pIcons_LOD->LoadTexture("IB-InitG-c", TEXTURE_16BIT_PALETTE); | |
5460 dword_5079C8 = pIcons_LOD->LoadTexture("IB-InitY-c", TEXTURE_16BIT_PALETTE); | |
5461 dword_5079CC = pIcons_LOD->LoadTexture("IB-InitR-c", TEXTURE_16BIT_PALETTE); | |
319 | 5462 uTextureID_Btn_NPCLeft = pIcons_LOD->LoadTexture("IB-NPCLD-C", TEXTURE_16BIT_PALETTE); |
5463 uTextureID_Btn_NPCRight = pIcons_LOD->LoadTexture("IB-NPCRD-C", TEXTURE_16BIT_PALETTE); | |
328 | 5464 uTextureID_Btn_ZoomIn = pIcons_LOD->LoadTexture("ib-autout-C", TEXTURE_16BIT_PALETTE); |
319 | 5465 uTextureID_Btn_ZoomOut = pIcons_LOD->LoadTexture("ib-autin-C", TEXTURE_16BIT_PALETTE); |
0 | 5466 dword_50C98C = pIcons_LOD->LoadTexture("IB-selec-C", TEXTURE_16BIT_PALETTE); |
319 | 5467 uTextureID_Btn_CastSpell = pIcons_LOD->LoadTexture("ib-m1d-c", TEXTURE_16BIT_PALETTE); |
5468 uTextureID_Btn_Rest = pIcons_LOD->LoadTexture("ib-m2d-c", TEXTURE_16BIT_PALETTE); | |
5469 uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-c", TEXTURE_16BIT_PALETTE); | |
5470 uTextureID_Btn_GameSettings = pIcons_LOD->LoadTexture("ib-m4d-c", TEXTURE_16BIT_PALETTE); | |
526 | 5471 uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-c", TEXTURE_16BIT_PALETTE); |
569 | 5472 uTextureID_PlayerBuff_Bless = pIcons_LOD->LoadTexture("isg-01-c", TEXTURE_16BIT_PALETTE); |
5473 uTextureID_PlayerBuff_Preservation = pIcons_LOD->LoadTexture("isg-02-c", TEXTURE_16BIT_PALETTE); | |
5474 uTextureID_PlayerBuff_Hammerhands = pIcons_LOD->LoadTexture("isg-03-c", TEXTURE_16BIT_PALETTE); | |
5475 uTextureID_PlayerBuff_PainReflection = pIcons_LOD->LoadTexture("isg-04-c", TEXTURE_16BIT_PALETTE); | |
0 | 5476 uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc-c", TEXTURE_16BIT_PALETTE); |
5477 uTextureID_507958 = pIcons_LOD->LoadTexture("fr_inven", TEXTURE_16BIT_PALETTE); | |
5478 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeC"); | |
5479 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
5480 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchC"); | |
5481 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
5482 } | |
5483 v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xC8u, 0, 0); | |
5484 v4 = 0; | |
5485 v6 = 0; | |
5486 v5 = 10; | |
5487 } | |
373 | 5488 else if (align == PartyAlignment_Neutral) |
0 | 5489 { |
5490 if ( bReplace ) | |
5491 { | |
5492 pTexture_RightFrame->Reload("ib-r-a.pcx"); | |
5493 pTexture_BottomFrame->Reload("ib-b-a.pcx"); | |
5494 pTexture_TopFrame->Reload("ib-t-a.pcx"); | |
5495 pTexture_LeftFrame->Reload("ib-l-a.pcx"); | |
5496 pTexture_StatusBar->Reload("IB-Foot-a.pcx"); | |
5497 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_right_panel], "ib-mb-a", 2); | |
5498 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D8], "ib-autmask-a", 2); | |
5499 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079B4], "IB-COMP-a", 2); | |
5500 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D0], "IB-InitG-a", 2); | |
5501 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079C8], "IB-InitY-a", 2); | |
5502 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079CC], "IB-InitR-a", 2); | |
319 | 5503 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-a", 2); |
5504 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-a", 2); | |
5505 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-a", 2); | |
5506 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-a", 2); | |
0 | 5507 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50C98C], "IB-selec-a", 2); |
319 | 5508 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-a", 2); |
5509 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-a", 2); | |
5510 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-a", 2); | |
5511 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-a", 2); | |
569 | 5512 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-a", 2); |
5513 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-a", 2); | |
5514 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-a", 2); | |
5515 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-a", 2); | |
0 | 5516 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeA"); |
5517 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
5518 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchA"); | |
5519 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
526 | 5520 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-a", 2); |
0 | 5521 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc", 2); |
5522 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507958], "fr_inven", 2); | |
5523 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Parchment], "parchment", 2); | |
5524 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B4], "cornr_ll", 2); | |
5525 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B0], "cornr_lr", 2); | |
5526 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076AC], "cornr_ul", 2); | |
5527 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A8], "cornr_ur", 2); | |
5528 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A4], "edge_btm", 2); | |
5529 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A0], "edge_lf", 2); | |
5530 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50769C], "edge_rt", 2); | |
5531 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507698], "edge_top", 2); | |
5532 pIcons_LOD->ReloadTexture(pTexture_591428, "endcap", 2); | |
5533 } | |
5534 else | |
5535 { | |
5536 pTexture_RightFrame->Load("ib-r-A.pcx", 0); | |
5537 pTexture_BottomFrame->Load("ib-b-A.pcx", 0); | |
5538 pTexture_TopFrame->Load("ib-t-A.pcx", 0); | |
5539 pTexture_LeftFrame->Load("ib-l-A.pcx", 0); | |
5540 pTexture_StatusBar->Load("IB-Foot-a.pcx", 0); | |
5541 uTextureID_right_panel = pIcons_LOD->LoadTexture("ib-mb-A", TEXTURE_16BIT_PALETTE); | |
5542 dword_5079D8 = pIcons_LOD->LoadTexture("ib-autmask-a", TEXTURE_16BIT_PALETTE); | |
5543 dword_5079B4 = pIcons_LOD->LoadTexture("IB-COMP-A", TEXTURE_16BIT_PALETTE); | |
5544 dword_5079D0 = pIcons_LOD->LoadTexture("IB-InitG-a", TEXTURE_16BIT_PALETTE); | |
5545 dword_5079C8 = pIcons_LOD->LoadTexture("IB-InitY-a", TEXTURE_16BIT_PALETTE); | |
5546 dword_5079CC = pIcons_LOD->LoadTexture("IB-InitR-a", TEXTURE_16BIT_PALETTE); | |
319 | 5547 uTextureID_Btn_NPCLeft = pIcons_LOD->LoadTexture("IB-NPCLD-A", TEXTURE_16BIT_PALETTE); |
5548 uTextureID_Btn_NPCRight = pIcons_LOD->LoadTexture("IB-NPCRD-A", TEXTURE_16BIT_PALETTE); | |
0 | 5549 dword_50C98C = pIcons_LOD->LoadTexture("IB-selec-A", TEXTURE_16BIT_PALETTE); |
319 | 5550 uTextureID_Btn_CastSpell = pIcons_LOD->LoadTexture("ib-m1d-a", TEXTURE_16BIT_PALETTE); |
5551 uTextureID_Btn_Rest = pIcons_LOD->LoadTexture("ib-m2d-a", TEXTURE_16BIT_PALETTE); | |
5552 uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-a", TEXTURE_16BIT_PALETTE); | |
5553 uTextureID_Btn_GameSettings = pIcons_LOD->LoadTexture("ib-m4d-a", TEXTURE_16BIT_PALETTE); | |
328 | 5554 uTextureID_Btn_ZoomIn = pIcons_LOD->LoadTexture("ib-autout-a", TEXTURE_16BIT_PALETTE); |
319 | 5555 uTextureID_Btn_ZoomOut = pIcons_LOD->LoadTexture("ib-autin-a", TEXTURE_16BIT_PALETTE); |
526 | 5556 uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-a", TEXTURE_16BIT_PALETTE); |
569 | 5557 uTextureID_PlayerBuff_Bless = pIcons_LOD->LoadTexture("isg-01-a", TEXTURE_16BIT_PALETTE); |
5558 uTextureID_PlayerBuff_Preservation = pIcons_LOD->LoadTexture("isg-02-a", TEXTURE_16BIT_PALETTE); | |
5559 uTextureID_PlayerBuff_Hammerhands = pIcons_LOD->LoadTexture("isg-03-a", TEXTURE_16BIT_PALETTE); | |
5560 uTextureID_PlayerBuff_PainReflection = pIcons_LOD->LoadTexture("isg-04-a", TEXTURE_16BIT_PALETTE); | |
0 | 5561 uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc", TEXTURE_16BIT_PALETTE); |
5562 uTextureID_507958 = pIcons_LOD->LoadTexture("fr_inven", TEXTURE_16BIT_PALETTE); | |
5563 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeA"); | |
5564 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
5565 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchA"); | |
5566 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
5567 uTextureID_Parchment = pIcons_LOD->LoadTexture("parchment", TEXTURE_16BIT_PALETTE); | |
5568 uTextureID_5076B4 = pIcons_LOD->LoadTexture("cornr_ll", TEXTURE_16BIT_PALETTE); | |
5569 uTextureID_5076B0 = pIcons_LOD->LoadTexture("cornr_lr", TEXTURE_16BIT_PALETTE); | |
5570 uTextureID_5076AC = pIcons_LOD->LoadTexture("cornr_ul", TEXTURE_16BIT_PALETTE); | |
5571 uTextureID_5076A8 = pIcons_LOD->LoadTexture("cornr_ur", TEXTURE_16BIT_PALETTE); | |
5572 uTextureID_5076A4 = pIcons_LOD->LoadTexture("edge_btm", TEXTURE_16BIT_PALETTE); | |
5573 uTextureID_5076A0 = pIcons_LOD->LoadTexture("edge_lf", TEXTURE_16BIT_PALETTE); | |
5574 uTextureID_50769C = pIcons_LOD->LoadTexture("edge_rt", TEXTURE_16BIT_PALETTE); | |
5575 uTextureID_507698 = pIcons_LOD->LoadTexture("edge_top", TEXTURE_16BIT_PALETTE); | |
5576 pTexture_591428 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("endcap", TEXTURE_16BIT_PALETTE)]; | |
5577 | |
5578 } | |
5579 v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xAu, 0, 0); | |
5580 v4 = 214; | |
5581 v5 = 230; | |
5582 v6 = 193; | |
5583 } | |
373 | 5584 else if (align == PartyAlignment_Good) |
0 | 5585 { |
5586 if ( bReplace ) | |
5587 { | |
5588 pTexture_RightFrame->Reload("ib-r-B.pcx"); | |
5589 pTexture_BottomFrame->Reload("ib-b-B.pcx"); | |
5590 pTexture_TopFrame->Reload("ib-t-B.pcx"); | |
5591 pTexture_LeftFrame->Reload("ib-l-B.pcx"); | |
5592 pTexture_StatusBar->Reload("IB-Foot-b.pcx"); | |
5593 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_right_panel], "ib-mb-B", 2); | |
5594 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D8], "ib-autmask-b", 2); | |
5595 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079B4], "IB-COMP-B", 2); | |
5596 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D0], "IB-InitG-b", 2); | |
5597 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079C8], "IB-InitY-b", 2); | |
5598 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079CC], "IB-InitR-b", 2); | |
319 | 5599 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-B", 2); |
5600 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-B", 2); | |
5601 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-B", 2); | |
5602 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-B", 2); | |
0 | 5603 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50C98C], "IB-selec-B", 2); |
319 | 5604 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-b", 2); |
5605 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-b", 2); | |
5606 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-b", 2); | |
5607 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-b", 2); | |
569 | 5608 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-b", 2); |
5609 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-b", 2); | |
5610 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-b", 2); | |
5611 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-b", 2); | |
0 | 5612 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeB"); |
5613 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
5614 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchB"); | |
5615 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
526 | 5616 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-b", 2); |
0 | 5617 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc-b", 2); |
5618 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507958], "fr_inven-b", 2); | |
5619 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Parchment], "parchment", 2); | |
5620 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B4], "cornr_ll-b", 2); | |
5621 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B0], "cornr_lr-b", 2); | |
5622 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076AC], "cornr_ul-b", 2); | |
5623 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A8], "cornr_ur-b", 2); | |
5624 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A4], "edge_btm-b", 2); | |
5625 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A0], "edge_lf-b", 2); | |
5626 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50769C], "edge_rt-b", 2); | |
5627 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507698], "edge_top-b", 2); | |
5628 pIcons_LOD->ReloadTexture(pTexture_591428, "endcap-b", 2); | |
5629 } | |
5630 v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0xC8u); | |
5631 v5 = 255; | |
5632 v4 = 225; | |
5633 v6 = 255; | |
5634 } | |
373 | 5635 else assert(false); |
5636 | |
0 | 5637 uGameUIFontMain = v3; |
5638 uGameUIFontShadow = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v5, v4, v6); | |
5639 } | |
5640 | |
5641 | |
5642 | |
5643 //----- (00423AEE) -------------------------------------------------------- | |
5644 void __cdecl reset_some_strus_flt_2Cs() | |
5645 { | |
5646 float *v0; // eax@1 | |
5647 signed int v1; // ecx@1 | |
5648 signed int v2; // edx@1 | |
5649 float *v3; // eax@3 | |
5650 signed int v4; // edx@3 | |
5651 float *v5; // eax@5 | |
5652 signed int v6; // edx@5 | |
5653 float *v7; // eax@7 | |
5654 signed int v8; // edx@7 | |
5655 float *v9; // eax@9 | |
5656 | |
5657 v0 = &array_50AC10[0].flt_2C; | |
5658 v1 = 50; | |
5659 v2 = 50; | |
5660 do | |
5661 { | |
5662 *v0 = 0.0; | |
5663 v0 += 12; | |
5664 --v2; | |
5665 } | |
5666 while ( v2 ); | |
5667 v3 = &array_50A2B0[0].flt_2C; | |
5668 v4 = 50; | |
5669 do | |
5670 { | |
5671 *v3 = 0.0; | |
5672 v3 += 12; | |
5673 --v4; | |
5674 } | |
5675 while ( v4 ); | |
5676 v5 = &array_509950[0].flt_2C; | |
5677 v6 = 50; | |
5678 do | |
5679 { | |
5680 *v5 = 0.0; | |
5681 v5 += 12; | |
5682 --v6; | |
5683 } | |
5684 while ( v6 ); | |
5685 v7 = &array_508FF0[0].flt_2C; | |
5686 v8 = 50; | |
5687 do | |
5688 { | |
5689 *v7 = 0.0; | |
5690 v7 += 12; | |
5691 --v8; | |
5692 } | |
5693 while ( v8 ); | |
5694 v9 = &array_508690[0].flt_2C; | |
5695 do | |
5696 { | |
5697 *v9 = 0.0; | |
5698 v9 += 12; | |
5699 --v1; | |
5700 } | |
5701 while ( v1 ); | |
5702 } | |
5703 | |
5704 //----- (00423B4A) -------------------------------------------------------- | |
5705 void __cdecl sub_423B4A() | |
5706 { | |
5707 float *v0; // eax@1 | |
5708 signed int v1; // ecx@1 | |
5709 | |
5710 v0 = &array_507D30[0].flt_2C; | |
5711 v1 = 50; | |
5712 do | |
5713 { | |
5714 *v0 = 0.0; | |
5715 v0 += 12; | |
5716 --v1; | |
5717 } | |
5718 while ( v1 ); | |
5719 } | |
5720 | |
5721 //----- (00423B5D) -------------------------------------------------------- | |
5722 int __fastcall sub_423B5D(unsigned int uFaceID) | |
5723 { | |
5724 BLVFace *v1; // ebx@1 | |
5725 Vec3_short_ *v2; // esi@1 | |
5726 //int v3; // ST28_4@1 | |
5727 __int16 v4; // ST2C_2@1 | |
5728 //signed int v5; // esi@1 | |
5729 //Vec3_short_ *v6; // eax@4 | |
5730 //signed int v7; // edi@5 | |
5731 //signed int v8; // eax@5 | |
5732 //signed int i_; // ecx@10 | |
5733 int v10; // eax@10 | |
5734 int v11; // edx@11 | |
5735 int v12; // ST28_4@12 | |
5736 signed int v13; // edx@12 | |
5737 signed __int64 v14; // qtt@12 | |
5738 int *v15; // ebx@12 | |
5739 int v16; // ST28_4@14 | |
5740 signed int v17; // eax@14 | |
5741 signed __int64 v18; // qtt@14 | |
5742 signed int v19; // edx@15 | |
5743 signed int v20; // edx@17 | |
5744 signed int v21; // ebx@19 | |
5745 signed int v22; // esi@20 | |
5746 int v23; // edi@21 | |
5747 int v24; // eax@21 | |
5748 int v25; // eax@22 | |
5749 int v26; // eax@22 | |
5750 signed int v27; // ST30_4@24 | |
5751 signed __int64 v28; // qtt@24 | |
5752 int v29; // ST18_4@25 | |
5753 int v30; // eax@26 | |
5754 int v31; // eax@27 | |
5755 int v32; // eax@27 | |
5756 signed int v33; // ST30_4@29 | |
5757 signed __int64 v34; // qtt@29 | |
5758 int v35; // ST30_4@30 | |
5759 signed int v36; // edi@31 | |
5760 unsigned int v37; // eax@31 | |
5761 bool v38; // edx@31 | |
5762 int v39; // ecx@31 | |
5763 int v40; // ecx@32 | |
5764 int v41; // esi@32 | |
5765 int v42; // eax@34 | |
5766 signed int v43; // ebx@41 | |
5767 unsigned int v44; // eax@41 | |
5768 signed int v45; // ecx@42 | |
5769 int v46; // esi@42 | |
5770 int v47; // eax@44 | |
5771 signed int v48; // edi@51 | |
5772 unsigned int v49; // eax@51 | |
5773 bool v50; // edx@51 | |
5774 int v51; // ecx@51 | |
5775 int v52; // ecx@52 | |
5776 signed int v53; // esi@52 | |
5777 int v54; // eax@54 | |
5778 int v55; // ebx@61 | |
5779 unsigned int v56; // eax@61 | |
5780 signed int v57; // ecx@62 | |
5781 int v58; // esi@62 | |
5782 int v59; // eax@64 | |
5783 char v61; // zf@72 | |
5784 signed int v62; // edx@75 | |
5785 int v63; // ecx@76 | |
5786 int v64; // esi@76 | |
5787 int v65; // ecx@83 | |
5788 //signed int v66; // [sp+14h] [bp-14h]@3 | |
5789 int v67; // [sp+14h] [bp-14h]@34 | |
5790 int v68; // [sp+14h] [bp-14h]@44 | |
5791 int v69; // [sp+14h] [bp-14h]@54 | |
5792 int v70; // [sp+14h] [bp-14h]@64 | |
5793 signed int v71; // [sp+14h] [bp-14h]@75 | |
5794 bool thisa; // [sp+18h] [bp-10h]@9 | |
5795 int thisb; // [sp+18h] [bp-10h]@12 | |
5796 int thisc; // [sp+18h] [bp-10h]@20 | |
5797 bool thisd; // [sp+18h] [bp-10h]@41 | |
5798 bool thise; // [sp+18h] [bp-10h]@61 | |
5799 int thisf; // [sp+18h] [bp-10h]@74 | |
5800 signed int v79; // [sp+1Ch] [bp-Ch]@9 | |
5801 int v80; // [sp+1Ch] [bp-Ch]@76 | |
5802 bool v81; // [sp+20h] [bp-8h]@10 | |
5803 bool v82; // [sp+20h] [bp-8h]@32 | |
5804 bool v83; // [sp+20h] [bp-8h]@42 | |
5805 bool v84; // [sp+20h] [bp-8h]@52 | |
5806 bool v85; // [sp+20h] [bp-8h]@62 | |
5807 //signed int i; // [sp+24h] [bp-4h]@9 | |
5808 signed int ia; // [sp+24h] [bp-4h]@19 | |
5809 signed int ib; // [sp+24h] [bp-4h]@31 | |
5810 signed int ic; // [sp+24h] [bp-4h]@41 | |
5811 signed int id; // [sp+24h] [bp-4h]@51 | |
5812 signed int ie; // [sp+24h] [bp-4h]@61 | |
5813 | |
5814 v1 = &pIndoor->pFaces[uFaceID]; | |
5815 //this = pGame->pIndoorCameraD3D; | |
5816 v2 = &pIndoor->pVertices[v1->pVertexIDs[0]]; | |
5817 //v3 = *(_DWORD *)&v2->x; | |
5818 v4 = v2->z; | |
5819 //v5 = 0; | |
5820 if ( v1->pFacePlane_old.vNormal.x * (v2->x - pBLVRenderParams->vPartyPos.x) | |
5821 + v1->pFacePlane_old.vNormal.y * (v2->y - pBLVRenderParams->vPartyPos.y) | |
5822 + v1->pFacePlane_old.vNormal.z * (v2->z - pBLVRenderParams->vPartyPos.z) < 0 ) | |
5823 { | |
5824 dword_50B700 = 1; | |
5825 } | |
5826 else | |
5827 { | |
5828 dword_50B700 = 0; | |
315 | 5829 if ( !v1->TwoSided() ) |
0 | 5830 return 0; |
5831 } | |
5832 //v66 = v1->uNumVertices; | |
5833 for (uint i = 0; i < v1->uNumVertices; ++i) | |
5834 { | |
5835 auto v6 = &pIndoor->pVertices[v1->pVertexIDs[i]]; | |
5836 pGame->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible( | |
5837 v6->x, | |
5838 v6->y, | |
5839 v6->z, | |
5840 &_50B924_view_transformed_xs[i], | |
5841 &_50B834_view_transformed_zs[i], | |
5842 &_50B744_view_transformed_ys[i], | |
5843 0); | |
5844 } | |
5845 | |
5846 //v7 = v1->uNumVertices; | |
5847 //v8 = 0; | |
5848 if (v1->uNumVertices <= 0) | |
5849 return 0; | |
5850 | |
5851 bool bFound = false; | |
5852 for (uint i = 0; i < v1->uNumVertices; ++i) | |
5853 if (_50B924_view_transformed_xs[i] >= 0x80000u) | |
5854 { | |
5855 bFound = true; | |
5856 break; | |
5857 } | |
5858 if (!bFound) | |
5859 return 0; | |
5860 | |
5861 v79 = 0; | |
5862 _50B924_view_transformed_xs[v1->uNumVertices] = _50B924_view_transformed_xs[0]; | |
5863 _50B834_view_transformed_zs[v1->uNumVertices] = _50B834_view_transformed_zs[0]; | |
5864 _50B744_view_transformed_ys[v1->uNumVertices] = _50B744_view_transformed_ys[0]; | |
564 | 5865 thisa = _50B924_view_transformed_xs[0] >= (signed int)0x80000u; |
0 | 5866 //int i = 1; |
561 | 5867 for (uint i = 1; i <= v1->uNumVertices; ++i) |
0 | 5868 { |
5869 v10 = _50B924_view_transformed_xs[i]; | |
5870 v81 = v10 >= (signed int)0x80000u; | |
5871 if ( thisa ^ v81 ) | |
5872 { | |
5873 v11 = _50B924_view_transformed_xs[i - 1]; | |
5874 if ( v10 >= (signed int)0x80000u ) | |
5875 { | |
5876 v12 = v10 - v11; | |
5877 v13 = 0x80000 - v11; | |
5878 LODWORD(v14) = v13 << 16; | |
5879 HIDWORD(v14) = v13 >> 16; | |
5880 v15 = &_50B744_view_transformed_ys[i - 1]; | |
486 | 5881 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 | 5882 thisb = (unsigned __int64)((_50B744_view_transformed_ys[i] - _50B744_view_transformed_ys[i - 1]) * v14 / v12) >> 16; |
5883 } | |
5884 else | |
5885 { | |
5886 v16 = v11 - v10; | |
5887 v17 = 0x80000 - v10; | |
5888 LODWORD(v18) = v17 << 16; | |
5889 HIDWORD(v18) = v17 >> 16; | |
5890 v15 = &_50B744_view_transformed_ys[i]; | |
108 | 5891 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 | 5892 thisb = (unsigned __int64)((_50B744_view_transformed_ys[i - 1] - _50B744_view_transformed_ys[i]) * v18 / v16) >> 16; |
5893 } | |
5894 v19 = v79++; | |
5895 //v7 = v66; | |
5896 dword_50B738[v19] = thisb + *v15; | |
5897 dword_50B918[v19] = 0x80000u; | |
5898 } | |
5899 if ( v81 ) | |
5900 { | |
5901 v20 = v79++; | |
5902 dword_50B918[v20] = _50B924_view_transformed_xs[i]; | |
5903 dword_50B828[v20] = _50B834_view_transformed_zs[i]; | |
5904 dword_50B738[v20] = _50B744_view_transformed_ys[i]; | |
5905 } | |
5906 //++i; | |
5907 thisa = v81; | |
5908 } | |
5909 v21 = v79; | |
5910 dword_50B918[v79] = dword_50B918[0]; | |
5911 dword_50B828[v79] = dword_50B828[0]; | |
561 | 5912 dword_50B738[v79] = dword_50B738[0]; |
5913 for (ia = 0; ia < v79; ++ia) | |
0 | 5914 { |
5915 v22 = ia; | |
5916 thisc = abs(dword_50B918[ia]); | |
5917 if ( abs(dword_50B828[ia]) >> 13 <= thisc ) | |
5918 { | |
5919 v27 = dword_50B828[v22]; | |
5920 LODWORD(v28) = v27 << 16; | |
5921 HIDWORD(v28) = v27 >> 16; | |
5922 v26 = v28 / dword_50B918[v22]; | |
5923 v23 = 0; | |
5924 } | |
5925 else | |
5926 { | |
5927 v23 = 0; | |
5928 v24 = 0; | |
5929 if ( dword_50B828[v22] >= 0 ) | |
5930 { | |
5931 LOBYTE(v24) = dword_50B918[v22] >= 0; | |
5932 v26 = ((v24 - 1) & 0xFF800000) + 0x400000; | |
5933 } | |
5934 else | |
5935 { | |
5936 LOBYTE(v24) = dword_50B918[v22] >= 0; | |
5937 v25 = v24 - 1; | |
5938 v26 = (v25 & 0x800000) - 0x400000; | |
5939 } | |
5940 } | |
5941 v29 = dword_50B738[v22]; | |
561 | 5942 dword_50BAF8_xs[v22] = v26; |
0 | 5943 if ( abs(v29) >> 13 <= thisc ) |
5944 { | |
5945 v33 = dword_50B738[v22]; | |
5946 LODWORD(v34) = v33 << 16; | |
5947 HIDWORD(v34) = v33 >> 16; | |
5948 v32 = v34 / dword_50B918[v22]; | |
5949 } | |
5950 else | |
5951 { | |
5952 v30 = 0; | |
5953 if ( dword_50B738[v22] >= v23 ) | |
5954 { | |
5955 LOBYTE(v30) = dword_50B918[v22] >= v23; | |
5956 v32 = ((v30 - 1) & 0xFF800000) + 0x400000; | |
5957 } | |
5958 else | |
5959 { | |
5960 LOBYTE(v30) = dword_50B918[v22] >= v23; | |
5961 v31 = v30 - 1; | |
5962 v32 = (v31 & 0x800000) - 0x400000; | |
5963 } | |
5964 } | |
561 | 5965 dword_50BA08_ys[v22] = v32; |
5966 dword_50BAF8_xs[v22] = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) * (signed __int64)dword_50BAF8_xs[v22]) >> 16; | |
5967 v35 = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) * (signed __int64)dword_50BA08_ys[v22]) >> 16; | |
5968 dword_50BAF8_xs[v22] = pBLVRenderParams->uViewportCenterX - dword_50BAF8_xs[v22]; | |
5969 dword_50BA08_ys[v22] = pBLVRenderParams->uViewportCenterY - v35; | |
0 | 5970 } |
5971 v36 = 0; | |
561 | 5972 dword_50BAF8_xs[v21] = dword_50BAF8_xs[0]; |
5973 dword_50BA08_ys[v21] = dword_50BA08_ys[0]; | |
0 | 5974 v37 = pBLVRenderParams->uViewportX; |
561 | 5975 v38 = dword_50BAF8_xs[0] < (signed int)pBLVRenderParams->uViewportX; |
5976 LOBYTE(v38) = dword_50BAF8_xs[0] >= (signed int)pBLVRenderParams->uViewportX; | |
0 | 5977 v39 = 1; |
5978 ib = 1; | |
5979 if ( v79 < 1 ) | |
5980 return 0; | |
5981 do | |
5982 { | |
5983 v40 = v39; | |
561 | 5984 v41 = dword_50BAF8_xs[v40]; |
0 | 5985 v82 = v41 >= (signed int)v37; |
5986 if ( v38 ^ v82 ) | |
5987 { | |
5988 if ( v41 >= (signed int)v37 ) | |
5989 { | |
561 | 5990 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]); |
5991 v42 = dword_50BA08_ys[v40 - 1]; | |
0 | 5992 } |
5993 else | |
5994 { | |
561 | 5995 v67 = (signed int)(v37 - v41) * (signed __int64)(dword_50BA08_ys[v40 - 1] - dword_50BA08_ys[v40]) / (dword_50BAF8_xs[v40 - 1] - v41); |
5996 v42 = dword_50BA08_ys[v40]; | |
0 | 5997 } |
561 | 5998 dword_50B9FC_ys[v36] = v67 + v42; |
5999 v37 = pBLVRenderParams->uViewportX; | |
6000 dword_50BAEC_xs[v36] = pBLVRenderParams->uViewportX; | |
0 | 6001 ++v36; |
6002 } | |
6003 v38 = v82; | |
6004 if ( v82 ) | |
6005 { | |
561 | 6006 dword_50BAEC_xs[v36] = dword_50BAF8_xs[v40]; |
6007 dword_50B9FC_ys[v36] = dword_50BA08_ys[v40]; | |
6008 ++v36; | |
0 | 6009 } |
6010 v39 = ib++ + 1; | |
6011 } | |
6012 while ( ib <= v79 ); | |
6013 | |
486 | 6014 if (v36 < 1) |
0 | 6015 return 0; |
6016 | |
486 | 6017 v43 = 0; |
561 | 6018 dword_50BAEC_xs[v36] = dword_50BAEC_xs[0]; |
6019 dword_50B9FC_ys[v36] = dword_50B9FC_ys[0]; | |
486 | 6020 v44 = pBLVRenderParams->uViewportZ; |
561 | 6021 thisd = dword_50BAEC_xs[0] <= (signed int)pBLVRenderParams->uViewportZ; |
486 | 6022 ic = 1; |
6023 | |
0 | 6024 do |
6025 { | |
6026 v45 = ic; | |
561 | 6027 v46 = dword_50BAEC_xs[ic]; |
0 | 6028 v83 = v46 <= (signed int)v44; |
6029 if ( thisd ^ v83 ) | |
6030 { | |
6031 if ( v46 <= (signed int)v44 ) | |
6032 { | |
561 | 6033 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]); |
6034 v47 = dword_50B9FC_ys[v45 - 1]; | |
0 | 6035 } |
6036 else | |
6037 { | |
561 | 6038 v68 = (signed int)(v44 - v46) * (signed __int64)(dword_50B9FC_ys[v45 - 1] - dword_50B9FC_ys[v45]) / (dword_50BAEC_xs[v45 - 1] - v46); |
6039 v47 = dword_50B9FC_ys[v45]; | |
0 | 6040 } |
561 | 6041 dword_50B9F0[v43] = v68 + v47; |
6042 v44 = pBLVRenderParams->uViewportZ; | |
6043 dword_50BAE0[v43] = pBLVRenderParams->uViewportZ; | |
0 | 6044 ++v43; |
6045 } | |
6046 if ( v83 ) | |
6047 { | |
561 | 6048 dword_50BAE0[v43] = dword_50BAEC_xs[v45]; |
6049 dword_50B9F0[v43++] = dword_50B9FC_ys[v45]; | |
0 | 6050 } |
6051 ++ic; | |
6052 thisd = v83; | |
6053 } | |
6054 while ( ic <= v36 ); | |
486 | 6055 |
6056 if (v43 < 1) | |
0 | 6057 return 0; |
486 | 6058 |
6059 v48 = 0; | |
6060 dword_50BAE0[v43] = dword_50BAE0[0]; | |
6061 dword_50B9F0[v43] = dword_50B9F0[0]; | |
6062 v49 = pBLVRenderParams->uViewportY; | |
6063 v50 = dword_50B9F0[0] < (signed int)pBLVRenderParams->uViewportY; | |
6064 LOBYTE(v50) = dword_50B9F0[0] >= (signed int)pBLVRenderParams->uViewportY; | |
6065 v51 = 1; | |
6066 id = 1; | |
0 | 6067 do |
6068 { | |
6069 v52 = v51; | |
6070 v53 = dword_50B9F0[v52]; | |
6071 v84 = v53 >= (signed int)v49; | |
6072 if ( v50 ^ v84 ) | |
6073 { | |
6074 if ( v53 >= (signed int)v49 ) | |
6075 { | |
561 | 6076 v69 = (signed int)(v49 - dword_50B9F0[v52 - 1]) * (signed __int64)(dword_50BAE0[v52] - dword_50BAE0[v52 - 1]) / (v53 - dword_50B9F0[v52 - 1]); |
6077 v54 = dword_50BAE0[v52 - 1]; | |
0 | 6078 } |
6079 else | |
6080 { | |
561 | 6081 v69 = (signed int)(v49 - v53) * (signed __int64)(dword_50BAE0[v52 - 1] - dword_50BAE0[v52]) / (dword_50B9F0[v52 - 1] - v53); |
0 | 6082 v54 = dword_50BAE0[v52]; |
6083 } | |
561 | 6084 dword_50BAD4[v48] = v69 + v54; |
6085 v49 = pBLVRenderParams->uViewportY; | |
6086 dword_50B9E4[v48] = pBLVRenderParams->uViewportY; | |
0 | 6087 ++v48; |
6088 } | |
6089 v50 = v84; | |
6090 if ( v84 ) | |
6091 { | |
6092 dword_50BAD4[v48] = dword_50BAE0[v52]; | |
561 | 6093 dword_50B9E4[v48++] = dword_50B9F0[v52]; |
0 | 6094 } |
6095 v51 = id++ + 1; | |
6096 } | |
6097 while ( id <= v43 ); | |
486 | 6098 |
6099 if (v48 < 1) | |
0 | 6100 return 0; |
486 | 6101 |
6102 v55 = 0; | |
6103 dword_50BAD4[v48] = dword_50BAD4[0]; | |
561 | 6104 dword_50B9E4[v48] = dword_50B9E4[0]; |
486 | 6105 v56 = pBLVRenderParams->uViewportW; |
561 | 6106 thise = dword_50B9E4[0] <= (signed int)pBLVRenderParams->uViewportW; |
486 | 6107 ie = 1; |
0 | 6108 do |
6109 { | |
6110 v57 = ie; | |
561 | 6111 v58 = dword_50B9E4[ie]; |
0 | 6112 v85 = v58 <= (signed int)v56; |
6113 if ( thise ^ v85 ) | |
6114 { | |
6115 if ( v58 <= (signed int)v56 ) | |
6116 { | |
561 | 6117 v70 = (signed int)(v56 - dword_50B9E4[v57 - 1]) * (signed __int64)(dword_50BAD4[v57] - dword_50BAD4[v57 - 1]) / (v58 - dword_50B9E4[v57 - 1]); |
6118 v59 = dword_50BAD4[v57 - 1]; | |
0 | 6119 } |
6120 else | |
6121 { | |
561 | 6122 v70 = (signed int)(v56 - v58) * (signed __int64)(dword_50BAD4[v57 - 1] - dword_50BAD4[v57]) / (dword_50B9E4[v57 - 1] - v58); |
0 | 6123 v59 = dword_50BAD4[v57]; |
6124 } | |
561 | 6125 dword_50BAC8[v55] = v70 + v59; |
6126 v56 = pBLVRenderParams->uViewportW; | |
6127 dword_50B9D8_ys[v55] = pBLVRenderParams->uViewportW; | |
0 | 6128 ++v55; |
6129 } | |
6130 if ( v85 ) | |
6131 { | |
6132 dword_50BAC8[v55] = dword_50BAD4[v57]; | |
561 | 6133 dword_50B9D8_ys[v55++] = dword_50B9E4[v57]; |
0 | 6134 } |
6135 ++ie; | |
6136 thise = v85; | |
6137 } | |
6138 while ( ie <= v48 ); | |
486 | 6139 |
0 | 6140 if ( !v55 ) |
6141 return 0; | |
6142 v61 = pRenderer->pRenderD3D == 0; | |
6143 dword_50BAC8[v55] = dword_50BAC8[0]; | |
6144 dword_50B9D8_ys[v55] = dword_50B9D8_ys[0]; | |
6145 if ( v61 && v55 > 3 ) | |
6146 { | |
6147 dword_50BAC8[v55 + 1] = dword_50BAC8[1]; | |
6148 dword_50B9D8_ys[v55 + 1] = dword_50B9D8_ys[1]; | |
6149 thisf = 2 * (dword_50B700 != 0) - 1; | |
6150 if ( v55 > 0 ) | |
6151 { | |
6152 v62 = 1; | |
6153 v71 = 1; | |
6154 do | |
6155 { | |
6156 v63 = v62 - 1; | |
6157 v64 = v62 + 1; | |
6158 v80 = v62 + 1; | |
6159 if ( v62 - 1 >= v55 ) | |
6160 v63 -= v55; | |
6161 if ( v62 >= v55 ) | |
6162 v62 -= v55; | |
6163 if ( v64 >= v55 ) | |
6164 v64 -= v55; | |
6165 if ( thisf | |
6166 * ((dword_50B9D8_ys[v64] - dword_50B9D8_ys[v63]) * (dword_50BAC8[v62] - dword_50BAC8[v63]) | |
6167 - (dword_50B9D8_ys[v62] - dword_50B9D8_ys[v63]) * (dword_50BAC8[v64] - dword_50BAC8[v63])) < 0 ) | |
6168 { | |
6169 v62 = v80; | |
6170 v71 = v80; | |
6171 } | |
6172 else | |
6173 { | |
6174 v62 = v71; | |
6175 v65 = v71; | |
6176 if ( v71 < v55 || (v65 = v71 - v55, v71 - v55 < v55) ) | |
6177 { | |
6178 memcpy(&dword_50B9D8_ys[v65], &dword_50B9D8_ys[v65 + 1], 4 * ((unsigned int)(4 * (v55 - v65)) >> 2)); | |
6179 memcpy(&dword_50BAC8[v65], &dword_50BAC8[v65 + 1], 4 * ((unsigned int)(4 * (v55 - v65)) >> 2)); | |
6180 } | |
6181 --v55; | |
6182 } | |
6183 } | |
6184 while ( v62 - 1 < v55 ); | |
6185 } | |
6186 dword_50BAC8[v55] = dword_50BAC8[0]; | |
6187 dword_50B9D8_ys[v55] = dword_50B9D8_ys[0]; | |
6188 } | |
6189 return v55; | |
6190 } | |
6191 | |
6192 //----- (00424579) -------------------------------------------------------- | |
6193 int __fastcall sub_424579(int uFaceID, stru320 *a2) | |
6194 { | |
6195 __debugbreak(); | |
6196 return 0; | |
6197 /*BLVFace *v2; // eax@1 | |
6198 Vec3_short_ *v3; // ebx@1 | |
6199 Vec3_short_ *v4; // esi@1 | |
6200 unsigned int v5; // esi@3 | |
6201 int v7; // ST1C_4@5 | |
6202 int v8; // ST1C_4@5 | |
6203 int v9; // ST1C_4@5 | |
6204 int v10; // ST1C_4@5 | |
6205 int v11; // esi@5 | |
6206 int v12; // ST1C_4@5 | |
6207 unsigned int v15; // ecx@8 | |
6208 unsigned int v19; // ecx@13 | |
6209 signed int v20; // ecx@16 | |
6210 signed int result; // eax@20 | |
6211 signed int v24; // edx@22 | |
6212 unsigned int v25; // [sp+Ch] [bp-1Ch]@3 | |
6213 float v26; // [sp+14h] [bp-14h]@3 | |
6214 float v27; // [sp+1Ch] [bp-Ch]@3 | |
6215 float v28; // [sp+20h] [bp-8h]@3 | |
6216 signed int v29; // [sp+24h] [bp-4h]@3 | |
6217 | |
6218 v2 = &pIndoor->pFaces[uFaceID]; | |
6219 v3 = pIndoor->pVertices; | |
6220 v4 = &pIndoor->pVertices[*v2->pVertexIDs]; | |
6221 if ( v2->pFacePlane_old.vNormal.x * ((signed __int16)*(int *)&v4->x - pBLVRenderParams->vPartyPos.x) | |
6222 + v2->pFacePlane_old.vNormal.y * ((signed __int16)(*(int *)&v4->x >> 16) - pBLVRenderParams->vPartyPos.y) | |
6223 + v2->pFacePlane_old.vNormal.z * (v4->z - pBLVRenderParams->vPartyPos.z) < 0 ) | |
6224 { | |
6225 dword_50B700 = 1; | |
6226 } | |
6227 else | |
6228 { | |
6229 dword_50B700 = 0; | |
6230 if ( !(v2->uAttributes & 1) ) | |
6231 return 0; | |
6232 } | |
6233 v29 = 0; | |
6234 v5 = v2->uNumVertices; | |
6235 __asm { fld pBLVRenderParams->fCosineY } | |
6236 v28 = pBLVRenderParams->fSineY; | |
6237 v26 = pBLVRenderParams->fCosineNegX; | |
6238 v27 = pBLVRenderParams->fSineNegX; | |
6239 v25 = v5; | |
6240 if ( (signed int)v5 > 0 ) | |
6241 { | |
6242 _ECX = (char *)&array_50AC10[0].vWorldPosition.z; | |
6243 do | |
6244 { | |
6245 v7 = v3[v2->pVertexIDs[v29]].x; | |
6246 __asm | |
6247 { | |
6248 fild [ebp+var_10] | |
6249 fstp dword ptr [ecx-8] | |
6250 } | |
6251 v8 = v3[v2->pVertexIDs[v29]].y; | |
6252 __asm | |
6253 { | |
6254 fild [ebp+var_10] | |
6255 fstp dword ptr [ecx-4] | |
6256 } | |
6257 v9 = v3[v2->pVertexIDs[v29]].z; | |
6258 __asm | |
6259 { | |
6260 fild [ebp+var_10] | |
6261 fstp dword ptr [ecx] | |
6262 } | |
6263 _ECX += 48; | |
6264 v10 = a2->pDeltaUV[0] + v2->pVertexUIDs[v29]; | |
6265 __asm | |
6266 { | |
6267 fild [ebp+var_10] | |
6268 fstp dword ptr [ecx-14h] | |
6269 } | |
6270 v11 = a2->pDeltaUV[1] + v2->pVertexVIDs[v29++]; | |
6271 v12 = v11; | |
6272 v5 = v25; | |
6273 __asm | |
6274 { | |
6275 fild [ebp+var_10] | |
6276 fstp dword ptr [ecx-10h] | |
6277 } | |
6278 } | |
6279 while ( v29 < (signed int)v25 ); | |
6280 } | |
6281 _EDX = (char *)&array_50AC10[0].vWorldViewPosition; | |
6282 if ( pBLVRenderParams->sPartyRotX ) | |
6283 { | |
6284 if ( (signed int)v5 > 0 ) | |
6285 { | |
6286 __asm | |
6287 { | |
6288 fild pBLVRenderParams->vPartyPos.x | |
6289 fild pBLVRenderParams->vPartyPos.y | |
6290 fild pBLVRenderParams->vPartyPos.z | |
6291 } | |
6292 _EAX = (char *)&array_50AC10[0].vWorldPosition.z; | |
6293 v15 = v5; | |
6294 do | |
6295 { | |
6296 __asm | |
6297 { | |
6298 fld dword ptr [eax-8] | |
6299 fsub st, st(3) | |
6300 fld dword ptr [eax-4] | |
6301 fsub st, st(3) | |
6302 fld st(1) | |
6303 fmul st, st(6) | |
6304 fld st(1) | |
6305 fmul [ebp+var_8] | |
6306 fsubp st(1), st | |
6307 fstp [ebp+var_4] | |
6308 fld dword ptr [eax] | |
6309 fsub st, st(3) | |
6310 } | |
6311 _EAX += 48; | |
6312 --v15; | |
6313 __asm | |
6314 { | |
6315 fstp [ebp+var_10] | |
6316 fld [ebp+var_4] | |
6317 fmul [ebp+var_14] | |
6318 fld [ebp+var_10] | |
6319 fmul [ebp+var_C] | |
6320 fsubp st(1), st | |
6321 fstp dword ptr [eax-2Ch] | |
6322 fld st(1) | |
6323 fmul [ebp+var_8] | |
6324 fld st(1) | |
6325 fmul st, st(7) | |
6326 faddp st(1), st | |
6327 fstp dword ptr [eax-28h] | |
6328 fstp st | |
6329 fstp st | |
6330 fld [ebp+var_4] | |
6331 fmul [ebp+var_C] | |
6332 fld [ebp+var_10] | |
6333 fmul [ebp+var_14] | |
6334 faddp st(1), st | |
6335 fstp dword ptr [eax-24h] | |
6336 } | |
6337 } | |
6338 while ( v15 ); | |
6339 LABEL_15: | |
6340 __asm | |
6341 { | |
6342 fstp st | |
6343 fstp st | |
6344 fstp st | |
6345 } | |
6346 goto LABEL_16; | |
6347 } | |
6348 } | |
6349 else | |
6350 { | |
6351 if ( (signed int)v5 > 0 ) | |
6352 { | |
6353 __asm | |
6354 { | |
6355 fild pBLVRenderParams->vPartyPos.x | |
6356 fild pBLVRenderParams->vPartyPos.y | |
6357 fild pBLVRenderParams->vPartyPos.z | |
6358 } | |
6359 _EAX = (char *)&array_50AC10[0].vWorldViewPosition; | |
6360 v19 = v5; | |
6361 do | |
6362 { | |
6363 __asm | |
6364 { | |
6365 fld dword ptr [eax-0Ch] | |
6366 fsub st, st(3) | |
6367 fld dword ptr [eax-8] | |
6368 fsub st, st(3) | |
6369 fld st(1) | |
6370 fmul st, st(6) | |
6371 fld st(1) | |
6372 fmul [ebp+var_8] | |
6373 fsubp st(1), st | |
6374 fstp dword ptr [eax] | |
6375 fld st(1) | |
6376 fmul [ebp+var_8] | |
6377 fld st(1) | |
6378 fmul st, st(7) | |
6379 } | |
6380 _EAX += 48; | |
6381 --v19; | |
6382 __asm | |
6383 { | |
6384 faddp st(1), st | |
6385 fstp dword ptr [eax-2Ch] | |
6386 fstp st | |
6387 fstp st | |
6388 fld dword ptr [eax-34h] | |
6389 fsub st, st(1) | |
6390 fstp dword ptr [eax-28h] | |
6391 } | |
6392 } | |
6393 while ( v19 ); | |
6394 goto LABEL_15; | |
6395 } | |
6396 } | |
6397 LABEL_16: | |
6398 v20 = 0; | |
6399 __asm { fstp st } | |
6400 if ( (signed int)v5 <= 0 ) | |
6401 return 0; | |
6402 do | |
6403 { | |
6404 __asm | |
6405 { | |
6406 fld dword ptr [edx] | |
6407 fcomp ds:flt_4D8524 | |
6408 fnstsw ax | |
6409 } | |
6410 if ( !(HIBYTE(_AX) & 1) ) | |
6411 break; | |
6412 ++v20; | |
6413 _EDX += 48; | |
6414 } | |
6415 while ( v20 < (signed int)v5 ); | |
6416 if ( v20 >= (signed int)v5 ) | |
6417 return 0; | |
6418 result = sr_424CD7(v5); | |
6419 if ( result > 0 ) | |
6420 { | |
6421 __asm { fild pBLVRenderParams->field_40 } | |
6422 _ECX = (char *)&array_507D30[0].vWorldViewPosition; | |
6423 v24 = result; | |
6424 __asm | |
6425 { | |
6426 fmul ds:flt_4D84A4 | |
6427 fild pBLVRenderParams->uViewportCenterX | |
6428 fild pBLVRenderParams->uViewportCenterY | |
6429 } | |
6430 do | |
6431 { | |
6432 __asm | |
6433 { | |
6434 fld1 | |
6435 fdiv dword ptr [ecx] | |
6436 } | |
6437 _ECX += 48; | |
6438 --v24; | |
6439 __asm | |
6440 { | |
6441 fld st | |
6442 fmul dword ptr [ecx-2Ch] | |
6443 fmul st, st(4) | |
6444 fsubr st, st(3) | |
6445 fstp dword ptr [ecx-24h] | |
6446 fmul dword ptr [ecx-28h] | |
6447 fmul st, st(3) | |
6448 fsubr st, st(1) | |
6449 fstp dword ptr [ecx-20h] | |
6450 } | |
6451 } | |
6452 while ( v24 ); | |
6453 __asm | |
6454 { | |
6455 fstp st | |
6456 fstp st | |
6457 fstp st | |
6458 } | |
6459 } | |
6460 memcpy(&array_507D30[result], array_507D30, sizeof(array_507D30[result])); | |
6461 return result;*/ | |
6462 } | |
6463 | |
6464 | |
6465 //----- (00424829) -------------------------------------------------------- | |
6466 bool sub_424829(int a1, BspRenderer_stru2 *a2, BspRenderer_stru2 *a3, int a4) | |
6467 { | |
6468 int v4; // edi@1 | |
6469 BspRenderer_stru2 *v5; // ebx@1 | |
6470 int v6; // eax@3 | |
6471 int v7; // esi@5 | |
6472 int v8; // edx@5 | |
6473 int v9; // ecx@6 | |
6474 int v10; // eax@12 | |
6475 int v11; // edi@13 | |
6476 int v12; // edx@18 | |
6477 int v13; // eax@22 | |
6478 int v14; // edi@28 | |
6479 int v15; // ecx@29 | |
6480 int v16; // edi@30 | |
6481 int v17; // edx@35 | |
6482 int v18; // eax@39 | |
6483 int v19; // eax@44 | |
6484 int v20; // ecx@44 | |
6485 int v21; // edi@45 | |
6486 int v22; // edi@46 | |
6487 __int16 *v23; // ecx@47 | |
6488 int v24; // edx@48 | |
6489 int v25; // eax@50 | |
6490 int v26; // eax@55 | |
6491 signed int v27; // edi@55 | |
6492 int v28; // edx@56 | |
6493 int v29; // edx@57 | |
6494 int v30; // eax@59 | |
6495 int v31; // eax@64 | |
6496 signed int v32; // edi@64 | |
6497 int v33; // edx@65 | |
6498 __int16 *v34; // eax@66 | |
6499 __int16 v35; // dx@66 | |
6500 __int16 v36; // dx@67 | |
6501 __int16 v37; // di@67 | |
6502 __int16 v38; // dx@67 | |
6503 BspRenderer_stru2 *v39; // ecx@69 | |
6504 int v40; // edx@69 | |
6505 int v41; // edi@70 | |
6506 __int16 *v42; // eax@76 | |
6507 __int16 *v43; // eax@81 | |
6508 __int16 *v45; // eax@87 | |
6509 int v46; // edx@87 | |
6510 __int16 v47; // cx@88 | |
6511 int v48; // eax@93 | |
6512 int v49; // esi@93 | |
6513 __int16 *v50; // ecx@94 | |
6514 int v51; // eax@95 | |
6515 int v52; // eax@97 | |
6516 int v53; // [sp+Ch] [bp-34h]@44 | |
6517 int v54; // [sp+10h] [bp-30h]@0 | |
6518 int v55; // [sp+14h] [bp-2Ch]@12 | |
6519 __int16 *v56; // [sp+14h] [bp-2Ch]@47 | |
6520 __int16 *v57; // [sp+14h] [bp-2Ch]@76 | |
6521 __int16 *v58; // [sp+14h] [bp-2Ch]@81 | |
6522 __int16 *v59; // [sp+14h] [bp-2Ch]@87 | |
6523 BspRenderer_stru2 *v60; // [sp+18h] [bp-28h]@1 | |
6524 int v61; // [sp+1Ch] [bp-24h]@29 | |
6525 int v62; // [sp+20h] [bp-20h]@0 | |
6526 signed int v63; // [sp+24h] [bp-1Ch]@3 | |
6527 signed int v64; // [sp+28h] [bp-18h]@3 | |
6528 int v65; // [sp+2Ch] [bp-14h]@5 | |
6529 int v66; // [sp+2Ch] [bp-14h]@39 | |
6530 int v67; // [sp+30h] [bp-10h]@22 | |
6531 int v68; // [sp+34h] [bp-Ch]@12 | |
6532 int v69; // [sp+34h] [bp-Ch]@29 | |
6533 int v70; // [sp+34h] [bp-Ch]@46 | |
6534 int v71; // [sp+34h] [bp-Ch]@75 | |
6535 int v72; // [sp+34h] [bp-Ch]@80 | |
6536 int v73; // [sp+38h] [bp-8h]@11 | |
6537 int v74; // [sp+3Ch] [bp-4h]@1 | |
6538 int a3a; // [sp+48h] [bp+8h]@76 | |
6539 int a3b; // [sp+48h] [bp+8h]@87 | |
6540 | |
6541 v4 = a1; | |
6542 v5 = a2; | |
6543 v74 = a1; | |
6544 v60 = a2; | |
6545 if ( !a1 | |
6546 || (!dword_50B700 ? (v64 = -1, v6 = 1, v63 = 1) : (v6 = 1, v63 = -1, v64 = 1), | |
6547 v7 = dword_50B9D8_ys[0], | |
6548 v65 = 0, | |
6549 v8 = dword_50B9D8_ys[0], | |
6550 a1 <= v6) ) | |
6551 return 0; | |
6552 do | |
6553 { | |
6554 v9 = dword_50B9D8_ys[v6]; | |
6555 if ( v9 >= v7 ) | |
6556 { | |
6557 if ( v9 > v8 ) | |
6558 v8 = dword_50B9D8_ys[v6]; | |
6559 } | |
6560 else | |
6561 { | |
6562 v65 = v6; | |
6563 v7 = dword_50B9D8_ys[v6]; | |
6564 } | |
6565 ++v6; | |
6566 } | |
6567 while ( v6 < v4 ); | |
6568 v73 = v8; | |
6569 if ( v8 == v7 ) | |
6570 return 0; | |
6571 v10 = v65; | |
6572 v68 = 0; | |
6573 v5->_viewport_space_y = v7; | |
6574 v5->_viewport_space_w = v8; | |
6575 v55 = v65; | |
6576 if ( v4 > 0 ) | |
6577 { | |
6578 v11 = v65; | |
6579 do | |
6580 { | |
6581 v10 += v64; | |
6582 if ( v10 < v74 ) | |
6583 { | |
6584 if ( v10 < 0 ) | |
6585 v10 += v74; | |
6586 } | |
6587 else | |
6588 { | |
6589 v10 -= v74; | |
6590 } | |
6591 v12 = dword_50B9D8_ys[v10]; | |
6592 if ( v12 <= dword_50B9D8_ys[v11] ) | |
6593 { | |
6594 v55 = v10; | |
6595 v11 = v10; | |
6596 } | |
6597 if ( v12 == v73 ) | |
6598 break; | |
6599 ++v68; | |
6600 } | |
6601 while ( v68 < v74 ); | |
6602 } | |
6603 v13 = v55 + v64; | |
6604 v67 = v55 + v64; | |
6605 if ( v55 + v64 < v74 ) | |
6606 { | |
6607 if ( v13 >= 0 ) | |
6608 goto LABEL_27; | |
6609 v13 += v74; | |
6610 } | |
6611 else | |
6612 { | |
6613 v13 -= v74; | |
6614 } | |
6615 v67 = v13; | |
6616 LABEL_27: | |
6617 if ( dword_50B9D8_ys[v13] != dword_50B9D8_ys[v55] ) | |
6618 { | |
6619 v14 = dword_50BAC8[v55]; | |
6620 v62 = v14 << 16; | |
6621 v54 = ((dword_50BAC8[v13] - v14) << 16) / (dword_50B9D8_ys[v13] - dword_50B9D8_ys[v55]); | |
6622 v5->array_18[v7] = LOWORD(dword_50BAC8[v55]); | |
6623 } | |
6624 v15 = v65; | |
6625 v69 = 0; | |
6626 v61 = v65; | |
6627 if ( v74 > 0 ) | |
6628 { | |
6629 v16 = v65; | |
6630 do | |
6631 { | |
6632 v15 += v63; | |
6633 if ( v15 < v74 ) | |
6634 { | |
6635 if ( v15 < 0 ) | |
6636 v15 += v74; | |
6637 } | |
6638 else | |
6639 { | |
6640 v15 -= v74; | |
6641 } | |
6642 v17 = dword_50B9D8_ys[v15]; | |
6643 if ( v17 <= dword_50B9D8_ys[v16] ) | |
6644 { | |
6645 v61 = v15; | |
6646 v16 = v15; | |
6647 } | |
6648 if ( v17 == v73 ) | |
6649 break; | |
6650 ++v69; | |
6651 } | |
6652 while ( v69 < v74 ); | |
6653 } | |
6654 v18 = v63 + v61; | |
6655 v66 = v63 + v61; | |
6656 if ( v63 + v61 < v74 ) | |
6657 { | |
6658 if ( v18 >= 0 ) | |
6659 goto LABEL_44; | |
6660 v18 += v74; | |
6661 } | |
6662 else | |
6663 { | |
6664 v18 -= v74; | |
6665 } | |
6666 v66 = v18; | |
6667 LABEL_44: | |
6668 v19 = v18; | |
6669 v20 = v61; | |
6670 v53 = dword_50B9D8_ys[v19] - dword_50B9D8_ys[v61]; | |
6671 if ( dword_50B9D8_ys[v19] != dword_50B9D8_ys[v61] ) | |
6672 { | |
6673 v21 = dword_50BAC8[v20]; | |
6674 v5 = v60; | |
6675 v61 = v21 << 16; | |
6676 v53 = ((dword_50BAC8[v19] - v21) << 16) / v53; | |
6677 v60->array_3D8[v73] = LOWORD(dword_50BAC8[v20]); | |
6678 } | |
6679 v22 = v7; | |
6680 v70 = v7; | |
6681 if ( v7 <= v73 ) | |
6682 { | |
6683 v56 = &v5->array_3D8[v7]; | |
6684 v23 = &v5->array_18[v7]; | |
6685 do | |
6686 { | |
6687 v24 = v67; | |
6688 if ( v22 < dword_50B9D8_ys[v67] || v22 == v73 ) | |
6689 goto LABEL_57; | |
6690 v25 = v64 + v67; | |
6691 v67 = v25; | |
6692 if ( v25 < v74 ) | |
6693 { | |
6694 if ( v25 >= 0 ) | |
6695 goto LABEL_55; | |
6696 v25 += v74; | |
6697 } | |
6698 else | |
6699 { | |
6700 v25 -= v74; | |
6701 } | |
6702 v67 = v25; | |
6703 LABEL_55: | |
6704 v26 = v25; | |
6705 v27 = dword_50B9D8_ys[v26] - dword_50B9D8_ys[v24]; | |
6706 if ( dword_50B9D8_ys[v26] - dword_50B9D8_ys[v24] > 0 ) | |
6707 { | |
6708 v28 = dword_50BAC8[v24]; | |
6709 v54 = ((dword_50BAC8[v26] - v28) << 16) / v27; | |
6710 v62 = v28 << 16; | |
6711 } | |
6712 LABEL_57: | |
6713 v29 = v66; | |
6714 if ( v70 >= dword_50B9D8_ys[v66] && v70 != v73 ) | |
6715 { | |
6716 v30 = v63 + v66; | |
6717 v66 += v63; | |
6718 if ( v66 >= v74 ) | |
6719 { | |
6720 v30 -= v74; | |
6721 goto LABEL_63; | |
6722 } | |
6723 if ( v30 < 0 ) | |
6724 { | |
6725 v30 += v74; | |
6726 LABEL_63: | |
6727 v66 = v30; | |
6728 } | |
6729 v31 = v30; | |
6730 v32 = dword_50B9D8_ys[v31] - dword_50B9D8_ys[v29]; | |
6731 if ( dword_50B9D8_ys[v31] - dword_50B9D8_ys[v29] > 0 ) | |
6732 { | |
6733 v33 = dword_50BAC8[v29]; | |
6734 v53 = ((dword_50BAC8[v31] - v33) << 16) / v32; | |
6735 v61 = v33 << 16; | |
6736 } | |
6737 } | |
6738 *(__int16 *)((char *)v56 + (int)(char *)v5->array_18 - (char *)v5->array_3D8) = HIWORD(v62); | |
6739 *v56 = HIWORD(v61); | |
6740 v34 = v23 + 480; | |
6741 v35 = v23[480]; | |
6742 if ( *v23 > v35 ) | |
6743 { | |
6744 v36 = *v23 ^ v35; | |
6745 v37 = *v34; | |
6746 *v23 = v36; | |
6747 v38 = v37 ^ v36; | |
6748 *v23 ^= v38; | |
6749 *v34 = v38; | |
6750 } | |
6751 ++v56; | |
6752 v62 += v54; | |
6753 v22 = v70 + 1; | |
6754 v61 += v53; | |
6755 ++v23; | |
6756 ++v70; | |
6757 } | |
6758 while ( v70 <= v73 ); | |
6759 } | |
6760 v39 = a3; | |
6761 v40 = v73; | |
6762 if ( v73 < a3->_viewport_space_y || (v41 = a3->_viewport_space_w, v7 > v41) ) | |
6763 return 0; | |
6764 if ( v7 < a3->_viewport_space_y ) | |
6765 v7 = a3->_viewport_space_y; | |
6766 if ( v73 > v41 ) | |
6767 { | |
6768 v40 = a3->_viewport_space_w; | |
6769 v73 = a3->_viewport_space_w; | |
6770 } | |
6771 v71 = v7; | |
6772 if ( v7 <= v40 ) | |
6773 { | |
6774 a3a = (char *)v5 - (char *)a3; | |
6775 v57 = &v5->array_18[v7]; | |
6776 v42 = &v39->array_3D8[v7]; | |
6777 do | |
6778 { | |
6779 if ( *(__int16 *)((char *)v42 + a3a) >= *(v42 - 480) && *v57 <= *v42 ) | |
6780 break; | |
6781 ++v57; | |
6782 ++v7; | |
6783 ++v71; | |
6784 ++v42; | |
6785 } | |
6786 while ( v71 <= v40 ); | |
6787 } | |
6788 v72 = v40; | |
6789 if ( v40 < v7 ) | |
6790 return 0; | |
6791 v58 = &v5->array_18[v40]; | |
6792 v43 = &v39->array_3D8[v40]; | |
6793 do | |
6794 { | |
6795 if ( *(__int16 *)((char *)v43 + (int)(char *)v5 - (char *)v39) >= *(v43 - 480) && *v58 <= *v43 ) | |
6796 break; | |
6797 --v58; | |
6798 --v40; | |
6799 --v72; | |
6800 --v43; | |
6801 v73 = v40; | |
6802 } | |
6803 while ( v72 >= v7 ); | |
6804 if ( v7 >= v40 ) | |
6805 return 0; | |
6806 a3b = (char *)v39 - (char *)v5; | |
6807 v59 = &v39->array_3D8[v7]; | |
6808 v45 = &v5->array_18[v7]; | |
6809 v46 = v73 - v7 + 1; | |
6810 do | |
6811 { | |
6812 v47 = *(__int16 *)((char *)v45 + a3b); | |
6813 if ( *v45 < v47 ) | |
6814 *v45 = v47; | |
6815 if ( v45[480] > *v59 ) | |
6816 v45[480] = *v59; | |
6817 ++v59; | |
6818 ++v45; | |
6819 --v46; | |
6820 } | |
6821 while ( v46 ); | |
6822 v5->_viewport_space_y = v7; | |
6823 v5->_viewport_space_w = v73; | |
6824 v5->field_8 = v5->array_18[v7]; | |
6825 v48 = v5->array_3D8[v7]; | |
6826 v5->field_10 = v7; | |
6827 v5->field_14 = v7; | |
6828 v49 = v7 + 1; | |
6829 v5->field_C = v48; | |
6830 if ( v49 <= v73 ) | |
6831 { | |
6832 v50 = &v5->array_3D8[v49]; | |
6833 do | |
6834 { | |
6835 v51 = *(v50 - 480); | |
6836 if ( v51 < v5->field_8 ) | |
6837 { | |
6838 v5->field_8 = v51; | |
6839 v5->field_10 = v49; | |
6840 } | |
6841 v52 = *v50; | |
6842 if ( v52 > v5->field_C ) | |
6843 { | |
6844 v5->field_C = v52; | |
6845 v5->field_14 = v49; | |
6846 } | |
6847 ++v49; | |
6848 ++v50; | |
6849 } | |
6850 while ( v49 <= v73 ); | |
6851 } | |
6852 return 1; | |
6853 } | |
6854 // 50B700: using guessed type int dword_50B700; | |
6855 | |
6856 //----- (00424CD7) -------------------------------------------------------- | |
6857 signed int __fastcall sr_424CD7(unsigned int uVertexID) | |
6858 { | |
6859 unsigned int v1; // edx@1 | |
6860 signed int v2; // edi@1 | |
6861 char *v3; // esi@4 | |
6862 char *v4; // ecx@4 | |
6863 unsigned int v5; // eax@4 | |
6864 char *v6; // edx@4 | |
6865 double v7; // st6@10 | |
6866 double v8; // st5@10 | |
6867 double v9; // st6@11 | |
6868 unsigned __int8 v10; // c2@15 | |
6869 unsigned __int8 v11; // c3@15 | |
6870 RenderVertexSoft *v12; // edi@22 | |
6871 char *v13; // eax@22 | |
6872 double v14; // st6@22 | |
6873 signed int result; // eax@24 | |
6874 unsigned int v16; // [sp+8h] [bp-28h]@4 | |
6875 bool v17; // [sp+Ch] [bp-24h]@6 | |
6876 char *v18; // [sp+10h] [bp-20h]@4 | |
6877 char *v19; // [sp+14h] [bp-1Ch]@4 | |
6878 signed int v20; // [sp+18h] [bp-18h]@1 | |
6879 RenderVertexSoft *v21; // [sp+1Ch] [bp-14h]@4 | |
6880 char *v22; // [sp+20h] [bp-10h]@4 | |
6881 char *v23; // [sp+24h] [bp-Ch]@4 | |
6882 char *v24; // [sp+28h] [bp-8h]@4 | |
6883 char *v25; // [sp+2Ch] [bp-4h]@4 | |
6884 | |
6885 v1 = uVertexID; | |
6886 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); | |
6887 v2 = 0; | |
6888 v20 = 0; | |
6889 if ( array_50AC10[0].vWorldViewPosition.x >= 8.0 ) | |
6890 v2 = 1; | |
6891 if ( (signed int)(uVertexID + 1) <= 1 ) | |
6892 return 0; | |
6893 v3 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
6894 v4 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
6895 v5 = v1; | |
168 | 6896 v23 = (char *)&array_507D30[0]._rhw; |
0 | 6897 v21 = array_507D30; |
6898 v18 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
6899 v19 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
6900 v22 = (char *)&array_507D30[0].vWorldViewPosition; | |
6901 v24 = (char *)&array_507D30[0].v; | |
6902 v25 = (char *)&array_507D30[0].u; | |
6903 v6 = (char *)&array_50AC10[0].v; | |
6904 v16 = v5; | |
6905 do | |
6906 { | |
6907 v17 = *((float *)v6 + 5) >= 8.0; | |
6908 if ( v2 != v17 ) | |
6909 { | |
6910 if ( v17 ) | |
6911 { | |
6912 v7 = (8.0 - *((float *)v6 - 7)) / (*((float *)v6 + 5) - *((float *)v6 - 7)); | |
6913 *(float *)v4 = (*((float *)v6 + 6) - *((float *)v6 - 6)) * v7 + *((float *)v6 - 6); | |
6914 *(float *)v3 = (*((float *)v6 + 7) - *((float *)v6 - 5)) * v7 + *((float *)v6 - 5); | |
6915 *(float *)v25 = (*((float *)v6 + 11) - *((float *)v6 - 1)) * v7 + *((float *)v6 - 1); | |
6916 v8 = (*((float *)v6 + 12) - *(float *)v6) * v7 + *(float *)v6; | |
6917 } | |
6918 else | |
6919 { | |
6920 v9 = (8.0 - *((float *)v6 + 5)) / (*((float *)v6 - 7) - *((float *)v6 + 5)); | |
6921 *(float *)v4 = (*((float *)v6 - 6) - *((float *)v6 + 6)) * v9 + *((float *)v6 + 6); | |
6922 *(float *)v3 = (*((float *)v6 - 5) - *((float *)v6 + 7)) * v9 + *((float *)v6 + 7); | |
6923 *(float *)v25 = (*((float *)v6 - 1) - *((float *)v6 + 11)) * v9 + *((float *)v6 + 11); | |
6924 v8 = (*(float *)v6 - *((float *)v6 + 12)) * v9 + *((float *)v6 + 12); | |
6925 } | |
6926 *(float *)v24 = v8; | |
6927 *(float *)v22 = 8.0; | |
6928 *(int *)v23 = 0x3E000000u; | |
6929 if ( v2 ) | |
6930 { | |
6931 if ( 8.0 == *((float *)v6 - 7) && *(float *)v4 == *((float *)v6 - 6) ) | |
6932 { | |
6933 v10 = 0; | |
6934 v11 = *(float *)v3 == *((float *)v6 - 5); | |
6935 goto LABEL_19; | |
6936 } | |
6937 } | |
6938 else | |
6939 { | |
6940 if ( 8.0 == *((float *)v6 + 5) && *(float *)v4 == *((float *)v6 + 6) ) | |
6941 { | |
6942 v10 = 0; | |
6943 v11 = *(float *)v3 == *((float *)v6 + 7); | |
6944 LABEL_19: | |
6945 if ( v11 | v10 ) | |
6946 goto LABEL_21; | |
6947 goto LABEL_20; | |
6948 } | |
6949 } | |
6950 LABEL_20: | |
6951 ++v21; | |
6952 v22 += 48; | |
6953 v24 += 48; | |
6954 v25 += 48; | |
6955 v4 += 48; | |
6956 v3 += 48; | |
6957 ++v20; | |
6958 v23 += 48; | |
6959 v19 = v4; | |
6960 v18 = v3; | |
6961 } | |
6962 LABEL_21: | |
6963 if ( v17 ) | |
6964 { | |
6965 v12 = v21; | |
6966 v13 = v23; | |
6967 v19 += 48; | |
6968 v18 += 48; | |
6969 v14 = 1.0 / (*((float *)v6 + 5) + 0.0000001); | |
6970 ++v20; | |
6971 v25 += 48; | |
6972 v24 += 48; | |
6973 v22 += 48; | |
6974 ++v21; | |
6975 v23 += 48; | |
6976 memcpy(v12, v6 + 8, 0x30u); | |
6977 v4 = v19; | |
6978 v3 = v18; | |
6979 *(float *)v13 = v14; | |
6980 } | |
6981 v2 = v17; | |
6982 v6 += 48; | |
6983 --v16; | |
6984 } | |
6985 while ( v16 ); | |
6986 result = v20; | |
6987 if ( v20 < 3 ) | |
6988 return 0; | |
6989 return result; | |
6990 } |