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