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