Mercurial > mm7
annotate mm7_1.cpp @ 1047:76ce871b0076
m
author | Ritor1 |
---|---|
date | Thu, 23 May 2013 11:16:46 +0600 |
parents | 7735bdb3c30f |
children | d36681a9e4f8 |
rev | line source |
---|---|
0 | 1 /* This file has been generated by the Hex-Rays decompiler. |
2 Copyright (c) 2007-2011 Hex-Rays <info@hex-rays.com> | |
3 | |
4 Detected compiler: Visual C++ | |
5 */ | |
6 | |
7 //#include <defs.h> | |
373 | 8 #include <assert.h> |
9 | |
1016 | 10 #include "VideoPlayer.h" |
11 #include "BSPModel.h" | |
12 #include "Mouse.h" | |
13 | |
14 #include "Vis.h" | |
0 | 15 #include "MM7.h" |
16 #include "Game.h" | |
17 #include "GUIWindow.h" | |
18 #include "Party.h" | |
19 #include "AudioPlayer.h" | |
20 #include "Outdoor.h" | |
21 #include "Overlays.h" | |
22 #include "LOD.h" | |
23 #include "Actor.h" | |
24 #include "Allocator.h" | |
25 #include "Events.h" | |
26 #include "Viewport.h" | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
27 #include "SpriteObject.h" |
0 | 28 #include "ObjectList.h" |
29 #include "Chest.h" | |
30 #include "DecorationList.h" | |
31 #include "stru123.h" | |
32 #include "Time.h" | |
33 #include "IconFrameTable.h" | |
34 #include "TurnEngine.h" | |
189 | 35 #include "texts.h" |
747 | 36 #include "UIHouses.h" |
0 | 37 #include "mm7_data.h" |
38 | |
39 int __stdcall aWinProc(HWND hWnd, UINT Msg, WPARAM wParam, unsigned int lParam); | |
40 int __stdcall InsertMM7CDDialogFunc(HWND hDlg, int a2, __int16 a3, int a4); | |
41 bool __fastcall FindMM7CD(HWND hWnd, char *pCDDrive); | |
42 bool __fastcall Initialize(HINSTANCE hInst, char *pCmdLine); | |
43 | |
791 | 44 |
45 //----- (004A1780) mm6_chinese--------------------------------------------- | |
46 int fixpoint_div(int a1, int a2) | |
47 { | |
48 return ((__int64)a1 << 16) / a2; | |
49 } | |
50 | |
871 | 51 int fixpoint_mul(int a1, int a2) |
52 { | |
53 return (((__int64)a1 << 16) * a2) >> 16; | |
54 } | |
55 | |
762 | 56 //----- (004453C0) mm6----------------------------------------------------- |
57 //----- (004A1760) mm6_chinese--------------------------------------------- | |
871 | 58 int fixpoint_sub0(int a1, int a2) |
762 | 59 { |
871 | 60 return ((__int64)a1 * (__int64)a2) >> 16; |
762 | 61 } |
62 | |
0 | 63 //----- (004196A0) -------------------------------------------------------- |
991 | 64 void CharacterUI_ReleaseButtons() |
0 | 65 { |
66 GUIButton *i; // esi@2 | |
67 GUIButton *j; // esi@7 | |
68 | |
69 if ( dword_507CC0 ) | |
70 { | |
71 dword_507CC0 = 0; | |
705 | 72 for ( i = pGUIWindow_CurrentMenu->pControlsHead; i; i = j ) |
0 | 73 { |
705 | 74 j=i->pNext; |
75 if ( BYTE1(i->field_1C) & 0x80 ) | |
76 { | |
697 | 77 i->Release(); |
705 | 78 pAllocator->FreeChunk(i); |
79 } | |
0 | 80 } |
81 for ( j = pGUIWindow_CurrentMenu->pControlsHead; j; j = j->pNext ) | |
82 { | |
832 | 83 if ( j->msg == UIMSG_InventoryLeftClick) |
0 | 84 { |
85 j->uX = dword_50698C; | |
86 j->uY = dword_506988; | |
87 j->uZ = dword_506984; | |
88 j->uW = dword_506980; | |
972 | 89 pGUIWindow_CurrentMenu->_41D08F_set_keyboard_control_group(1, 0, 0, 0); |
0 | 90 } |
91 } | |
92 } | |
93 } | |
94 | |
95 //----- (0041CD4F) -------------------------------------------------------- | |
972 | 96 bool UI_OnKeyDown(unsigned int vkKey) |
0 | 97 { |
972 | 98 //unsigned int v1; // edi@1 |
99 //unsigned int v2; // eax@2 | |
0 | 100 int v3; // esi@3 |
101 int v4; // ecx@10 | |
979 | 102 GUIButton *pButton; // eax@11 |
0 | 103 int v6; // edx@12 |
104 int v7; // ecx@20 | |
105 char v8; // zf@21 | |
979 | 106 //GUIButton *v9; // ecx@24 |
0 | 107 int v10; // esi@24 |
832 | 108 //int v11; // edx@26 |
0 | 109 int v12; // edx@28 |
110 int v13; // esi@32 | |
979 | 111 //GUIButton *v14; // eax@37 |
0 | 112 int v15; // edx@38 |
113 int v17; // ecx@50 | |
114 int v18; // edx@50 | |
979 | 115 //GUIButton *v19; // ecx@54 |
0 | 116 int v20; // esi@54 |
832 | 117 //int v21; // edx@56 |
0 | 118 int v22; // ecx@59 |
119 int v23; // edx@59 | |
120 int v24; // ecx@60 | |
121 int v25; // esi@63 | |
972 | 122 //unsigned int v26; // [sp+Ch] [bp-14h]@1 |
123 //int v27; // [sp+10h] [bp-10h]@1 | |
0 | 124 int v28; // [sp+14h] [bp-Ch]@10 |
125 int v29; // [sp+14h] [bp-Ch]@36 | |
126 unsigned int uClickX; // [sp+18h] [bp-8h]@10 | |
127 unsigned int uClickY; // [sp+1Ch] [bp-4h]@10 | |
128 | |
972 | 129 //v1 = 0; |
130 //v27 = uNumVisibleWindows; | |
0 | 131 if ( uNumVisibleWindows < 0 ) |
979 | 132 return false; |
972 | 133 //v2 = pMessageQueue_50CBD0->uNumMessages; |
134 for (int i = uNumVisibleWindows; i >= 0; --i) | |
135 //while ( 1 ) | |
0 | 136 { |
972 | 137 v3 = pVisibleWindowsIdxs[i] - 1; |
138 if (!pWindowList[v3].receives_keyboard_input) | |
139 continue; | |
140 | |
979 | 141 switch (vkKey) |
142 { | |
143 case VK_LEFT: | |
144 { | |
145 v12 = pWindowList[v3].field_34; | |
146 if ( pWindowList[v3].pCurrentPosActiveItem - pWindowList[v3].pStartingPosActiveItem - v12 >= 0 ) | |
147 { | |
148 v8 = pCurrentScreen == SCREEN_PARTY_CREATION; | |
149 pWindowList[v3].pCurrentPosActiveItem -= v12; | |
150 if ( v8 ) | |
151 { | |
152 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); | |
153 //v2 = pMessageQueue_50CBD0->uNumMessages; | |
154 } | |
155 } | |
156 if ( pWindowList[v3].field_30 != 0 ) | |
157 { | |
158 break; | |
159 } | |
160 pButton = pWindowList[v3].pControlsHead; | |
161 v13 = pWindowList[v3].pCurrentPosActiveItem; | |
162 if ( v13 > 0) | |
163 { | |
164 do | |
165 { | |
166 pButton = pButton->pNext; | |
167 --v13; | |
168 } | |
169 while ( v13 ); | |
170 } | |
171 pMessageQueue_50CBD0->AddMessage(pButton->msg, pButton->msg_param, 0); | |
172 break; | |
173 } | |
174 case VK_RIGHT: | |
175 { | |
176 v7 = pWindowList[v3].pCurrentPosActiveItem + pWindowList[v3].field_34; | |
177 if ( v7 < pWindowList[v3].pNumPresenceButton + pWindowList[v3].pStartingPosActiveItem ) | |
178 { | |
179 v8 = pCurrentScreen == SCREEN_PARTY_CREATION; | |
180 pWindowList[v3].pCurrentPosActiveItem = v7; | |
181 if ( v8 ) | |
182 { | |
183 pAudioPlayer->PlaySound(SOUND_Button, 0, 0, -1, 0, 0, 0, 0); | |
184 //v2 = pMessageQueue_50CBD0->uNumMessages; | |
185 } | |
186 } | |
187 if ( pWindowList[v3].field_30 != 0 ) | |
188 { | |
189 break; | |
190 } | |
191 pButton = pWindowList[v3].pControlsHead; | |
192 v10 = pWindowList[v3].pCurrentPosActiveItem; | |
193 if ( v10 > 0) | |
194 { | |
195 do | |
196 { | |
197 pButton = pButton->pNext; | |
198 --v10; | |
199 } | |
200 while ( v10 ); | |
201 } | |
202 pMessageQueue_50CBD0->AddMessage(pButton->msg, pButton->msg_param, 0); | |
203 break; | |
204 } | |
205 case VK_DOWN: | |
206 { | |
207 v17 = pWindowList[v3].pStartingPosActiveItem; | |
208 v18 = pWindowList[v3].pCurrentPosActiveItem; | |
209 if ( v18 >= pWindowList[v3].pNumPresenceButton + v17 - 1 ) | |
210 pWindowList[v3].pCurrentPosActiveItem = v17; | |
211 else | |
212 pWindowList[v3].pCurrentPosActiveItem = v18 + 1; | |
213 if ( pWindowList[v3].field_30 != 0 ) | |
214 return true; | |
215 pButton = pWindowList[v3].pControlsHead; | |
216 v20 = pWindowList[v3].pCurrentPosActiveItem; | |
217 if ( v20 > 0) | |
218 { | |
219 do | |
220 { | |
221 pButton = pButton->pNext; | |
222 --v20; | |
223 } | |
224 while ( v20 ); | |
972 | 225 } |
979 | 226 pMessageQueue_50CBD0->AddMessage(pButton->msg, pButton->msg_param, 0); |
227 return true; | |
228 } | |
229 case VK_SELECT: | |
230 { | |
231 pMouse->GetClickPos(&uClickX, &uClickY); | |
232 v4 = pWindowList[v3].pStartingPosActiveItem; | |
233 v28 = v4 + pWindowList[v3].pNumPresenceButton; | |
234 if ( v4 < v4 + pWindowList[v3].pNumPresenceButton ) | |
235 { | |
236 while ( 1 ) | |
237 { | |
238 pButton = pWindowList[v3].pControlsHead; | |
239 if ( v4 > 0 ) | |
240 { | |
241 v6 = v4; | |
242 do | |
243 { | |
244 pButton = pButton->pNext; | |
245 --v6; | |
246 } | |
247 while ( v6 ); | |
248 } | |
249 if ( (signed int)uClickX >= (signed int)pButton->uX//test for StatsTab in PlayerCreation Window | |
250 && (signed int)uClickX <= (signed int)pButton->uZ | |
251 && (signed int)uClickY >= (signed int)pButton->uY | |
252 && (signed int)uClickY <= (signed int)pButton->uW ) | |
253 break; | |
254 ++v4; | |
255 if ( v4 >= v28 ) | |
256 { | |
257 //v1 = 0; | |
258 //v2 = pMessageQueue_50CBD0->uNumMessages; | |
259 //--i; | |
260 //if ( i < 0 ) | |
261 return false; | |
262 //continue; | |
263 } | |
264 } | |
265 pWindowList[v3].pCurrentPosActiveItem = v4; | |
266 return true; | |
267 } | |
268 //v2 = pMessageQueue_50CBD0->uNumMessages; | |
269 break; | |
270 } | |
271 case VK_UP: | |
272 { | |
273 v22 = pWindowList[v3].pCurrentPosActiveItem; | |
274 v23 = pWindowList[v3].pStartingPosActiveItem; | |
275 if ( v22 <= v23 ) | |
276 v24 = pWindowList[v3].pNumPresenceButton + v23 - 1; | |
277 else | |
278 v24 = v22 - 1; | |
279 v8 = pWindowList[v3].field_30 == 0; | |
280 pWindowList[v3].pCurrentPosActiveItem = v24; | |
281 if ( !v8 ) | |
282 return true; | |
283 pButton = pWindowList[v3].pControlsHead; | |
284 v25 = pWindowList[v3].pCurrentPosActiveItem; | |
285 if ( v25 > 0) | |
286 { | |
287 do | |
288 { | |
289 pButton = pButton->pNext; | |
290 --v25; | |
291 } | |
292 while ( v25 ); | |
293 } | |
294 pMessageQueue_50CBD0->AddMessage(pButton->msg, pButton->msg_param, 0); | |
295 return true; | |
296 } | |
297 case VK_NEXT: | |
298 { | |
299 if ( pWindowList[v3].field_30 != 0 ) | |
300 { | |
301 pMouse->GetClickPos(&uClickX, &uClickY); | |
302 v4 = pWindowList[v3].pStartingPosActiveItem; | |
303 v29 = v4 + pWindowList[v3].pNumPresenceButton; | |
304 if ( v4 < v4 + pWindowList[v3].pNumPresenceButton ) | |
305 { | |
306 while ( 1 ) | |
307 { | |
308 pButton = pWindowList[v3].pControlsHead; | |
309 if ( v4 > 0 ) | |
310 { | |
311 v15 = v4; | |
312 do | |
313 { | |
314 pButton = pButton->pNext; | |
315 --v15; | |
316 } | |
317 while ( v15 ); | |
318 } | |
319 if ( (signed int)uClickX >= (signed int)pButton->uX | |
320 && (signed int)uClickX <= (signed int)pButton->uZ | |
321 && (signed int)uClickY >= (signed int)pButton->uY | |
322 && (signed int)uClickY <= (signed int)pButton->uW ) | |
323 { | |
324 pWindowList[v3].pCurrentPosActiveItem = v4; | |
325 return true; | |
326 } | |
327 ++v4; | |
328 if ( v4 >= v29 ) | |
329 { | |
330 //v1 = 0; | |
331 //v2 = pMessageQueue_50CBD0->uNumMessages; | |
332 break; | |
333 } | |
334 } | |
335 } | |
336 else | |
337 { | |
338 //v2 = pMessageQueue_50CBD0->uNumMessages; | |
339 } | |
340 } | |
341 break; | |
342 } | |
343 default: | |
344 { | |
345 break; | |
346 } | |
347 } | |
0 | 348 } |
349 } | |
350 | |
351 //----- (0041D20D) -------------------------------------------------------- | |
1006 | 352 void __fastcall sub_41D20D_buff_remaining_time_string( int ecx0, struct GUIWindow *edx0, __int64 a3, struct GUIFont *a2 ) |
353 { | |
0 | 354 unsigned int v4; // edi@1 |
355 unsigned int v5; // esi@1 | |
356 unsigned int v6; // ebp@1 | |
357 unsigned int v7; // ebx@1 | |
358 signed __int64 v8; // ST34_8@1 | |
359 signed __int64 v9; // kr00_8@1 | |
360 char *v10; // eax@2 | |
361 char *v11; // eax@7 | |
362 char *v12; // eax@13 | |
363 char *v13; // eax@19 | |
364 int uY; // [sp+0h] [bp-20h]@1 | |
365 GUIWindow *a1; // [sp+4h] [bp-1Ch]@1 | |
366 signed __int64 v17; // [sp+10h] [bp-10h]@1 | |
367 signed __int64 v18; // [sp+18h] [bp-8h]@1 | |
368 unsigned int v19; // [sp+24h] [bp+4h]@1 | |
369 | |
370 a1 = edx0; | |
371 uY = ecx0; | |
372 v4 = (unsigned __int64)(signed __int64)((double)a3 * 0.234375) >> 32; | |
373 v5 = (signed __int64)((double)a3 * 0.234375); | |
374 v6 = (unsigned __int64)((signed __int64)((double)a3 * 0.234375) / 60) >> 32; | |
375 v7 = (signed __int64)((double)a3 * 0.234375) / 60; | |
376 v8 = (signed __int64)((double)a3 * 0.234375) / 60 / 60; | |
377 v19 = (unsigned int)v8 / 0x18; | |
378 v18 = (signed __int64)__PAIR__(v4, v5) % 60; | |
379 v17 = (signed __int64)__PAIR__(v6, v7) % 60; | |
380 v9 = v8 % 24; | |
381 strcpy(pTmpBuf, "\r020"); | |
382 if ( (unsigned int)v8 / 0x18 ) | |
383 { | |
384 v10 = pGlobalTXT_LocalizationStrings[57]; // Days | |
385 if ( v19 <= 1 ) | |
386 v10 = pGlobalTXT_LocalizationStrings[56]; // Day | |
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 v0 = pGame->pVisInstance->get_picked_object_zbuf_val(); | |
1019 else | |
1020 { | |
1021 v1 = pMouse->GetCursorPos(&a2); | |
1022 v0 = pRenderer->pActiveZBuffer[v1->x + pSRZBufferLineOffsets[pMouse->GetCursorPos(&v25)->y]]; | |
1023 } | |
848 | 1024 if ( PID_TYPE(v0) == OBJECT_Item) |
0 | 1025 { |
1026 a2.y = (signed int)(unsigned __int16)v0 >> 3; | |
1027 v21 = (signed int)(unsigned __int16)v0 >> 3; | |
1047 | 1028 if ( !(pObjectList->pObjects[pSpriteObjects[v21].uObjectDescID].uFlags & 0x10) && a2.y < 1000 && pSpriteObjects[v21].uObjectDescID |
0 | 1029 && (unsigned int)v0 < 0x2000000 ) |
1030 { | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
1031 v22 = &pSpriteObjects[v21].stru_24; |
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
1032 v23 = pSpriteObjects[v21].stru_24.uItemID; |
0 | 1033 if ( pItemsTable->pItems[v23].uEquipType == 18 ) |
1034 { | |
377 | 1035 party_finds_gold(v22->uSpecEnchantmentType, 0); |
0 | 1036 viewparams->bRedrawGameUI = 1; |
1037 } | |
1038 else | |
1039 { | |
721 | 1040 sprintfex(pTmpBuf2, pGlobalTXT_LocalizationStrings[471], pItemsTable->pItems[v23].pUnidentifiedName); |
0 | 1041 ShowStatusBarString(pTmpBuf2, 2u); |
1042 if ( v22->uItemID == 506 ) | |
484 | 1043 _449B7E_toggle_bit(pParty->_quest_bits, 184, 1u); |
0 | 1044 if ( v22->uItemID == 455 ) |
484 | 1045 _449B7E_toggle_bit(pParty->_quest_bits, 185, 1u); |
0 | 1046 if ( !pParty->AddItem(v22) ) |
1047 pParty->SetHoldingItem(v22); | |
1048 } | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
510
diff
changeset
|
1049 SpriteObject::OnInteraction(a2.y); |
0 | 1050 return; |
1051 } | |
588 | 1052 v4 = pParty->pPickedItem.uItemID; |
1053 if ( !pParty->pPickedItem.uItemID ) | |
1054 return; | |
1055 goto LABEL_14; | |
0 | 1056 } |
848 | 1057 if ( PID_TYPE(v0) != OBJECT_Actor) |
141 | 1058 { |
848 | 1059 if ( PID_TYPE(v0) == OBJECT_Decoration) |
0 | 1060 { |
1061 v13 = &pLevelDecorations[(signed int)(unsigned __int16)v0 >> 3]; | |
1062 if ( (signed int)(((unsigned int)v0 >> 16) - pDecorationList->pDecorations[v13->uDecorationDescID].uRadius) >= 512 ) | |
588 | 1063 { |
1064 v4 = pParty->pPickedItem.uItemID; | |
1065 if ( !pParty->pPickedItem.uItemID ) | |
1066 return; | |
1067 goto LABEL_14; | |
1068 } | |
0 | 1069 v14 = v13->field_16_event_id; |
1070 if ( !v14 ) | |
1071 { | |
1072 if ( pLevelDecorations[(signed int)(unsigned __int16)v0 >> 3].IsInteractive() ) | |
1073 { | |
1074 v15 = stru_5E4C90._decor_events[v13->_idx_in_stru123 - 75] + 380; | |
520
35f28d4c0ff9
GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents:
515
diff
changeset
|
1075 activeLevelDecoration = &pLevelDecorations[(signed int)(unsigned __int16)v0 >> 3]; |
0 | 1076 EventProcessor(v15, 0, 1); |
520
35f28d4c0ff9
GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents:
515
diff
changeset
|
1077 activeLevelDecoration = NULL; |
0 | 1078 } |
1079 return; | |
1080 } | |
1081 v11 = v14; | |
1082 } | |
1083 else | |
1084 { | |
1030 | 1085 if ( PID_TYPE(v0) != OBJECT_BModel || HIWORD(v0) >= 512 ) |
588 | 1086 { |
1087 v4 = pParty->pPickedItem.uItemID; | |
1088 if ( !pParty->pPickedItem.uItemID ) | |
1089 return; | |
1090 goto LABEL_14; | |
1091 } | |
1030 | 1092 v2 = PID_ID(v0); |
0 | 1093 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor) |
1094 { | |
1095 v3 = &pIndoor->pFaces[v2]; | |
1096 if ( !(v3->uAttributes & 0x2000000) ) | |
1097 { | |
1098 LABEL_11: | |
588 | 1099 v4 = pParty->pPickedItem.uItemID; |
1100 if ( !pParty->pPickedItem.uItemID ) | |
1101 { | |
1102 ShowNothingHereStatus(); | |
1103 v4 = pParty->pPickedItem.uItemID; | |
1104 if ( !pParty->pPickedItem.uItemID ) | |
1105 return; | |
1106 } | |
0 | 1107 LABEL_14: |
588 | 1108 v5 = pItemsTable->pItems[v4].uSpriteID; |
1109 v6 = 0; | |
1110 a1.uType = v5; | |
1111 if ( (signed int)pObjectList->uNumObjects <= 0 ) | |
1112 LOWORD(v6) = 0; | |
1113 else | |
1114 { | |
1115 v7 = (char *)&pObjectList->pObjects->uObjectID; | |
1116 while ( v5 != *(short *)v7 ) | |
1117 { | |
1118 ++v6; | |
1119 v7 += 56; | |
1120 if ( v6 >= (signed int)pObjectList->uNumObjects ) | |
1121 { | |
1122 LOWORD(v6) = 0; | |
1123 break; | |
1124 } | |
1125 } | |
1126 } | |
1127 a1.uObjectDescID = v6; | |
1128 a1.vPosition.y = pParty->vPosition.y; | |
822 | 1129 a1.spell_caster_pid = OBJECT_Player; |
588 | 1130 a1.vPosition.x = pParty->vPosition.x; |
1131 a1.vPosition.z = pParty->sEyelevel + pParty->vPosition.z; | |
1132 a1.uSoundID = 0; | |
1133 a1.uFacing = 0; | |
1134 a1.uAttributes = 8; | |
1047 | 1135 a1.uSectorID = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->sEyelevel + pParty->vPosition.z); |
588 | 1136 a1.uSpriteFrameID = 0; |
1137 memcpy(&a1.stru_24, &pParty->pPickedItem, 0x24u); | |
1138 v8 = (int *)pMouse->GetCursorPos(&v25); | |
1139 v9 = UnprojectX(*v8); | |
1140 a1.Create(pParty->sRotationY + v9, 184, 200, 0); | |
1047 | 1141 v10 = pIcons_LOD->LoadTexture(pItemsTable->pItems[pParty->pPickedItem.uItemID].pIconName, TEXTURE_16BIT_PALETTE); |
588 | 1142 if (v10 != -1) |
1143 pIcons_LOD->pTextures[v10].Release(); | |
1144 pMouse->RemoveHoldingItem(); | |
1006 | 1145 pIcons_LOD->SyncLoadedFilesCount(); |
588 | 1146 return; |
0 | 1147 } |
1148 v11 = pIndoor->pFaceExtras[v3->uFaceExtraID].uEventID; | |
1149 } | |
1150 else | |
1151 { | |
1030 | 1152 v12 = &pOutdoor->pBModels[(signed int)(v0 & 0xFFFF) >> 9].pFaces[v2 & 0x3F]; |
1153 if ( !v12->Clickable()) | |
0 | 1154 goto LABEL_11; |
1155 v11 = v12->sCogTriggeredID; | |
1156 } | |
1157 } | |
1158 EventProcessor(v11, (unsigned __int16)v0, 1); | |
1159 return; | |
1160 } | |
1161 v16 = (signed int)(unsigned __int16)v0 >> 3; | |
1162 a2.y = v16; | |
1163 v17 = &pActors[v16]; | |
1164 if ( v17->uAIState == 5 ) | |
1165 { | |
1166 if ( (unsigned int)v0 < 0x2000000 ) | |
1167 { | |
1168 stru_50C198.LootActor(&pActors[v16]); | |
1169 return; | |
1170 } | |
588 | 1171 v4 = pParty->pPickedItem.uItemID; |
1172 if ( !pParty->pPickedItem.uItemID ) | |
1173 return; | |
1174 goto LABEL_14; | |
0 | 1175 } |
1176 if ( GetAsyncKeyState(VK_SHIFT) >= 0 ) | |
1177 { | |
1178 if ( !v17->GetActorsRelation(0) && !(BYTE2(v17->uAttributes) & 8) ) | |
1179 { | |
1030 | 1180 if ( HIWORD(v0) >= 512) |
588 | 1181 { |
1182 v4 = pParty->pPickedItem.uItemID; | |
1183 if ( !pParty->pPickedItem.uItemID ) | |
1184 return; | |
1185 goto LABEL_14; | |
1186 } | |
0 | 1187 if ( !v17->CanAct() ) |
1188 return; | |
1189 v18 = a2.y; | |
1190 Actor::FaceObject(a2.y, 4u, 0, 0); | |
602 | 1191 if ( !v17->sNPC_ID ) |
0 | 1192 { |
1193 v19 = pNPCStats->pGroups_copy[v17->uGroup]; | |
1194 if ( v19 ) | |
1195 { | |
1196 v20 = pNPCStats->pCatchPhrases[v19]; | |
1197 if ( v20 ) | |
1198 { | |
1199 pParty->uFlags |= 2u; | |
1200 strcpy(byte_5B0938, v20); | |
1201 sub_4451A8_press_any_key(0, 0, 0); | |
1202 } | |
1203 } | |
1204 return; | |
1205 } | |
437 | 1206 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages >= 40 ) |
0 | 1207 return; |
990 | 1208 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_StartNPCDialogue; |
0 | 1209 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = v18; |
1210 LABEL_42: | |
1211 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
1212 ++pMessageQueue_50CBD0->uNumMessages; | |
437 | 1213 return;*/ |
1214 pMessageQueue_50CBD0->AddMessage(UIMSG_StartNPCDialogue, v18, 0); | |
0 | 1215 return; |
1216 } | |
1217 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 3 ) | |
1218 { | |
1219 pTurnEngine->field_18 |= 8u; | |
1220 return; | |
1221 } | |
437 | 1222 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) |
0 | 1223 { |
990 | 1224 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Attack; |
0 | 1225 goto LABEL_41; |
437 | 1226 }*/ |
1227 pMessageQueue_50CBD0->AddMessage(UIMSG_Attack, 0, 0); | |
0 | 1228 } |
1229 else | |
1230 { | |
1231 if ( pParty->bTurnBasedModeOn == 1 && pTurnEngine->field_4 == 3 ) | |
1232 { | |
569 | 1233 pParty->uFlags |= PARTY_FLAGS_1_FALLING; |
0 | 1234 return; |
1235 } | |
1236 if ( uActiveCharacter | |
437 | 1237 && sub_427769_spell(pPlayers[uActiveCharacter]->uQuickSpell)) |
0 | 1238 { |
961 | 1239 pMessageQueue_50CBD0->AddMessage(UIMSG_CastQuickSpell, 0, 0); |
437 | 1240 /*&& (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) |
990 | 1241 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_CastQuickSpell; |
0 | 1242 LABEL_41: |
1243 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 0; | |
437 | 1244 goto LABEL_42;*/ |
0 | 1245 } |
1246 } | |
1247 } | |
1248 | |
1249 //----- (004226C2) -------------------------------------------------------- | |
265 | 1250 bool PauseGameDrawing() |
0 | 1251 { |
265 | 1252 if ( pCurrentScreen != SCREEN_GAME |
151 | 1253 && pCurrentScreen != SCREEN_NPC_DIALOGUE |
1254 && pCurrentScreen != SCREEN_CHANGE_LOCATION ) | |
1255 { | |
1256 if ( pCurrentScreen == SCREEN_INPUT_BLV ) | |
0 | 1257 return pVideoPlayer->pSmackerMovie != 0; |
151 | 1258 if ( pCurrentScreen != SCREEN_BRANCHLESS_NPC_DIALOG ) |
265 | 1259 return true; |
1260 } | |
1261 return false; | |
0 | 1262 } |
1263 // 4E28F8: using guessed type int pCurrentScreen; | |
1264 | |
1265 //----- (004226EF) -------------------------------------------------------- | |
373 | 1266 void SetUserInterface(PartyAlignment align, bool bReplace) |
0 | 1267 { |
1268 unsigned int v3; // eax@7 | |
1269 unsigned __int16 v4; // dx@7 | |
1270 unsigned __int16 v5; // cx@7 | |
1271 unsigned __int16 v6; // [sp-4h] [bp-14h]@7 | |
1272 | |
373 | 1273 |
983 | 1274 extern void set_default_ui_skin(); |
1275 set_default_ui_skin(); | |
1276 | |
373 | 1277 if (align == PartyAlignment_Evil) |
1278 { | |
0 | 1279 if ( bReplace ) |
1280 { | |
1281 pTexture_RightFrame->Reload("ib-r-C.pcx"); | |
1282 pTexture_BottomFrame->Reload("ib-b-C.pcx"); | |
1283 pTexture_TopFrame->Reload("ib-t-C.pcx"); | |
1284 pTexture_LeftFrame->Reload("ib-l-C.pcx"); | |
1285 pTexture_StatusBar->Reload("IB-Foot-c.pcx"); | |
1286 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_right_panel], "ib-mb-C", 2); | |
1287 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D8], "ib-autmask-c", 2); | |
1288 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079B4], "IB-COMP-C", 2); | |
1289 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D0], "IB-InitG-c", 2); | |
1290 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079C8], "IB-InitY-c", 2); | |
1291 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079CC], "IB-InitR-c", 2); | |
319 | 1292 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-C", 2); |
1293 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-C", 2); | |
1294 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-C", 2); | |
1295 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-C", 2); | |
995 | 1296 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_GameUI_CharSelectionFrame], "IB-selec-C", 2); |
319 | 1297 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-c", 2); |
1298 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-c", 2); | |
1299 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-c", 2); | |
1300 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-c", 2); | |
569 | 1301 |
1302 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-c", 2); | |
1303 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-c", 2); | |
1304 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-c", 2); | |
1305 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-c", 2); | |
1306 | |
0 | 1307 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeC"); |
569 | 1308 pIconsFrameTable->InitializeAnimation(pUIAnim_WizardEye->uIconID); |
0 | 1309 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchC"); |
569 | 1310 pIconsFrameTable->InitializeAnimation(pUIAnum_Torchlight->uIconID); |
1311 | |
526 | 1312 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-c", 2); |
0 | 1313 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc-c", 2); |
984 | 1314 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_CharacterUI_InventoryBackground], "fr_inven-c", 2); |
0 | 1315 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Parchment], "parchment", 2); |
1316 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B4], "cornr_ll-c", 2); | |
1317 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B0], "cornr_lr-c", 2); | |
1318 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076AC], "cornr_ul-c", 2); | |
1319 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A8], "cornr_ur-c", 2); | |
1320 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A4], "edge_btm-c", 2); | |
1321 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A0], "edge_lf-c", 2); | |
1322 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50769C], "edge_rt-c", 2); | |
1323 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507698], "edge_top-c", 2); | |
1324 pIcons_LOD->ReloadTexture(pTexture_591428, "endcap-c", 2); | |
1325 } | |
1326 else | |
1327 { | |
1328 pTexture_RightFrame->Load("ib-r-C.pcx", 0); | |
1329 pTexture_BottomFrame->Load("ib-b-c.pcx", 0); | |
1330 pTexture_TopFrame->Load("ib-t-C.pcx", 0); | |
1331 pTexture_LeftFrame->Load("ib-l-C.pcx", 0); | |
1332 pTexture_StatusBar->Load("IB-Foot-c.pcx", 0); | |
1333 uTextureID_right_panel = pIcons_LOD->LoadTexture("ib-mb-C", TEXTURE_16BIT_PALETTE); | |
1334 dword_5079D8 = pIcons_LOD->LoadTexture("ib-autmask-c", TEXTURE_16BIT_PALETTE); | |
1335 dword_5079B4 = pIcons_LOD->LoadTexture("IB-COMP-C", TEXTURE_16BIT_PALETTE); | |
1336 dword_5079D0 = pIcons_LOD->LoadTexture("IB-InitG-c", TEXTURE_16BIT_PALETTE); | |
1337 dword_5079C8 = pIcons_LOD->LoadTexture("IB-InitY-c", TEXTURE_16BIT_PALETTE); | |
1338 dword_5079CC = pIcons_LOD->LoadTexture("IB-InitR-c", TEXTURE_16BIT_PALETTE); | |
319 | 1339 uTextureID_Btn_NPCLeft = pIcons_LOD->LoadTexture("IB-NPCLD-C", TEXTURE_16BIT_PALETTE); |
1340 uTextureID_Btn_NPCRight = pIcons_LOD->LoadTexture("IB-NPCRD-C", TEXTURE_16BIT_PALETTE); | |
328 | 1341 uTextureID_Btn_ZoomIn = pIcons_LOD->LoadTexture("ib-autout-C", TEXTURE_16BIT_PALETTE); |
319 | 1342 uTextureID_Btn_ZoomOut = pIcons_LOD->LoadTexture("ib-autin-C", TEXTURE_16BIT_PALETTE); |
995 | 1343 uTextureID_GameUI_CharSelectionFrame = pIcons_LOD->LoadTexture("IB-selec-C", TEXTURE_16BIT_PALETTE); |
319 | 1344 uTextureID_Btn_CastSpell = pIcons_LOD->LoadTexture("ib-m1d-c", TEXTURE_16BIT_PALETTE); |
1345 uTextureID_Btn_Rest = pIcons_LOD->LoadTexture("ib-m2d-c", TEXTURE_16BIT_PALETTE); | |
1346 uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-c", TEXTURE_16BIT_PALETTE); | |
1347 uTextureID_Btn_GameSettings = pIcons_LOD->LoadTexture("ib-m4d-c", TEXTURE_16BIT_PALETTE); | |
526 | 1348 uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-c", TEXTURE_16BIT_PALETTE); |
569 | 1349 uTextureID_PlayerBuff_Bless = pIcons_LOD->LoadTexture("isg-01-c", TEXTURE_16BIT_PALETTE); |
1350 uTextureID_PlayerBuff_Preservation = pIcons_LOD->LoadTexture("isg-02-c", TEXTURE_16BIT_PALETTE); | |
1351 uTextureID_PlayerBuff_Hammerhands = pIcons_LOD->LoadTexture("isg-03-c", TEXTURE_16BIT_PALETTE); | |
1352 uTextureID_PlayerBuff_PainReflection = pIcons_LOD->LoadTexture("isg-04-c", TEXTURE_16BIT_PALETTE); | |
0 | 1353 uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc-c", TEXTURE_16BIT_PALETTE); |
984 | 1354 uTextureID_CharacterUI_InventoryBackground = pIcons_LOD->LoadTexture("fr_inven", TEXTURE_16BIT_PALETTE); |
0 | 1355 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeC"); |
1356 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
1357 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchC"); | |
1358 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
1359 } | |
949 | 1360 v3 = TargetColor(0xC8u, 0, 0); |
0 | 1361 v4 = 0; |
1362 v6 = 0; | |
1363 v5 = 10; | |
1364 } | |
373 | 1365 else if (align == PartyAlignment_Neutral) |
0 | 1366 { |
1367 if ( bReplace ) | |
1368 { | |
1369 pTexture_RightFrame->Reload("ib-r-a.pcx"); | |
1370 pTexture_BottomFrame->Reload("ib-b-a.pcx"); | |
1371 pTexture_TopFrame->Reload("ib-t-a.pcx"); | |
1372 pTexture_LeftFrame->Reload("ib-l-a.pcx"); | |
1373 pTexture_StatusBar->Reload("IB-Foot-a.pcx"); | |
1374 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_right_panel], "ib-mb-a", 2); | |
1375 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D8], "ib-autmask-a", 2); | |
1376 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079B4], "IB-COMP-a", 2); | |
1377 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D0], "IB-InitG-a", 2); | |
1378 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079C8], "IB-InitY-a", 2); | |
1379 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079CC], "IB-InitR-a", 2); | |
319 | 1380 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-a", 2); |
1381 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-a", 2); | |
1382 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-a", 2); | |
1383 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-a", 2); | |
995 | 1384 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_GameUI_CharSelectionFrame], "IB-selec-a", 2); |
319 | 1385 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-a", 2); |
1386 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-a", 2); | |
1387 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-a", 2); | |
1388 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-a", 2); | |
569 | 1389 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-a", 2); |
1390 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-a", 2); | |
1391 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-a", 2); | |
1392 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-a", 2); | |
0 | 1393 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeA"); |
1394 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
1395 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchA"); | |
1396 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
526 | 1397 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-a", 2); |
0 | 1398 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc", 2); |
984 | 1399 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_CharacterUI_InventoryBackground], "fr_inven", 2); |
0 | 1400 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Parchment], "parchment", 2); |
1401 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B4], "cornr_ll", 2); | |
1402 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B0], "cornr_lr", 2); | |
1403 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076AC], "cornr_ul", 2); | |
1404 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A8], "cornr_ur", 2); | |
1405 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A4], "edge_btm", 2); | |
1406 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A0], "edge_lf", 2); | |
1407 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50769C], "edge_rt", 2); | |
1408 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507698], "edge_top", 2); | |
1409 pIcons_LOD->ReloadTexture(pTexture_591428, "endcap", 2); | |
1410 } | |
1411 else | |
1412 { | |
1413 pTexture_RightFrame->Load("ib-r-A.pcx", 0); | |
1414 pTexture_BottomFrame->Load("ib-b-A.pcx", 0); | |
1415 pTexture_TopFrame->Load("ib-t-A.pcx", 0); | |
1416 pTexture_LeftFrame->Load("ib-l-A.pcx", 0); | |
1417 pTexture_StatusBar->Load("IB-Foot-a.pcx", 0); | |
1418 uTextureID_right_panel = pIcons_LOD->LoadTexture("ib-mb-A", TEXTURE_16BIT_PALETTE); | |
1419 dword_5079D8 = pIcons_LOD->LoadTexture("ib-autmask-a", TEXTURE_16BIT_PALETTE); | |
1420 dword_5079B4 = pIcons_LOD->LoadTexture("IB-COMP-A", TEXTURE_16BIT_PALETTE); | |
1421 dword_5079D0 = pIcons_LOD->LoadTexture("IB-InitG-a", TEXTURE_16BIT_PALETTE); | |
1422 dword_5079C8 = pIcons_LOD->LoadTexture("IB-InitY-a", TEXTURE_16BIT_PALETTE); | |
1423 dword_5079CC = pIcons_LOD->LoadTexture("IB-InitR-a", TEXTURE_16BIT_PALETTE); | |
319 | 1424 uTextureID_Btn_NPCLeft = pIcons_LOD->LoadTexture("IB-NPCLD-A", TEXTURE_16BIT_PALETTE); |
1425 uTextureID_Btn_NPCRight = pIcons_LOD->LoadTexture("IB-NPCRD-A", TEXTURE_16BIT_PALETTE); | |
995 | 1426 uTextureID_GameUI_CharSelectionFrame = pIcons_LOD->LoadTexture("IB-selec-A", TEXTURE_16BIT_PALETTE); |
319 | 1427 uTextureID_Btn_CastSpell = pIcons_LOD->LoadTexture("ib-m1d-a", TEXTURE_16BIT_PALETTE); |
1428 uTextureID_Btn_Rest = pIcons_LOD->LoadTexture("ib-m2d-a", TEXTURE_16BIT_PALETTE); | |
1429 uTextureID_Btn_QuickReference = pIcons_LOD->LoadTexture("ib-m3d-a", TEXTURE_16BIT_PALETTE); | |
1430 uTextureID_Btn_GameSettings = pIcons_LOD->LoadTexture("ib-m4d-a", TEXTURE_16BIT_PALETTE); | |
328 | 1431 uTextureID_Btn_ZoomIn = pIcons_LOD->LoadTexture("ib-autout-a", TEXTURE_16BIT_PALETTE); |
319 | 1432 uTextureID_Btn_ZoomOut = pIcons_LOD->LoadTexture("ib-autin-a", TEXTURE_16BIT_PALETTE); |
526 | 1433 uExitCancelTextureId = pIcons_LOD->LoadTexture("ib-bcu-a", TEXTURE_16BIT_PALETTE); |
569 | 1434 uTextureID_PlayerBuff_Bless = pIcons_LOD->LoadTexture("isg-01-a", TEXTURE_16BIT_PALETTE); |
1435 uTextureID_PlayerBuff_Preservation = pIcons_LOD->LoadTexture("isg-02-a", TEXTURE_16BIT_PALETTE); | |
1436 uTextureID_PlayerBuff_Hammerhands = pIcons_LOD->LoadTexture("isg-03-a", TEXTURE_16BIT_PALETTE); | |
1437 uTextureID_PlayerBuff_PainReflection = pIcons_LOD->LoadTexture("isg-04-a", TEXTURE_16BIT_PALETTE); | |
0 | 1438 uTextureID_50795C = pIcons_LOD->LoadTexture("evtnpc", TEXTURE_16BIT_PALETTE); |
984 | 1439 uTextureID_CharacterUI_InventoryBackground = pIcons_LOD->LoadTexture("fr_inven", TEXTURE_16BIT_PALETTE); |
0 | 1440 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeA"); |
1441 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
1442 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchA"); | |
1443 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
1444 uTextureID_Parchment = pIcons_LOD->LoadTexture("parchment", TEXTURE_16BIT_PALETTE); | |
1445 uTextureID_5076B4 = pIcons_LOD->LoadTexture("cornr_ll", TEXTURE_16BIT_PALETTE); | |
1446 uTextureID_5076B0 = pIcons_LOD->LoadTexture("cornr_lr", TEXTURE_16BIT_PALETTE); | |
1447 uTextureID_5076AC = pIcons_LOD->LoadTexture("cornr_ul", TEXTURE_16BIT_PALETTE); | |
1448 uTextureID_5076A8 = pIcons_LOD->LoadTexture("cornr_ur", TEXTURE_16BIT_PALETTE); | |
1449 uTextureID_5076A4 = pIcons_LOD->LoadTexture("edge_btm", TEXTURE_16BIT_PALETTE); | |
1450 uTextureID_5076A0 = pIcons_LOD->LoadTexture("edge_lf", TEXTURE_16BIT_PALETTE); | |
1451 uTextureID_50769C = pIcons_LOD->LoadTexture("edge_rt", TEXTURE_16BIT_PALETTE); | |
1452 uTextureID_507698 = pIcons_LOD->LoadTexture("edge_top", TEXTURE_16BIT_PALETTE); | |
948 | 1453 pTexture_591428 = pIcons_LOD->LoadTexturePtr("endcap", TEXTURE_16BIT_PALETTE); |
0 | 1454 |
1455 } | |
949 | 1456 v3 = TargetColor(0xAu, 0, 0); |
0 | 1457 v4 = 214; |
1458 v5 = 230; | |
1459 v6 = 193; | |
1460 } | |
373 | 1461 else if (align == PartyAlignment_Good) |
0 | 1462 { |
1463 if ( bReplace ) | |
1464 { | |
1465 pTexture_RightFrame->Reload("ib-r-B.pcx"); | |
1466 pTexture_BottomFrame->Reload("ib-b-B.pcx"); | |
1467 pTexture_TopFrame->Reload("ib-t-B.pcx"); | |
1468 pTexture_LeftFrame->Reload("ib-l-B.pcx"); | |
1469 pTexture_StatusBar->Reload("IB-Foot-b.pcx"); | |
1470 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_right_panel], "ib-mb-B", 2); | |
1471 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D8], "ib-autmask-b", 2); | |
1472 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079B4], "IB-COMP-B", 2); | |
1473 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079D0], "IB-InitG-b", 2); | |
1474 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079C8], "IB-InitY-b", 2); | |
1475 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[dword_5079CC], "IB-InitR-b", 2); | |
319 | 1476 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCLeft], "IB-NPCLD-B", 2); |
1477 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_NPCRight], "IB-NPCRD-B", 2); | |
1478 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomIn], "ib-autout-B", 2); | |
1479 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_ZoomOut], "ib-autin-B", 2); | |
995 | 1480 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_GameUI_CharSelectionFrame], "IB-selec-B", 2); |
319 | 1481 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_CastSpell], "ib-m1d-b", 2); |
1482 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_Rest], "ib-m2d-b", 2); | |
1483 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_QuickReference], "ib-m3d-b", 2); | |
1484 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Btn_GameSettings], "ib-m4d-b", 2); | |
569 | 1485 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Bless], "isg-01-b", 2); |
1486 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Preservation], "isg-02-b", 2); | |
1487 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_Hammerhands], "isg-03-b", 2); | |
1488 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_PlayerBuff_PainReflection], "isg-04-b", 2); | |
0 | 1489 pUIAnim_WizardEye->uIconID = pIconsFrameTable->FindIcon("wizeyeB"); |
1490 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnim_WizardEye->uIconID); | |
1491 pUIAnum_Torchlight->uIconID = pIconsFrameTable->FindIcon("torchB"); | |
1492 pIconsFrameTable->InitializeAnimation((signed __int16)pUIAnum_Torchlight->uIconID); | |
526 | 1493 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uExitCancelTextureId], "ib-bcu-b", 2); |
0 | 1494 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50795C], "evtnpc-b", 2); |
984 | 1495 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_CharacterUI_InventoryBackground], "fr_inven-b", 2); |
0 | 1496 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_Parchment], "parchment", 2); |
1497 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B4], "cornr_ll-b", 2); | |
1498 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076B0], "cornr_lr-b", 2); | |
1499 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076AC], "cornr_ul-b", 2); | |
1500 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A8], "cornr_ur-b", 2); | |
1501 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A4], "edge_btm-b", 2); | |
1502 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_5076A0], "edge_lf-b", 2); | |
1503 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_50769C], "edge_rt-b", 2); | |
1504 pIcons_LOD->ReloadTexture(&pIcons_LOD->pTextures[uTextureID_507698], "edge_top-b", 2); | |
1505 pIcons_LOD->ReloadTexture(pTexture_591428, "endcap-b", 2); | |
1506 } | |
949 | 1507 v3 = TargetColor(0, 0, 0xC8u); |
0 | 1508 v5 = 255; |
1509 v4 = 225; | |
1510 v6 = 255; | |
1511 } | |
373 | 1512 else assert(false); |
1513 | |
0 | 1514 uGameUIFontMain = v3; |
949 | 1515 uGameUIFontShadow = TargetColor(v5, v4, v6); |
0 | 1516 } |
1517 | |
1518 //----- (00423AEE) -------------------------------------------------------- | |
1519 void __cdecl reset_some_strus_flt_2Cs() | |
1520 { | |
1521 float *v0; // eax@1 | |
1522 signed int v1; // ecx@1 | |
1523 signed int v2; // edx@1 | |
1524 float *v3; // eax@3 | |
1525 signed int v4; // edx@3 | |
1526 float *v5; // eax@5 | |
1527 signed int v6; // edx@5 | |
1528 float *v7; // eax@7 | |
1529 signed int v8; // edx@7 | |
1530 float *v9; // eax@9 | |
1531 | |
1532 v0 = &array_50AC10[0].flt_2C; | |
1533 v1 = 50; | |
1534 v2 = 50; | |
1535 do | |
1536 { | |
1537 *v0 = 0.0; | |
1538 v0 += 12; | |
1539 --v2; | |
1540 } | |
1541 while ( v2 ); | |
1542 v3 = &array_50A2B0[0].flt_2C; | |
1543 v4 = 50; | |
1544 do | |
1545 { | |
1546 *v3 = 0.0; | |
1547 v3 += 12; | |
1548 --v4; | |
1549 } | |
1550 while ( v4 ); | |
1551 v5 = &array_509950[0].flt_2C; | |
1552 v6 = 50; | |
1553 do | |
1554 { | |
1555 *v5 = 0.0; | |
1556 v5 += 12; | |
1557 --v6; | |
1558 } | |
1559 while ( v6 ); | |
1560 v7 = &array_508FF0[0].flt_2C; | |
1561 v8 = 50; | |
1562 do | |
1563 { | |
1564 *v7 = 0.0; | |
1565 v7 += 12; | |
1566 --v8; | |
1567 } | |
1568 while ( v8 ); | |
1569 v9 = &array_508690[0].flt_2C; | |
1570 do | |
1571 { | |
1572 *v9 = 0.0; | |
1573 v9 += 12; | |
1574 --v1; | |
1575 } | |
1576 while ( v1 ); | |
1577 } | |
1578 | |
1579 //----- (00423B4A) -------------------------------------------------------- | |
1580 void __cdecl sub_423B4A() | |
1581 { | |
1582 float *v0; // eax@1 | |
1583 signed int v1; // ecx@1 | |
1584 | |
1585 v0 = &array_507D30[0].flt_2C; | |
1586 v1 = 50; | |
1587 do | |
1588 { | |
1589 *v0 = 0.0; | |
1590 v0 += 12; | |
1591 --v1; | |
1592 } | |
1593 while ( v1 ); | |
1594 } | |
1595 | |
1596 //----- (00423B5D) -------------------------------------------------------- | |
1597 int __fastcall sub_423B5D(unsigned int uFaceID) | |
1598 { | |
1599 BLVFace *v1; // ebx@1 | |
1600 Vec3_short_ *v2; // esi@1 | |
1601 //int v3; // ST28_4@1 | |
1602 __int16 v4; // ST2C_2@1 | |
1603 //signed int v5; // esi@1 | |
1604 //Vec3_short_ *v6; // eax@4 | |
1605 //signed int v7; // edi@5 | |
1606 //signed int v8; // eax@5 | |
1607 //signed int i_; // ecx@10 | |
1608 int v10; // eax@10 | |
1609 int v11; // edx@11 | |
1610 int v12; // ST28_4@12 | |
1611 signed int v13; // edx@12 | |
1612 signed __int64 v14; // qtt@12 | |
1613 int *v15; // ebx@12 | |
1614 int v16; // ST28_4@14 | |
1615 signed int v17; // eax@14 | |
1616 signed __int64 v18; // qtt@14 | |
1617 signed int v19; // edx@15 | |
1618 signed int v20; // edx@17 | |
1619 signed int v21; // ebx@19 | |
1620 signed int v22; // esi@20 | |
1621 int v23; // edi@21 | |
1622 int v24; // eax@21 | |
1623 int v25; // eax@22 | |
1624 int v26; // eax@22 | |
1625 signed int v27; // ST30_4@24 | |
1626 signed __int64 v28; // qtt@24 | |
1627 int v29; // ST18_4@25 | |
1628 int v30; // eax@26 | |
1629 int v31; // eax@27 | |
1630 int v32; // eax@27 | |
1631 signed int v33; // ST30_4@29 | |
1632 signed __int64 v34; // qtt@29 | |
1633 int v35; // ST30_4@30 | |
1634 signed int v36; // edi@31 | |
1635 unsigned int v37; // eax@31 | |
1636 bool v38; // edx@31 | |
1637 int v39; // ecx@31 | |
1638 int v40; // ecx@32 | |
1639 int v41; // esi@32 | |
1640 int v42; // eax@34 | |
1641 signed int v43; // ebx@41 | |
1642 unsigned int v44; // eax@41 | |
1643 signed int v45; // ecx@42 | |
1644 int v46; // esi@42 | |
1645 int v47; // eax@44 | |
1646 signed int v48; // edi@51 | |
1647 unsigned int v49; // eax@51 | |
1648 bool v50; // edx@51 | |
1649 int v51; // ecx@51 | |
1650 int v52; // ecx@52 | |
1651 signed int v53; // esi@52 | |
1652 int v54; // eax@54 | |
1653 int v55; // ebx@61 | |
1654 unsigned int v56; // eax@61 | |
1655 signed int v57; // ecx@62 | |
1656 int v58; // esi@62 | |
1657 int v59; // eax@64 | |
1658 char v61; // zf@72 | |
1659 signed int v62; // edx@75 | |
1660 int v63; // ecx@76 | |
1661 int v64; // esi@76 | |
1662 int v65; // ecx@83 | |
1663 //signed int v66; // [sp+14h] [bp-14h]@3 | |
1664 int v67; // [sp+14h] [bp-14h]@34 | |
1665 int v68; // [sp+14h] [bp-14h]@44 | |
1666 int v69; // [sp+14h] [bp-14h]@54 | |
1667 int v70; // [sp+14h] [bp-14h]@64 | |
1668 signed int v71; // [sp+14h] [bp-14h]@75 | |
1669 bool thisa; // [sp+18h] [bp-10h]@9 | |
1670 int thisb; // [sp+18h] [bp-10h]@12 | |
1671 int thisc; // [sp+18h] [bp-10h]@20 | |
1672 bool thisd; // [sp+18h] [bp-10h]@41 | |
1673 bool thise; // [sp+18h] [bp-10h]@61 | |
1674 int thisf; // [sp+18h] [bp-10h]@74 | |
1675 signed int v79; // [sp+1Ch] [bp-Ch]@9 | |
1676 int v80; // [sp+1Ch] [bp-Ch]@76 | |
1677 bool v81; // [sp+20h] [bp-8h]@10 | |
1678 bool v82; // [sp+20h] [bp-8h]@32 | |
1679 bool v83; // [sp+20h] [bp-8h]@42 | |
1680 bool v84; // [sp+20h] [bp-8h]@52 | |
1681 bool v85; // [sp+20h] [bp-8h]@62 | |
1682 //signed int i; // [sp+24h] [bp-4h]@9 | |
1683 signed int ia; // [sp+24h] [bp-4h]@19 | |
1684 signed int ib; // [sp+24h] [bp-4h]@31 | |
1685 signed int ic; // [sp+24h] [bp-4h]@41 | |
1686 signed int id; // [sp+24h] [bp-4h]@51 | |
1687 signed int ie; // [sp+24h] [bp-4h]@61 | |
1688 | |
1689 v1 = &pIndoor->pFaces[uFaceID]; | |
1690 //this = pGame->pIndoorCameraD3D; | |
1691 v2 = &pIndoor->pVertices[v1->pVertexIDs[0]]; | |
1692 //v3 = *(_DWORD *)&v2->x; | |
1693 v4 = v2->z; | |
1694 //v5 = 0; | |
1695 if ( v1->pFacePlane_old.vNormal.x * (v2->x - pBLVRenderParams->vPartyPos.x) | |
1696 + v1->pFacePlane_old.vNormal.y * (v2->y - pBLVRenderParams->vPartyPos.y) | |
1697 + v1->pFacePlane_old.vNormal.z * (v2->z - pBLVRenderParams->vPartyPos.z) < 0 ) | |
1698 { | |
1699 dword_50B700 = 1; | |
1700 } | |
1701 else | |
1702 { | |
1703 dword_50B700 = 0; | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
1704 if ( !v1->Portal() ) |
0 | 1705 return 0; |
1706 } | |
1707 //v66 = v1->uNumVertices; | |
1708 for (uint i = 0; i < v1->uNumVertices; ++i) | |
1709 { | |
1710 auto v6 = &pIndoor->pVertices[v1->pVertexIDs[i]]; | |
1711 pGame->pIndoorCameraD3D->ApplyViewTransform_TrueIfStillVisible( | |
1712 v6->x, | |
1713 v6->y, | |
1714 v6->z, | |
1715 &_50B924_view_transformed_xs[i], | |
1716 &_50B834_view_transformed_zs[i], | |
1717 &_50B744_view_transformed_ys[i], | |
1718 0); | |
1719 } | |
1720 | |
1721 //v7 = v1->uNumVertices; | |
1722 //v8 = 0; | |
1723 if (v1->uNumVertices <= 0) | |
1724 return 0; | |
1725 | |
1726 bool bFound = false; | |
1727 for (uint i = 0; i < v1->uNumVertices; ++i) | |
1728 if (_50B924_view_transformed_xs[i] >= 0x80000u) | |
1729 { | |
1730 bFound = true; | |
1731 break; | |
1732 } | |
1733 if (!bFound) | |
1734 return 0; | |
1735 | |
1736 v79 = 0; | |
1737 _50B924_view_transformed_xs[v1->uNumVertices] = _50B924_view_transformed_xs[0]; | |
1738 _50B834_view_transformed_zs[v1->uNumVertices] = _50B834_view_transformed_zs[0]; | |
1739 _50B744_view_transformed_ys[v1->uNumVertices] = _50B744_view_transformed_ys[0]; | |
564 | 1740 thisa = _50B924_view_transformed_xs[0] >= (signed int)0x80000u; |
0 | 1741 //int i = 1; |
561 | 1742 for (uint i = 1; i <= v1->uNumVertices; ++i) |
0 | 1743 { |
1744 v10 = _50B924_view_transformed_xs[i]; | |
1745 v81 = v10 >= (signed int)0x80000u; | |
1746 if ( thisa ^ v81 ) | |
1747 { | |
1748 v11 = _50B924_view_transformed_xs[i - 1]; | |
1749 if ( v10 >= (signed int)0x80000u ) | |
1750 { | |
1751 v12 = v10 - v11; | |
1752 v13 = 0x80000 - v11; | |
1753 LODWORD(v14) = v13 << 16; | |
1754 HIDWORD(v14) = v13 >> 16; | |
1755 v15 = &_50B744_view_transformed_ys[i - 1]; | |
486 | 1756 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 | 1757 thisb = (unsigned __int64)((_50B744_view_transformed_ys[i] - _50B744_view_transformed_ys[i - 1]) * v14 / v12) >> 16; |
1758 } | |
1759 else | |
1760 { | |
1761 v16 = v11 - v10; | |
1762 v17 = 0x80000 - v10; | |
1763 LODWORD(v18) = v17 << 16; | |
1764 HIDWORD(v18) = v17 >> 16; | |
1765 v15 = &_50B744_view_transformed_ys[i]; | |
108 | 1766 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 | 1767 thisb = (unsigned __int64)((_50B744_view_transformed_ys[i - 1] - _50B744_view_transformed_ys[i]) * v18 / v16) >> 16; |
1768 } | |
1769 v19 = v79++; | |
1770 //v7 = v66; | |
1771 dword_50B738[v19] = thisb + *v15; | |
1772 dword_50B918[v19] = 0x80000u; | |
1773 } | |
1774 if ( v81 ) | |
1775 { | |
1776 v20 = v79++; | |
1777 dword_50B918[v20] = _50B924_view_transformed_xs[i]; | |
1778 dword_50B828[v20] = _50B834_view_transformed_zs[i]; | |
1779 dword_50B738[v20] = _50B744_view_transformed_ys[i]; | |
1780 } | |
1781 //++i; | |
1782 thisa = v81; | |
1783 } | |
1784 v21 = v79; | |
1785 dword_50B918[v79] = dword_50B918[0]; | |
1786 dword_50B828[v79] = dword_50B828[0]; | |
561 | 1787 dword_50B738[v79] = dword_50B738[0]; |
1788 for (ia = 0; ia < v79; ++ia) | |
0 | 1789 { |
1790 v22 = ia; | |
1791 thisc = abs(dword_50B918[ia]); | |
1792 if ( abs(dword_50B828[ia]) >> 13 <= thisc ) | |
1793 { | |
1794 v27 = dword_50B828[v22]; | |
1795 LODWORD(v28) = v27 << 16; | |
1796 HIDWORD(v28) = v27 >> 16; | |
1797 v26 = v28 / dword_50B918[v22]; | |
1798 v23 = 0; | |
1799 } | |
1800 else | |
1801 { | |
1802 v23 = 0; | |
1803 v24 = 0; | |
1804 if ( dword_50B828[v22] >= 0 ) | |
1805 { | |
1806 LOBYTE(v24) = dword_50B918[v22] >= 0; | |
1807 v26 = ((v24 - 1) & 0xFF800000) + 0x400000; | |
1808 } | |
1809 else | |
1810 { | |
1811 LOBYTE(v24) = dword_50B918[v22] >= 0; | |
1812 v25 = v24 - 1; | |
1813 v26 = (v25 & 0x800000) - 0x400000; | |
1814 } | |
1815 } | |
1816 v29 = dword_50B738[v22]; | |
561 | 1817 dword_50BAF8_xs[v22] = v26; |
0 | 1818 if ( abs(v29) >> 13 <= thisc ) |
1819 { | |
1820 v33 = dword_50B738[v22]; | |
1821 LODWORD(v34) = v33 << 16; | |
1822 HIDWORD(v34) = v33 >> 16; | |
1823 v32 = v34 / dword_50B918[v22]; | |
1824 } | |
1825 else | |
1826 { | |
1827 v30 = 0; | |
1828 if ( dword_50B738[v22] >= v23 ) | |
1829 { | |
1830 LOBYTE(v30) = dword_50B918[v22] >= v23; | |
1831 v32 = ((v30 - 1) & 0xFF800000) + 0x400000; | |
1832 } | |
1833 else | |
1834 { | |
1835 LOBYTE(v30) = dword_50B918[v22] >= v23; | |
1836 v31 = v30 - 1; | |
1837 v32 = (v31 & 0x800000) - 0x400000; | |
1838 } | |
1839 } | |
561 | 1840 dword_50BA08_ys[v22] = v32; |
1841 dword_50BAF8_xs[v22] = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) * (signed __int64)dword_50BAF8_xs[v22]) >> 16; | |
1842 v35 = (unsigned __int64)(SHIWORD(pBLVRenderParams->field_40) * (signed __int64)dword_50BA08_ys[v22]) >> 16; | |
1843 dword_50BAF8_xs[v22] = pBLVRenderParams->uViewportCenterX - dword_50BAF8_xs[v22]; | |
1844 dword_50BA08_ys[v22] = pBLVRenderParams->uViewportCenterY - v35; | |
0 | 1845 } |
1846 v36 = 0; | |
561 | 1847 dword_50BAF8_xs[v21] = dword_50BAF8_xs[0]; |
1848 dword_50BA08_ys[v21] = dword_50BA08_ys[0]; | |
0 | 1849 v37 = pBLVRenderParams->uViewportX; |
561 | 1850 v38 = dword_50BAF8_xs[0] < (signed int)pBLVRenderParams->uViewportX; |
1851 LOBYTE(v38) = dword_50BAF8_xs[0] >= (signed int)pBLVRenderParams->uViewportX; | |
0 | 1852 v39 = 1; |
1853 ib = 1; | |
1854 if ( v79 < 1 ) | |
1855 return 0; | |
1856 do | |
1857 { | |
1858 v40 = v39; | |
561 | 1859 v41 = dword_50BAF8_xs[v40]; |
0 | 1860 v82 = v41 >= (signed int)v37; |
1861 if ( v38 ^ v82 ) | |
1862 { | |
1863 if ( v41 >= (signed int)v37 ) | |
1864 { | |
561 | 1865 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]); |
1866 v42 = dword_50BA08_ys[v40 - 1]; | |
0 | 1867 } |
1868 else | |
1869 { | |
561 | 1870 v67 = (signed int)(v37 - v41) * (signed __int64)(dword_50BA08_ys[v40 - 1] - dword_50BA08_ys[v40]) / (dword_50BAF8_xs[v40 - 1] - v41); |
1871 v42 = dword_50BA08_ys[v40]; | |
0 | 1872 } |
561 | 1873 dword_50B9FC_ys[v36] = v67 + v42; |
1874 v37 = pBLVRenderParams->uViewportX; | |
1875 dword_50BAEC_xs[v36] = pBLVRenderParams->uViewportX; | |
0 | 1876 ++v36; |
1877 } | |
1878 v38 = v82; | |
1879 if ( v82 ) | |
1880 { | |
561 | 1881 dword_50BAEC_xs[v36] = dword_50BAF8_xs[v40]; |
1882 dword_50B9FC_ys[v36] = dword_50BA08_ys[v40]; | |
1883 ++v36; | |
0 | 1884 } |
1885 v39 = ib++ + 1; | |
1886 } | |
1887 while ( ib <= v79 ); | |
1888 | |
486 | 1889 if (v36 < 1) |
0 | 1890 return 0; |
1891 | |
486 | 1892 v43 = 0; |
561 | 1893 dword_50BAEC_xs[v36] = dword_50BAEC_xs[0]; |
1894 dword_50B9FC_ys[v36] = dword_50B9FC_ys[0]; | |
486 | 1895 v44 = pBLVRenderParams->uViewportZ; |
561 | 1896 thisd = dword_50BAEC_xs[0] <= (signed int)pBLVRenderParams->uViewportZ; |
486 | 1897 ic = 1; |
1898 | |
0 | 1899 do |
1900 { | |
1901 v45 = ic; | |
561 | 1902 v46 = dword_50BAEC_xs[ic]; |
0 | 1903 v83 = v46 <= (signed int)v44; |
1904 if ( thisd ^ v83 ) | |
1905 { | |
1906 if ( v46 <= (signed int)v44 ) | |
1907 { | |
561 | 1908 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]); |
1909 v47 = dword_50B9FC_ys[v45 - 1]; | |
0 | 1910 } |
1911 else | |
1912 { | |
561 | 1913 v68 = (signed int)(v44 - v46) * (signed __int64)(dword_50B9FC_ys[v45 - 1] - dword_50B9FC_ys[v45]) / (dword_50BAEC_xs[v45 - 1] - v46); |
1914 v47 = dword_50B9FC_ys[v45]; | |
0 | 1915 } |
561 | 1916 dword_50B9F0[v43] = v68 + v47; |
1917 v44 = pBLVRenderParams->uViewportZ; | |
1918 dword_50BAE0[v43] = pBLVRenderParams->uViewportZ; | |
0 | 1919 ++v43; |
1920 } | |
1921 if ( v83 ) | |
1922 { | |
561 | 1923 dword_50BAE0[v43] = dword_50BAEC_xs[v45]; |
1924 dword_50B9F0[v43++] = dword_50B9FC_ys[v45]; | |
0 | 1925 } |
1926 ++ic; | |
1927 thisd = v83; | |
1928 } | |
1929 while ( ic <= v36 ); | |
486 | 1930 |
1931 if (v43 < 1) | |
0 | 1932 return 0; |
486 | 1933 |
1934 v48 = 0; | |
1935 dword_50BAE0[v43] = dword_50BAE0[0]; | |
1936 dword_50B9F0[v43] = dword_50B9F0[0]; | |
1937 v49 = pBLVRenderParams->uViewportY; | |
1938 v50 = dword_50B9F0[0] < (signed int)pBLVRenderParams->uViewportY; | |
1939 LOBYTE(v50) = dword_50B9F0[0] >= (signed int)pBLVRenderParams->uViewportY; | |
1940 v51 = 1; | |
1941 id = 1; | |
0 | 1942 do |
1943 { | |
1944 v52 = v51; | |
1945 v53 = dword_50B9F0[v52]; | |
1946 v84 = v53 >= (signed int)v49; | |
1947 if ( v50 ^ v84 ) | |
1948 { | |
1949 if ( v53 >= (signed int)v49 ) | |
1950 { | |
561 | 1951 v69 = (signed int)(v49 - dword_50B9F0[v52 - 1]) * (signed __int64)(dword_50BAE0[v52] - dword_50BAE0[v52 - 1]) / (v53 - dword_50B9F0[v52 - 1]); |
1952 v54 = dword_50BAE0[v52 - 1]; | |
0 | 1953 } |
1954 else | |
1955 { | |
561 | 1956 v69 = (signed int)(v49 - v53) * (signed __int64)(dword_50BAE0[v52 - 1] - dword_50BAE0[v52]) / (dword_50B9F0[v52 - 1] - v53); |
0 | 1957 v54 = dword_50BAE0[v52]; |
1958 } | |
561 | 1959 dword_50BAD4[v48] = v69 + v54; |
1960 v49 = pBLVRenderParams->uViewportY; | |
1961 dword_50B9E4[v48] = pBLVRenderParams->uViewportY; | |
0 | 1962 ++v48; |
1963 } | |
1964 v50 = v84; | |
1965 if ( v84 ) | |
1966 { | |
1967 dword_50BAD4[v48] = dword_50BAE0[v52]; | |
561 | 1968 dword_50B9E4[v48++] = dword_50B9F0[v52]; |
0 | 1969 } |
1970 v51 = id++ + 1; | |
1971 } | |
1972 while ( id <= v43 ); | |
486 | 1973 |
1974 if (v48 < 1) | |
0 | 1975 return 0; |
486 | 1976 |
1977 v55 = 0; | |
1978 dword_50BAD4[v48] = dword_50BAD4[0]; | |
561 | 1979 dword_50B9E4[v48] = dword_50B9E4[0]; |
486 | 1980 v56 = pBLVRenderParams->uViewportW; |
561 | 1981 thise = dword_50B9E4[0] <= (signed int)pBLVRenderParams->uViewportW; |
486 | 1982 ie = 1; |
0 | 1983 do |
1984 { | |
1985 v57 = ie; | |
561 | 1986 v58 = dword_50B9E4[ie]; |
0 | 1987 v85 = v58 <= (signed int)v56; |
1988 if ( thise ^ v85 ) | |
1989 { | |
1990 if ( v58 <= (signed int)v56 ) | |
1991 { | |
561 | 1992 v70 = (signed int)(v56 - dword_50B9E4[v57 - 1]) * (signed __int64)(dword_50BAD4[v57] - dword_50BAD4[v57 - 1]) / (v58 - dword_50B9E4[v57 - 1]); |
1993 v59 = dword_50BAD4[v57 - 1]; | |
0 | 1994 } |
1995 else | |
1996 { | |
561 | 1997 v70 = (signed int)(v56 - v58) * (signed __int64)(dword_50BAD4[v57 - 1] - dword_50BAD4[v57]) / (dword_50B9E4[v57 - 1] - v58); |
0 | 1998 v59 = dword_50BAD4[v57]; |
1999 } | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2000 _50BAC8_screen_space_x[v55] = v70 + v59; |
561 | 2001 v56 = pBLVRenderParams->uViewportW; |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2002 _50B9D8_screen_space_y[v55] = pBLVRenderParams->uViewportW; |
0 | 2003 ++v55; |
2004 } | |
2005 if ( v85 ) | |
2006 { | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2007 _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
|
2008 _50B9D8_screen_space_y[v55++] = dword_50B9E4[v57]; |
0 | 2009 } |
2010 ++ie; | |
2011 thise = v85; | |
2012 } | |
2013 while ( ie <= v48 ); | |
486 | 2014 |
0 | 2015 if ( !v55 ) |
2016 return 0; | |
2017 v61 = pRenderer->pRenderD3D == 0; | |
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] = _50BAC8_screen_space_x[0]; |
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2019 _50B9D8_screen_space_y[v55] = _50B9D8_screen_space_y[0]; |
0 | 2020 if ( v61 && v55 > 3 ) |
2021 { | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2022 _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
|
2023 _50B9D8_screen_space_y[v55 + 1] = _50B9D8_screen_space_y[1]; |
0 | 2024 thisf = 2 * (dword_50B700 != 0) - 1; |
2025 if ( v55 > 0 ) | |
2026 { | |
2027 v62 = 1; | |
2028 v71 = 1; | |
2029 do | |
2030 { | |
2031 v63 = v62 - 1; | |
2032 v64 = v62 + 1; | |
2033 v80 = v62 + 1; | |
2034 if ( v62 - 1 >= v55 ) | |
2035 v63 -= v55; | |
2036 if ( v62 >= v55 ) | |
2037 v62 -= v55; | |
2038 if ( v64 >= v55 ) | |
2039 v64 -= v55; | |
2040 if ( thisf | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2041 * ((_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
|
2042 - (_50B9D8_screen_space_y[v62] - _50B9D8_screen_space_y[v63]) * (_50BAC8_screen_space_x[v64] - _50BAC8_screen_space_x[v63])) < 0 ) |
0 | 2043 { |
2044 v62 = v80; | |
2045 v71 = v80; | |
2046 } | |
2047 else | |
2048 { | |
2049 v62 = v71; | |
2050 v65 = v71; | |
2051 if ( v71 < v55 || (v65 = v71 - v55, v71 - v55 < v55) ) | |
2052 { | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2053 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
|
2054 memcpy(&_50BAC8_screen_space_x[v65], &_50BAC8_screen_space_x[v65 + 1], 4 * ((unsigned int)(4 * (v55 - v65)) >> 2)); |
0 | 2055 } |
2056 --v55; | |
2057 } | |
2058 } | |
2059 while ( v62 - 1 < v55 ); | |
2060 } | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2061 _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
|
2062 _50B9D8_screen_space_y[v55] = _50B9D8_screen_space_y[0]; |
0 | 2063 } |
2064 return v55; | |
2065 } | |
2066 | |
2067 //----- (00424579) -------------------------------------------------------- | |
2068 int __fastcall sub_424579(int uFaceID, stru320 *a2) | |
2069 { | |
2070 __debugbreak(); | |
2071 return 0; | |
2072 /*BLVFace *v2; // eax@1 | |
2073 Vec3_short_ *v3; // ebx@1 | |
2074 Vec3_short_ *v4; // esi@1 | |
2075 unsigned int v5; // esi@3 | |
2076 int v7; // ST1C_4@5 | |
2077 int v8; // ST1C_4@5 | |
2078 int v9; // ST1C_4@5 | |
2079 int v10; // ST1C_4@5 | |
2080 int v11; // esi@5 | |
2081 int v12; // ST1C_4@5 | |
2082 unsigned int v15; // ecx@8 | |
2083 unsigned int v19; // ecx@13 | |
2084 signed int v20; // ecx@16 | |
2085 signed int result; // eax@20 | |
2086 signed int v24; // edx@22 | |
2087 unsigned int v25; // [sp+Ch] [bp-1Ch]@3 | |
2088 float v26; // [sp+14h] [bp-14h]@3 | |
2089 float v27; // [sp+1Ch] [bp-Ch]@3 | |
2090 float v28; // [sp+20h] [bp-8h]@3 | |
2091 signed int v29; // [sp+24h] [bp-4h]@3 | |
2092 | |
2093 v2 = &pIndoor->pFaces[uFaceID]; | |
2094 v3 = pIndoor->pVertices; | |
2095 v4 = &pIndoor->pVertices[*v2->pVertexIDs]; | |
2096 if ( v2->pFacePlane_old.vNormal.x * ((signed __int16)*(int *)&v4->x - pBLVRenderParams->vPartyPos.x) | |
2097 + v2->pFacePlane_old.vNormal.y * ((signed __int16)(*(int *)&v4->x >> 16) - pBLVRenderParams->vPartyPos.y) | |
2098 + v2->pFacePlane_old.vNormal.z * (v4->z - pBLVRenderParams->vPartyPos.z) < 0 ) | |
2099 { | |
2100 dword_50B700 = 1; | |
2101 } | |
2102 else | |
2103 { | |
2104 dword_50B700 = 0; | |
2105 if ( !(v2->uAttributes & 1) ) | |
2106 return 0; | |
2107 } | |
2108 v29 = 0; | |
2109 v5 = v2->uNumVertices; | |
2110 __asm { fld pBLVRenderParams->fCosineY } | |
2111 v28 = pBLVRenderParams->fSineY; | |
2112 v26 = pBLVRenderParams->fCosineNegX; | |
2113 v27 = pBLVRenderParams->fSineNegX; | |
2114 v25 = v5; | |
2115 if ( (signed int)v5 > 0 ) | |
2116 { | |
2117 _ECX = (char *)&array_50AC10[0].vWorldPosition.z; | |
2118 do | |
2119 { | |
2120 v7 = v3[v2->pVertexIDs[v29]].x; | |
2121 __asm | |
2122 { | |
2123 fild [ebp+var_10] | |
2124 fstp dword ptr [ecx-8] | |
2125 } | |
2126 v8 = v3[v2->pVertexIDs[v29]].y; | |
2127 __asm | |
2128 { | |
2129 fild [ebp+var_10] | |
2130 fstp dword ptr [ecx-4] | |
2131 } | |
2132 v9 = v3[v2->pVertexIDs[v29]].z; | |
2133 __asm | |
2134 { | |
2135 fild [ebp+var_10] | |
2136 fstp dword ptr [ecx] | |
2137 } | |
2138 _ECX += 48; | |
2139 v10 = a2->pDeltaUV[0] + v2->pVertexUIDs[v29]; | |
2140 __asm | |
2141 { | |
2142 fild [ebp+var_10] | |
2143 fstp dword ptr [ecx-14h] | |
2144 } | |
2145 v11 = a2->pDeltaUV[1] + v2->pVertexVIDs[v29++]; | |
2146 v12 = v11; | |
2147 v5 = v25; | |
2148 __asm | |
2149 { | |
2150 fild [ebp+var_10] | |
2151 fstp dword ptr [ecx-10h] | |
2152 } | |
2153 } | |
2154 while ( v29 < (signed int)v25 ); | |
2155 } | |
2156 _EDX = (char *)&array_50AC10[0].vWorldViewPosition; | |
2157 if ( pBLVRenderParams->sPartyRotX ) | |
2158 { | |
2159 if ( (signed int)v5 > 0 ) | |
2160 { | |
2161 __asm | |
2162 { | |
2163 fild pBLVRenderParams->vPartyPos.x | |
2164 fild pBLVRenderParams->vPartyPos.y | |
2165 fild pBLVRenderParams->vPartyPos.z | |
2166 } | |
2167 _EAX = (char *)&array_50AC10[0].vWorldPosition.z; | |
2168 v15 = v5; | |
2169 do | |
2170 { | |
2171 __asm | |
2172 { | |
2173 fld dword ptr [eax-8] | |
2174 fsub st, st(3) | |
2175 fld dword ptr [eax-4] | |
2176 fsub st, st(3) | |
2177 fld st(1) | |
2178 fmul st, st(6) | |
2179 fld st(1) | |
2180 fmul [ebp+var_8] | |
2181 fsubp st(1), st | |
2182 fstp [ebp+var_4] | |
2183 fld dword ptr [eax] | |
2184 fsub st, st(3) | |
2185 } | |
2186 _EAX += 48; | |
2187 --v15; | |
2188 __asm | |
2189 { | |
2190 fstp [ebp+var_10] | |
2191 fld [ebp+var_4] | |
2192 fmul [ebp+var_14] | |
2193 fld [ebp+var_10] | |
2194 fmul [ebp+var_C] | |
2195 fsubp st(1), st | |
2196 fstp dword ptr [eax-2Ch] | |
2197 fld st(1) | |
2198 fmul [ebp+var_8] | |
2199 fld st(1) | |
2200 fmul st, st(7) | |
2201 faddp st(1), st | |
2202 fstp dword ptr [eax-28h] | |
2203 fstp st | |
2204 fstp st | |
2205 fld [ebp+var_4] | |
2206 fmul [ebp+var_C] | |
2207 fld [ebp+var_10] | |
2208 fmul [ebp+var_14] | |
2209 faddp st(1), st | |
2210 fstp dword ptr [eax-24h] | |
2211 } | |
2212 } | |
2213 while ( v15 ); | |
2214 LABEL_15: | |
2215 __asm | |
2216 { | |
2217 fstp st | |
2218 fstp st | |
2219 fstp st | |
2220 } | |
2221 goto LABEL_16; | |
2222 } | |
2223 } | |
2224 else | |
2225 { | |
2226 if ( (signed int)v5 > 0 ) | |
2227 { | |
2228 __asm | |
2229 { | |
2230 fild pBLVRenderParams->vPartyPos.x | |
2231 fild pBLVRenderParams->vPartyPos.y | |
2232 fild pBLVRenderParams->vPartyPos.z | |
2233 } | |
2234 _EAX = (char *)&array_50AC10[0].vWorldViewPosition; | |
2235 v19 = v5; | |
2236 do | |
2237 { | |
2238 __asm | |
2239 { | |
2240 fld dword ptr [eax-0Ch] | |
2241 fsub st, st(3) | |
2242 fld dword ptr [eax-8] | |
2243 fsub st, st(3) | |
2244 fld st(1) | |
2245 fmul st, st(6) | |
2246 fld st(1) | |
2247 fmul [ebp+var_8] | |
2248 fsubp st(1), st | |
2249 fstp dword ptr [eax] | |
2250 fld st(1) | |
2251 fmul [ebp+var_8] | |
2252 fld st(1) | |
2253 fmul st, st(7) | |
2254 } | |
2255 _EAX += 48; | |
2256 --v19; | |
2257 __asm | |
2258 { | |
2259 faddp st(1), st | |
2260 fstp dword ptr [eax-2Ch] | |
2261 fstp st | |
2262 fstp st | |
2263 fld dword ptr [eax-34h] | |
2264 fsub st, st(1) | |
2265 fstp dword ptr [eax-28h] | |
2266 } | |
2267 } | |
2268 while ( v19 ); | |
2269 goto LABEL_15; | |
2270 } | |
2271 } | |
2272 LABEL_16: | |
2273 v20 = 0; | |
2274 __asm { fstp st } | |
2275 if ( (signed int)v5 <= 0 ) | |
2276 return 0; | |
2277 do | |
2278 { | |
2279 __asm | |
2280 { | |
2281 fld dword ptr [edx] | |
2282 fcomp ds:flt_4D8524 | |
2283 fnstsw ax | |
2284 } | |
2285 if ( !(HIBYTE(_AX) & 1) ) | |
2286 break; | |
2287 ++v20; | |
2288 _EDX += 48; | |
2289 } | |
2290 while ( v20 < (signed int)v5 ); | |
2291 if ( v20 >= (signed int)v5 ) | |
2292 return 0; | |
2293 result = sr_424CD7(v5); | |
2294 if ( result > 0 ) | |
2295 { | |
2296 __asm { fild pBLVRenderParams->field_40 } | |
2297 _ECX = (char *)&array_507D30[0].vWorldViewPosition; | |
2298 v24 = result; | |
2299 __asm | |
2300 { | |
2301 fmul ds:flt_4D84A4 | |
2302 fild pBLVRenderParams->uViewportCenterX | |
2303 fild pBLVRenderParams->uViewportCenterY | |
2304 } | |
2305 do | |
2306 { | |
2307 __asm | |
2308 { | |
2309 fld1 | |
2310 fdiv dword ptr [ecx] | |
2311 } | |
2312 _ECX += 48; | |
2313 --v24; | |
2314 __asm | |
2315 { | |
2316 fld st | |
2317 fmul dword ptr [ecx-2Ch] | |
2318 fmul st, st(4) | |
2319 fsubr st, st(3) | |
2320 fstp dword ptr [ecx-24h] | |
2321 fmul dword ptr [ecx-28h] | |
2322 fmul st, st(3) | |
2323 fsubr st, st(1) | |
2324 fstp dword ptr [ecx-20h] | |
2325 } | |
2326 } | |
2327 while ( v24 ); | |
2328 __asm | |
2329 { | |
2330 fstp st | |
2331 fstp st | |
2332 fstp st | |
2333 } | |
2334 } | |
2335 memcpy(&array_507D30[result], array_507D30, sizeof(array_507D30[result])); | |
2336 return result;*/ | |
2337 } | |
2338 | |
2339 //----- (00424829) -------------------------------------------------------- | |
2340 bool sub_424829(int a1, BspRenderer_stru2 *a2, BspRenderer_stru2 *a3, int a4) | |
2341 { | |
2342 int v4; // edi@1 | |
2343 BspRenderer_stru2 *v5; // ebx@1 | |
2344 int v6; // eax@3 | |
2345 int v7; // esi@5 | |
2346 int v8; // edx@5 | |
2347 int v9; // ecx@6 | |
2348 int v10; // eax@12 | |
2349 int v11; // edi@13 | |
2350 int v12; // edx@18 | |
2351 int v13; // eax@22 | |
2352 int v14; // edi@28 | |
2353 int v15; // ecx@29 | |
2354 int v16; // edi@30 | |
2355 int v17; // edx@35 | |
2356 int v18; // eax@39 | |
2357 int v19; // eax@44 | |
2358 int v20; // ecx@44 | |
2359 int v21; // edi@45 | |
2360 int v22; // edi@46 | |
2361 __int16 *v23; // ecx@47 | |
2362 int v24; // edx@48 | |
2363 int v25; // eax@50 | |
2364 int v26; // eax@55 | |
2365 signed int v27; // edi@55 | |
2366 int v28; // edx@56 | |
2367 int v29; // edx@57 | |
2368 int v30; // eax@59 | |
2369 int v31; // eax@64 | |
2370 signed int v32; // edi@64 | |
2371 int v33; // edx@65 | |
2372 __int16 *v34; // eax@66 | |
2373 __int16 v35; // dx@66 | |
2374 __int16 v36; // dx@67 | |
2375 __int16 v37; // di@67 | |
2376 __int16 v38; // dx@67 | |
2377 BspRenderer_stru2 *v39; // ecx@69 | |
2378 int v40; // edx@69 | |
2379 int v41; // edi@70 | |
2380 __int16 *v42; // eax@76 | |
2381 __int16 *v43; // eax@81 | |
2382 __int16 *v45; // eax@87 | |
2383 int v46; // edx@87 | |
2384 __int16 v47; // cx@88 | |
2385 int v48; // eax@93 | |
2386 int v49; // esi@93 | |
2387 __int16 *v50; // ecx@94 | |
2388 int v51; // eax@95 | |
2389 int v52; // eax@97 | |
2390 int v53; // [sp+Ch] [bp-34h]@44 | |
2391 int v54; // [sp+10h] [bp-30h]@0 | |
2392 int v55; // [sp+14h] [bp-2Ch]@12 | |
2393 __int16 *v56; // [sp+14h] [bp-2Ch]@47 | |
2394 __int16 *v57; // [sp+14h] [bp-2Ch]@76 | |
2395 __int16 *v58; // [sp+14h] [bp-2Ch]@81 | |
2396 __int16 *v59; // [sp+14h] [bp-2Ch]@87 | |
2397 BspRenderer_stru2 *v60; // [sp+18h] [bp-28h]@1 | |
2398 int v61; // [sp+1Ch] [bp-24h]@29 | |
2399 int v62; // [sp+20h] [bp-20h]@0 | |
2400 signed int v63; // [sp+24h] [bp-1Ch]@3 | |
2401 signed int v64; // [sp+28h] [bp-18h]@3 | |
2402 int v65; // [sp+2Ch] [bp-14h]@5 | |
2403 int v66; // [sp+2Ch] [bp-14h]@39 | |
2404 int v67; // [sp+30h] [bp-10h]@22 | |
2405 int v68; // [sp+34h] [bp-Ch]@12 | |
2406 int v69; // [sp+34h] [bp-Ch]@29 | |
2407 int v70; // [sp+34h] [bp-Ch]@46 | |
2408 int v71; // [sp+34h] [bp-Ch]@75 | |
2409 int v72; // [sp+34h] [bp-Ch]@80 | |
2410 int v73; // [sp+38h] [bp-8h]@11 | |
2411 int v74; // [sp+3Ch] [bp-4h]@1 | |
2412 int a3a; // [sp+48h] [bp+8h]@76 | |
2413 int a3b; // [sp+48h] [bp+8h]@87 | |
2414 | |
2415 v4 = a1; | |
2416 v5 = a2; | |
2417 v74 = a1; | |
2418 v60 = a2; | |
2419 if ( !a1 | |
2420 || (!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
|
2421 v7 = _50B9D8_screen_space_y[0], |
0 | 2422 v65 = 0, |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2423 v8 = _50B9D8_screen_space_y[0], |
0 | 2424 a1 <= v6) ) |
2425 return 0; | |
2426 do | |
2427 { | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2428 v9 = _50B9D8_screen_space_y[v6]; |
0 | 2429 if ( v9 >= v7 ) |
2430 { | |
2431 if ( v9 > v8 ) | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2432 v8 = _50B9D8_screen_space_y[v6]; |
0 | 2433 } |
2434 else | |
2435 { | |
2436 v65 = v6; | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2437 v7 = _50B9D8_screen_space_y[v6]; |
0 | 2438 } |
2439 ++v6; | |
2440 } | |
2441 while ( v6 < v4 ); | |
2442 v73 = v8; | |
2443 if ( v8 == v7 ) | |
2444 return 0; | |
2445 v10 = v65; | |
2446 v68 = 0; | |
2447 v5->_viewport_space_y = v7; | |
2448 v5->_viewport_space_w = v8; | |
2449 v55 = v65; | |
2450 if ( v4 > 0 ) | |
2451 { | |
2452 v11 = v65; | |
2453 do | |
2454 { | |
2455 v10 += v64; | |
2456 if ( v10 < v74 ) | |
2457 { | |
2458 if ( v10 < 0 ) | |
2459 v10 += v74; | |
2460 } | |
2461 else | |
2462 { | |
2463 v10 -= v74; | |
2464 } | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2465 v12 = _50B9D8_screen_space_y[v10]; |
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2466 if ( v12 <= _50B9D8_screen_space_y[v11] ) |
0 | 2467 { |
2468 v55 = v10; | |
2469 v11 = v10; | |
2470 } | |
2471 if ( v12 == v73 ) | |
2472 break; | |
2473 ++v68; | |
2474 } | |
2475 while ( v68 < v74 ); | |
2476 } | |
2477 v13 = v55 + v64; | |
2478 v67 = v55 + v64; | |
2479 if ( v55 + v64 < v74 ) | |
2480 { | |
2481 if ( v13 >= 0 ) | |
2482 goto LABEL_27; | |
2483 v13 += v74; | |
2484 } | |
2485 else | |
2486 { | |
2487 v13 -= v74; | |
2488 } | |
2489 v67 = v13; | |
2490 LABEL_27: | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2491 if ( _50B9D8_screen_space_y[v13] != _50B9D8_screen_space_y[v55] ) |
0 | 2492 { |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2493 v14 = _50BAC8_screen_space_x[v55]; |
0 | 2494 v62 = v14 << 16; |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2495 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
|
2496 v5->array_18[v7] = LOWORD(_50BAC8_screen_space_x[v55]); |
0 | 2497 } |
2498 v15 = v65; | |
2499 v69 = 0; | |
2500 v61 = v65; | |
2501 if ( v74 > 0 ) | |
2502 { | |
2503 v16 = v65; | |
2504 do | |
2505 { | |
2506 v15 += v63; | |
2507 if ( v15 < v74 ) | |
2508 { | |
2509 if ( v15 < 0 ) | |
2510 v15 += v74; | |
2511 } | |
2512 else | |
2513 { | |
2514 v15 -= v74; | |
2515 } | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2516 v17 = _50B9D8_screen_space_y[v15]; |
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2517 if ( v17 <= _50B9D8_screen_space_y[v16] ) |
0 | 2518 { |
2519 v61 = v15; | |
2520 v16 = v15; | |
2521 } | |
2522 if ( v17 == v73 ) | |
2523 break; | |
2524 ++v69; | |
2525 } | |
2526 while ( v69 < v74 ); | |
2527 } | |
2528 v18 = v63 + v61; | |
2529 v66 = v63 + v61; | |
2530 if ( v63 + v61 < v74 ) | |
2531 { | |
2532 if ( v18 >= 0 ) | |
2533 goto LABEL_44; | |
2534 v18 += v74; | |
2535 } | |
2536 else | |
2537 { | |
2538 v18 -= v74; | |
2539 } | |
2540 v66 = v18; | |
2541 LABEL_44: | |
2542 v19 = v18; | |
2543 v20 = v61; | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2544 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
|
2545 if ( _50B9D8_screen_space_y[v19] != _50B9D8_screen_space_y[v61] ) |
0 | 2546 { |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2547 v21 = _50BAC8_screen_space_x[v20]; |
0 | 2548 v5 = v60; |
2549 v61 = v21 << 16; | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2550 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
|
2551 v60->array_3D8[v73] = LOWORD(_50BAC8_screen_space_x[v20]); |
0 | 2552 } |
2553 v22 = v7; | |
2554 v70 = v7; | |
2555 if ( v7 <= v73 ) | |
2556 { | |
2557 v56 = &v5->array_3D8[v7]; | |
2558 v23 = &v5->array_18[v7]; | |
2559 do | |
2560 { | |
2561 v24 = v67; | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2562 if ( v22 < _50B9D8_screen_space_y[v67] || v22 == v73 ) |
0 | 2563 goto LABEL_57; |
2564 v25 = v64 + v67; | |
2565 v67 = v25; | |
2566 if ( v25 < v74 ) | |
2567 { | |
2568 if ( v25 >= 0 ) | |
2569 goto LABEL_55; | |
2570 v25 += v74; | |
2571 } | |
2572 else | |
2573 { | |
2574 v25 -= v74; | |
2575 } | |
2576 v67 = v25; | |
2577 LABEL_55: | |
2578 v26 = v25; | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2579 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
|
2580 if ( _50B9D8_screen_space_y[v26] - _50B9D8_screen_space_y[v24] > 0 ) |
0 | 2581 { |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2582 v28 = _50BAC8_screen_space_x[v24]; |
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2583 v54 = ((_50BAC8_screen_space_x[v26] - v28) << 16) / v27; |
0 | 2584 v62 = v28 << 16; |
2585 } | |
2586 LABEL_57: | |
2587 v29 = v66; | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2588 if ( v70 >= _50B9D8_screen_space_y[v66] && v70 != v73 ) |
0 | 2589 { |
2590 v30 = v63 + v66; | |
2591 v66 += v63; | |
2592 if ( v66 >= v74 ) | |
2593 { | |
2594 v30 -= v74; | |
2595 goto LABEL_63; | |
2596 } | |
2597 if ( v30 < 0 ) | |
2598 { | |
2599 v30 += v74; | |
2600 LABEL_63: | |
2601 v66 = v30; | |
2602 } | |
2603 v31 = v30; | |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2604 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
|
2605 if ( _50B9D8_screen_space_y[v31] - _50B9D8_screen_space_y[v29] > 0 ) |
0 | 2606 { |
676
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2607 v33 = _50BAC8_screen_space_x[v29]; |
ecfb1b3c9a39
BLV: when standing right on the portal (orange wall) everything looks fine
Nomad
parents:
652
diff
changeset
|
2608 v53 = ((_50BAC8_screen_space_x[v31] - v33) << 16) / v32; |
0 | 2609 v61 = v33 << 16; |
2610 } | |
2611 } | |
2612 *(__int16 *)((char *)v56 + (int)(char *)v5->array_18 - (char *)v5->array_3D8) = HIWORD(v62); | |
2613 *v56 = HIWORD(v61); | |
2614 v34 = v23 + 480; | |
2615 v35 = v23[480]; | |
2616 if ( *v23 > v35 ) | |
2617 { | |
2618 v36 = *v23 ^ v35; | |
2619 v37 = *v34; | |
2620 *v23 = v36; | |
2621 v38 = v37 ^ v36; | |
2622 *v23 ^= v38; | |
2623 *v34 = v38; | |
2624 } | |
2625 ++v56; | |
2626 v62 += v54; | |
2627 v22 = v70 + 1; | |
2628 v61 += v53; | |
2629 ++v23; | |
2630 ++v70; | |
2631 } | |
2632 while ( v70 <= v73 ); | |
2633 } | |
2634 v39 = a3; | |
2635 v40 = v73; | |
2636 if ( v73 < a3->_viewport_space_y || (v41 = a3->_viewport_space_w, v7 > v41) ) | |
2637 return 0; | |
2638 if ( v7 < a3->_viewport_space_y ) | |
2639 v7 = a3->_viewport_space_y; | |
2640 if ( v73 > v41 ) | |
2641 { | |
2642 v40 = a3->_viewport_space_w; | |
2643 v73 = a3->_viewport_space_w; | |
2644 } | |
2645 v71 = v7; | |
2646 if ( v7 <= v40 ) | |
2647 { | |
2648 a3a = (char *)v5 - (char *)a3; | |
2649 v57 = &v5->array_18[v7]; | |
2650 v42 = &v39->array_3D8[v7]; | |
2651 do | |
2652 { | |
2653 if ( *(__int16 *)((char *)v42 + a3a) >= *(v42 - 480) && *v57 <= *v42 ) | |
2654 break; | |
2655 ++v57; | |
2656 ++v7; | |
2657 ++v71; | |
2658 ++v42; | |
2659 } | |
2660 while ( v71 <= v40 ); | |
2661 } | |
2662 v72 = v40; | |
2663 if ( v40 < v7 ) | |
2664 return 0; | |
2665 v58 = &v5->array_18[v40]; | |
2666 v43 = &v39->array_3D8[v40]; | |
2667 do | |
2668 { | |
2669 if ( *(__int16 *)((char *)v43 + (int)(char *)v5 - (char *)v39) >= *(v43 - 480) && *v58 <= *v43 ) | |
2670 break; | |
2671 --v58; | |
2672 --v40; | |
2673 --v72; | |
2674 --v43; | |
2675 v73 = v40; | |
2676 } | |
2677 while ( v72 >= v7 ); | |
2678 if ( v7 >= v40 ) | |
2679 return 0; | |
2680 a3b = (char *)v39 - (char *)v5; | |
2681 v59 = &v39->array_3D8[v7]; | |
2682 v45 = &v5->array_18[v7]; | |
2683 v46 = v73 - v7 + 1; | |
2684 do | |
2685 { | |
2686 v47 = *(__int16 *)((char *)v45 + a3b); | |
2687 if ( *v45 < v47 ) | |
2688 *v45 = v47; | |
2689 if ( v45[480] > *v59 ) | |
2690 v45[480] = *v59; | |
2691 ++v59; | |
2692 ++v45; | |
2693 --v46; | |
2694 } | |
2695 while ( v46 ); | |
2696 v5->_viewport_space_y = v7; | |
2697 v5->_viewport_space_w = v73; | |
2698 v5->field_8 = v5->array_18[v7]; | |
2699 v48 = v5->array_3D8[v7]; | |
2700 v5->field_10 = v7; | |
2701 v5->field_14 = v7; | |
2702 v49 = v7 + 1; | |
2703 v5->field_C = v48; | |
2704 if ( v49 <= v73 ) | |
2705 { | |
2706 v50 = &v5->array_3D8[v49]; | |
2707 do | |
2708 { | |
2709 v51 = *(v50 - 480); | |
2710 if ( v51 < v5->field_8 ) | |
2711 { | |
2712 v5->field_8 = v51; | |
2713 v5->field_10 = v49; | |
2714 } | |
2715 v52 = *v50; | |
2716 if ( v52 > v5->field_C ) | |
2717 { | |
2718 v5->field_C = v52; | |
2719 v5->field_14 = v49; | |
2720 } | |
2721 ++v49; | |
2722 ++v50; | |
2723 } | |
2724 while ( v49 <= v73 ); | |
2725 } | |
2726 return 1; | |
2727 } | |
2728 // 50B700: using guessed type int dword_50B700; | |
2729 | |
2730 //----- (00424CD7) -------------------------------------------------------- | |
2731 signed int __fastcall sr_424CD7(unsigned int uVertexID) | |
2732 { | |
2733 unsigned int v1; // edx@1 | |
2734 signed int v2; // edi@1 | |
2735 char *v3; // esi@4 | |
2736 char *v4; // ecx@4 | |
2737 unsigned int v5; // eax@4 | |
2738 char *v6; // edx@4 | |
2739 double v7; // st6@10 | |
2740 double v8; // st5@10 | |
2741 double v9; // st6@11 | |
2742 unsigned __int8 v10; // c2@15 | |
2743 unsigned __int8 v11; // c3@15 | |
2744 RenderVertexSoft *v12; // edi@22 | |
2745 char *v13; // eax@22 | |
2746 double v14; // st6@22 | |
2747 signed int result; // eax@24 | |
2748 unsigned int v16; // [sp+8h] [bp-28h]@4 | |
2749 bool v17; // [sp+Ch] [bp-24h]@6 | |
2750 char *v18; // [sp+10h] [bp-20h]@4 | |
2751 char *v19; // [sp+14h] [bp-1Ch]@4 | |
2752 signed int v20; // [sp+18h] [bp-18h]@1 | |
2753 RenderVertexSoft *v21; // [sp+1Ch] [bp-14h]@4 | |
2754 char *v22; // [sp+20h] [bp-10h]@4 | |
2755 char *v23; // [sp+24h] [bp-Ch]@4 | |
2756 char *v24; // [sp+28h] [bp-8h]@4 | |
2757 char *v25; // [sp+2Ch] [bp-4h]@4 | |
2758 | |
2759 v1 = uVertexID; | |
2760 memcpy(&array_50AC10[uVertexID], array_50AC10, sizeof(array_50AC10[uVertexID])); | |
2761 v2 = 0; | |
2762 v20 = 0; | |
2763 if ( array_50AC10[0].vWorldViewPosition.x >= 8.0 ) | |
2764 v2 = 1; | |
2765 if ( (signed int)(uVertexID + 1) <= 1 ) | |
2766 return 0; | |
2767 v3 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
2768 v4 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
2769 v5 = v1; | |
168 | 2770 v23 = (char *)&array_507D30[0]._rhw; |
0 | 2771 v21 = array_507D30; |
2772 v18 = (char *)&array_507D30[0].vWorldViewPosition.z; | |
2773 v19 = (char *)&array_507D30[0].vWorldViewPosition.y; | |
2774 v22 = (char *)&array_507D30[0].vWorldViewPosition; | |
2775 v24 = (char *)&array_507D30[0].v; | |
2776 v25 = (char *)&array_507D30[0].u; | |
2777 v6 = (char *)&array_50AC10[0].v; | |
2778 v16 = v5; | |
2779 do | |
2780 { | |
2781 v17 = *((float *)v6 + 5) >= 8.0; | |
2782 if ( v2 != v17 ) | |
2783 { | |
2784 if ( v17 ) | |
2785 { | |
2786 v7 = (8.0 - *((float *)v6 - 7)) / (*((float *)v6 + 5) - *((float *)v6 - 7)); | |
2787 *(float *)v4 = (*((float *)v6 + 6) - *((float *)v6 - 6)) * v7 + *((float *)v6 - 6); | |
2788 *(float *)v3 = (*((float *)v6 + 7) - *((float *)v6 - 5)) * v7 + *((float *)v6 - 5); | |
2789 *(float *)v25 = (*((float *)v6 + 11) - *((float *)v6 - 1)) * v7 + *((float *)v6 - 1); | |
2790 v8 = (*((float *)v6 + 12) - *(float *)v6) * v7 + *(float *)v6; | |
2791 } | |
2792 else | |
2793 { | |
2794 v9 = (8.0 - *((float *)v6 + 5)) / (*((float *)v6 - 7) - *((float *)v6 + 5)); | |
2795 *(float *)v4 = (*((float *)v6 - 6) - *((float *)v6 + 6)) * v9 + *((float *)v6 + 6); | |
2796 *(float *)v3 = (*((float *)v6 - 5) - *((float *)v6 + 7)) * v9 + *((float *)v6 + 7); | |
2797 *(float *)v25 = (*((float *)v6 - 1) - *((float *)v6 + 11)) * v9 + *((float *)v6 + 11); | |
2798 v8 = (*(float *)v6 - *((float *)v6 + 12)) * v9 + *((float *)v6 + 12); | |
2799 } | |
2800 *(float *)v24 = v8; | |
2801 *(float *)v22 = 8.0; | |
2802 *(int *)v23 = 0x3E000000u; | |
2803 if ( v2 ) | |
2804 { | |
2805 if ( 8.0 == *((float *)v6 - 7) && *(float *)v4 == *((float *)v6 - 6) ) | |
2806 { | |
2807 v10 = 0; | |
2808 v11 = *(float *)v3 == *((float *)v6 - 5); | |
2809 goto LABEL_19; | |
2810 } | |
2811 } | |
2812 else | |
2813 { | |
2814 if ( 8.0 == *((float *)v6 + 5) && *(float *)v4 == *((float *)v6 + 6) ) | |
2815 { | |
2816 v10 = 0; | |
2817 v11 = *(float *)v3 == *((float *)v6 + 7); | |
2818 LABEL_19: | |
2819 if ( v11 | v10 ) | |
2820 goto LABEL_21; | |
2821 goto LABEL_20; | |
2822 } | |
2823 } | |
2824 LABEL_20: | |
2825 ++v21; | |
2826 v22 += 48; | |
2827 v24 += 48; | |
2828 v25 += 48; | |
2829 v4 += 48; | |
2830 v3 += 48; | |
2831 ++v20; | |
2832 v23 += 48; | |
2833 v19 = v4; | |
2834 v18 = v3; | |
2835 } | |
2836 LABEL_21: | |
2837 if ( v17 ) | |
2838 { | |
2839 v12 = v21; | |
2840 v13 = v23; | |
2841 v19 += 48; | |
2842 v18 += 48; | |
2843 v14 = 1.0 / (*((float *)v6 + 5) + 0.0000001); | |
2844 ++v20; | |
2845 v25 += 48; | |
2846 v24 += 48; | |
2847 v22 += 48; | |
2848 ++v21; | |
2849 v23 += 48; | |
2850 memcpy(v12, v6 + 8, 0x30u); | |
2851 v4 = v19; | |
2852 v3 = v18; | |
2853 *(float *)v13 = v14; | |
2854 } | |
2855 v2 = v17; | |
2856 v6 += 48; | |
2857 --v16; | |
2858 } | |
2859 while ( v16 ); | |
2860 result = v20; | |
2861 if ( v20 < 3 ) | |
2862 return 0; | |
2863 return result; | |
2864 } |