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