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