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