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