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