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