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