Mercurial > mm7
annotate mm7_1.cpp @ 792:41b4e9769863
Walking in BLV iproved drastically.
author | Nomad |
---|---|
date | Mon, 25 Mar 2013 07:32:38 +0200 |
parents | 346f7069676a |
children | c232f160e6f3 |
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 #include "MapInfo.h" | |
12 #include "Game.h" | |
13 #include "GUIWindow.h" | |
14 #include "GUIFont.h" | |
15 #include "GUIButton.h" | |
16 #include "GUIProgressBar.h" | |
17 #include "Party.h" | |
18 #include "AudioPlayer.h" | |
19 #include "Outdoor.h" | |
20 #include "IndoorCamera.h" | |
21 #include "Overlays.h" | |
22 #include "Monsters.h" | |
23 #include "Arcomage.h" | |
24 #include "LOD.h" | |
25 #include "Actor.h" | |
26 #include "Allocator.h" | |
27 #include "Events.h" | |
28 #include "Viewport.h" | |
29 #include "FrameTableInc.h" | |
30 #include "Math.h" | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
31 #include "SpriteObject.h" |
0 | 32 #include "ObjectList.h" |
33 #include "Chest.h" | |
34 #include "PaletteManager.h" | |
35 #include "DecorationList.h" | |
36 #include "SaveLoad.h" | |
37 #include "stru123.h" | |
38 #include "Time.h" | |
39 #include "IconFrameTable.h" | |
40 #include "Awards.h" | |
41 #include "Autonotes.h" | |
42 #include "stru160.h" | |
43 #include "stru279.h" | |
44 #include "TurnEngine.h" | |
45 #include "stru277.h" | |
46 #include "Weather.h" | |
47 #include "stru272.h" | |
48 #include "stru298.h" | |
49 #include "StorylineTextTable.h" | |
50 #include "Events2D.h" | |
189 | 51 #include "texts.h" |
351 | 52 #include "stru351.h" |
747 | 53 #include "UIHouses.h" |
0 | 54 #include "mm7_data.h" |
55 | |
56 int __stdcall aWinProc(HWND hWnd, UINT Msg, WPARAM wParam, unsigned int lParam); | |
57 int __stdcall InsertMM7CDDialogFunc(HWND hDlg, int a2, __int16 a3, int a4); | |
58 bool __fastcall FindMM7CD(HWND hWnd, char *pCDDrive); | |
59 bool __fastcall Initialize(HINSTANCE hInst, char *pCmdLine); | |
60 | |
791 | 61 |
62 //----- (004A1780) mm6_chinese--------------------------------------------- | |
63 int fixpoint_div(int a1, int a2) | |
64 { | |
65 return ((__int64)a1 << 16) / a2; | |
66 } | |
67 | |
762 | 68 //----- (004453C0) mm6----------------------------------------------------- |
69 //----- (004A1760) mm6_chinese--------------------------------------------- | |
70 int fixpoint_mul(int a1, int a2) | |
71 { | |
791 | 72 return ((__int64)a1 * (__int64)a2) / 65536; |
762 | 73 } |
74 | |
0 | 75 //----- (004196A0) -------------------------------------------------------- |
76 void __cdecl sub_4196A0() | |
77 { | |
78 GUIButton *i; // esi@2 | |
79 GUIButton *j; // esi@7 | |
80 | |
81 if ( dword_507CC0 ) | |
82 { | |
83 dword_507CC0 = 0; | |
705 | 84 for ( i = pGUIWindow_CurrentMenu->pControlsHead; i; i = j ) |
0 | 85 { |
705 | 86 j=i->pNext; |
87 if ( BYTE1(i->field_1C) & 0x80 ) | |
88 { | |
697 | 89 i->Release(); |
705 | 90 pAllocator->FreeChunk(i); |
91 } | |
0 | 92 } |
93 for ( j = pGUIWindow_CurrentMenu->pControlsHead; j; j = j->pNext ) | |
94 { | |
95 if ( j->uControlID == 120 ) | |
96 { | |
97 j->uX = dword_50698C; | |
98 j->uY = dword_506988; | |
99 j->uZ = dword_506984; | |
100 j->uW = dword_506980; | |
101 pGUIWindow_CurrentMenu->_41D08F(1, 0, 0, 0); | |
102 } | |
103 } | |
104 } | |
105 } | |
106 // 506980: using guessed type int dword_506980; | |
107 // 506984: using guessed type int dword_506984; | |
108 // 506988: using guessed type int dword_506988; | |
109 // 50698C: using guessed type int dword_50698C; | |
110 // 507CC0: using guessed type int dword_507CC0; | |
111 // 50651C: using guessed type int dword_50651C; | |
112 // 506520: using guessed type int dword_506520; | |
113 // 506524: using guessed type int dword_506524; | |
114 // 506528: using guessed type int dword_506528; | |
115 // 506544: using guessed type int dword_506544; | |
116 // 506548: using guessed type int dword_506548; | |
117 // 723E80: using guessed type int dword_723E80_award_related[]; | |
118 // 723E84: using guessed type int dword_723E84[]; | |
119 // 5075E0: using guessed type int pVisibleWindowsIdxs[20]; | |
120 | |
121 //----- (0041CD4F) -------------------------------------------------------- | |
122 bool __thiscall sub_41CD4F(unsigned int _this) | |
123 { | |
124 unsigned int v1; // edi@1 | |
125 unsigned int v2; // eax@2 | |
126 int v3; // esi@3 | |
127 int v4; // ecx@10 | |
128 GUIButton *v5; // eax@11 | |
129 int v6; // edx@12 | |
130 int v7; // ecx@20 | |
131 char v8; // zf@21 | |
132 GUIButton *v9; // ecx@24 | |
133 int v10; // esi@24 | |
134 int v11; // edx@26 | |
135 int v12; // edx@28 | |
136 int v13; // esi@32 | |
137 GUIButton *v14; // eax@37 | |
138 int v15; // edx@38 | |
139 int v17; // ecx@50 | |
140 int v18; // edx@50 | |
141 GUIButton *v19; // ecx@54 | |
142 int v20; // esi@54 | |
143 int v21; // edx@56 | |
144 int v22; // ecx@59 | |
145 int v23; // edx@59 | |
146 int v24; // ecx@60 | |
147 int v25; // esi@63 | |
148 unsigned int v26; // [sp+Ch] [bp-14h]@1 | |
149 int v27; // [sp+10h] [bp-10h]@1 | |
150 int v28; // [sp+14h] [bp-Ch]@10 | |
151 int v29; // [sp+14h] [bp-Ch]@36 | |
152 unsigned int uClickX; // [sp+18h] [bp-8h]@10 | |
153 unsigned int uClickY; // [sp+1Ch] [bp-4h]@10 | |
154 | |
155 v1 = 0; | |
156 v26 = _this; | |
157 v27 = uNumVisibleWindows; | |
158 if ( uNumVisibleWindows < 0 ) | |
159 return 0; | |
160 v2 = pMessageQueue_50CBD0->uNumMessages; | |
161 while ( 1 ) | |
162 { | |
163 v3 = pVisibleWindowsIdxs[v27] - 1; | |
585 | 164 if ( pWindowList[v3].field_44 != v1 ) |
165 { | |
586 | 166 switch(v26) |
585 | 167 { |
586 | 168 case VK_LEFT: |
169 { | |
170 v12 = pWindowList[v3].field_34; | |
171 if ( pWindowList[v3].pCurrentPosActiveItem - pWindowList[v3].pStartingPosActiveItem - v12 >= 0 ) | |
172 { | |
173 v8 = pCurrentScreen == SCREEN_PARTY_CREATION; | |
174 pWindowList[v3].pCurrentPosActiveItem -= v12; | |
175 if ( v8 ) | |
176 { | |
177 pAudioPlayer->PlaySound(SOUND_Button, v1, v1, -1, v1, v1, v1, v1); | |
178 v2 = pMessageQueue_50CBD0->uNumMessages; | |
179 } | |
180 } | |
181 if ( pWindowList[v3].field_30 != v1 ) | |
585 | 182 { |
586 | 183 break; |
184 } | |
185 v9 = pWindowList[v3].pControlsHead; | |
186 v13 = pWindowList[v3].pCurrentPosActiveItem; | |
187 if ( v13 > (signed int)v1 ) | |
188 { | |
189 do | |
190 { | |
191 v9 = v9->pNext; | |
192 --v13; | |
193 } | |
194 while ( v13 ); | |
195 } | |
196 v11 = v9->uControlParam; | |
197 /*if ( (signed int)v2 < 40 ) | |
198 { | |
199 pMessageQueue_50CBD0->pMessages[v2].eType = (UIMessageType)v9->uControlID; | |
200 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v11; | |
201 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = v1; | |
202 v2 = pMessageQueue_50CBD0->uNumMessages + 1; | |
203 ++pMessageQueue_50CBD0->uNumMessages; | |
204 }*/ | |
205 pMessageQueue_50CBD0->AddMessage((UIMessageType)v9->uControlID, v11, v1); | |
206 break; | |
585 | 207 } |
586 | 208 case VK_RIGHT: |
209 { | |
210 v7 = pWindowList[v3].pCurrentPosActiveItem + pWindowList[v3].field_34; | |
211 if ( v7 < pWindowList[v3].pNumPresenceButton + pWindowList[v3].pStartingPosActiveItem ) | |
585 | 212 { |
586 | 213 v8 = pCurrentScreen == SCREEN_PARTY_CREATION; |
214 pWindowList[v3].pCurrentPosActiveItem = v7; | |
215 if ( v8 ) | |
216 { | |
217 pAudioPlayer->PlaySound(SOUND_Button, v1, v1, -1, v1, v1, v1, v1); | |
218 v2 = pMessageQueue_50CBD0->uNumMessages; | |
219 } | |
220 } | |
221 if ( pWindowList[v3].field_30 != v1 ) | |
222 { | |
223 break; | |
585 | 224 } |
586 | 225 v9 = pWindowList[v3].pControlsHead; |
226 v10 = pWindowList[v3].pCurrentPosActiveItem; | |
227 if ( v10 > (signed int)v1 ) | |
585 | 228 { |
586 | 229 do |
230 { | |
231 v9 = v9->pNext; | |
232 --v10; | |
233 } | |
234 while ( v10 ); | |
235 } | |
236 v11 = v9->uControlParam; | |
237 pMessageQueue_50CBD0->AddMessage((UIMessageType)v9->uControlID, v11, v1); | |
238 break; | |
585 | 239 } |
586 | 240 case VK_DOWN: |
585 | 241 { |
586 | 242 v17 = pWindowList[v3].pStartingPosActiveItem; |
243 v18 = pWindowList[v3].pCurrentPosActiveItem; | |
244 if ( v18 >= pWindowList[v3].pNumPresenceButton + v17 - 1 ) | |
245 pWindowList[v3].pCurrentPosActiveItem = v17; | |
246 else | |
247 pWindowList[v3].pCurrentPosActiveItem = v18 + 1; | |
248 if ( pWindowList[v3].field_30 != v1 ) | |
249 return 1; | |
250 v19 = pWindowList[v3].pControlsHead; | |
251 v20 = pWindowList[v3].pCurrentPosActiveItem; | |
252 if ( v20 > (signed int)v1 ) | |
253 { | |
585 | 254 do |
255 { | |
586 | 256 v19 = v19->pNext; |
257 --v20; | |
585 | 258 } |
586 | 259 while ( v20 ); |
585 | 260 } |
586 | 261 v21 = v19->uControlParam; |
262 pMessageQueue_50CBD0->AddMessage((UIMessageType)v19->uControlID, v21, v1); | |
585 | 263 return 1; |
586 | 264 } |
265 case VK_SELECT: | |
266 { | |
267 pMouse->GetClickPos(&uClickX, &uClickY); | |
268 v4 = pWindowList[v3].pStartingPosActiveItem; | |
269 v28 = v4 + pWindowList[v3].pNumPresenceButton; | |
270 if ( v4 < v4 + pWindowList[v3].pNumPresenceButton ) | |
271 { | |
272 while ( 1 ) | |
273 { | |
274 v5 = pWindowList[v3].pControlsHead; | |
275 if ( v4 > 0 ) | |
276 { | |
277 v6 = v4; | |
278 do | |
279 { | |
280 v5 = v5->pNext; | |
281 --v6; | |
282 } | |
283 while ( v6 ); | |
284 } | |
285 if ( (signed int)uClickX >= (signed int)v5->uX | |
286 && (signed int)uClickX <= (signed int)v5->uZ | |
287 && (signed int)uClickY >= (signed int)v5->uY | |
288 && (signed int)uClickY <= (signed int)v5->uW ) | |
289 break; | |
290 ++v4; | |
291 if ( v4 >= v28 ) | |
292 { | |
293 v1 = 0; | |
294 v2 = pMessageQueue_50CBD0->uNumMessages; | |
295 --v27; | |
296 if ( v27 < 0 ) | |
297 return 0; | |
298 continue; | |
299 } | |
300 } | |
301 pWindowList[v3].pCurrentPosActiveItem = v4; | |
302 return 1; | |
303 } | |
304 v2 = pMessageQueue_50CBD0->uNumMessages; | |
305 break; | |
306 } | |
307 case VK_UP: | |
308 { | |
309 v22 = pWindowList[v3].pCurrentPosActiveItem; | |
310 v23 = pWindowList[v3].pStartingPosActiveItem; | |
311 if ( v22 <= v23 ) | |
312 v24 = pWindowList[v3].pNumPresenceButton + v23 - 1; | |
313 else | |
314 v24 = v22 - 1; | |
315 v8 = pWindowList[v3].field_30 == v1; | |
316 pWindowList[v3].pCurrentPosActiveItem = v24; | |
317 if ( !v8 ) | |
318 return 1; | |
319 v19 = pWindowList[v3].pControlsHead; | |
320 v25 = pWindowList[v3].pCurrentPosActiveItem; | |
321 if ( v25 > (signed int)v1 ) | |
585 | 322 { |
586 | 323 do |
324 { | |
325 v19 = v19->pNext; | |
326 --v25; | |
327 } | |
328 while ( v25 ); | |
585 | 329 } |
586 | 330 v21 = v19->uControlParam; |
331 /*if ( (signed int)v2 < 40 ) | |
332 { | |
333 pMessageQueue_50CBD0->pMessages[v2].eType = (UIMessageType)v19->uControlID; | |
334 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v21; | |
335 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = v1; | |
336 ++pMessageQueue_50CBD0->uNumMessages; | |
337 }*/ | |
338 pMessageQueue_50CBD0->AddMessage((UIMessageType)v19->uControlID, v21, v1); | |
585 | 339 return 1; |
586 | 340 } |
341 case VK_NEXT: | |
342 { | |
343 if ( pWindowList[v3].field_30 != v1 ) | |
344 { | |
345 pMouse->GetClickPos(&uClickX, &uClickY); | |
346 v4 = pWindowList[v3].pStartingPosActiveItem; | |
347 v29 = v4 + pWindowList[v3].pNumPresenceButton; | |
348 if ( v4 < v4 + pWindowList[v3].pNumPresenceButton ) | |
349 { | |
350 while ( 1 ) | |
351 { | |
352 v14 = pWindowList[v3].pControlsHead; | |
353 if ( v4 > 0 ) | |
354 { | |
355 v15 = v4; | |
356 do | |
357 { | |
358 v14 = v14->pNext; | |
359 --v15; | |
360 } | |
361 while ( v15 ); | |
362 } | |
363 if ( (signed int)uClickX >= (signed int)v14->uX | |
364 && (signed int)uClickX <= (signed int)v14->uZ | |
365 && (signed int)uClickY >= (signed int)v14->uY | |
366 && (signed int)uClickY <= (signed int)v14->uW ) | |
367 { | |
368 pWindowList[v3].pCurrentPosActiveItem = v4; | |
369 return 1; | |
370 } | |
371 ++v4; | |
372 if ( v4 >= v29 ) | |
373 { | |
374 v1 = 0; | |
375 v2 = pMessageQueue_50CBD0->uNumMessages; | |
376 break; | |
377 } | |
378 } | |
379 } | |
380 else | |
381 { | |
382 v2 = pMessageQueue_50CBD0->uNumMessages; | |
383 } | |
384 } | |
585 | 385 break; |
586 | 386 } |
387 default: | |
388 { | |
389 break; | |
390 } | |
391 | |
585 | 392 } |
393 } | |
0 | 394 --v27; |
395 if ( v27 < 0 ) | |
396 return 0; | |
397 } | |
585 | 398 |
0 | 399 } |
400 | |
401 //----- (0041D20D) -------------------------------------------------------- | |
402 char __fastcall sub_41D20D_buff_remaining_time_string(int ecx0, GUIWindow *edx0, __int64 a3, GUIFont *a2) | |
403 { | |
404 unsigned int v4; // edi@1 | |
405 unsigned int v5; // esi@1 | |
406 unsigned int v6; // ebp@1 | |
407 unsigned int v7; // ebx@1 | |
408 signed __int64 v8; // ST34_8@1 | |
409 signed __int64 v9; // kr00_8@1 | |
410 char *v10; // eax@2 | |
411 char *v11; // eax@7 | |
412 char *v12; // eax@13 | |
413 char *v13; // eax@19 | |
414 int uY; // [sp+0h] [bp-20h]@1 | |
415 GUIWindow *a1; // [sp+4h] [bp-1Ch]@1 | |
416 signed __int64 v17; // [sp+10h] [bp-10h]@1 | |
417 signed __int64 v18; // [sp+18h] [bp-8h]@1 | |
418 unsigned int v19; // [sp+24h] [bp+4h]@1 | |
419 | |
420 a1 = edx0; | |
421 uY = ecx0; | |
422 v4 = (unsigned __int64)(signed __int64)((double)a3 * 0.234375) >> 32; | |
423 v5 = (signed __int64)((double)a3 * 0.234375); | |
424 v6 = (unsigned __int64)((signed __int64)((double)a3 * 0.234375) / 60) >> 32; | |
425 v7 = (signed __int64)((double)a3 * 0.234375) / 60; | |
426 v8 = (signed __int64)((double)a3 * 0.234375) / 60 / 60; | |
427 v19 = (unsigned int)v8 / 0x18; | |
428 v18 = (signed __int64)__PAIR__(v4, v5) % 60; | |
429 v17 = (signed __int64)__PAIR__(v6, v7) % 60; | |
430 v9 = v8 % 24; | |
431 strcpy(pTmpBuf, "\r020"); | |
432 if ( (unsigned int)v8 / 0x18 ) | |
433 { | |
434 v10 = pGlobalTXT_LocalizationStrings[57]; // Days | |
435 if ( v19 <= 1 ) | |
436 v10 = pGlobalTXT_LocalizationStrings[56]; // Day | |
437 sprintf(pTmpBuf2, "%d %s ", v19, v10); | |
438 strcat(pTmpBuf, pTmpBuf2); | |
439 } | |
440 if ( v9 ) | |
441 { | |
442 if ( v9 <= 1 ) | |
443 v11 = pGlobalTXT_LocalizationStrings[109];// Hour | |
444 else | |
445 v11 = pGlobalTXT_LocalizationStrings[110];// Hours | |
446 sprintf(pTmpBuf2, "%d %s ", v9, v11); | |
447 strcat(pTmpBuf, pTmpBuf2); | |
448 } | |
449 if ( v17 && !v19 ) | |
450 { | |
451 if ( v17 <= 1 ) | |
452 v12 = pGlobalTXT_LocalizationStrings[437];// Minute | |
453 else | |
454 v12 = pGlobalTXT_LocalizationStrings[436];// Minutes | |
455 sprintf(pTmpBuf2, "%d %s ", v17, v12); | |
456 strcat(pTmpBuf, pTmpBuf2); | |
457 } | |
458 if ( v18 && !v9 ) | |
459 { | |
460 if ( v18 <= 1 ) | |
461 v13 = pGlobalTXT_LocalizationStrings[439];// Second | |
462 else | |
463 v13 = pGlobalTXT_LocalizationStrings[438];// Seconds | |
464 sprintf(pTmpBuf2, "%d %s ", v18, v13); | |
465 strcat(pTmpBuf, pTmpBuf2); | |
466 } | |
467 return a1->DrawText(a2, 32, uY, 0, pTmpBuf, 0, 0, 0); | |
468 } | |
469 | |
470 //----- (0041F54A) -------------------------------------------------------- | |
471 void __cdecl LoadActualSkyFrame() | |
472 { | |
473 if ( pTexture_RestUI_CurrentSkyFrame ) | |
474 pTexture_RestUI_CurrentSkyFrame->Release(); | |
475 if ( pTexture_RestUI_CurrentHourglassFrame ) | |
476 pTexture_RestUI_CurrentHourglassFrame->Release(); | |
477 pIcons_LOD->_40F9C5(); | |
478 sprintf(pTmpBuf, "TERRA%03d", pParty->uCurrentMinute / 6 + 10 * pParty->uCurrentHour); | |
479 pTexture_RestUI_CurrentSkyFrame = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture(pTmpBuf, TEXTURE_16BIT_PALETTE)]; | |
480 } | |
481 | |
482 //----- (0041F5BE) -------------------------------------------------------- | |
483 void __cdecl Sleep6Hours() | |
484 { | |
485 if ( _506F18_num_hours_to_sleep < 6 ) | |
486 { | |
487 pParty->pPlayers[3].pConditions[2] = 0i64; | |
488 pParty->pPlayers[2].pConditions[2] = 0i64; | |
489 pParty->pPlayers[1].pConditions[2] = 0i64; | |
490 pParty->pPlayers[0].pConditions[2] = 0i64; | |
491 if ( _506F18_num_hours_to_sleep ) | |
492 { | |
493 Rest(_506F18_num_hours_to_sleep); | |
494 _506F18_num_hours_to_sleep = 0; | |
495 LoadActualSkyFrame(); | |
496 } | |
497 if ( dword_506F14 == 2 ) | |
498 { | |
499 pGUIWindow_CurrentMenu->Release(); | |
500 pEventTimer->Resume(); | |
501 if ( pTexture_RestUI_CurrentSkyFrame ) | |
502 pTexture_RestUI_CurrentSkyFrame->Release(); | |
503 if ( pTexture_RestUI_CurrentHourglassFrame ) | |
504 pTexture_RestUI_CurrentHourglassFrame->Release(); | |
505 pTexture_RestUI_CurrentHourglassFrame = 0; | |
506 pTexture_RestUI_CurrentSkyFrame = 0; | |
507 pIcons_LOD->_4114F2(); | |
508 pIcons_LOD->_40F9C5(); | |
151 | 509 pCurrentScreen = SCREEN_GAME; |
0 | 510 viewparams->bRedrawGameUI = 1; |
511 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
512 { | |
513 pOutdoor->UpdateSunlightVectors(); | |
514 pOutdoor->UpdateFog(); | |
515 } | |
516 } | |
517 dword_506F14 = 0; | |
518 } | |
519 else | |
520 { | |
521 Rest(6u); | |
522 _506F18_num_hours_to_sleep -= 6; | |
523 LoadActualSkyFrame(); | |
524 } | |
525 viewparams->bRedrawGameUI = 1; | |
526 } | |
527 | |
528 //----- (0042038D) -------------------------------------------------------- | |
529 void __cdecl sub_42038D() | |
530 { | |
531 POINT *v0; // esi@2 | |
532 int v1; // ecx@2 | |
533 const char *v2; // eax@3 | |
534 POINT v3; // [sp+0h] [bp-10h]@2 | |
535 POINT a2; // [sp+8h] [bp-8h]@1 | |
536 | |
537 if ( pMouse->GetCursorPos(&a2)->y < 350 ) | |
538 { | |
539 v0 = pMouse->GetCursorPos(&a2); | |
540 v1 = pRenderer->pActiveZBuffer[v0->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v3)->y]]; | |
541 if ( v1 ) | |
542 { | |
543 auto _w = (ItemGen *)(&pOtherOverlayList->pOverlays[49].field_4 + 2662 * (unsigned int)pChestWindow->ptr_1C | |
526 | 544 + 18 * *((short *)&pChests[0].igChestItems[139].uExpireTime |
0 | 545 + v1 + 2662 * (unsigned int)pChestWindow->ptr_1C + 3)); |
702 | 546 |
547 _w = (ItemGen *)(&pChests[(unsigned int)pChestWindow->ptr_1C] -32 | |
548 + 18 * *((short *)&pChests[(unsigned int)pChestWindow->ptr_1C].igChestItems[139].uExpireTime + v1 + 3)); | |
0 | 549 v2 = _w->GetDisplayName(); |
550 sub_41C0B8_set_status_string(v2); | |
551 } | |
552 } | |
553 } | |
554 | |
555 //----- (00420C05) -------------------------------------------------------- | |
556 void __fastcall party_finds_gold(unsigned int uNumGold, int _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal) | |
557 { | |
558 unsigned int v2; // edi@1 | |
559 int v3; // ebp@1 | |
560 unsigned int v4; // esi@1 | |
561 int v5; // ecx@6 | |
562 NPCData *v6; // eax@6 | |
563 signed int v7; // edx@8 | |
564 signed int v8; // ebx@10 | |
565 char *v9; // edi@11 | |
566 signed int v10; // ecx@17 | |
567 int v11; // eax@21 | |
568 NPCData *v12; // ecx@21 | |
569 unsigned int v13; // ecx@23 | |
570 signed int v14; // [sp+Ch] [bp-4h]@6 | |
571 | |
572 v2 = 0; | |
573 v3 = 0; | |
574 v4 = uNumGold; | |
575 if ( _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal ) | |
576 { | |
577 if ( _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal == 1 ) | |
578 { | |
579 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[467], uNumGold);// You found %lu gold! | |
580 } | |
581 else | |
582 { | |
583 if ( _1_dont_share_with_followers___2_the_same_but_without_a_message__else_normal == 2 ) | |
584 pTmpBuf2[0] = 0; | |
585 } | |
586 } | |
587 else | |
588 { | |
589 v14 = 0; | |
590 v5 = 0; | |
591 v6 = pParty->pHirelings; | |
592 do | |
593 { | |
594 if ( v6->pName ) | |
595 { | |
596 v7 = v14++; | |
597 pTmpBuf[v7] = v5; | |
598 } | |
599 ++v6; | |
600 ++v5; | |
601 } | |
602 while ( (signed int)v6 < (signed int)&pParty->pPickedItem ); | |
603 v8 = 0; | |
604 if ( (signed int)pNPCStats->uNumNewNPCs > 0 ) | |
605 { | |
606 v9 = (char *)pNPCStats->pNewNPCData; | |
607 do | |
608 { | |
609 if ( v9[8] & 0x80 | |
610 && (!pParty->pHirelings[0].pName || strcmp(*(const char **)v9, pParty->pHirelings[0].pName)) | |
611 && (!pParty->pHirelings[1].pName || strcmp(*(const char **)v9, pParty->pHirelings[1].pName)) ) | |
612 { | |
613 v10 = v14++; | |
614 pTmpBuf[v10] = v8 + 2; | |
615 } | |
616 ++v8; | |
617 v9 += 76; | |
618 } | |
619 while ( v8 < (signed int)pNPCStats->uNumNewNPCs ); | |
620 v2 = 0; | |
621 } | |
622 if ( v14 > 0 ) | |
623 { | |
624 do | |
625 { | |
626 v11 = (unsigned __int8)pTmpBuf[v2]; | |
627 v12 = &pNPCStats->pNPCData[v11 + 499]; | |
33 | 628 if ( (unsigned __int8)pTmpBuf[v2] < 2 ) |
0 | 629 v12 = &pParty->pHirelings[v11]; |
630 v13 = v12->uProfession; | |
631 if ( v13 ) | |
291 | 632 v3 += pNPCStats->pProfessions[v13].uHirePrice;//*(&pNPCStats->field_13A58 + 5 * v13); |
0 | 633 ++v2; |
634 } | |
635 while ( (signed int)v2 < v14 ); | |
636 } | |
652 | 637 if ( CheckHiredNPCSpeciality(Factor) ) |
0 | 638 v4 += (signed int)(10 * v4) / 100; |
652 | 639 if ( CheckHiredNPCSpeciality(Banker) ) |
0 | 640 v4 += (signed int)(20 * v4) / 100; |
652 | 641 if ( CheckHiredNPCSpeciality(Pirate) ) |
0 | 642 v4 += (signed int)(10 * v4) / 100; |
643 if ( v3 ) | |
644 { | |
645 v3 = (signed int)(v4 * v3 / 100) / 100; | |
646 if ( v3 < 1 ) | |
647 v3 = 1; | |
648 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[466], v4, v3);// You found %lu gold (followers take %lu)! | |
649 } | |
650 else | |
651 { | |
652 sprintf(pTmpBuf2, pGlobalTXT_LocalizationStrings[467], v4);// You found %lu gold! | |
653 } | |
654 v2 = 0; | |
655 } | |
656 pParty->uNumGold += v4 - v3; | |
657 pUIAnim_Gold->uAnimTime = v2; | |
658 pUIAnim_Gold->uAnimLength = 8 * pIconsFrameTable->pIcons[(signed __int16)pUIAnim_Gold->uIconID].uAnimLength; | |
659 if ( pTmpBuf2[0] ) | |
660 ShowStatusBarString(pTmpBuf2, 2u); | |
661 pAudioPlayer->PlaySound(SOUND_GoldReceived, v2, v2, -1, v2, v2, v2, v2); | |
662 } | |
663 | |
664 //----- (00420E01) -------------------------------------------------------- | |
665 void __cdecl sub_420E01() | |
666 { | |
526 | 667 int chest_id; // edi@1 |
0 | 668 POINT *v1; // esi@2 |
669 int v2; // eax@2 | |
670 int v3; // ebx@4 | |
671 int v4; // esi@6 | |
672 int v5; // ecx@6 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
673 //SpriteObject v6; // [sp+Ch] [bp-80h]@1 |
526 | 674 POINT v7; // [sp+7Ch] [bp-10h]@2 |
0 | 675 POINT a2; // [sp+84h] [bp-8h]@2 |
676 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
677 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
|
678 //SpriteObject::SpriteObject(&v6); |
0 | 679 |
526 | 680 chest_id = pGUIWindow_CurrentMenu->par1C; |
0 | 681 if ( pParty->pPickedItem.uItemID ) |
682 { | |
526 | 683 if ( Chest::PutItemInChest(-1, &pParty->pPickedItem, pGUIWindow_CurrentMenu->par1C) ) |
0 | 684 pMouse->RemoveHoldingItem(); |
685 } | |
686 else | |
687 { | |
688 v1 = pMouse->GetCursorPos(&a2); | |
689 v2 = pRenderer->pActiveZBuffer[v1->x + pSRZBufferLineOffsets[pMouse->GetCursorPos((POINT *)&v7)->y]] & 0xFFFF; | |
690 if ( v2 ) | |
691 { | |
692 if ( v2 ) | |
693 v3 = v2 - 1; | |
694 else | |
695 v3 = -1; | |
526 | 696 v4 = pChests[chest_id].pInventoryIndices[v3] - 1; |
600 | 697 if ( pItemsTable->pItems[pChests[chest_id].igChestItems[v4].uItemID].uEquipType == EQUIP_GOLD ) |
0 | 698 { |
600 | 699 party_finds_gold(pChests[chest_id].igChestItems[v4].uSpecEnchantmentType, 0); |
0 | 700 viewparams->bRedrawGameUI = 1; |
701 } | |
702 else | |
703 { | |
526 | 704 pParty->SetHoldingItem(&pChests[chest_id].igChestItems[v4]); |
0 | 705 } |
706 sub_420B13(v4, v3); | |
707 } | |
708 } | |
709 } | |
710 | |
711 //----- (004219BE) -------------------------------------------------------- | |
712 GUIWindow *stru277::sub_4219BE() | |
713 { | |
714 int v1; // esi@1 | |
715 GUIWindow *v2; // ebx@1 | |
716 | |
717 auto a4 = this; | |
718 v1 = (int)a4; | |
719 pEventTimer->Pause(); | |
720 pAudioPlayer->StopChannels(-1, -1); | |
721 bRingsShownInCharScreen = 0; | |
722 CharacterUI_LoadPaperdollTextures(); | |
151 | 723 pCurrentScreen = SCREEN_CASTING; |
710 | 724 v2 = GUIWindow::Create(0, 0, 640, 480, WINDOW_1F, v1, 0); |
0 | 725 pCharacterScreen_ExitBtn = v2->CreateButton( |
726 394u, | |
727 318u, | |
728 75u, | |
729 33u, | |
730 1, | |
731 0, | |
732 0xA8u, | |
733 0, | |
734 0, | |
710 | 735 pGlobalTXT_LocalizationStrings[79], // Close |
0 | 736 (Texture *)(papredoll_dbrds[2] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[2]] : 0), |
737 papredoll_dbrds[1] != -1 ? (int)&pIcons_LOD->pTextures[papredoll_dbrds[1]] : 0, | |
738 0); | |
739 v2->CreateButton(0, 0, 0x1DCu, 0x159u, 1, 122, 0x78u, 0, 0, "", 0); | |
740 pCharacterScreen_DollBtn = v2->CreateButton(0x1DCu, 0, 0xA4u, 0x159u, 1, 0, 0x85u, 0, 0, "", 0); | |
741 v2->CreateButton(61u, 424u, 0x1Fu, 0, 2, 94, 0x6Eu, 1u, 0x31u, "", 0); | |
742 v2->CreateButton(177u, 424u, 0x1Fu, 0, 2, 94, 0x6Eu, 2u, 0x32u, "", 0); | |
743 v2->CreateButton(292u, 424u, 0x1Fu, 0, 2, 94, 0x6Eu, 3u, 0x33u, "", 0); | |
744 v2->CreateButton(407u, 424u, 0x1Fu, 0, 2, 94, 0x6Eu, 4u, 0x34u, "", 0); | |
745 return v2; | |
746 } | |
747 | |
748 //----- (00421B2C) -------------------------------------------------------- | |
749 bool __cdecl sub_421B2C_PlaceInInventory_or_DropPickedItem() | |
750 { | |
751 unsigned int v0; // eax@2 | |
752 Texture *v1; // ebx@2 | |
753 int v2; // eax@3 | |
754 Player *v3; // esi@5 | |
755 int v4; // eax@6 | |
756 unsigned __int16 v5; // dx@11 | |
757 signed int v6; // eax@11 | |
758 char *v7; // edi@12 | |
759 __int16 v8; // ax@16 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
760 SpriteObject a1; // [sp+4h] [bp-78h]@11 |
0 | 761 int v11; // [sp+74h] [bp-8h]@2 |
762 int v12; // [sp+78h] [bp-4h]@5 | |
763 | |
764 if ( !pParty->pPickedItem.uItemID ) | |
765 return 1; | |
766 v0 = pIcons_LOD->LoadTexture( | |
767 pItemsTable->pItems[pParty->pPickedItem.uItemID].pIconName, | |
768 TEXTURE_16BIT_PALETTE); | |
769 v1 = (Texture *)(v0 != -1 ? (int)&pIcons_LOD->pTextures[v0] : 0); | |
770 v11 = areWeLoadingTexture; | |
771 if ( uActiveCharacter | |
772 && (v2 = pPlayers[uActiveCharacter]->AddItem(0xFFFFFFFFu, pParty->pPickedItem.uItemID)) != 0 ) | |
773 { | |
232 | 774 memcpy(&pPlayers[uActiveCharacter]->pInventoryItems[v2-1], &pParty->pPickedItem, 0x24u); |
244 | 775 pMouse->RemoveHoldingItem(); |
0 | 776 } |
777 else | |
778 { | |
779 v12 = 0; | |
780 v3 = pParty->pPlayers; | |
244 | 781 while ( v3 <= &pParty->pPlayers[3] ) |
0 | 782 { |
783 v4 = v3->AddItem(0xFFFFFFFFu, pParty->pPickedItem.uItemID); | |
784 if ( v4 ) | |
244 | 785 { |
786 memcpy(&pParty->pPlayers[v12].pInventoryItems[v4], &pParty->pPickedItem, 0x24u); | |
787 pMouse->RemoveHoldingItem(); | |
788 break; | |
789 } | |
790 ++v12; | |
0 | 791 ++v3; |
244 | 792 } |
793 if ( v12 == 4 ) | |
794 { | |
795 v5 = pItemsTable->pItems[pParty->pPickedItem.uItemID].uSpriteID; | |
796 v6 = 0; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
797 a1.uType = pItemsTable->pItems[pParty->pPickedItem.uItemID].uSpriteID; |
244 | 798 if ( (signed int)pObjectList->uNumObjects <= 0 ) |
799 { | |
800 LOWORD(v6) = 0; | |
801 } | |
802 else | |
803 { | |
804 v7 = (char *)&pObjectList->pObjects->uObjectID; | |
805 while ( v5 != *(short *)v7 ) | |
806 { | |
807 ++v6; | |
808 v7 += 56; | |
809 if ( v6 >= (signed int)pObjectList->uNumObjects ) | |
810 { | |
811 LOWORD(v6) = 0; | |
812 break; | |
813 } | |
814 } | |
815 } | |
303 | 816 a1.field_58_pid = OBJECT_Player; |
244 | 817 a1.uObjectDescID = v6; |
818 a1.vPosition.y = pParty->vPosition.y; | |
819 a1.vPosition.x = pParty->vPosition.x; | |
820 a1.vPosition.z = pParty->sEyelevel + pParty->vPosition.z; | |
821 a1.uSoundID = 0; | |
822 a1.uFacing = 0; | |
823 a1.uAttributes = 8; | |
824 v8 = pIndoor->GetSector( | |
825 pParty->vPosition.x, | |
826 pParty->vPosition.y, | |
827 pParty->sEyelevel + pParty->vPosition.z); | |
828 a1.uSpriteFrameID = 0; | |
829 a1.uSectorID = v8; | |
830 memcpy(&a1.stru_24, &pParty->pPickedItem, sizeof(a1.stru_24)); | |
831 a1.Create(pParty->sRotationY, 184, 200, 0); | |
832 pMouse->RemoveHoldingItem(); | |
833 } | |
834 } | |
0 | 835 if ( !v11 ) |
836 { | |
837 v1->Release(); | |
838 pIcons_LOD->_40F9C5(); | |
839 } | |
840 return 1; | |
841 } | |
842 | |
843 //----- (00421D00) -------------------------------------------------------- | |
844 void __fastcall GameUI_OnPlayerPortraitLeftClick(unsigned int uPlayerID) | |
845 { | |
201 | 846 //unsigned int v1; // esi@1 |
847 //int v2; // eax@2 | |
848 //Player *v3; // ecx@2 | |
849 //Player *v4; // ecx@5 | |
0 | 850 unsigned int v5; // [sp-4h] [bp-10h]@21 |
851 | |
201 | 852 //v1 = uPlayerID; |
853 auto player = &pParty->pPlayers[uPlayerID - 1]; | |
854 if (pParty->pPickedItem.uItemID) | |
855 { | |
856 //v3 = player; | |
857 if (auto slot = player->AddItem(0xFFFFFFFFu, pParty->pPickedItem.uItemID)) | |
858 { | |
232 | 859 memcpy(&player->pInventoryItems[slot-1], &pParty->pPickedItem, 0x24u); |
201 | 860 viewparams->bRedrawGameUI = true; |
0 | 861 pMouse->RemoveHoldingItem(); |
862 return; | |
863 } | |
201 | 864 |
865 if (!player->CanAct()) | |
866 { | |
867 player = pPlayers[uActiveCharacter]; | |
868 } | |
595 | 869 if(player->CanAct() || !pPlayers[uActiveCharacter]->CanAct()) |
588 | 870 player->PlaySound(SPEECH_NoRoom, 0); |
201 | 871 } |
872 | |
588 | 873 //LABEL_9: |
201 | 874 if (pCurrentScreen == SCREEN_GAME) |
875 { | |
876 viewparams->bRedrawGameUI = true; | |
877 if ( uActiveCharacter != uPlayerID ) | |
11 | 878 //goto LABEL_27; |
879 { | |
201 | 880 if ( pPlayers[uPlayerID]->uTimeToRecovery ) |
11 | 881 return; |
201 | 882 |
883 uActiveCharacter = uPlayerID; | |
11 | 884 return; |
885 } | |
0 | 886 v5 = 7; |
11 | 887 //LABEL_22: |
0 | 888 pGUIWindow_CurrentMenu = GameUI_InitializeCharacterWindow(v5); |
889 return; | |
890 } | |
151 | 891 if ( pCurrentScreen == SCREEN_SPELL_BOOK ) |
0 | 892 return; |
151 | 893 if ( pCurrentScreen == SCREEN_CHEST ) |
0 | 894 { |
11 | 895 //LABEL_23: |
201 | 896 viewparams->bRedrawGameUI = true; |
897 if ( uActiveCharacter == uPlayerID ) | |
0 | 898 { |
899 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; | |
151 | 900 pCurrentScreen = SCREEN_F; |
11 | 901 //goto LABEL_28; |
201 | 902 uActiveCharacter = uPlayerID; |
11 | 903 return; |
904 } | |
905 //LABEL_27: | |
201 | 906 if ( pPlayers[uPlayerID]->uTimeToRecovery ) |
0 | 907 return; |
11 | 908 //goto LABEL_28; |
201 | 909 uActiveCharacter = uPlayerID; |
11 | 910 return; |
0 | 911 } |
151 | 912 if ( pCurrentScreen != SCREEN_HOUSE ) |
913 { | |
914 if ( pCurrentScreen == SCREEN_E ) | |
0 | 915 { |
11 | 916 //LABEL_28: |
201 | 917 uActiveCharacter = uPlayerID; |
0 | 918 return; |
919 } | |
151 | 920 if ( pCurrentScreen != SCREEN_F ) |
0 | 921 { |
201 | 922 viewparams->bRedrawGameUI = true; |
923 uActiveCharacter = uPlayerID; | |
0 | 924 if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 102 ) |
521 | 925 FillAwardsData(); |
0 | 926 return; |
927 } | |
11 | 928 //goto LABEL_23; |
201 | 929 viewparams->bRedrawGameUI = true; |
930 if ( uActiveCharacter == uPlayerID ) | |
11 | 931 { |
932 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; | |
151 | 933 pCurrentScreen = SCREEN_F; |
11 | 934 //goto LABEL_28; |
201 | 935 uActiveCharacter = uPlayerID; |
11 | 936 return; |
937 } | |
938 //LABEL_27: | |
201 | 939 if ( pPlayers[uPlayerID]->uTimeToRecovery ) |
11 | 940 return; |
941 //goto LABEL_28; | |
201 | 942 uActiveCharacter = uPlayerID; |
11 | 943 return; |
0 | 944 } |
336 | 945 if ( window_SpeakInHouse->field_40 == 1 ) |
0 | 946 return; |
201 | 947 viewparams->bRedrawGameUI = true; |
948 if ( uActiveCharacter != uPlayerID ) | |
11 | 949 //goto LABEL_28; |
201 | 950 uActiveCharacter = uPlayerID; |
11 | 951 return; |
749 | 952 if (dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_STANDARD || dialog_menu_id == HOUSE_DIALOGUE_SHOP_6) |
0 | 953 { |
747 | 954 __debugbreak(); // fix indexing |
0 | 955 pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] = 103; |
956 v5 = 14; | |
11 | 957 //goto LABEL_22; |
958 pGUIWindow_CurrentMenu = GameUI_InitializeCharacterWindow(v5); | |
959 return; | |
0 | 960 } |
961 } | |
962 // 4E28F8: using guessed type int pCurrentScreen; | |
963 // F8B19C: using guessed type int dword_F8B19C; | |
964 | |
965 //----- (00421EA6) -------------------------------------------------------- | |
966 void __cdecl sub_421EA6_OnInventoryLeftClick() | |
967 { | |
968 Player *v0; // ebx@1 | |
969 signed int v1; // eax@2 | |
970 signed int v2; // ecx@2 | |
971 int v3; // eax@2 | |
972 char v4; // sf@2 | |
973 int v5; // eax@2 | |
974 unsigned int v6; // eax@7 | |
975 unsigned int v7; // esi@12 | |
976 unsigned int v8; // eax@12 | |
977 unsigned int v9; // eax@16 | |
978 unsigned int v10; // eax@18 | |
979 ItemGen this_; // [sp+Ch] [bp-3Ch]@1 | |
980 POINT a2; // [sp+30h] [bp-18h]@4 | |
981 unsigned int v13; // [sp+38h] [bp-10h]@13 | |
982 unsigned int pY; // [sp+3Ch] [bp-Ch]@2 | |
983 unsigned int pX; // [sp+40h] [bp-8h]@2 | |
984 int a4; // [sp+44h] [bp-4h]@2 | |
985 | |
986 v0 = pPlayers[uActiveCharacter]; | |
501 | 987 if ( pWindowList_at_506F50_minus1_indexing_buttons____and_an_int_[0] == 103 ) |
0 | 988 { |
501 | 989 pMouse->GetClickPos(&pX, &pY); |
990 pY = pY - 17; | |
991 v2 =pX - 14; | |
992 pX = v2; | |
993 v3 = 14 * (pY >> 5); | |
994 v2 >>= 5; | |
995 v4 = v2 + v3 < 0; | |
996 v5 = v2 + v3; | |
997 a4 = v5; | |
998 if ( !v4 ) | |
0 | 999 { |
501 | 1000 if ( v5 <= 126 && pMouse->GetCursorPos(&a2)->x < 462 |
1001 && pMouse->GetCursorPos(&a2)->x >= 14 ) | |
0 | 1002 { |
501 | 1003 if ( unk_50C9A0 ) |
1004 { | |
1005 v6 = v0->GetItemIDAtInventoryIndex(&a4); | |
1006 if ( v6 ) | |
1007 { | |
1008 *((char *)pGUIWindow_Settings->ptr_1C + 8) &= 0x7Fu; | |
1009 *((short *)pGUIWindow_Settings->ptr_1C + 2) = uActiveCharacter - 1; | |
1010 *((int *)pGUIWindow_Settings->ptr_1C + 3) = v6 - 1; | |
1011 *((short *)pGUIWindow_Settings->ptr_1C + 3) = a4; | |
1012 ptr_50C9A4 = (ItemGen *)&v0->pInventoryItems[v6-1]; | |
1013 unk_50C9A0 = 0; | |
1014 if ( pMessageQueue_50CBD0->uNumMessages ) | |
1015 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
1016 pMouse->SetCursorBitmap("MICON1"); | |
1017 dword_50C9D0 = 113; | |
1018 dword_50C9D4 = 0; | |
1019 dword_50C9D8 = 256; | |
1020 } | |
1021 return; | |
1022 } | |
1023 if ( ptr_50C9A4 ) | |
1024 return; | |
1025 v7 = pParty->pPickedItem.uItemID; | |
1026 v8 = v0->GetItemIDAtInventoryIndex(&a4); | |
1027 if ( !v7 ) | |
1028 { | |
1029 if ( !v8 ) | |
1030 return; | |
1031 memcpy(&pParty->pPickedItem, &v0->pInventoryItems[v8-1], sizeof(pParty->pPickedItem)); | |
1032 v0->RemoveItemAtInventoryIndex(a4); | |
1033 v9 = pParty->pPickedItem.uItemID; | |
588 | 1034 pMouse->SetCursorBitmap(pItemsTable->pItems[v9].pIconName); |
1035 return; | |
501 | 1036 } |
1037 v13 = v8; | |
1038 if ( v8 ) | |
1039 { | |
1040 a2.y = (LONG)&v0->pInventoryItems[v8-1]; | |
1041 memcpy(&this_, (const void *)a2.y, sizeof(this_)); | |
1042 v0->RemoveItemAtInventoryIndex(a4); | |
1043 pX = v0->AddItem2(a4, &pParty->pPickedItem); | |
1044 if ( !pX ) | |
1045 { | |
1046 pX = v0->AddItem2(0xFFFFFFFFu, &pParty->pPickedItem); | |
1047 if ( !pX ) | |
1048 { | |
1049 v0->_49298B(&this_, v13 - 1, a4); | |
1050 memcpy((void *)a2.y, &this_, sizeof(ItemGen)); | |
1051 return; | |
1052 } | |
1053 } | |
1054 v9 = this_.uItemID; | |
1055 memcpy(&pParty->pPickedItem, &this_, sizeof(pParty->pPickedItem)); | |
1056 pMouse->SetCursorBitmap(pItemsTable->pItems[v9].pIconName); | |
1057 return; | |
1058 } | |
1059 v10 = v0->AddItem(a4, v7); | |
1060 pX = v10; | |
1061 if ( v10 || (v10 = v0->AddItem(0xFFFFFFFFu, pParty->pPickedItem.uItemID), (pX = v10) != 0) ) | |
1062 { | |
1063 memcpy(&v0->pInventoryItems[v10-1], &pParty->pPickedItem, 0x24u); | |
1064 pMouse->RemoveHoldingItem(); | |
1065 } | |
0 | 1066 } |
1067 } | |
1068 } | |
1069 } | |
1070 | |
1071 //----- (0042213C) -------------------------------------------------------- | |
1072 void __cdecl OnGameViewportClick() | |
1073 { | |
1074 signed int v0; // ebx@2 | |
1075 POINT *v1; // esi@3 | |
1076 signed int v2; // eax@9 | |
1077 BLVFace *v3; // eax@10 | |
1078 unsigned int v4; // eax@11 | |
1079 unsigned __int16 v5; // dx@14 | |
1080 signed int v6; // eax@14 | |
1081 char *v7; // esi@15 | |
1082 int *v8; // eax@19 | |
1083 int v9; // eax@19 | |
1084 unsigned int v10; // eax@19 | |
1085 int v11; // ecx@21 | |
1086 ODMFace *v12; // eax@22 | |
1087 LevelDecoration *v13; // esi@24 | |
1088 __int16 v14; // ax@25 | |
1089 int v15; // ecx@29 | |
1090 signed int v16; // edx@30 | |
1091 Actor *v17; // esi@30 | |
1092 int v18; // ebx@47 | |
1093 unsigned __int16 v19; // ax@50 | |
1094 const char *v20; // eax@51 | |
1095 signed int v21; // eax@58 | |
1096 ItemGen *v22; // esi@62 | |
1097 unsigned int v23; // eax@62 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
1098 SpriteObject a1; // [sp+Ch] [bp-80h]@1 |
0 | 1099 POINT v25; // [sp+7Ch] [bp-10h]@3 |
1100 POINT a2; // [sp+84h] [bp-8h]@3 | |
1101 | |
1102 if ( pRenderer->pRenderD3D ) | |
1103 { | |
1104 v0 = pGame->pVisInstance->get_picked_object_zbuf_val(); | |
1105 } | |
1106 else | |
1107 { | |
1108 v1 = pMouse->GetCursorPos(&a2); | |
1109 v0 = pRenderer->pActiveZBuffer[v1->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v25)->y]]; | |
1110 } | |
141 | 1111 if ( (v0 & 7) == OBJECT_Item) |
0 | 1112 { |
1113 a2.y = (signed int)(unsigned __int16)v0 >> 3; | |
1114 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
|
1115 if ( !(pObjectList->pObjects[pSpriteObjects[v21].uObjectDescID].uFlags & 0x10) |
0 | 1116 && a2.y < 1000 |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
1117 && pSpriteObjects[v21].uObjectDescID |
0 | 1118 && (unsigned int)v0 < 0x2000000 ) |
1119 { | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
1120 v22 = &pSpriteObjects[v21].stru_24; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
1121 v23 = pSpriteObjects[v21].stru_24.uItemID; |
0 | 1122 if ( pItemsTable->pItems[v23].uEquipType == 18 ) |
1123 { | |
377 | 1124 party_finds_gold(v22->uSpecEnchantmentType, 0); |
0 | 1125 viewparams->bRedrawGameUI = 1; |
1126 } | |
1127 else | |
1128 { | |
721 | 1129 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[v23].pUnidentifiedName); |
0 | 1130 ShowStatusBarString(pTmpBuf2, 2u); |
1131 if ( v22->uItemID == 506 ) | |
484 | 1132 _449B7E_toggle_bit(pParty->_quest_bits, 184, 1u); |
0 | 1133 if ( v22->uItemID == 455 ) |
484 | 1134 _449B7E_toggle_bit(pParty->_quest_bits, 185, 1u); |
0 | 1135 if ( !pParty->AddItem(v22) ) |
1136 pParty->SetHoldingItem(v22); | |
1137 } | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
1138 SpriteObject::OnInteraction(a2.y); |
0 | 1139 return; |
1140 } | |
588 | 1141 v4 = pParty->pPickedItem.uItemID; |
1142 if ( !pParty->pPickedItem.uItemID ) | |
1143 return; | |
1144 goto LABEL_14; | |
0 | 1145 } |
141 | 1146 if ( (v0 & 7) != OBJECT_Actor) |
1147 { | |
1148 if ( (v0 & 7) == OBJECT_Decoration) | |
0 | 1149 { |
1150 v13 = &pLevelDecorations[(signed int)(unsigned __int16)v0 >> 3]; | |
1151 if ( (signed int)(((unsigned int)v0 >> 16) - pDecorationList->pDecorations[v13->uDecorationDescID].uRadius) >= 512 ) | |
588 | 1152 { |
1153 v4 = pParty->pPickedItem.uItemID; | |
1154 if ( !pParty->pPickedItem.uItemID ) | |
1155 return; | |
1156 goto LABEL_14; | |
1157 } | |
0 | 1158 v14 = v13->field_16_event_id; |
1159 if ( !v14 ) | |
1160 { | |
1161 if ( pLevelDecorations[(signed int)(unsigned __int16)v0 >> 3].IsInteractive() ) | |
1162 { | |
1163 v15 = stru_5E4C90._decor_events[v13->_idx_in_stru123 - 75] + 380; | |
520
35f28d4c0ff9
GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents:
515
diff
changeset
|
1164 activeLevelDecoration = &pLevelDecorations[(signed int)(unsigned __int16)v0 >> 3]; |
0 | 1165 EventProcessor(v15, 0, 1); |
520
35f28d4c0ff9
GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents:
515
diff
changeset
|
1166 activeLevelDecoration = NULL; |
0 | 1167 } |
1168 return; | |
1169 } | |
1170 v11 = v14; | |
1171 } | |
1172 else | |
1173 { | |
790 | 1174 if ( (v0 & 7) != OBJECT_BModel || (signed)v0 >= 0x2000000 ) |
588 | 1175 { |
1176 v4 = pParty->pPickedItem.uItemID; | |
1177 if ( !pParty->pPickedItem.uItemID ) | |
1178 return; | |
1179 goto LABEL_14; | |
1180 } | |
0 | 1181 v2 = (signed int)(unsigned __int16)v0 >> 3; |
1182 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) | |
1183 { | |
1184 v3 = &pIndoor->pFaces[v2]; | |
1185 if ( !(v3->uAttributes & 0x2000000) ) | |
1186 { | |
1187 LABEL_11: | |
588 | 1188 v4 = pParty->pPickedItem.uItemID; |
1189 if ( !pParty->pPickedItem.uItemID ) | |
1190 { | |
1191 ShowNothingHereStatus(); | |
1192 v4 = pParty->pPickedItem.uItemID; | |
1193 if ( !pParty->pPickedItem.uItemID ) | |
1194 return; | |
1195 } | |
0 | 1196 LABEL_14: |
588 | 1197 v5 = pItemsTable->pItems[v4].uSpriteID; |
1198 v6 = 0; | |
1199 a1.uType = v5; | |
1200 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
1201 { | |
1202 LOWORD(v6) = 0; | |
1203 } | |
1204 else | |
1205 { | |
1206 v7 = (char *)&pObjectList->pObjects->uObjectID; | |
1207 while ( v5 != *(short *)v7 ) | |
1208 { | |
1209 ++v6; | |
1210 v7 += 56; | |
1211 if ( v6 >= (signed int)pObjectList->uNumObjects ) | |
1212 { | |
1213 LOWORD(v6) = 0; | |
1214 break; | |
1215 } | |
1216 } | |
1217 } | |
1218 a1.uObjectDescID = v6; | |
1219 a1.vPosition.y = pParty->vPosition.y; | |
1220 a1.field_58_pid = OBJECT_Player; | |
1221 a1.vPosition.x = pParty->vPosition.x; | |
1222 a1.vPosition.z = pParty->sEyelevel + pParty->vPosition.z; | |
1223 a1.uSoundID = 0; | |
1224 a1.uFacing = 0; | |
1225 a1.uAttributes = 8; | |
1226 a1.uSectorID = pIndoor->GetSector( | |
1227 pParty->vPosition.x, | |
1228 pParty->vPosition.y, | |
1229 pParty->sEyelevel + pParty->vPosition.z); | |
1230 a1.uSpriteFrameID = 0; | |
1231 memcpy(&a1.stru_24, &pParty->pPickedItem, 0x24u); | |
1232 v8 = (int *)pMouse->GetCursorPos(&v25); | |
1233 v9 = UnprojectX(*v8); | |
1234 a1.Create(pParty->sRotationY + v9, 184, 200, 0); | |
1235 v10 = pIcons_LOD->LoadTexture( | |
1236 pItemsTable->pItems[pParty->pPickedItem.uItemID].pIconName, | |
1237 TEXTURE_16BIT_PALETTE); | |
1238 if (v10 != -1) | |
1239 pIcons_LOD->pTextures[v10].Release(); | |
1240 pMouse->RemoveHoldingItem(); | |
1241 pIcons_LOD->_40F9C5(); | |
1242 return; | |
0 | 1243 } |
1244 v11 = pIndoor->pFaceExtras[v3->uFaceExtraID].uEventID; | |
1245 } | |
1246 else | |
1247 { | |
1248 v12 = &pOutdoor->pBModels[(signed int)(unsigned __int16)v0 >> 9].pFaces[v2 & 0x3F]; | |
1249 if ( !(v12->uAttributes & 0x2000000) ) | |
1250 goto LABEL_11; | |
1251 v11 = v12->sCogTriggeredID; | |
1252 } | |
1253 } | |
1254 EventProcessor(v11, (unsigned __int16)v0, 1); | |
1255 return; | |
1256 } | |
1257 v16 = (signed int)(unsigned __int16)v0 >> 3; | |
1258 a2.y = v16; | |
1259 v17 = &pActors[v16]; | |
1260 if ( v17->uAIState == 5 ) | |
1261 { | |
1262 if ( (unsigned int)v0 < 0x2000000 ) | |
1263 { | |
1264 stru_50C198.LootActor(&pActors[v16]); | |
1265 return; | |
1266 } | |
588 | 1267 v4 = pParty->pPickedItem.uItemID; |
1268 if ( !pParty->pPickedItem.uItemID ) | |
1269 return; | |
1270 goto LABEL_14; | |
0 | 1271 } |
1272 if ( GetAsyncKeyState(VK_SHIFT) >= 0 ) | |
1273 { | |
1274 if ( !v17->GetActorsRelation(0) && !(BYTE2(v17->uAttributes) & 8) ) | |
1275 { | |
1276 if ( (unsigned int)v0 >= 0x2000000 ) | |
588 | 1277 { |
1278 v4 = pParty->pPickedItem.uItemID; | |
1279 if ( !pParty->pPickedItem.uItemID ) | |
1280 return; | |
1281 goto LABEL_14; | |
1282 } | |
0 | 1283 if ( !v17->CanAct() ) |
1284 return; | |
1285 v18 = a2.y; | |
1286 Actor::FaceObject(a2.y, 4u, 0, 0); | |
602 | 1287 if ( !v17->sNPC_ID ) |
0 | 1288 { |
1289 v19 = pNPCStats->pGroups_copy[v17->uGroup]; | |
1290 if ( v19 ) | |
1291 { | |
1292 v20 = pNPCStats->pCatchPhrases[v19]; | |
1293 if ( v20 ) | |
1294 { | |
1295 pParty->uFlags |= 2u; | |
1296 strcpy(byte_5B0938, v20); | |
1297 sub_4451A8_press_any_key(0, 0, 0); | |
1298 } | |
1299 } | |
1300 return; | |
1301 } | |
437 | 1302 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) |
0 | 1303 return; |
1304 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)161; | |
1305 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v18; | |
1306 LABEL_42: | |
1307 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
1308 ++pMessageQueue_50CBD0->uNumMessages; | |
437 | 1309 return;*/ |
1310 pMessageQueue_50CBD0->AddMessage(UIMSG_StartNPCDialogue, v18, 0); | |
0 | 1311 return; |
1312 } | |
1313 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 3 ) | |
1314 { | |
1315 pTurnEngine->field_18 |= 8u; | |
1316 return; | |
1317 } | |
437 | 1318 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) |
0 | 1319 { |
1320 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)23; | |
1321 goto LABEL_41; | |
437 | 1322 }*/ |
1323 pMessageQueue_50CBD0->AddMessage(UIMSG_Attack, 0, 0); | |
0 | 1324 } |
1325 else | |
1326 { | |
1327 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 3 ) | |
1328 { | |
569 | 1329 pParty->uFlags |= PARTY_FLAGS_1_FALLING; |
0 | 1330 return; |
1331 } | |
1332 if ( uActiveCharacter | |
437 | 1333 && sub_427769_spell(pPlayers[uActiveCharacter]->uQuickSpell)) |
0 | 1334 { |
437 | 1335 pMessageQueue_50CBD0->AddMessage(UIMSG_19, 0, 0); |
1336 /*&& (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) | |
0 | 1337 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = (UIMessageType)25; |
1338 LABEL_41: | |
1339 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
437 | 1340 goto LABEL_42;*/ |
0 | 1341 } |
1342 } | |
1343 } | |
1344 | |
1345 //----- (004226C2) -------------------------------------------------------- | |
265 | 1346 bool PauseGameDrawing() |
0 | 1347 { |
265 | 1348 if ( pCurrentScreen != SCREEN_GAME |
151 | 1349 && pCurrentScreen != SCREEN_NPC_DIALOGUE |
1350 && pCurrentScreen != SCREEN_CHANGE_LOCATION ) | |
1351 { | |
1352 if ( pCurrentScreen == SCREEN_INPUT_BLV ) | |
0 | 1353 return pVideoPlayer->pSmackerMovie != 0; |
151 | 1354 if ( pCurrentScreen != SCREEN_BRANCHLESS_NPC_DIALOG ) |
265 | 1355 return true; |
1356 } | |
1357 return false; | |
0 | 1358 } |
1359 // 4E28F8: using guessed type int pCurrentScreen; | |
1360 | |
1361 //----- (004226EF) -------------------------------------------------------- | |
373 | 1362 void SetUserInterface(PartyAlignment align, bool bReplace) |
0 | 1363 { |
1364 unsigned int v3; // eax@7 | |
1365 unsigned __int16 v4; // dx@7 | |
1366 unsigned __int16 v5; // cx@7 | |
1367 unsigned __int16 v6; // [sp-4h] [bp-14h]@7 | |
1368 | |
373 | 1369 |
1370 if (align == PartyAlignment_Evil) | |
1371 { | |
0 | 1372 if ( bReplace ) |
1373 { | |
1374 pTexture_RightFrame->Reload("ib-r-C.pcx"); | |
1375 pTexture_BottomFrame->Reload("ib-b-C.pcx"); | |
1376 pTexture_TopFrame->Reload("ib-t-C.pcx"); | |
1377 pTexture_LeftFrame->Reload("ib-l-C.pcx"); | |
1378 pTexture_StatusBar->Reload("IB-Foot-c.pcx"); | |
1379 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_right_panel], "ib-mb-C", 2); | |
1380 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D8], "ib-autmask-c", 2); | |
1381 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079B4], "IB-COMP-C", 2); | |
1382 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D0], "IB-InitG-c", 2); | |
1383 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079C8], "IB-InitY-c", 2); | |
1384 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079CC], "IB-InitR-c", 2); | |
319 | 1385 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-C", 2); |
1386 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-C", 2); | |
1387 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-C", 2); | |
1388 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-C", 2); | |
0 | 1389 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50C98C], "IB-selec-C", 2); |
319 | 1390 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-c", 2); |
1391 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-c", 2); | |
1392 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-c", 2); | |
1393 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-c", 2); | |
569 | 1394 |
1395 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-c", 2); | |
1396 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-c", 2); | |
1397 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-c", 2); | |
1398 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-c", 2); | |
1399 | |
0 | 1400 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeC"); |
569 | 1401 pIconsFrameTable->InitializeAnimation(pUIAnim_WizardEye->uIconID); |
0 | 1402 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchC"); |
569 | 1403 pIconsFrameTable->InitializeAnimation(pUIAnum_Torchlight->uIconID); |
1404 | |
526 | 1405 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-c", 2); |
0 | 1406 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc-c", 2); |
1407 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507958], "fr_inven-c", 2); | |
1408 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Parchment], "parchment", 2); | |
1409 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B4], "cornr_ll-c", 2); | |
1410 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B0], "cornr_lr-c", 2); | |
1411 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076AC], "cornr_ul-c", 2); | |
1412 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A8], "cornr_ur-c", 2); | |
1413 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A4], "edge_btm-c", 2); | |
1414 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A0], "edge_lf-c", 2); | |
1415 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50769C], "edge_rt-c", 2); | |
1416 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507698], "edge_top-c", 2); | |
1417 pIcons_LOD->ReloadTexture(pTexture_591428, "endcap-c", 2); | |
1418 } | |
1419 else | |
1420 { | |
1421 pTexture_RightFrame->Load("ib-r-C.pcx", 0); | |
1422 pTexture_BottomFrame->Load("ib-b-c.pcx", 0); | |
1423 pTexture_TopFrame->Load("ib-t-C.pcx", 0); | |
1424 pTexture_LeftFrame->Load("ib-l-C.pcx", 0); | |
1425 pTexture_StatusBar->Load("IB-Foot-c.pcx", 0); | |
1426 uTextureID_right_panel = pIcons_LOD->LoadTexture("ib-mb-C", TEXTURE_16BIT_PALETTE); | |
1427 dword_5079D8 = pIcons_LOD->LoadTexture("ib-autmask-c", TEXTURE_16BIT_PALETTE); | |
1428 dword_5079B4 = pIcons_LOD->LoadTexture("IB-COMP-C", TEXTURE_16BIT_PALETTE); | |
1429 dword_5079D0 = pIcons_LOD->LoadTexture("IB-InitG-c", TEXTURE_16BIT_PALETTE); | |
1430 dword_5079C8 = pIcons_LOD->LoadTexture("IB-InitY-c", TEXTURE_16BIT_PALETTE); | |
1431 dword_5079CC = pIcons_LOD->LoadTexture("IB-InitR-c", TEXTURE_16BIT_PALETTE); | |
319 | 1432 uTextureID_Btn_NPCLeft = pIcons_LOD->LoadTexture("IB-NPCLD-C", TEXTURE_16BIT_PALETTE); |
1433 uTextureID_Btn_NPCRight = pIcons_LOD->LoadTexture("IB-NPCRD-C", TEXTURE_16BIT_PALETTE); | |
328 | 1434 uTextureID_Btn_ZoomIn = pIcons_LOD->LoadTexture("ib-autout-C", TEXTURE_16BIT_PALETTE); |
319 | 1435 uTextureID_Btn_ZoomOut = pIcons_LOD->LoadTexture("ib-autin-C", TEXTURE_16BIT_PALETTE); |
0 | 1436 dword_50C98C = pIcons_LOD->LoadTexture("IB-selec-C", TEXTURE_16BIT_PALETTE); |
319 | 1437 uTextureID_Btn_CastSpell = pIcons_LOD->LoadTexture("ib-m1d-c", TEXTURE_16BIT_PALETTE); |
1438 uTextureID_Btn_Rest = pIcons_LOD->LoadTexture("ib-m2d-c", TEXTURE_16BIT_PALETTE); | |
1439 uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-c", TEXTURE_16BIT_PALETTE); | |
1440 uTextureID_Btn_GameSettings = pIcons_LOD->LoadTexture("ib-m4d-c", TEXTURE_16BIT_PALETTE); | |
526 | 1441 uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-c", TEXTURE_16BIT_PALETTE); |
569 | 1442 uTextureID_PlayerBuff_Bless = pIcons_LOD->LoadTexture("isg-01-c", TEXTURE_16BIT_PALETTE); |
1443 uTextureID_PlayerBuff_Preservation = pIcons_LOD->LoadTexture("isg-02-c", TEXTURE_16BIT_PALETTE); | |
1444 uTextureID_PlayerBuff_Hammerhands = pIcons_LOD->LoadTexture("isg-03-c", TEXTURE_16BIT_PALETTE); | |
1445 uTextureID_PlayerBuff_PainReflection = pIcons_LOD->LoadTexture("isg-04-c", TEXTURE_16BIT_PALETTE); | |
0 | 1446 uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc-c", TEXTURE_16BIT_PALETTE); |
1447 uTextureID_507958 = pIcons_LOD->LoadTexture("fr_inven", TEXTURE_16BIT_PALETTE); | |
1448 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeC"); | |
1449 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
1450 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchC"); | |
1451 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
1452 } | |
1453 v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xC8u, 0, 0); | |
1454 v4 = 0; | |
1455 v6 = 0; | |
1456 v5 = 10; | |
1457 } | |
373 | 1458 else if (align == PartyAlignment_Neutral) |
0 | 1459 { |
1460 if ( bReplace ) | |
1461 { | |
1462 pTexture_RightFrame->Reload("ib-r-a.pcx"); | |
1463 pTexture_BottomFrame->Reload("ib-b-a.pcx"); | |
1464 pTexture_TopFrame->Reload("ib-t-a.pcx"); | |
1465 pTexture_LeftFrame->Reload("ib-l-a.pcx"); | |
1466 pTexture_StatusBar->Reload("IB-Foot-a.pcx"); | |
1467 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_right_panel], "ib-mb-a", 2); | |
1468 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D8], "ib-autmask-a", 2); | |
1469 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079B4], "IB-COMP-a", 2); | |
1470 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D0], "IB-InitG-a", 2); | |
1471 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079C8], "IB-InitY-a", 2); | |
1472 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079CC], "IB-InitR-a", 2); | |
319 | 1473 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-a", 2); |
1474 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-a", 2); | |
1475 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-a", 2); | |
1476 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-a", 2); | |
0 | 1477 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50C98C], "IB-selec-a", 2); |
319 | 1478 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-a", 2); |
1479 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-a", 2); | |
1480 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-a", 2); | |
1481 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-a", 2); | |
569 | 1482 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-a", 2); |
1483 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-a", 2); | |
1484 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-a", 2); | |
1485 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-a", 2); | |
0 | 1486 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeA"); |
1487 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
1488 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchA"); | |
1489 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
526 | 1490 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-a", 2); |
0 | 1491 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc", 2); |
1492 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507958], "fr_inven", 2); | |
1493 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Parchment], "parchment", 2); | |
1494 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B4], "cornr_ll", 2); | |
1495 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B0], "cornr_lr", 2); | |
1496 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076AC], "cornr_ul", 2); | |
1497 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A8], "cornr_ur", 2); | |
1498 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A4], "edge_btm", 2); | |
1499 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A0], "edge_lf", 2); | |
1500 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50769C], "edge_rt", 2); | |
1501 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507698], "edge_top", 2); | |
1502 pIcons_LOD->ReloadTexture(pTexture_591428, "endcap", 2); | |
1503 } | |
1504 else | |
1505 { | |
1506 pTexture_RightFrame->Load("ib-r-A.pcx", 0); | |
1507 pTexture_BottomFrame->Load("ib-b-A.pcx", 0); | |
1508 pTexture_TopFrame->Load("ib-t-A.pcx", 0); | |
1509 pTexture_LeftFrame->Load("ib-l-A.pcx", 0); | |
1510 pTexture_StatusBar->Load("IB-Foot-a.pcx", 0); | |
1511 uTextureID_right_panel = pIcons_LOD->LoadTexture("ib-mb-A", TEXTURE_16BIT_PALETTE); | |
1512 dword_5079D8 = pIcons_LOD->LoadTexture("ib-autmask-a", TEXTURE_16BIT_PALETTE); | |
1513 dword_5079B4 = pIcons_LOD->LoadTexture("IB-COMP-A", TEXTURE_16BIT_PALETTE); | |
1514 dword_5079D0 = pIcons_LOD->LoadTexture("IB-InitG-a", TEXTURE_16BIT_PALETTE); | |
1515 dword_5079C8 = pIcons_LOD->LoadTexture("IB-InitY-a", TEXTURE_16BIT_PALETTE); | |
1516 dword_5079CC = pIcons_LOD->LoadTexture("IB-InitR-a", TEXTURE_16BIT_PALETTE); | |
319 | 1517 uTextureID_Btn_NPCLeft = pIcons_LOD->LoadTexture("IB-NPCLD-A", TEXTURE_16BIT_PALETTE); |
1518 uTextureID_Btn_NPCRight = pIcons_LOD->LoadTexture("IB-NPCRD-A", TEXTURE_16BIT_PALETTE); | |
0 | 1519 dword_50C98C = pIcons_LOD->LoadTexture("IB-selec-A", TEXTURE_16BIT_PALETTE); |
319 | 1520 uTextureID_Btn_CastSpell = pIcons_LOD->LoadTexture("ib-m1d-a", TEXTURE_16BIT_PALETTE); |
1521 uTextureID_Btn_Rest = pIcons_LOD->LoadTexture("ib-m2d-a", TEXTURE_16BIT_PALETTE); | |
1522 uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-a", TEXTURE_16BIT_PALETTE); | |
1523 uTextureID_Btn_GameSettings = pIcons_LOD->LoadTexture("ib-m4d-a", TEXTURE_16BIT_PALETTE); | |
328 | 1524 uTextureID_Btn_ZoomIn = pIcons_LOD->LoadTexture("ib-autout-a", TEXTURE_16BIT_PALETTE); |
319 | 1525 uTextureID_Btn_ZoomOut = pIcons_LOD->LoadTexture("ib-autin-a", TEXTURE_16BIT_PALETTE); |
526 | 1526 uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-a", TEXTURE_16BIT_PALETTE); |
569 | 1527 uTextureID_PlayerBuff_Bless = pIcons_LOD->LoadTexture("isg-01-a", TEXTURE_16BIT_PALETTE); |
1528 uTextureID_PlayerBuff_Preservation = pIcons_LOD->LoadTexture("isg-02-a", TEXTURE_16BIT_PALETTE); | |
1529 uTextureID_PlayerBuff_Hammerhands = pIcons_LOD->LoadTexture("isg-03-a", TEXTURE_16BIT_PALETTE); | |
1530 uTextureID_PlayerBuff_PainReflection = pIcons_LOD->LoadTexture("isg-04-a", TEXTURE_16BIT_PALETTE); | |
0 | 1531 uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc", TEXTURE_16BIT_PALETTE); |
1532 uTextureID_507958 = pIcons_LOD->LoadTexture("fr_inven", TEXTURE_16BIT_PALETTE); | |
1533 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeA"); | |
1534 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
1535 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchA"); | |
1536 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
1537 uTextureID_Parchment = pIcons_LOD->LoadTexture("parchment", TEXTURE_16BIT_PALETTE); | |
1538 uTextureID_5076B4 = pIcons_LOD->LoadTexture("cornr_ll", TEXTURE_16BIT_PALETTE); | |
1539 uTextureID_5076B0 = pIcons_LOD->LoadTexture("cornr_lr", TEXTURE_16BIT_PALETTE); | |
1540 uTextureID_5076AC = pIcons_LOD->LoadTexture("cornr_ul", TEXTURE_16BIT_PALETTE); | |
1541 uTextureID_5076A8 = pIcons_LOD->LoadTexture("cornr_ur", TEXTURE_16BIT_PALETTE); | |
1542 uTextureID_5076A4 = pIcons_LOD->LoadTexture("edge_btm", TEXTURE_16BIT_PALETTE); | |
1543 uTextureID_5076A0 = pIcons_LOD->LoadTexture("edge_lf", TEXTURE_16BIT_PALETTE); | |
1544 uTextureID_50769C = pIcons_LOD->LoadTexture("edge_rt", TEXTURE_16BIT_PALETTE); | |
1545 uTextureID_507698 = pIcons_LOD->LoadTexture("edge_top", TEXTURE_16BIT_PALETTE); | |
1546 pTexture_591428 = &pIcons_LOD->pTextures[pIcons_LOD->LoadTexture("endcap", TEXTURE_16BIT_PALETTE)]; | |
1547 | |
1548 } | |
1549 v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0xAu, 0, 0); | |
1550 v4 = 214; | |
1551 v5 = 230; | |
1552 v6 = 193; | |
1553 } | |
373 | 1554 else if (align == PartyAlignment_Good) |
0 | 1555 { |
1556 if ( bReplace ) | |
1557 { | |
1558 pTexture_RightFrame->Reload("ib-r-B.pcx"); | |
1559 pTexture_BottomFrame->Reload("ib-b-B.pcx"); | |
1560 pTexture_TopFrame->Reload("ib-t-B.pcx"); | |
1561 pTexture_LeftFrame->Reload("ib-l-B.pcx"); | |
1562 pTexture_StatusBar->Reload("IB-Foot-b.pcx"); | |
1563 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_right_panel], "ib-mb-B", 2); | |
1564 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D8], "ib-autmask-b", 2); | |
1565 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079B4], "IB-COMP-B", 2); | |
1566 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D0], "IB-InitG-b", 2); | |
1567 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079C8], "IB-InitY-b", 2); | |
1568 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079CC], "IB-InitR-b", 2); | |
319 | 1569 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-B", 2); |
1570 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-B", 2); | |
1571 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-B", 2); | |
1572 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-B", 2); | |
0 | 1573 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_50C98C], "IB-selec-B", 2); |
319 | 1574 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-b", 2); |
1575 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-b", 2); | |
1576 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-b", 2); | |
1577 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-b", 2); | |
569 | 1578 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-b", 2); |
1579 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-b", 2); | |
1580 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-b", 2); | |
1581 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-b", 2); | |
0 | 1582 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeB"); |
1583 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
1584 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchB"); | |
1585 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
526 | 1586 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-b", 2); |
0 | 1587 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc-b", 2); |
1588 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507958], "fr_inven-b", 2); | |
1589 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Parchment], "parchment", 2); | |
1590 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B4], "cornr_ll-b", 2); | |
1591 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B0], "cornr_lr-b", 2); | |
1592 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076AC], "cornr_ul-b", 2); | |
1593 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A8], "cornr_ur-b", 2); | |
1594 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A4], "edge_btm-b", 2); | |
1595 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A0], "edge_lf-b", 2); | |
1596 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50769C], "edge_rt-b", 2); | |
1597 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507698], "edge_top-b", 2); | |
1598 pIcons_LOD->ReloadTexture(pTexture_591428, "endcap-b", 2); | |
1599 } | |
1600 v3 = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(0, 0, 0xC8u); | |
1601 v5 = 255; | |
1602 v4 = 225; | |
1603 v6 = 255; | |
1604 } | |
373 | 1605 else assert(false); |
1606 | |
0 | 1607 uGameUIFontMain = v3; |
1608 uGameUIFontShadow = GenerateColorAsCloseAsPossibleToR8G8B8InTargetFormat(v5, v4, v6); | |
1609 } | |
1610 | |
1611 //----- (00423AEE) -------------------------------------------------------- | |
1612 void __cdecl reset_some_strus_flt_2Cs() | |
1613 { | |
1614 float *v0; // eax@1 | |
1615 signed int v1; // ecx@1 | |
1616 signed int v2; // edx@1 | |
1617 float *v3; // eax@3 | |
1618 signed int v4; // edx@3 | |
1619 float *v5; // eax@5 | |
1620 signed int v6; // edx@5 | |
1621 float *v7; // eax@7 | |
1622 signed int v8; // edx@7 | |
1623 float *v9; // eax@9 | |
1624 | |
1625 v0 = &array_50AC10[0].flt_2C; | |
1626 v1 = 50; | |
1627 v2 = 50; | |
1628 do | |
1629 { | |
1630 *v0 = 0.0; | |
1631 v0 += 12; | |
1632 --v2; | |
1633 } | |
1634 while ( v2 ); | |
1635 v3 = &array_50A2B0[0].flt_2C; | |
1636 v4 = 50; | |
1637 do | |
1638 { | |
1639 *v3 = 0.0; | |
1640 v3 += 12; | |
1641 --v4; | |
1642 } | |
1643 while ( v4 ); | |
1644 v5 = &array_509950[0].flt_2C; | |
1645 v6 = 50; | |
1646 do | |
1647 { | |
1648 *v5 = 0.0; | |
1649 v5 += 12; | |
1650 --v6; | |
1651 } | |
1652 while ( v6 ); | |
1653 v7 = &array_508FF0[0].flt_2C; | |
1654 v8 = 50; | |
1655 do | |
1656 { | |
1657 *v7 = 0.0; | |
1658 v7 += 12; | |
1659 --v8; | |
1660 } | |
1661 while ( v8 ); | |
1662 v9 = &array_508690[0].flt_2C; | |
1663 do | |
1664 { | |
1665 *v9 = 0.0; | |
1666 v9 += 12; | |
1667 --v1; | |
1668 } | |
1669 while ( v1 ); | |
1670 } | |
1671 | |
1672 //----- (00423B4A) -------------------------------------------------------- | |
1673 void __cdecl sub_423B4A() | |
1674 { | |
1675 float *v0; // eax@1 | |
1676 signed int v1; // ecx@1 | |
1677 | |
1678 v0 = &array_507D30[0].flt_2C; | |
1679 v1 = 50; | |
1680 do | |
1681 { | |
1682 *v0 = 0.0; | |
1683 v0 += 12; | |
1684 --v1; | |
1685 } | |
1686 while ( v1 ); | |
1687 } | |
1688 | |
1689 //----- (00423B5D) -------------------------------------------------------- | |
1690 int __fastcall sub_423B5D(unsigned int uFaceID) | |
1691 { | |
1692 BLVFace *v1; // ebx@1 | |
1693 Vec3_short_ *v2; // esi@1 | |
1694 //int v3; // ST28_4@1 | |
1695 __int16 v4; // ST2C_2@1 | |
1696 //signed int v5; // esi@1 | |
1697 //Vec3_short_ *v6; // eax@4 | |
1698 //signed int v7; // edi@5 | |
1699 //signed int v8; // eax@5 | |
1700 //signed int i_; // ecx@10 | |
1701 int v10; // eax@10 | |
1702 int v11; // edx@11 | |
1703 int v12; // ST28_4@12 | |
1704 signed int v13; // edx@12 | |
1705 signed __int64 v14; // qtt@12 | |
1706 int *v15; // ebx@12 | |
1707 int v16; // ST28_4@14 | |
1708 signed int v17; // eax@14 | |
1709 signed __int64 v18; // qtt@14 | |
1710 signed int v19; // edx@15 | |
1711 signed int v20; // edx@17 | |
1712 signed int v21; // ebx@19 | |
1713 signed int v22; // esi@20 | |
1714 int v23; // edi@21 | |
1715 int v24; // eax@21 | |
1716 int v25; // eax@22 | |
1717 int v26; // eax@22 | |
1718 signed int v27; // ST30_4@24 | |
1719 signed __int64 v28; // qtt@24 | |
1720 int v29; // ST18_4@25 | |
1721 int v30; // eax@26 | |
1722 int v31; // eax@27 | |
1723 int v32; // eax@27 | |
1724 signed int v33; // ST30_4@29 | |
1725 signed __int64 v34; // qtt@29 | |
1726 int v35; // ST30_4@30 | |
1727 signed int v36; // edi@31 | |
1728 unsigned int v37; // eax@31 | |
1729 bool v38; // edx@31 | |
1730 int v39; // ecx@31 | |
1731 int v40; // ecx@32 | |
1732 int v41; // esi@32 | |
1733 int v42; // eax@34 | |
1734 signed int v43; // ebx@41 | |
1735 unsigned int v44; // eax@41 | |
1736 signed int v45; // ecx@42 | |
1737 int v46; // esi@42 | |
1738 int v47; // eax@44 | |
1739 signed int v48; // edi@51 | |
1740 unsigned int v49; // eax@51 | |
1741 bool v50; // edx@51 | |
1742 int v51; // ecx@51 | |
1743 int v52; // ecx@52 | |
1744 signed int v53; // esi@52 | |
1745 int v54; // eax@54 | |
1746 int v55; // ebx@61 | |
1747 unsigned int v56; // eax@61 | |
1748 signed int v57; // ecx@62 | |
1749 int v58; // esi@62 | |
1750 int v59; // eax@64 | |
1751 char v61; // zf@72 | |
1752 signed int v62; // edx@75 | |
1753 int v63; // ecx@76 | |
1754 int v64; // esi@76 | |
1755 int v65; // ecx@83 | |
1756 //signed int v66; // [sp+14h] [bp-14h]@3 | |
1757 int v67; // [sp+14h] [bp-14h]@34 | |
1758 int v68; // [sp+14h] [bp-14h]@44 | |
1759 int v69; // [sp+14h] [bp-14h]@54 | |
1760 int v70; // [sp+14h] [bp-14h]@64 | |
1761 signed int v71; // [sp+14h] [bp-14h]@75 | |
1762 bool thisa; // [sp+18h] [bp-10h]@9 | |
1763 int thisb; // [sp+18h] [bp-10h]@12 | |
1764 int thisc; // [sp+18h] [bp-10h]@20 | |
1765 bool thisd; // [sp+18h] [bp-10h]@41 | |
1766 bool thise; // [sp+18h] [bp-10h]@61 | |
1767 int thisf; // [sp+18h] [bp-10h]@74 | |
1768 signed int v79; // [sp+1Ch] [bp-Ch]@9 | |
1769 int v80; // [sp+1Ch] [bp-Ch]@76 | |
1770 bool v81; // [sp+20h] [bp-8h]@10 | |
1771 bool v82; // [sp+20h] [bp-8h]@32 | |
1772 bool v83; // [sp+20h] [bp-8h]@42 | |
1773 bool v84; // [sp+20h] [bp-8h]@52 | |
1774 bool v85; // [sp+20h] [bp-8h]@62 | |
1775 //signed int i; // [sp+24h] [bp-4h]@9 | |
1776 signed int ia; // [sp+24h] [bp-4h]@19 | |
1777 signed int ib; // [sp+24h] [bp-4h]@31 | |
1778 signed int ic; // [sp+24h] [bp-4h]@41 | |
1779 signed int id; // [sp+24h] [bp-4h]@51 | |
1780 signed int ie; // [sp+24h] [bp-4h]@61 | |
1781 | |
1782 v1 = &pIndoor->pFaces[uFaceID]; | |
1783 //this = pGame->pIndoorCameraD3D; | |
1784 v2 = &pIndoor->pVertices[v1->pVertexIDs[0]]; | |
1785 //v3 = *(_DWORD *)&v2->x; | |
1786 v4 = v2->z; | |
1787 //v5 = 0; | |
1788 if ( v1->pFacePlane_old.vNormal.x * (v2->x - pBLVRenderParams->vPartyPos.x) | |
1789 + v1->pFacePlane_old.vNormal.y * (v2->y - pBLVRenderParams->vPartyPos.y) | |
1790 + v1->pFacePlane_old.vNormal.z * (v2->z - pBLVRenderParams->vPartyPos.z) < 0 ) | |
1791 { | |
1792 dword_50B700 = 1; | |
1793 } | |
1794 else | |
1795 { | |
1796 dword_50B700 = 0; | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
1797 if ( !v1->Portal() ) |
0 | 1798 return 0; |
1799 } | |
1800 //v66 = v1->uNumVertices; | |
1801 for (uint i = 0; i < v1->uNumVertices; ++i) | |
1802 { | |
1803 auto v6 = &pIndoor->pVertices[v1->pVertexIDs[i]]; | |
1804 pGame->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible( | |
1805 v6->x, | |
1806 v6->y, | |
1807 v6->z, | |
1808 &_50B924_view_transformed_xs[i], | |
1809 &_50B834_view_transformed_zs[i], | |
1810 &_50B744_view_transformed_ys[i], | |
1811 0); | |
1812 } | |
1813 | |
1814 //v7 = v1->uNumVertices; | |
1815 //v8 = 0; | |
1816 if (v1->uNumVertices <= 0) | |
1817 return 0; | |
1818 | |
1819 bool bFound = false; | |
1820 for (uint i = 0; i < v1->uNumVertices; ++i) | |
1821 if (_50B924_view_transformed_xs[i] >= 0x80000u) | |
1822 { | |
1823 bFound = true; | |
1824 break; | |
1825 } | |
1826 if (!bFound) | |
1827 return 0; | |
1828 | |
1829 v79 = 0; | |
1830 _50B924_view_transformed_xs[v1->uNumVertices] = _50B924_view_transformed_xs[0]; | |
1831 _50B834_view_transformed_zs[v1->uNumVertices] = _50B834_view_transformed_zs[0]; | |
1832 _50B744_view_transformed_ys[v1->uNumVertices] = _50B744_view_transformed_ys[0]; | |
564 | 1833 thisa = _50B924_view_transformed_xs[0] >= (signed int)0x80000u; |
0 | 1834 //int i = 1; |
561 | 1835 for (uint i = 1; i <= v1->uNumVertices; ++i) |
0 | 1836 { |
1837 v10 = _50B924_view_transformed_xs[i]; | |
1838 v81 = v10 >= (signed int)0x80000u; | |
1839 if ( thisa ^ v81 ) | |
1840 { | |
1841 v11 = _50B924_view_transformed_xs[i - 1]; | |
1842 if ( v10 >= (signed int)0x80000u ) | |
1843 { | |
1844 v12 = v10 - v11; | |
1845 v13 = 0x80000 - v11; | |
1846 LODWORD(v14) = v13 << 16; | |
1847 HIDWORD(v14) = v13 >> 16; | |
1848 v15 = &_50B744_view_transformed_ys[i - 1]; | |
486 | 1849 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 | 1850 thisb = (unsigned __int64)((_50B744_view_transformed_ys[i] - _50B744_view_transformed_ys[i - 1]) * v14 / v12) >> 16; |
1851 } | |
1852 else | |
1853 { | |
1854 v16 = v11 - v10; | |
1855 v17 = 0x80000 - v10; | |
1856 LODWORD(v18) = v17 << 16; | |
1857 HIDWORD(v18) = v17 >> 16; | |
1858 v15 = &_50B744_view_transformed_ys[i]; | |
108 | 1859 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 | 1860 thisb = (unsigned __int64)((_50B744_view_transformed_ys[i - 1] - _50B744_view_transformed_ys[i]) * v18 / v16) >> 16; |
1861 } | |
1862 v19 = v79++; | |
1863 //v7 = v66; | |
1864 dword_50B738[v19] = thisb + *v15; | |
1865 dword_50B918[v19] = 0x80000u; | |
1866 } | |
1867 if ( v81 ) | |
1868 { | |
1869 v20 = v79++; | |
1870 dword_50B918[v20] = _50B924_view_transformed_xs[i]; | |
1871 dword_50B828[v20] = _50B834_view_transformed_zs[i]; | |
1872 dword_50B738[v20] = _50B744_view_transformed_ys[i]; | |
1873 } | |
1874 //++i; | |
1875 thisa = v81; | |
1876 } | |
1877 v21 = v79; | |
1878 dword_50B918[v79] = dword_50B918[0]; | |
1879 dword_50B828[v79] = dword_50B828[0]; | |
561 | 1880 dword_50B738[v79] = dword_50B738[0]; |
1881 for (ia = 0; ia < v79; ++ia) | |
0 | 1882 { |
1883 v22 = ia; | |
1884 thisc = abs(dword_50B918[ia]); | |
1885 if ( abs(dword_50B828[ia]) >> 13 <= thisc ) | |
1886 { | |
1887 v27 = dword_50B828[v22]; | |
1888 LODWORD(v28) = v27 << 16; | |
1889 HIDWORD(v28) = v27 >> 16; | |
1890 v26 = v28 / dword_50B918[v22]; | |
1891 v23 = 0; | |
1892 } | |
1893 else | |
1894 { | |
1895 v23 = 0; | |
1896 v24 = 0; | |
1897 if ( dword_50B828[v22] >= 0 ) | |
1898 { | |
1899 LOBYTE(v24) = dword_50B918[v22] >= 0; | |
1900 v26 = ((v24 - 1) & 0xFF800000) + 0x400000; | |
1901 } | |
1902 else | |
1903 { | |
1904 LOBYTE(v24) = dword_50B918[v22] >= 0; | |
1905 v25 = v24 - 1; | |
1906 v26 = (v25 & 0x800000) - 0x400000; | |
1907 } | |
1908 } | |
1909 v29 = dword_50B738[v22]; | |
561 | 1910 dword_50BAF8_xs[v22] = v26; |
0 | 1911 if ( abs(v29) >> 13 <= thisc ) |
1912 { | |
1913 v33 = dword_50B738[v22]; | |
1914 LODWORD(v34) = v33 << 16; | |
1915 HIDWORD(v34) = v33 >> 16; | |
1916 v32 = v34 / dword_50B918[v22]; | |
1917 } | |
1918 else | |
1919 { | |
1920 v30 = 0; | |
1921 if ( dword_50B738[v22] >= v23 ) | |
1922 { | |
1923 LOBYTE(v30) = dword_50B918[v22] >= v23; | |
1924 v32 = ((v30 - 1) & 0xFF800000) + 0x400000; | |
1925 } | |
1926 else | |
1927 { | |
1928 LOBYTE(v30) = dword_50B918[v22] >= v23; | |
1929 v31 = v30 - 1; | |
1930 v32 = (v31 & 0x800000) - 0x400000; | |
1931 } | |
1932 } | |
561 | 1933 dword_50BA08_ys[v22] = v32; |
1934 dword_50BAF8_xs[v22] = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) * (signed __int64)dword_50BAF8_xs[v22]) >> 16; | |
1935 v35 = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) * (signed __int64)dword_50BA08_ys[v22]) >> 16; | |
1936 dword_50BAF8_xs[v22] = pBLVRenderParams->uViewportCenterX - dword_50BAF8_xs[v22]; | |
1937 dword_50BA08_ys[v22] = pBLVRenderParams->uViewportCenterY - v35; | |
0 | 1938 } |
1939 v36 = 0; | |
561 | 1940 dword_50BAF8_xs[v21] = dword_50BAF8_xs[0]; |
1941 dword_50BA08_ys[v21] = dword_50BA08_ys[0]; | |
0 | 1942 v37 = pBLVRenderParams->uViewportX; |
561 | 1943 v38 = dword_50BAF8_xs[0] < (signed int)pBLVRenderParams->uViewportX; |
1944 LOBYTE(v38) = dword_50BAF8_xs[0] >= (signed int)pBLVRenderParams->uViewportX; | |
0 | 1945 v39 = 1; |
1946 ib = 1; | |
1947 if ( v79 < 1 ) | |
1948 return 0; | |
1949 do | |
1950 { | |
1951 v40 = v39; | |
561 | 1952 v41 = dword_50BAF8_xs[v40]; |
0 | 1953 v82 = v41 >= (signed int)v37; |
1954 if ( v38 ^ v82 ) | |
1955 { | |
1956 if ( v41 >= (signed int)v37 ) | |
1957 { | |
561 | 1958 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]); |
1959 v42 = dword_50BA08_ys[v40 - 1]; | |
0 | 1960 } |
1961 else | |
1962 { | |
561 | 1963 v67 = (signed int)(v37 - v41) * (signed __int64)(dword_50BA08_ys[v40 - 1] - dword_50BA08_ys[v40]) / (dword_50BAF8_xs[v40 - 1] - v41); |
1964 v42 = dword_50BA08_ys[v40]; | |
0 | 1965 } |
561 | 1966 dword_50B9FC_ys[v36] = v67 + v42; |
1967 v37 = pBLVRenderParams->uViewportX; | |
1968 dword_50BAEC_xs[v36] = pBLVRenderParams->uViewportX; | |
0 | 1969 ++v36; |
1970 } | |
1971 v38 = v82; | |
1972 if ( v82 ) | |
1973 { | |
561 | 1974 dword_50BAEC_xs[v36] = dword_50BAF8_xs[v40]; |
1975 dword_50B9FC_ys[v36] = dword_50BA08_ys[v40]; | |
1976 ++v36; | |
0 | 1977 } |
1978 v39 = ib++ + 1; | |
1979 } | |
1980 while ( ib <= v79 ); | |
1981 | |
486 | 1982 if (v36 < 1) |
0 | 1983 return 0; |
1984 | |
486 | 1985 v43 = 0; |
561 | 1986 dword_50BAEC_xs[v36] = dword_50BAEC_xs[0]; |
1987 dword_50B9FC_ys[v36] = dword_50B9FC_ys[0]; | |
486 | 1988 v44 = pBLVRenderParams->uViewportZ; |
561 | 1989 thisd = dword_50BAEC_xs[0] <= (signed int)pBLVRenderParams->uViewportZ; |
486 | 1990 ic = 1; |
1991 | |
0 | 1992 do |
1993 { | |
1994 v45 = ic; | |
561 | 1995 v46 = dword_50BAEC_xs[ic]; |
0 | 1996 v83 = v46 <= (signed int)v44; |
1997 if ( thisd ^ v83 ) | |
1998 { | |
1999 if ( v46 <= (signed int)v44 ) | |
2000 { | |
561 | 2001 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]); |
2002 v47 = dword_50B9FC_ys[v45 - 1]; | |
0 | 2003 } |
2004 else | |
2005 { | |
561 | 2006 v68 = (signed int)(v44 - v46) * (signed __int64)(dword_50B9FC_ys[v45 - 1] - dword_50B9FC_ys[v45]) / (dword_50BAEC_xs[v45 - 1] - v46); |
2007 v47 = dword_50B9FC_ys[v45]; | |
0 | 2008 } |
561 | 2009 dword_50B9F0[v43] = v68 + v47; |
2010 v44 = pBLVRenderParams->uViewportZ; | |
2011 dword_50BAE0[v43] = pBLVRenderParams->uViewportZ; | |
0 | 2012 ++v43; |
2013 } | |
2014 if ( v83 ) | |
2015 { | |
561 | 2016 dword_50BAE0[v43] = dword_50BAEC_xs[v45]; |
2017 dword_50B9F0[v43++] = dword_50B9FC_ys[v45]; | |
0 | 2018 } |
2019 ++ic; | |
2020 thisd = v83; | |
2021 } | |
2022 while ( ic <= v36 ); | |
486 | 2023 |
2024 if (v43 < 1) | |
0 | 2025 return 0; |
486 | 2026 |
2027 v48 = 0; | |
2028 dword_50BAE0[v43] = dword_50BAE0[0]; | |
2029 dword_50B9F0[v43] = dword_50B9F0[0]; | |
2030 v49 = pBLVRenderParams->uViewportY; | |
2031 v50 = dword_50B9F0[0] < (signed int)pBLVRenderParams->uViewportY; | |
2032 LOBYTE(v50) = dword_50B9F0[0] >= (signed int)pBLVRenderParams->uViewportY; | |
2033 v51 = 1; | |
2034 id = 1; | |
0 | 2035 do |
2036 { | |
2037 v52 = v51; | |
2038 v53 = dword_50B9F0[v52]; | |
2039 v84 = v53 >= (signed int)v49; | |
2040 if ( v50 ^ v84 ) | |
2041 { | |
2042 if ( v53 >= (signed int)v49 ) | |
2043 { | |
561 | 2044 v69 = (signed int)(v49 - dword_50B9F0[v52 - 1]) * (signed __int64)(dword_50BAE0[v52] - dword_50BAE0[v52 - 1]) / (v53 - dword_50B9F0[v52 - 1]); |
2045 v54 = dword_50BAE0[v52 - 1]; | |
0 | 2046 } |
2047 else | |
2048 { | |
561 | 2049 v69 = (signed int)(v49 - v53) * (signed __int64)(dword_50BAE0[v52 - 1] - dword_50BAE0[v52]) / (dword_50B9F0[v52 - 1] - v53); |
0 | 2050 v54 = dword_50BAE0[v52]; |
2051 } | |
561 | 2052 dword_50BAD4[v48] = v69 + v54; |
2053 v49 = pBLVRenderParams->uViewportY; | |
2054 dword_50B9E4[v48] = pBLVRenderParams->uViewportY; | |
0 | 2055 ++v48; |
2056 } | |
2057 v50 = v84; | |
2058 if ( v84 ) | |
2059 { | |
2060 dword_50BAD4[v48] = dword_50BAE0[v52]; | |
561 | 2061 dword_50B9E4[v48++] = dword_50B9F0[v52]; |
0 | 2062 } |
2063 v51 = id++ + 1; | |
2064 } | |
2065 while ( id <= v43 ); | |
486 | 2066 |
2067 if (v48 < 1) | |
0 | 2068 return 0; |
486 | 2069 |
2070 v55 = 0; | |
2071 dword_50BAD4[v48] = dword_50BAD4[0]; | |
561 | 2072 dword_50B9E4[v48] = dword_50B9E4[0]; |
486 | 2073 v56 = pBLVRenderParams->uViewportW; |
561 | 2074 thise = dword_50B9E4[0] <= (signed int)pBLVRenderParams->uViewportW; |
486 | 2075 ie = 1; |
0 | 2076 do |
2077 { | |
2078 v57 = ie; | |
561 | 2079 v58 = dword_50B9E4[ie]; |
0 | 2080 v85 = v58 <= (signed int)v56; |
2081 if ( thise ^ v85 ) | |
2082 { | |
2083 if ( v58 <= (signed int)v56 ) | |
2084 { | |
561 | 2085 v70 = (signed int)(v56 - dword_50B9E4[v57 - 1]) * (signed __int64)(dword_50BAD4[v57] - dword_50BAD4[v57 - 1]) / (v58 - dword_50B9E4[v57 - 1]); |
2086 v59 = dword_50BAD4[v57 - 1]; | |
0 | 2087 } |
2088 else | |
2089 { | |
561 | 2090 v70 = (signed int)(v56 - v58) * (signed __int64)(dword_50BAD4[v57 - 1] - dword_50BAD4[v57]) / (dword_50B9E4[v57 - 1] - v58); |
0 | 2091 v59 = dword_50BAD4[v57]; |
2092 } | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2093 _50BAC8_screen_space_x[v55] = v70 + v59; |
561 | 2094 v56 = pBLVRenderParams->uViewportW; |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2095 _50B9D8_screen_space_y[v55] = pBLVRenderParams->uViewportW; |
0 | 2096 ++v55; |
2097 } | |
2098 if ( v85 ) | |
2099 { | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2100 _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
|
2101 _50B9D8_screen_space_y[v55++] = dword_50B9E4[v57]; |
0 | 2102 } |
2103 ++ie; | |
2104 thise = v85; | |
2105 } | |
2106 while ( ie <= v48 ); | |
486 | 2107 |
0 | 2108 if ( !v55 ) |
2109 return 0; | |
2110 v61 = pRenderer->pRenderD3D == 0; | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2111 _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
|
2112 _50B9D8_screen_space_y[v55] = _50B9D8_screen_space_y[0]; |
0 | 2113 if ( v61 && v55 > 3 ) |
2114 { | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2115 _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
|
2116 _50B9D8_screen_space_y[v55 + 1] = _50B9D8_screen_space_y[1]; |
0 | 2117 thisf = 2 * (dword_50B700 != 0) - 1; |
2118 if ( v55 > 0 ) | |
2119 { | |
2120 v62 = 1; | |
2121 v71 = 1; | |
2122 do | |
2123 { | |
2124 v63 = v62 - 1; | |
2125 v64 = v62 + 1; | |
2126 v80 = v62 + 1; | |
2127 if ( v62 - 1 >= v55 ) | |
2128 v63 -= v55; | |
2129 if ( v62 >= v55 ) | |
2130 v62 -= v55; | |
2131 if ( v64 >= v55 ) | |
2132 v64 -= v55; | |
2133 if ( thisf | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2134 * ((_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
|
2135 - (_50B9D8_screen_space_y[v62] - _50B9D8_screen_space_y[v63]) * (_50BAC8_screen_space_x[v64] - _50BAC8_screen_space_x[v63])) < 0 ) |
0 | 2136 { |
2137 v62 = v80; | |
2138 v71 = v80; | |
2139 } | |
2140 else | |
2141 { | |
2142 v62 = v71; | |
2143 v65 = v71; | |
2144 if ( v71 < v55 || (v65 = v71 - v55, v71 - v55 < v55) ) | |
2145 { | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2146 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
|
2147 memcpy(&_50BAC8_screen_space_x[v65], &_50BAC8_screen_space_x[v65 + 1], 4 * ((unsigned int)(4 * (v55 - v65)) >> 2)); |
0 | 2148 } |
2149 --v55; | |
2150 } | |
2151 } | |
2152 while ( v62 - 1 < v55 ); | |
2153 } | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2154 _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
|
2155 _50B9D8_screen_space_y[v55] = _50B9D8_screen_space_y[0]; |
0 | 2156 } |
2157 return v55; | |
2158 } | |
2159 | |
2160 //----- (00424579) -------------------------------------------------------- | |
2161 int __fastcall sub_424579(int uFaceID, stru320 *a2) | |
2162 { | |
2163 __debugbreak(); | |
2164 return 0; | |
2165 /*BLVFace *v2; // eax@1 | |
2166 Vec3_short_ *v3; // ebx@1 | |
2167 Vec3_short_ *v4; // esi@1 | |
2168 unsigned int v5; // esi@3 | |
2169 int v7; // ST1C_4@5 | |
2170 int v8; // ST1C_4@5 | |
2171 int v9; // ST1C_4@5 | |
2172 int v10; // ST1C_4@5 | |
2173 int v11; // esi@5 | |
2174 int v12; // ST1C_4@5 | |
2175 unsigned int v15; // ecx@8 | |
2176 unsigned int v19; // ecx@13 | |
2177 signed int v20; // ecx@16 | |
2178 signed int result; // eax@20 | |
2179 signed int v24; // edx@22 | |
2180 unsigned int v25; // [sp+Ch] [bp-1Ch]@3 | |
2181 float v26; // [sp+14h] [bp-14h]@3 | |
2182 float v27; // [sp+1Ch] [bp-Ch]@3 | |
2183 float v28; // [sp+20h] [bp-8h]@3 | |
2184 signed int v29; // [sp+24h] [bp-4h]@3 | |
2185 | |
2186 v2 = &pIndoor->pFaces[uFaceID]; | |
2187 v3 = pIndoor->pVertices; | |
2188 v4 = &pIndoor->pVertices[*v2->pVertexIDs]; | |
2189 if ( v2->pFacePlane_old.vNormal.x * ((signed __int16)*(int *)&v4->x - pBLVRenderParams->vPartyPos.x) | |
2190 + v2->pFacePlane_old.vNormal.y * ((signed __int16)(*(int *)&v4->x >> 16) - pBLVRenderParams->vPartyPos.y) | |
2191 + v2->pFacePlane_old.vNormal.z * (v4->z - pBLVRenderParams->vPartyPos.z) < 0 ) | |
2192 { | |
2193 dword_50B700 = 1; | |
2194 } | |
2195 else | |
2196 { | |
2197 dword_50B700 = 0; | |
2198 if ( !(v2->uAttributes & 1) ) | |
2199 return 0; | |
2200 } | |
2201 v29 = 0; | |
2202 v5 = v2->uNumVertices; | |
2203 __asm { fld pBLVRenderParams->fCosineY } | |
2204 v28 = pBLVRenderParams->fSineY; | |
2205 v26 = pBLVRenderParams->fCosineNegX; | |
2206 v27 = pBLVRenderParams->fSineNegX; | |
2207 v25 = v5; | |
2208 if ( (signed int)v5 > 0 ) | |
2209 { | |
2210 _ECX = (char *)&array_50AC10[0].vWorldPosition.z; | |
2211 do | |
2212 { | |
2213 v7 = v3[v2->pVertexIDs[v29]].x; | |
2214 __asm | |
2215 { | |
2216 fild [ebp+var_10] | |
2217 fstp dword ptr [ecx-8] | |
2218 } | |
2219 v8 = v3[v2->pVertexIDs[v29]].y; | |
2220 __asm | |
2221 { | |
2222 fild [ebp+var_10] | |
2223 fstp dword ptr [ecx-4] | |
2224 } | |
2225 v9 = v3[v2->pVertexIDs[v29]].z; | |
2226 __asm | |
2227 { | |
2228 fild [ebp+var_10] | |
2229 fstp dword ptr [ecx] | |
2230 } | |
2231 _ECX += 48; | |
2232 v10 = a2->pDeltaUV[0] + v2->pVertexUIDs[v29]; | |
2233 __asm | |
2234 { | |
2235 fild [ebp+var_10] | |
2236 fstp dword ptr [ecx-14h] | |
2237 } | |
2238 v11 = a2->pDeltaUV[1] + v2->pVertexVIDs[v29++]; | |
2239 v12 = v11; | |
2240 v5 = v25; | |
2241 __asm | |
2242 { | |
2243 fild [ebp+var_10] | |
2244 fstp dword ptr [ecx-10h] | |
2245 } | |
2246 } | |
2247 while ( v29 < (signed int)v25 ); | |
2248 } | |
2249 _EDX = (char *)&array_50AC10[0].vWorldViewPosition; | |
2250 if ( pBLVRenderParams->sPartyRotX ) | |
2251 { | |
2252 if ( (signed int)v5 > 0 ) | |
2253 { | |
2254 __asm | |
2255 { | |
2256 fild pBLVRenderParams->vPartyPos.x | |
2257 fild pBLVRenderParams->vPartyPos.y | |
2258 fild pBLVRenderParams->vPartyPos.z | |
2259 } | |
2260 _EAX = (char *)&array_50AC10[0].vWorldPosition.z; | |
2261 v15 = v5; | |
2262 do | |
2263 { | |
2264 __asm | |
2265 { | |
2266 fld dword ptr [eax-8] | |
2267 fsub st, st(3) | |
2268 fld dword ptr [eax-4] | |
2269 fsub st, st(3) | |
2270 fld st(1) | |
2271 fmul st, st(6) | |
2272 fld st(1) | |
2273 fmul [ebp+var_8] | |
2274 fsubp st(1), st | |
2275 fstp [ebp+var_4] | |
2276 fld dword ptr [eax] | |
2277 fsub st, st(3) | |
2278 } | |
2279 _EAX += 48; | |
2280 --v15; | |
2281 __asm | |
2282 { | |
2283 fstp [ebp+var_10] | |
2284 fld [ebp+var_4] | |
2285 fmul [ebp+var_14] | |
2286 fld [ebp+var_10] | |
2287 fmul [ebp+var_C] | |
2288 fsubp st(1), st | |
2289 fstp dword ptr [eax-2Ch] | |
2290 fld st(1) | |
2291 fmul [ebp+var_8] | |
2292 fld st(1) | |
2293 fmul st, st(7) | |
2294 faddp st(1), st | |
2295 fstp dword ptr [eax-28h] | |
2296 fstp st | |
2297 fstp st | |
2298 fld [ebp+var_4] | |
2299 fmul [ebp+var_C] | |
2300 fld [ebp+var_10] | |
2301 fmul [ebp+var_14] | |
2302 faddp st(1), st | |
2303 fstp dword ptr [eax-24h] | |
2304 } | |
2305 } | |
2306 while ( v15 ); | |
2307 LABEL_15: | |
2308 __asm | |
2309 { | |
2310 fstp st | |
2311 fstp st | |
2312 fstp st | |
2313 } | |
2314 goto LABEL_16; | |
2315 } | |
2316 } | |
2317 else | |
2318 { | |
2319 if ( (signed int)v5 > 0 ) | |
2320 { | |
2321 __asm | |
2322 { | |
2323 fild pBLVRenderParams->vPartyPos.x | |
2324 fild pBLVRenderParams->vPartyPos.y | |
2325 fild pBLVRenderParams->vPartyPos.z | |
2326 } | |
2327 _EAX = (char *)&array_50AC10[0].vWorldViewPosition; | |
2328 v19 = v5; | |
2329 do | |
2330 { | |
2331 __asm | |
2332 { | |
2333 fld dword ptr [eax-0Ch] | |
2334 fsub st, st(3) | |
2335 fld dword ptr [eax-8] | |
2336 fsub st, st(3) | |
2337 fld st(1) | |
2338 fmul st, st(6) | |
2339 fld st(1) | |
2340 fmul [ebp+var_8] | |
2341 fsubp st(1), st | |
2342 fstp dword ptr [eax] | |
2343 fld st(1) | |
2344 fmul [ebp+var_8] | |
2345 fld st(1) | |
2346 fmul st, st(7) | |
2347 } | |
2348 _EAX += 48; | |
2349 --v19; | |
2350 __asm | |
2351 { | |
2352 faddp st(1), st | |
2353 fstp dword ptr [eax-2Ch] | |
2354 fstp st | |
2355 fstp st | |
2356 fld dword ptr [eax-34h] | |
2357 fsub st, st(1) | |
2358 fstp dword ptr [eax-28h] | |
2359 } | |
2360 } | |
2361 while ( v19 ); | |
2362 goto LABEL_15; | |
2363 } | |
2364 } | |
2365 LABEL_16: | |
2366 v20 = 0; | |
2367 __asm { fstp st } | |
2368 if ( (signed int)v5 <= 0 ) | |
2369 return 0; | |
2370 do | |
2371 { | |
2372 __asm | |
2373 { | |
2374 fld dword ptr [edx] | |
2375 fcomp ds:flt_4D8524 | |
2376 fnstsw ax | |
2377 } | |
2378 if ( !(HIBYTE(_AX) & 1) ) | |
2379 break; | |
2380 ++v20; | |
2381 _EDX += 48; | |
2382 } | |
2383 while ( v20 < (signed int)v5 ); | |
2384 if ( v20 >= (signed int)v5 ) | |
2385 return 0; | |
2386 result = sr_424CD7(v5); | |
2387 if ( result > 0 ) | |
2388 { | |
2389 __asm { fild pBLVRenderParams->field_40 } | |
2390 _ECX = (char *)&array_507D30[0].vWorldViewPosition; | |
2391 v24 = result; | |
2392 __asm | |
2393 { | |
2394 fmul ds:flt_4D84A4 | |
2395 fild pBLVRenderParams->uViewportCenterX | |
2396 fild pBLVRenderParams->uViewportCenterY | |
2397 } | |
2398 do | |
2399 { | |
2400 __asm | |
2401 { | |
2402 fld1 | |
2403 fdiv dword ptr [ecx] | |
2404 } | |
2405 _ECX += 48; | |
2406 --v24; | |
2407 __asm | |
2408 { | |
2409 fld st | |
2410 fmul dword ptr [ecx-2Ch] | |
2411 fmul st, st(4) | |
2412 fsubr st, st(3) | |
2413 fstp dword ptr [ecx-24h] | |
2414 fmul dword ptr [ecx-28h] | |
2415 fmul st, st(3) | |
2416 fsubr st, st(1) | |
2417 fstp dword ptr [ecx-20h] | |
2418 } | |
2419 } | |
2420 while ( v24 ); | |
2421 __asm | |
2422 { | |
2423 fstp st | |
2424 fstp st | |
2425 fstp st | |
2426 } | |
2427 } | |
2428 memcpy(&array_507D30[result], array_507D30, sizeof(array_507D30[result])); | |
2429 return result;*/ | |
2430 } | |
2431 | |
2432 //----- (00424829) -------------------------------------------------------- | |
2433 bool sub_424829(int a1, BspRenderer_stru2 *a2, BspRenderer_stru2 *a3, int a4) | |
2434 { | |
2435 int v4; // edi@1 | |
2436 BspRenderer_stru2 *v5; // ebx@1 | |
2437 int v6; // eax@3 | |
2438 int v7; // esi@5 | |
2439 int v8; // edx@5 | |
2440 int v9; // ecx@6 | |
2441 int v10; // eax@12 | |
2442 int v11; // edi@13 | |
2443 int v12; // edx@18 | |
2444 int v13; // eax@22 | |
2445 int v14; // edi@28 | |
2446 int v15; // ecx@29 | |
2447 int v16; // edi@30 | |
2448 int v17; // edx@35 | |
2449 int v18; // eax@39 | |
2450 int v19; // eax@44 | |
2451 int v20; // ecx@44 | |
2452 int v21; // edi@45 | |
2453 int v22; // edi@46 | |
2454 __int16 *v23; // ecx@47 | |
2455 int v24; // edx@48 | |
2456 int v25; // eax@50 | |
2457 int v26; // eax@55 | |
2458 signed int v27; // edi@55 | |
2459 int v28; // edx@56 | |
2460 int v29; // edx@57 | |
2461 int v30; // eax@59 | |
2462 int v31; // eax@64 | |
2463 signed int v32; // edi@64 | |
2464 int v33; // edx@65 | |
2465 __int16 *v34; // eax@66 | |
2466 __int16 v35; // dx@66 | |
2467 __int16 v36; // dx@67 | |
2468 __int16 v37; // di@67 | |
2469 __int16 v38; // dx@67 | |
2470 BspRenderer_stru2 *v39; // ecx@69 | |
2471 int v40; // edx@69 | |
2472 int v41; // edi@70 | |
2473 __int16 *v42; // eax@76 | |
2474 __int16 *v43; // eax@81 | |
2475 __int16 *v45; // eax@87 | |
2476 int v46; // edx@87 | |
2477 __int16 v47; // cx@88 | |
2478 int v48; // eax@93 | |
2479 int v49; // esi@93 | |
2480 __int16 *v50; // ecx@94 | |
2481 int v51; // eax@95 | |
2482 int v52; // eax@97 | |
2483 int v53; // [sp+Ch] [bp-34h]@44 | |
2484 int v54; // [sp+10h] [bp-30h]@0 | |
2485 int v55; // [sp+14h] [bp-2Ch]@12 | |
2486 __int16 *v56; // [sp+14h] [bp-2Ch]@47 | |
2487 __int16 *v57; // [sp+14h] [bp-2Ch]@76 | |
2488 __int16 *v58; // [sp+14h] [bp-2Ch]@81 | |
2489 __int16 *v59; // [sp+14h] [bp-2Ch]@87 | |
2490 BspRenderer_stru2 *v60; // [sp+18h] [bp-28h]@1 | |
2491 int v61; // [sp+1Ch] [bp-24h]@29 | |
2492 int v62; // [sp+20h] [bp-20h]@0 | |
2493 signed int v63; // [sp+24h] [bp-1Ch]@3 | |
2494 signed int v64; // [sp+28h] [bp-18h]@3 | |
2495 int v65; // [sp+2Ch] [bp-14h]@5 | |
2496 int v66; // [sp+2Ch] [bp-14h]@39 | |
2497 int v67; // [sp+30h] [bp-10h]@22 | |
2498 int v68; // [sp+34h] [bp-Ch]@12 | |
2499 int v69; // [sp+34h] [bp-Ch]@29 | |
2500 int v70; // [sp+34h] [bp-Ch]@46 | |
2501 int v71; // [sp+34h] [bp-Ch]@75 | |
2502 int v72; // [sp+34h] [bp-Ch]@80 | |
2503 int v73; // [sp+38h] [bp-8h]@11 | |
2504 int v74; // [sp+3Ch] [bp-4h]@1 | |
2505 int a3a; // [sp+48h] [bp+8h]@76 | |
2506 int a3b; // [sp+48h] [bp+8h]@87 | |
2507 | |
2508 v4 = a1; | |
2509 v5 = a2; | |
2510 v74 = a1; | |
2511 v60 = a2; | |
2512 if ( !a1 | |
2513 || (!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
|
2514 v7 = _50B9D8_screen_space_y[0], |
0 | 2515 v65 = 0, |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2516 v8 = _50B9D8_screen_space_y[0], |
0 | 2517 a1 <= v6) ) |
2518 return 0; | |
2519 do | |
2520 { | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2521 v9 = _50B9D8_screen_space_y[v6]; |
0 | 2522 if ( v9 >= v7 ) |
2523 { | |
2524 if ( v9 > v8 ) | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2525 v8 = _50B9D8_screen_space_y[v6]; |
0 | 2526 } |
2527 else | |
2528 { | |
2529 v65 = v6; | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2530 v7 = _50B9D8_screen_space_y[v6]; |
0 | 2531 } |
2532 ++v6; | |
2533 } | |
2534 while ( v6 < v4 ); | |
2535 v73 = v8; | |
2536 if ( v8 == v7 ) | |
2537 return 0; | |
2538 v10 = v65; | |
2539 v68 = 0; | |
2540 v5->_viewport_space_y = v7; | |
2541 v5->_viewport_space_w = v8; | |
2542 v55 = v65; | |
2543 if ( v4 > 0 ) | |
2544 { | |
2545 v11 = v65; | |
2546 do | |
2547 { | |
2548 v10 += v64; | |
2549 if ( v10 < v74 ) | |
2550 { | |
2551 if ( v10 < 0 ) | |
2552 v10 += v74; | |
2553 } | |
2554 else | |
2555 { | |
2556 v10 -= v74; | |
2557 } | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2558 v12 = _50B9D8_screen_space_y[v10]; |
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2559 if ( v12 <= _50B9D8_screen_space_y[v11] ) |
0 | 2560 { |
2561 v55 = v10; | |
2562 v11 = v10; | |
2563 } | |
2564 if ( v12 == v73 ) | |
2565 break; | |
2566 ++v68; | |
2567 } | |
2568 while ( v68 < v74 ); | |
2569 } | |
2570 v13 = v55 + v64; | |
2571 v67 = v55 + v64; | |
2572 if ( v55 + v64 < v74 ) | |
2573 { | |
2574 if ( v13 >= 0 ) | |
2575 goto LABEL_27; | |
2576 v13 += v74; | |
2577 } | |
2578 else | |
2579 { | |
2580 v13 -= v74; | |
2581 } | |
2582 v67 = v13; | |
2583 LABEL_27: | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2584 if ( _50B9D8_screen_space_y[v13] != _50B9D8_screen_space_y[v55] ) |
0 | 2585 { |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2586 v14 = _50BAC8_screen_space_x[v55]; |
0 | 2587 v62 = v14 << 16; |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2588 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
|
2589 v5->array_18[v7] = LOWORD(_50BAC8_screen_space_x[v55]); |
0 | 2590 } |
2591 v15 = v65; | |
2592 v69 = 0; | |
2593 v61 = v65; | |
2594 if ( v74 > 0 ) | |
2595 { | |
2596 v16 = v65; | |
2597 do | |
2598 { | |
2599 v15 += v63; | |
2600 if ( v15 < v74 ) | |
2601 { | |
2602 if ( v15 < 0 ) | |
2603 v15 += v74; | |
2604 } | |
2605 else | |
2606 { | |
2607 v15 -= v74; | |
2608 } | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2609 v17 = _50B9D8_screen_space_y[v15]; |
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2610 if ( v17 <= _50B9D8_screen_space_y[v16] ) |
0 | 2611 { |
2612 v61 = v15; | |
2613 v16 = v15; | |
2614 } | |
2615 if ( v17 == v73 ) | |
2616 break; | |
2617 ++v69; | |
2618 } | |
2619 while ( v69 < v74 ); | |
2620 } | |
2621 v18 = v63 + v61; | |
2622 v66 = v63 + v61; | |
2623 if ( v63 + v61 < v74 ) | |
2624 { | |
2625 if ( v18 >= 0 ) | |
2626 goto LABEL_44; | |
2627 v18 += v74; | |
2628 } | |
2629 else | |
2630 { | |
2631 v18 -= v74; | |
2632 } | |
2633 v66 = v18; | |
2634 LABEL_44: | |
2635 v19 = v18; | |
2636 v20 = v61; | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2637 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
|
2638 if ( _50B9D8_screen_space_y[v19] != _50B9D8_screen_space_y[v61] ) |
0 | 2639 { |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2640 v21 = _50BAC8_screen_space_x[v20]; |
0 | 2641 v5 = v60; |
2642 v61 = v21 << 16; | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2643 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
|
2644 v60->array_3D8[v73] = LOWORD(_50BAC8_screen_space_x[v20]); |
0 | 2645 } |
2646 v22 = v7; | |
2647 v70 = v7; | |
2648 if ( v7 <= v73 ) | |
2649 { | |
2650 v56 = &v5->array_3D8[v7]; | |
2651 v23 = &v5->array_18[v7]; | |
2652 do | |
2653 { | |
2654 v24 = v67; | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2655 if ( v22 < _50B9D8_screen_space_y[v67] || v22 == v73 ) |
0 | 2656 goto LABEL_57; |
2657 v25 = v64 + v67; | |
2658 v67 = v25; | |
2659 if ( v25 < v74 ) | |
2660 { | |
2661 if ( v25 >= 0 ) | |
2662 goto LABEL_55; | |
2663 v25 += v74; | |
2664 } | |
2665 else | |
2666 { | |
2667 v25 -= v74; | |
2668 } | |
2669 v67 = v25; | |
2670 LABEL_55: | |
2671 v26 = v25; | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2672 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
|
2673 if ( _50B9D8_screen_space_y[v26] - _50B9D8_screen_space_y[v24] > 0 ) |
0 | 2674 { |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2675 v28 = _50BAC8_screen_space_x[v24]; |
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2676 v54 = ((_50BAC8_screen_space_x[v26] - v28) << 16) / v27; |
0 | 2677 v62 = v28 << 16; |
2678 } | |
2679 LABEL_57: | |
2680 v29 = v66; | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2681 if ( v70 >= _50B9D8_screen_space_y[v66] && v70 != v73 ) |
0 | 2682 { |
2683 v30 = v63 + v66; | |
2684 v66 += v63; | |
2685 if ( v66 >= v74 ) | |
2686 { | |
2687 v30 -= v74; | |
2688 goto LABEL_63; | |
2689 } | |
2690 if ( v30 < 0 ) | |
2691 { | |
2692 v30 += v74; | |
2693 LABEL_63: | |
2694 v66 = v30; | |
2695 } | |
2696 v31 = v30; | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2697 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
|
2698 if ( _50B9D8_screen_space_y[v31] - _50B9D8_screen_space_y[v29] > 0 ) |
0 | 2699 { |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2700 v33 = _50BAC8_screen_space_x[v29]; |
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2701 v53 = ((_50BAC8_screen_space_x[v31] - v33) << 16) / v32; |
0 | 2702 v61 = v33 << 16; |
2703 } | |
2704 } | |
2705 *(__int16 *)((char *)v56 + (int)(char *)v5->array_18 - (char *)v5->array_3D8) = HIWORD(v62); | |
2706 *v56 = HIWORD(v61); | |
2707 v34 = v23 + 480; | |
2708 v35 = v23[480]; | |
2709 if ( *v23 > v35 ) | |
2710 { | |
2711 v36 = *v23 ^ v35; | |
2712 v37 = *v34; | |
2713 *v23 = v36; | |
2714 v38 = v37 ^ v36; | |
2715 *v23 ^= v38; | |
2716 *v34 = v38; | |
2717 } | |
2718 ++v56; | |
2719 v62 += v54; | |
2720 v22 = v70 + 1; | |
2721 v61 += v53; | |
2722 ++v23; | |
2723 ++v70; | |
2724 } | |
2725 while ( v70 <= v73 ); | |
2726 } | |
2727 v39 = a3; | |
2728 v40 = v73; | |
2729 if ( v73 < a3->_viewport_space_y || (v41 = a3->_viewport_space_w, v7 > v41) ) | |
2730 return 0; | |
2731 if ( v7 < a3->_viewport_space_y ) | |
2732 v7 = a3->_viewport_space_y; | |
2733 if ( v73 > v41 ) | |
2734 { | |
2735 v40 = a3->_viewport_space_w; | |
2736 v73 = a3->_viewport_space_w; | |
2737 } | |
2738 v71 = v7; | |
2739 if ( v7 <= v40 ) | |
2740 { | |
2741 a3a = (char *)v5 - (char *)a3; | |
2742 v57 = &v5->array_18[v7]; | |
2743 v42 = &v39->array_3D8[v7]; | |
2744 do | |
2745 { | |
2746 if ( *(__int16 *)((char *)v42 + a3a) >= *(v42 - 480) && *v57 <= *v42 ) | |
2747 break; | |
2748 ++v57; | |
2749 ++v7; | |
2750 ++v71; | |
2751 ++v42; | |
2752 } | |
2753 while ( v71 <= v40 ); | |
2754 } | |
2755 v72 = v40; | |
2756 if ( v40 < v7 ) | |
2757 return 0; | |
2758 v58 = &v5->array_18[v40]; | |
2759 v43 = &v39->array_3D8[v40]; | |
2760 do | |
2761 { | |
2762 if ( *(__int16 *)((char *)v43 + (int)(char *)v5 - (char *)v39) >= *(v43 - 480) && *v58 <= *v43 ) | |
2763 break; | |
2764 --v58; | |
2765 --v40; | |
2766 --v72; | |
2767 --v43; | |
2768 v73 = v40; | |
2769 } | |
2770 while ( v72 >= v7 ); | |
2771 if ( v7 >= v40 ) | |
2772 return 0; | |
2773 a3b = (char *)v39 - (char *)v5; | |
2774 v59 = &v39->array_3D8[v7]; | |
2775 v45 = &v5->array_18[v7]; | |
2776 v46 = v73 - v7 + 1; | |
2777 do | |
2778 { | |
2779 v47 = *(__int16 *)((char *)v45 + a3b); | |
2780 if ( *v45 < v47 ) | |
2781 *v45 = v47; | |
2782 if ( v45[480] > *v59 ) | |
2783 v45[480] = *v59; | |
2784 ++v59; | |
2785 ++v45; | |
2786 --v46; | |
2787 } | |
2788 while ( v46 ); | |
2789 v5->_viewport_space_y = v7; | |
2790 v5->_viewport_space_w = v73; | |
2791 v5->field_8 = v5->array_18[v7]; | |
2792 v48 = v5->array_3D8[v7]; | |
2793 v5->field_10 = v7; | |
2794 v5->field_14 = v7; | |
2795 v49 = v7 + 1; | |
2796 v5->field_C = v48; | |
2797 if ( v49 <= v73 ) | |
2798 { | |
2799 v50 = &v5->array_3D8[v49]; | |
2800 do | |
2801 { | |
2802 v51 = *(v50 - 480); | |
2803 if ( v51 < v5->field_8 ) | |
2804 { | |
2805 v5->field_8 = v51; | |
2806 v5->field_10 = v49; | |
2807 } | |
2808 v52 = *v50; | |
2809 if ( v52 > v5->field_C ) | |
2810 { | |
2811 v5->field_C = v52; | |
2812 v5->field_14 = v49; | |
2813 } | |
2814 ++v49; | |
2815 ++v50; | |
2816 } | |
2817 while ( v49 <= v73 ); | |
2818 } | |
2819 return 1; | |
2820 } | |
2821 // 50B700: using guessed type int dword_50B700; | |
2822 | |
2823 //----- (00424CD7) -------------------------------------------------------- | |
2824 signed int __fastcall sr_424CD7(unsigned int uVertexID) | |
2825 { | |
2826 unsigned int v1; // edx@1 | |
2827 signed int v2; // edi@1 | |
2828 char *v3; // esi@4 | |
2829 char *v4; // ecx@4 | |
2830 unsigned int v5; // eax@4 | |
2831 char *v6; // edx@4 | |
2832 double v7; // st6@10 | |
2833 double v8; // st5@10 | |
2834 double v9; // st6@11 | |
2835 unsigned __int8 v10; // c2@15 | |
2836 unsigned __int8 v11; // c3@15 | |
2837 RenderVertexSoft *v12; // edi@22 | |
2838 char *v13; // eax@22 | |
2839 double v14; // st6@22 | |
2840 signed int result; // eax@24 | |
2841 unsigned int v16; // [sp+8h] [bp-28h]@4 | |
2842 bool v17; // [sp+Ch] [bp-24h]@6 | |
2843 char *v18; // [sp+10h] [bp-20h]@4 | |
2844 char *v19; // [sp+14h] [bp-1Ch]@4 | |
2845 signed int v20; // [sp+18h] [bp-18h]@1 | |
2846 RenderVertexSoft *v21; // [sp+1Ch] [bp-14h]@4 | |
2847 char *v22; // [sp+20h] [bp-10h]@4 | |
2848 char *v23; // [sp+24h] [bp-Ch]@4 | |
2849 char *v24; // [sp+28h] [bp-8h]@4 | |
2850 char *v25; // [sp+2Ch] [bp-4h]@4 | |
2851 | |
2852 v1 = uVertexID; | |
2853 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); | |
2854 v2 = 0; | |
2855 v20 = 0; | |
2856 if ( array_50AC10[0].vWorldViewPosition.x >= 8.0 ) | |
2857 v2 = 1; | |
2858 if ( (signed int)(uVertexID + 1) <= 1 ) | |
2859 return 0; | |
2860 v3 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
2861 v4 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
2862 v5 = v1; | |
168 | 2863 v23 = (char *)&array_507D30[0]._rhw; |
0 | 2864 v21 = array_507D30; |
2865 v18 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
2866 v19 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
2867 v22 = (char *)&array_507D30[0].vWorldViewPosition; | |
2868 v24 = (char *)&array_507D30[0].v; | |
2869 v25 = (char *)&array_507D30[0].u; | |
2870 v6 = (char *)&array_50AC10[0].v; | |
2871 v16 = v5; | |
2872 do | |
2873 { | |
2874 v17 = *((float *)v6 + 5) >= 8.0; | |
2875 if ( v2 != v17 ) | |
2876 { | |
2877 if ( v17 ) | |
2878 { | |
2879 v7 = (8.0 - *((float *)v6 - 7)) / (*((float *)v6 + 5) - *((float *)v6 - 7)); | |
2880 *(float *)v4 = (*((float *)v6 + 6) - *((float *)v6 - 6)) * v7 + *((float *)v6 - 6); | |
2881 *(float *)v3 = (*((float *)v6 + 7) - *((float *)v6 - 5)) * v7 + *((float *)v6 - 5); | |
2882 *(float *)v25 = (*((float *)v6 + 11) - *((float *)v6 - 1)) * v7 + *((float *)v6 - 1); | |
2883 v8 = (*((float *)v6 + 12) - *(float *)v6) * v7 + *(float *)v6; | |
2884 } | |
2885 else | |
2886 { | |
2887 v9 = (8.0 - *((float *)v6 + 5)) / (*((float *)v6 - 7) - *((float *)v6 + 5)); | |
2888 *(float *)v4 = (*((float *)v6 - 6) - *((float *)v6 + 6)) * v9 + *((float *)v6 + 6); | |
2889 *(float *)v3 = (*((float *)v6 - 5) - *((float *)v6 + 7)) * v9 + *((float *)v6 + 7); | |
2890 *(float *)v25 = (*((float *)v6 - 1) - *((float *)v6 + 11)) * v9 + *((float *)v6 + 11); | |
2891 v8 = (*(float *)v6 - *((float *)v6 + 12)) * v9 + *((float *)v6 + 12); | |
2892 } | |
2893 *(float *)v24 = v8; | |
2894 *(float *)v22 = 8.0; | |
2895 *(int *)v23 = 0x3E000000u; | |
2896 if ( v2 ) | |
2897 { | |
2898 if ( 8.0 == *((float *)v6 - 7) && *(float *)v4 == *((float *)v6 - 6) ) | |
2899 { | |
2900 v10 = 0; | |
2901 v11 = *(float *)v3 == *((float *)v6 - 5); | |
2902 goto LABEL_19; | |
2903 } | |
2904 } | |
2905 else | |
2906 { | |
2907 if ( 8.0 == *((float *)v6 + 5) && *(float *)v4 == *((float *)v6 + 6) ) | |
2908 { | |
2909 v10 = 0; | |
2910 v11 = *(float *)v3 == *((float *)v6 + 7); | |
2911 LABEL_19: | |
2912 if ( v11 | v10 ) | |
2913 goto LABEL_21; | |
2914 goto LABEL_20; | |
2915 } | |
2916 } | |
2917 LABEL_20: | |
2918 ++v21; | |
2919 v22 += 48; | |
2920 v24 += 48; | |
2921 v25 += 48; | |
2922 v4 += 48; | |
2923 v3 += 48; | |
2924 ++v20; | |
2925 v23 += 48; | |
2926 v19 = v4; | |
2927 v18 = v3; | |
2928 } | |
2929 LABEL_21: | |
2930 if ( v17 ) | |
2931 { | |
2932 v12 = v21; | |
2933 v13 = v23; | |
2934 v19 += 48; | |
2935 v18 += 48; | |
2936 v14 = 1.0 / (*((float *)v6 + 5) + 0.0000001); | |
2937 ++v20; | |
2938 v25 += 48; | |
2939 v24 += 48; | |
2940 v22 += 48; | |
2941 ++v21; | |
2942 v23 += 48; | |
2943 memcpy(v12, v6 + 8, 0x30u); | |
2944 v4 = v19; | |
2945 v3 = v18; | |
2946 *(float *)v13 = v14; | |
2947 } | |
2948 v2 = v17; | |
2949 v6 += 48; | |
2950 --v16; | |
2951 } | |
2952 while ( v16 ); | |
2953 result = v20; | |
2954 if ( v20 < 3 ) | |
2955 return 0; | |
2956 return result; | |
2957 } |