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