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