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