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