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