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