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