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