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