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