Mercurial > mm7
annotate mm7_2.cpp @ 2412:e7a551f458e1
LoadSound - cause of the crash exe file
author | Ritor1 |
---|---|
date | Wed, 16 Jul 2014 17:22:12 +0600 |
parents | 8cee51ce4382 |
children | f4af3b203f65 |
rev | line source |
---|---|
2253
aff7a7b072b7
adding _CRT_SECURE_NO_WARNINGS to get rid of a few hundrer annoying warnings + adding count parameter to swprintf
Grumpy7
parents:
2235
diff
changeset
|
1 #define _CRT_SECURE_NO_WARNINGS |
0 | 2 #include <io.h> |
3 #include <direct.h> | |
2336 | 4 #include "mm7_unsorted_subs.h" |
2350
7c10dfb6d802
Finishing moving all known UI functions to their appropriate headers
Grumpy7
parents:
2341
diff
changeset
|
5 #include "UI\UIPartyCreation.h" |
7c10dfb6d802
Finishing moving all known UI functions to their appropriate headers
Grumpy7
parents:
2341
diff
changeset
|
6 #include "GUIButton.h" |
2336 | 7 |
8 | |
1262 | 9 #include "mm7_data.h" |
1016 | 10 #include "Sprites.h" |
11 | |
12 #include "LightmapBuilder.h" | |
13 #include "DecalBuilder.h" | |
14 #include "ParticleEngine.h" | |
15 #include "Mouse.h" | |
16 #include "Keyboard.h" | |
17 #include "CShow.h" | |
18 #include "GammaControl.h" | |
19 #include "stru6.h" | |
20 | |
21 #include "Vis.h" | |
0 | 22 #include "MapInfo.h" |
23 #include "Game.h" | |
24 #include "GUIWindow.h" | |
25 #include "GUIFont.h" | |
26 #include "Party.h" | |
27 #include "AudioPlayer.h" | |
28 #include "Outdoor.h" | |
1637 | 29 #include "Outdoor_stuff.h" |
0 | 30 #include "Overlays.h" |
31 #include "Arcomage.h" | |
32 #include "LOD.h" | |
2337
d04017f3d2fa
LightsStack_StationaryLight_::AddLight moved to LightStack.cpp
Grumpy7
parents:
2336
diff
changeset
|
33 #include "Log.h" |
0 | 34 #include "Actor.h" |
35 #include "Events.h" | |
36 #include "Viewport.h" | |
2037
7a9477135943
Renamed Math.h -> OurMath.h (file resolution was sometimes ambiguous)
Nomad
parents:
2035
diff
changeset
|
37 #include "OurMath.h" |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
496
diff
changeset
|
38 #include "SpriteObject.h" |
0 | 39 #include "ObjectList.h" |
40 #include "Chest.h" | |
41 #include "PaletteManager.h" | |
42 #include "DecorationList.h" | |
43 #include "SaveLoad.h" | |
44 #include "stru123.h" | |
2386 | 45 #include "MapsLongTimer.h" |
2044 | 46 #include "Timer.h" |
0 | 47 #include "IconFrameTable.h" |
48 #include "GUIProgressBar.h" | |
49 #include "Bink_Smacker.h" | |
50 #include "PlayerFrameTable.h" | |
51 #include "TurnEngine.h" | |
52 #include "FactionTable.h" | |
53 #include "StorylineTextTable.h" | |
54 #include "Random.h" | |
924 | 55 #include "CastSpellInfo.h" |
0 | 56 #include "stru298.h" |
1299 | 57 #include "UI\UIHouses.h" |
189 | 58 #include "texts.h" |
522 | 59 #include "MM7.h" |
1262 | 60 #include "Lights.h" |
1815 | 61 #include "NewUI/MainMenu.h" |
1828
35c1e4ff6ba7
party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents:
1826
diff
changeset
|
62 #include "Level/Decoration.h" |
2052 | 63 #include "LuaVM.h" |
2290 | 64 #include "MMT.h" |
2341 | 65 #include "Registry.h" |
2052 | 66 |
1913 | 67 int __stdcall aWinProc(HWND hWnd, UINT Msg, WPARAM wParam, unsigned int lParam); |
68 int __stdcall InsertMM7CDDialogFunc(HWND hDlg, int a2, __int16 a3, int a4); | |
69 bool __fastcall FindMM7CD(HWND hWnd, char *pCDDrive); | |
70 bool __fastcall Initialize(HINSTANCE hInst, char *pCmdLine); | |
71 | |
72 | |
0 | 73 //----- (004BBA85) -------------------------------------------------------- |
1529 | 74 void CheckBountyRespawnAndAward() |
0 | 75 { |
76 int i; // eax@2 | |
1529 | 77 int rand_monster_id; // edx@3 |
0 | 78 |
79 uDialogueType = 83; | |
80 pDialogueWindow->Release(); | |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2212
diff
changeset
|
81 pDialogueWindow = GUIWindow::Create(0, 0, window->GetWidth(), 350, WINDOW_MainMenu, 0, 0); |
1529 | 82 pBtn_ExitCancel = pDialogueWindow->CreateButton(471, 445, 169, 35, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[34],// "Cancel" |
945 | 83 pIcons_LOD->GetTexture(uExitCancelTextureId), 0); |
832 | 84 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", 0); |
1529 | 85 pDialogueWindow->CreateButton(480, 160, 140, 30, 1, 0, UIMSG_0, 83, 0, "", 0); |
972 | 86 pDialogueWindow->_41D08F_set_keyboard_control_group(1, 1, 0, 2); |
747 | 87 dialog_menu_id = HOUSE_DIALOGUE_OTHER; |
1529 | 88 //get new monster for hunting |
1747
cecb080929c4
Party_stru0 renamed to PartyTimeStruct, fixed its members, renamed Party::field_3C to Party::PartyTimes, started Player::SetVariable refactoring start
Grumpy7
parents:
1736
diff
changeset
|
89 if ( pParty->PartyTimes.bountyHunting_next_generation_time[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] < (signed __int64)pParty->uTimePlayed ) |
1529 | 90 { |
91 pParty->monster_for_hunting_killed[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] = false; | |
1747
cecb080929c4
Party_stru0 renamed to PartyTimeStruct, fixed its members, renamed Party::field_3C to Party::PartyTimes, started Player::SetVariable refactoring start
Grumpy7
parents:
1736
diff
changeset
|
92 pParty->PartyTimes.bountyHunting_next_generation_time[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] = (signed __int64)((double)(0x12750000 * (pParty->uCurrentMonth + 12i64 * pParty->uCurrentYear - 14015)) * 0.033333335); |
0 | 93 for ( i = rand(); ; i = rand() ) |
94 { | |
1529 | 95 rand_monster_id = i % 258 + 1; |
96 pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] = rand_monster_id; | |
97 if ( (unsigned __int16)rand_monster_id < 0x73u || (unsigned __int16)rand_monster_id > 0x84u ) | |
0 | 98 { |
1529 | 99 if ( ((unsigned __int16)rand_monster_id < 0xEBu || (unsigned __int16)rand_monster_id > 0xFCu) |
100 && ((unsigned __int16)rand_monster_id < 0x85u || (unsigned __int16)rand_monster_id > 0x96u) | |
101 && ((unsigned __int16)rand_monster_id < 0x97u || (unsigned __int16)rand_monster_id > 0xBAu) | |
102 && ((unsigned __int16)rand_monster_id < 0xC4u || (unsigned __int16)rand_monster_id > 0xC6u) ) | |
0 | 103 break; |
104 } | |
105 } | |
106 } | |
1529 | 107 bountyHunting_monster_id_for_hunting = pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)]; |
108 if ( !pParty->monster_for_hunting_killed[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] ) | |
109 { | |
110 bountyHunting_text = pNPCTopics[351].pText; | |
111 if ( !pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] ) | |
112 bountyHunting_text = pNPCTopics[353].pText; | |
113 } | |
114 else//get prize | |
115 { | |
116 if ( pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] ) | |
0 | 117 { |
1828
35c1e4ff6ba7
party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents:
1826
diff
changeset
|
118 pParty->PartyFindsGold(100 * pMonsterStats->pInfos[(unsigned __int16)pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)]].uLevel, 0); |
1529 | 119 for ( uint i = 0; i < 4; ++i ) |
120 pParty->pPlayers[i].SetVariable(VAR_Award, 86); | |
121 pParty->uNumBountiesCollected += 100 * pMonsterStats->pInfos[pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)]].uLevel; | |
122 pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] = 0; | |
123 pParty->monster_for_hunting_killed[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] = false; | |
0 | 124 } |
1529 | 125 bountyHunting_text = pNPCTopics[352].pText; |
126 } | |
0 | 127 } |
128 | |
129 //----- (004BF91E) -------------------------------------------------------- | |
2061 | 130 unsigned int GameOverMenu(void *ecx0) |
0 | 131 { |
1838 | 132 const char *v1; // eax@2 |
0 | 133 unsigned int result; // eax@3 |
1838 | 134 const char *v6; // eax@10 |
135 const char *v7; // edx@10 | |
136 const char *v8; // ecx@12 | |
137 const char *v9; // eax@14 | |
0 | 138 unsigned int v10; // eax@25 |
139 GUIWindow pWindow; // [sp+34h] [bp-9Ch]@1 | |
140 unsigned int v14; // [sp+A4h] [bp-2Ch]@5 | |
141 void *v15; // [sp+A8h] [bp-28h]@1 | |
1838 | 142 const char *pInString; // [sp+ACh] [bp-24h]@5 |
0 | 143 unsigned int v17; // [sp+B0h] [bp-20h]@5 |
144 unsigned int v18; // [sp+B4h] [bp-1Ch]@5 | |
145 unsigned int v19; // [sp+B8h] [bp-18h]@5 | |
146 int v20; // [sp+BCh] [bp-14h]@7 | |
147 GUIFont *pFont; // [sp+C4h] [bp-Ch]@1 | |
148 unsigned __int64 v23; // [sp+C8h] [bp-8h]@5 | |
149 | |
150 v15 = ecx0; | |
151 | |
152 RGBTexture _this; // [sp+Ch] [bp-C4h]@1 | |
153 //RGBTexture::RGBTexture(&this); | |
154 | |
2061 | 155 dword_6BE364_game_settings_1 &= ~GAME_SETTINGS_4000; |
0 | 156 bGameoverLoop = 1; |
157 pVideoPlayer->bStopBeforeSchedule = 0; | |
158 pAudioPlayer->StopChannels(-1, -1); | |
159 pRenderer->BeginScene(); | |
160 pRenderer->ClearBlack(); | |
161 pRenderer->EndScene(); | |
162 pRenderer->Present(); | |
165 | 163 pVideoPlayer->pResetflag = 0; |
484 | 164 _449B57_test_bit(pParty->_quest_bits, 99); |
0 | 165 _this.Load("winbg.pcx", 2); |
166 pRenderer->BeginScene(); | |
167 pRenderer->DrawTextureRGB(0, 0, &_this); | |
168 pRenderer->EndScene(); | |
169 free(_this.pPixels); | |
170 _this.pPixels = 0; | |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2212
diff
changeset
|
171 window_SpeakInHouse = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_MainMenu, 0, 0); |
0 | 172 pWindow.uFrameX = 75; |
173 pWindow.uFrameY = 60; | |
174 pWindow.uFrameWidth = 469; | |
175 pWindow.uFrameHeight = 338; | |
176 pWindow.uFrameZ = 543; | |
177 pWindow.uFrameW = 397; | |
180 | 178 pFont = LoadFont("endgame.fnt", "FONTPAL", NULL); |
1359
60cdc3eac407
_449B57_test_bit(pParty->_quest_bits, 99) and _449B57_test_bit(pParty->_quest_bits, 100) changed to Party::IsPartyGood, Party::IsPartyEvil, respectively
Grumpy7
parents:
1330
diff
changeset
|
179 if ( pParty->IsPartyGood() ) |
2133 | 180 v1 = pGlobalTXT_LocalizationStrings[675];//"Splendid job! With the activation of the Gate, a thousand worlds lie at your feet. Perhaps on one of them you will find the Ancients themselves, and return with the fruits their great civilization has to offer your world and your kingdom." |
0 | 181 else |
182 { | |
1359
60cdc3eac407
_449B57_test_bit(pParty->_quest_bits, 99) and _449B57_test_bit(pParty->_quest_bits, 100) changed to Party::IsPartyGood, Party::IsPartyEvil, respectively
Grumpy7
parents:
1330
diff
changeset
|
183 result = pParty->IsPartyEvil(); |
0 | 184 if ( !(short)result ) |
185 return result; | |
2133 | 186 v1 = pGlobalTXT_LocalizationStrings[676];//"Brilliant! The completion of the Heavenly Forge has provided enough Ancient weapons to crush all resistance to your plans. Soon the world will bow to your every whim! Still, you can't help but wonder what was beyond the Gate the other side was trying so hard to build." |
0 | 187 } |
188 pInString = v1; | |
189 v23 = pParty->uTimePlayed - 138240; | |
2373 | 190 v19 = (unsigned int)((signed __int64)((double)(pParty->uTimePlayed - 138240) * 0.234375) / 60 / 60) / 24; |
191 v14 = (unsigned int)((signed __int64)((double)(pParty->uTimePlayed - 138240) * 0.234375) / 60 / 60) / 24 / 0x1C / 0xC; | |
192 v18 = (unsigned int)((signed __int64)((double)(pParty->uTimePlayed - 138240) * 0.234375) / 60 / 60) / 24 / 0x1C % 0xC; | |
0 | 193 v17 = v19 % 0x1C; |
194 if ( !v19 ) | |
195 v19 = 1; | |
196 pRenderer->BeginScene(); | |
2133 | 197 pWindow.DrawTitleText(pFont, 1, 0x23, 1, pGlobalTXT_LocalizationStrings[9], 3);//Congratulations! |
0 | 198 v23 = 0i64; |
199 v20 = 0; | |
2133 | 200 for ( uint i = 0; i < 4; i++ ) |
89 | 201 { |
2133 | 202 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[129], pParty->pPlayers[i].pName, pParty->pPlayers[i].GetBaseLevel(), pClassNames[pParty->pPlayers[i].classType]);//%s the Level %u %s |
203 pWindow.DrawTitleText(pFont, 1, i * (LOBYTE(pFont->uFontHeight) - 2) + LOBYTE(pFont->uFontHeight) + 46, 1, pTmpBuf.data(), 3); | |
204 v23 += pParty->pPlayers[i].uExperience;//__PAIR__(*(int *)(i - 4), *(int *)(i - 8)); | |
0 | 205 } |
206 v23 = (signed __int64)v23 / v19; | |
2133 | 207 v6 = FitTextInAWindow(pInString, pFont, &pWindow, 0xC, 0); |
208 pWindow.DrawTitleText(pFont, 1, 5 * (LOBYTE(pFont->uFontHeight) + 11), 1, v6, 0); | |
209 strcpy(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[37]);//Total Time: | |
2373 | 210 |
0 | 211 v7 = pGlobalTXT_LocalizationStrings[56]; |
212 if ( v17 != 1 ) | |
213 v7 = pGlobalTXT_LocalizationStrings[57]; | |
2373 | 214 |
215 v8 = pGlobalTXT_LocalizationStrings[146];//Month, Ìåñÿö | |
0 | 216 if ( v18 != 1 ) |
2373 | 217 v8 = pGlobalTXT_LocalizationStrings[148];//Months,Ìåñÿöåâ |
218 | |
0 | 219 v9 = pGlobalTXT_LocalizationStrings[245]; |
220 if ( v14 != 1 ) | |
221 v9 = pGlobalTXT_LocalizationStrings[132]; | |
2373 | 222 |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1203
diff
changeset
|
223 sprintf(pTmpBuf2.data(), " %lu %s, %lu %s, %lu %s ", v14, v9, v18, v8, v17, v7); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1203
diff
changeset
|
224 strcat(pTmpBuf.data(), pTmpBuf2.data()); |
2386 | 225 pWindow.DrawTitleText(pFont, 1, pWindow.uFrameHeight - 2 * LOBYTE(pFont->uFontHeight) - 5, 1, pTmpBuf.data(), 3); |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1203
diff
changeset
|
226 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[94], v23); |
2386 | 227 pWindow.DrawTitleText(pFont, 1, pWindow.uFrameHeight, 1, pTmpBuf.data(), 3); |
2061 | 228 dword_6BE364_game_settings_1 |= GAME_SETTINGS_4000; |
0 | 229 pRenderer->EndScene(); |
230 pRenderer->Present(); | |
2153 | 231 //if ( pRenderer->pRenderD3D ) |
0 | 232 pRenderer->pBeforePresentFunction(); |
2069 | 233 pRenderer->SaveWinnersCertificate("MM7_Win.Pcx"); |
1583 | 234 free(pFont); |
336 | 235 window_SpeakInHouse->Release(); |
236 window_SpeakInHouse = 0; | |
0 | 237 if ( v15 == (void *)2 ) |
238 { | |
239 result = pMessageQueue_50CBD0->uNumMessages; | |
240 } | |
241 else | |
242 { | |
243 LODWORD(v23) = GetTickCount() + 5000; | |
244 while ( (unsigned int)v23 > GetTickCount() ) | |
245 ; | |
1532 | 246 for (MSG msg; PeekMessage(&msg, 0, 0, 0, PM_REMOVE);) |
0 | 247 { |
1532 | 248 if (msg.message == WM_QUIT) |
0 | 249 Game_DeinitializeAndTerminate(0); |
1532 | 250 TranslateMessage(&msg); |
251 DispatchMessage(&msg); | |
0 | 252 } |
253 if ( pMessageQueue_50CBD0->uNumMessages ) | |
254 { | |
255 LOBYTE(v10) = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
256 pMessageQueue_50CBD0->uNumMessages = v10; | |
257 } | |
258 pKeyActionMap->ResetKeys(); | |
259 pKeyActionMap->uLastKeyPressed = 0; | |
260 do | |
261 { | |
1532 | 262 for (MSG msg; PeekMessage(&msg, 0, 0, 0, PM_REMOVE);) |
0 | 263 { |
1532 | 264 if (msg.message == WM_QUIT) |
0 | 265 Game_DeinitializeAndTerminate(0); |
1532 | 266 TranslateMessage(&msg); |
267 DispatchMessage(&msg); | |
0 | 268 } |
269 } | |
270 while ( !pKeyActionMap->uLastKeyPressed ); | |
271 result = pMessageQueue_50CBD0->uNumMessages; | |
272 if ( pMessageQueue_50CBD0->uNumMessages ) | |
273 { | |
274 result = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
275 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
276 } | |
277 } | |
278 if ( v15 ) | |
279 { | |
437 | 280 /*if ( (signed int)result < 40 ) |
281 { | |
282 pMessageQueue_50CBD0->pMessages[result].eType = UIMSG_Quit; | |
283 }*/ | |
2402 | 284 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_Quit, 1, 0); |
0 | 285 } |
286 else | |
287 { | |
2402 | 288 pMessageQueue_50CBD0->AddGUIMessage(UIMSG_ShowFinalWindow, 1, 0); |
437 | 289 /*if ( (signed int)result < 40 ) |
290 { | |
291 pMessageQueue_50CBD0->pMessages[result].eType = UIMSG_C5; | |
0 | 292 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1; |
293 result = 3 * pMessageQueue_50CBD0->uNumMessages + 3; | |
294 *(&pMessageQueue_50CBD0->uNumMessages + result) = 0; | |
295 ++pMessageQueue_50CBD0->uNumMessages; | |
437 | 296 }*/ |
0 | 297 } |
298 bGameoverLoop = 0; | |
299 return result; | |
300 } | |
301 | |
302 //----- (00451007) -------------------------------------------------------- | |
1148
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
303 int stru350::sub_451007_scale_image_bicubic(unsigned short *pSrc, int srcWidth, int srcHeight, int srcPitch, //changing this to some library function might be a good idea |
0 | 304 unsigned short *pDst, int dstWidth, int dstHeight, int dstPitch, |
305 int a10, int a11) | |
306 { | |
307 int result; // eax@1 | |
308 float v17; // ST3C_4@12 | |
309 float v18; // ST38_4@12 | |
310 unsigned int v19; // esi@12 | |
311 int v21; // eax@18 | |
312 unsigned int v22; // ecx@25 | |
313 unsigned int v23; // eax@29 | |
1146
b4ade2580ae3
sub_451007_scale_image_bicubic cleanup - some variable renaming, code shuffling
Grumpy7
parents:
1145
diff
changeset
|
314 unsigned int heightRatioPlusOne; // [sp+Ch] [bp-7Ch]@12 |
b4ade2580ae3
sub_451007_scale_image_bicubic cleanup - some variable renaming, code shuffling
Grumpy7
parents:
1145
diff
changeset
|
315 unsigned int widthRatio; // [sp+Ch] [bp-7Ch]@218 |
b4ade2580ae3
sub_451007_scale_image_bicubic cleanup - some variable renaming, code shuffling
Grumpy7
parents:
1145
diff
changeset
|
316 unsigned int heightRatio; // [sp+14h] [bp-74h]@12 |
b4ade2580ae3
sub_451007_scale_image_bicubic cleanup - some variable renaming, code shuffling
Grumpy7
parents:
1145
diff
changeset
|
317 unsigned int widthRatioPlusOne; // [sp+14h] [bp-74h]@218 |
2334 | 318 // int v160; // [sp+3Ch] [bp-4Ch]@13 |
0 | 319 unsigned __int16 *v175; // [sp+4Ch] [bp-3Ch]@13 |
320 unsigned __int16 *v193; // [sp+5Ch] [bp-2Ch]@7 | |
2314 | 321 //signed int v231; // [sp+78h] [bp-10h]@7 |
0 | 322 __int64 v240; // [sp+7Ch] [bp-Ch]@12 |
323 unsigned int v251; // [sp+80h] [bp-8h]@218 | |
1148
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
324 unsigned int v252; // [sp+84h] [bp-4h]@218 |
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
325 float a6s; // [sp+A0h] [bp+18h]@218 |
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
326 float a6t; // [sp+A0h] [bp+18h]@218 |
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
327 unsigned int a6b; // [sp+A0h] [bp+18h]@218 |
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
328 int field_0_bits; |
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
329 int field_20_bits; |
1131
71ba92960bc5
banker's rounding template made as fast as before and a bit more safe
Grumpy7
parents:
1130
diff
changeset
|
330 |
1146
b4ade2580ae3
sub_451007_scale_image_bicubic cleanup - some variable renaming, code shuffling
Grumpy7
parents:
1145
diff
changeset
|
331 int field0value = this->field_0.field_C; |
1148
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
332 switch(field0value) |
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
333 { |
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
334 case 8: field_0_bits = 1; |
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
335 break; |
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
336 case 16: field_0_bits = 2; |
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
337 break; |
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
338 case 32: field_0_bits = 4; |
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
339 break; |
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
340 default: |
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
341 return field0value; |
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
342 } |
1144
f544cd6f7168
sub_451007_scale_image_bicubic cleanup - preparations for further condition body extractions
Grumpy7
parents:
1140
diff
changeset
|
343 int field20value = this->field_20.field_C; |
f544cd6f7168
sub_451007_scale_image_bicubic cleanup - preparations for further condition body extractions
Grumpy7
parents:
1140
diff
changeset
|
344 switch(field20value) |
1129
9362028fccd1
sub_451007_scale_image_bicubic cleanup - extracting common bodies from conditions
Grumpy7
parents:
1128
diff
changeset
|
345 { |
1148
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
346 case 8: field_20_bits = 1; |
1129
9362028fccd1
sub_451007_scale_image_bicubic cleanup - extracting common bodies from conditions
Grumpy7
parents:
1128
diff
changeset
|
347 break; |
1148
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
348 case 16: field_20_bits = 2; |
1129
9362028fccd1
sub_451007_scale_image_bicubic cleanup - extracting common bodies from conditions
Grumpy7
parents:
1128
diff
changeset
|
349 break; |
1148
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
350 case 32: field_20_bits = 4; |
1129
9362028fccd1
sub_451007_scale_image_bicubic cleanup - extracting common bodies from conditions
Grumpy7
parents:
1128
diff
changeset
|
351 break; |
9362028fccd1
sub_451007_scale_image_bicubic cleanup - extracting common bodies from conditions
Grumpy7
parents:
1128
diff
changeset
|
352 default: |
1144
f544cd6f7168
sub_451007_scale_image_bicubic cleanup - preparations for further condition body extractions
Grumpy7
parents:
1140
diff
changeset
|
353 return field20value; |
1129
9362028fccd1
sub_451007_scale_image_bicubic cleanup - extracting common bodies from conditions
Grumpy7
parents:
1128
diff
changeset
|
354 } |
1148
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
355 |
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
356 result = (int)pDst; |
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
357 v193 = pDst; |
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
358 if ( dstHeight <= 0 ) |
1129
9362028fccd1
sub_451007_scale_image_bicubic cleanup - extracting common bodies from conditions
Grumpy7
parents:
1128
diff
changeset
|
359 return result; |
1600
0016b08ab621
stru350::sub_451007_scale_image_bicubic - fixing a memory access bug
Grumpy7
parents:
1546
diff
changeset
|
360 |
2212 | 361 //do |
2314 | 362 for ( int height = 0; height < dstHeight; height++ ) |
1148
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
363 { |
2314 | 364 for (int width = 0; width < dstWidth; width++) |
1149
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
365 { |
2314 | 366 a6s = (double)width / (double)dstWidth * (double)srcWidth; |
1149
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
367 widthRatio = bankersRounding(a6s); |
2314 | 368 a6t = (double)(width + 1) / (double)dstWidth * (double)srcWidth; |
1149
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
369 widthRatioPlusOne = bankersRounding(a6t); |
2314 | 370 |
371 v17 = (double)height / (double)dstHeight * (double)srcHeight; | |
1149
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
372 heightRatio = bankersRounding(v17); |
2314 | 373 v18 = (double)(height + 1) / (double)dstHeight * (double)srcHeight; |
1149
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
374 heightRatioPlusOne = bankersRounding(v18); |
2314 | 375 |
1149
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
376 v251 = 0; |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
377 v19 = (heightRatioPlusOne - heightRatio) * (widthRatioPlusOne - widthRatio); |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
378 v252 = 0; |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
379 a6b = 0; |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
380 v240 = 0i64; |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
381 |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
382 v175 = (unsigned short*)((char *)pSrc + field_0_bits * (widthRatio + srcPitch * heightRatio)); |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
383 for (int heightDiff = 0; heightDiff < heightRatioPlusOne - heightRatio; heightDiff++) |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
384 { |
2314 | 385 //int ratioDiff = widthRatioPlusOne - widthRatio; |
386 for(int ratioDiff = 0; ratioDiff < widthRatioPlusOne - widthRatio; ratioDiff++) | |
1149
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
387 { |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
388 if(field0value == 32) |
2314 | 389 v21 = _450FB1(((int*)v175)[ratioDiff]); |
1149
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
390 else if(field0value == 16) |
2314 | 391 v21 = _450FB1(((_WORD*)v175)[ratioDiff]); |
1901 | 392 else if (field0value == 8) |
2314 | 393 v21 = _450FB1(((unsigned __int8*)v175)[ratioDiff]); |
1149
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
394 v240 += ((unsigned int)v21 >> 24); |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
395 a6b += BYTE2(v21); |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
396 v252 += BYTE1(v21); |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
397 v251 += (unsigned __int8)v21; |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
398 } |
1901 | 399 if (field0value == 32) |
1149
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
400 v175 += 2 * srcPitch; |
1901 | 401 else if (field0value == 16) |
2314 | 402 v175 += srcPitch; |
1901 | 403 else if (field0value == 8) |
1149
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
404 v175 = (unsigned short*)((char *)v175 + 2 * srcPitch); |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
405 } |
2314 | 406 |
1149
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
407 v22 = (unsigned int)v240 / ((heightRatioPlusOne - heightRatio) * (widthRatioPlusOne - widthRatio)); |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
408 if ( v19 ) |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
409 { |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
410 a6b /= v19; |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
411 v252 /= v19; |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
412 v251 /= v19; |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
413 } |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
414 if ( v22 != 255 ) |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
415 v22 &= 0x7FFFFFFFu; |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
416 v23 = _450F55(v251 | ((v252 | ((a6b | (v22 << 8)) << 8)) << 8)); |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
417 *(_DWORD *)v193 = v23; |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
418 v193 = (unsigned __int16 *)((char *)v193 + field_20_bits); |
1148
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
419 } |
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
420 v193 = (unsigned __int16 *)((char *)v193 + field_20_bits * (dstPitch - dstWidth)); |
2212 | 421 //++v231; |
2314 | 422 result = height; |
1148
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
423 } |
2212 | 424 //while(v231 < dstHeight); |
1148
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
425 return result; |
0 | 426 } |
427 | |
428 | |
429 //----- (00450DDE) -------------------------------------------------------- | |
430 stru350 *stru350::_450DDE() | |
431 { | |
432 _450DF1(&stru_4E82A4, &stru_4E82A4); | |
433 return this; | |
434 } | |
435 | |
436 //----- (00450DF1) -------------------------------------------------------- | |
437 bool stru350::_450DF1(const stru355 *p1, const stru355 *p2) | |
438 { | |
439 //stru350 *v3; // esi@1 | |
440 //void *result; // eax@1 | |
441 unsigned int v5; // ecx@2 | |
442 int v6; // edi@2 | |
443 int v7; // edx@2 | |
444 unsigned int v8; // ecx@8 | |
445 int v9; // edi@8 | |
446 int v10; // edx@8 | |
447 int v11; // ecx@12 | |
448 int v12; // edi@12 | |
449 unsigned int v13; // ecx@12 | |
450 int v14; // edx@12 | |
451 int v15; // ecx@16 | |
452 unsigned int v16; // edx@16 | |
453 int v17; // ecx@16 | |
454 int v18; // edi@16 | |
455 char v19; // zf@20 | |
456 unsigned int v20; // ecx@21 | |
457 int v21; // edi@21 | |
458 int v22; // edx@21 | |
459 unsigned int v23; // ecx@27 | |
460 int v24; // edi@27 | |
461 int v25; // edx@27 | |
462 int v26; // ecx@31 | |
463 int v27; // edi@31 | |
464 unsigned int v28; // ecx@31 | |
465 int v29; // edx@31 | |
466 int v30; // ebx@35 | |
467 int v31; // ecx@35 | |
468 int v32; // edi@35 | |
469 int v33; // edx@35 | |
470 unsigned int i; // ecx@35 | |
471 int v35; // ecx@39 | |
472 unsigned int v36; // edx@39 | |
473 int v37; // ecx@39 | |
474 int v38; // ebx@39 | |
475 | |
476 //v3 = this; | |
477 memcpy(&field_0, p1, sizeof(stru355)); | |
478 memcpy(&field_20, p2, sizeof(stru355)); | |
479 //result = memcpy(&v3->field_20, p2, 0x20u); | |
480 //LOBYTE(result) = 1; | |
481 if (field_0.field_4 & 1) | |
482 { | |
483 v5 = field_0.field_1C; | |
484 v6 = 0; | |
485 v7 = 0; | |
486 while ( !(v5 & 1) ) | |
487 { | |
488 ++v6; | |
489 v5 >>= 1; | |
490 } | |
491 do | |
492 { | |
493 v5 >>= 1; | |
494 ++v7; | |
495 } | |
496 while ( v5 & 1 ); | |
497 field_40 = 32 - v7 - v6; | |
498 } | |
499 else | |
500 { | |
501 field_40 = 0; | |
502 } | |
503 v8 = field_0.field_10; | |
504 v9 = 0; | |
505 v10 = 0; | |
506 while ( !(v8 & 1) ) | |
507 { | |
508 ++v9; | |
509 v8 >>= 1; | |
510 } | |
511 do | |
512 { | |
513 v8 >>= 1; | |
514 ++v10; | |
515 } | |
516 while ( v8 & 1 ); | |
517 v11 = 24 - v10 - v9; | |
518 v12 = 0; | |
519 field_48 = v11; | |
520 v13 = field_0.field_14; | |
521 v14 = 0; | |
522 while ( !(v13 & 1) ) | |
523 { | |
524 ++v12; | |
525 v13 >>= 1; | |
526 } | |
527 do | |
528 { | |
529 v13 >>= 1; | |
530 ++v14; | |
531 } | |
532 while ( v13 & 1 ); | |
533 v15 = 16 - v14; | |
534 v16 = field_0.field_18; | |
535 field_50 = v15 - v12; | |
536 v17 = 0; | |
537 v18 = 0; | |
538 while ( !(v16 & 1) ) | |
539 { | |
540 ++v17; | |
541 v16 >>= 1; | |
542 } | |
543 do | |
544 { | |
545 v16 >>= 1; | |
546 ++v18; | |
547 } | |
548 while ( v16 & 1 ); | |
549 v19 = (field_20.field_4 & 1) == 0; | |
550 field_58 = v17 - v18 + 8; | |
551 if ( v19 ) | |
552 { | |
553 field_44 = 0; | |
554 } | |
555 else | |
556 { | |
557 v20 = field_20.field_1C; | |
558 v21 = 0; | |
559 v22 = 0; | |
560 while ( !(v20 & 1) ) | |
561 { | |
562 ++v21; | |
563 v20 >>= 1; | |
564 } | |
565 do | |
566 { | |
567 v20 >>= 1; | |
568 ++v22; | |
569 } | |
570 while ( v20 & 1 ); | |
571 field_44 = 32 - v22 - v21; | |
572 } | |
573 v23 = field_20.field_10; | |
574 v24 = 0; | |
575 v25 = 0; | |
576 while ( !(v23 & 1) ) | |
577 { | |
578 ++v24; | |
579 v23 >>= 1; | |
580 } | |
581 do | |
582 { | |
583 v23 >>= 1; | |
584 ++v25; | |
585 } | |
586 while ( v23 & 1 ); | |
587 v26 = 24 - v25 - v24; | |
588 v27 = 0; | |
589 field_4C = v26; | |
590 v28 = field_20.field_14; | |
591 v29 = 0; | |
592 while ( !(v28 & 1) ) | |
593 { | |
594 ++v27; | |
595 v28 >>= 1; | |
596 } | |
597 do | |
598 { | |
599 v28 >>= 1; | |
600 ++v29; | |
601 } | |
602 while ( v28 & 1 ); | |
603 v30 = 0; | |
604 v31 = 16 - v29 - v27; | |
605 v32 = field_20.field_18; | |
606 field_54 = v31; | |
607 v33 = 0; | |
608 for ( i = v32; !(i & 1); i >>= 1 ) | |
609 ++v30; | |
610 do | |
611 { | |
612 i >>= 1; | |
613 ++v33; | |
614 } | |
615 while ( i & 1 ); | |
616 v35 = 32 - v33; | |
617 v36 = v32; | |
618 field_5C = v35 - v30; | |
619 v37 = 0; | |
620 v38 = 0; | |
621 while ( !(v36 & 1) ) | |
622 { | |
623 ++v37; | |
624 v36 >>= 1; | |
625 } | |
626 do | |
627 { | |
628 v36 >>= 1; | |
629 ++v38; | |
630 } | |
631 while ( v36 & 1 ); | |
632 field_5C = v37 - v38 + 8; | |
633 return true; | |
634 } | |
635 | |
636 //----- (00450F55) -------------------------------------------------------- | |
637 unsigned int stru350::_450F55(int a2) | |
638 { | |
639 int v2 = a2 & stru_4E82A4.field_1C; | |
640 if (field_20.field_4 & 1) | |
641 v2 = (unsigned int)v2 >> this->field_44; | |
642 return v2 & field_20.field_1C | | |
643 field_20.field_10 & ((a2 & (unsigned int)stru_4E82A4.field_10) >> field_4C) | | |
644 field_20.field_14 & ((a2 & (unsigned int)stru_4E82A4.field_14) >> field_54) | | |
645 field_20.field_18 & ((a2 & (unsigned int)stru_4E82A4.field_18) >> field_5C); | |
646 } | |
647 | |
648 //----- (00450FB1) -------------------------------------------------------- | |
649 int stru350::_450FB1(int a2) | |
650 { | |
651 int v2 = 0; | |
652 int v4 = field_0.field_4 & 1; | |
653 if ( v4 ) | |
654 v2 = a2 & field_0.field_1C; | |
655 if ( v4 ) | |
656 v2 <<= field_40; | |
657 return v2 | ((a2 & field_0.field_10) << field_48) | ((a2 & field_0.field_14) << field_50) | ((a2 & field_0.field_18) << field_58); | |
658 } | |
659 | |
660 //----- (00452442) -------------------------------------------------------- | |
1583 | 661 unsigned int __fastcall _452442_color_cvt(unsigned __int16 a1, unsigned __int16 a2, int a3, int a4) |
0 | 662 { |
663 int v4; // ebx@0 | |
664 __int16 v5; // ST14_2@1 | |
665 __int16 v6; // dx@1 | |
666 int v7; // ecx@1 | |
667 __int16 v8; // ST10_2@1 | |
668 int v9; // edi@1 | |
669 unsigned __int16 v10; // dh@1@1 | |
670 int v11; // ebx@1 | |
671 int v12; // ebx@1 | |
672 __int16 a3a; // [sp+1Ch] [bp+8h]@1 | |
673 | |
674 v5 = a2 >> 2; | |
675 v6 = (unsigned __int16)a4 >> 2; | |
676 v8 = a1 >> 2; | |
677 a3a = (unsigned __int16)a3 >> 2; | |
678 LOWORD(v7) = a3a; | |
679 v9 = v7; | |
680 LOWORD(v4) = ((unsigned __int16)a4 >> 2) & 0xE0; | |
681 LOWORD(v7) = a3a & 0xE0; | |
682 LOWORD(v9) = v9 & 0x1C00; | |
683 v11 = v7 + v4; | |
684 LOWORD(v7) = v5 & 0xE0; | |
685 v12 = v7 + v11; | |
686 LOWORD(v7) = v8 & 0xE0; | |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1408
diff
changeset
|
687 __debugbreak(); // warning C4700: uninitialized local variable 'v10' used |
848 | 688 return (PID_TYPE(v8) + PID_TYPE(v5) + PID_TYPE(a3a) + PID_TYPE(v6)) | (v7 + v12) | ((v8 & 0x1C00) |
0 | 689 + (v5 & 0x1C00) |
690 + v9 | |
691 + (__PAIR__(v10, (unsigned __int16)a4 >> 2) & 0x1C00)); | |
692 } | |
693 | |
694 //----- (004547E4) -------------------------------------------------------- | |
695 void FactionTable::Initialize() | |
696 { | |
237 | 697 int i; |
698 char* test_string; | |
699 unsigned char c; | |
700 bool break_loop; | |
701 unsigned int temp_str_len; | |
702 char* tmp_pos; | |
703 int decode_step; | |
2334 | 704 // int item_counter; |
237 | 705 |
2369
bddcaf5d5db2
removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents:
2362
diff
changeset
|
706 free(pHostileTXT_Raw); |
0 | 707 pHostileTXT_Raw = (char *)pEvents_LOD->LoadRaw("hostile.txt", 0); |
708 strtok(pHostileTXT_Raw, "\r"); | |
2101 | 709 for ( i=0; i < 89; ++i ) |
710 { | |
711 test_string = strtok(NULL, "\r") + 1; | |
712 break_loop = false; | |
713 decode_step=0; | |
714 do | |
715 { | |
716 c = *(unsigned char*)test_string; | |
717 temp_str_len = 0; | |
718 while((c!='\t') && (c > 0)) | |
719 { | |
720 ++temp_str_len; | |
721 c = test_string[temp_str_len]; | |
722 } | |
723 tmp_pos=test_string+temp_str_len; | |
724 if (*tmp_pos == 0) | |
725 break_loop = true; | |
726 *tmp_pos = 0; | |
727 if (temp_str_len) | |
728 { | |
729 if ( decode_step >= 1 && decode_step < 90 ) | |
730 relations[decode_step-1][i] = atoi(test_string); | |
731 } | |
732 else | |
733 break_loop = true; | |
734 ++decode_step; | |
735 test_string=tmp_pos+1; | |
736 } | |
737 while ((decode_step < 92) && !break_loop ); | |
738 } | |
2369
bddcaf5d5db2
removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents:
2362
diff
changeset
|
739 free(pHostileTXT_Raw); |
bddcaf5d5db2
removing non-nullptr conditions before frees, chaning 0 and NULL assignmnets to pointers to nullptr assignments
Grumpy7
parents:
2362
diff
changeset
|
740 pHostileTXT_Raw = nullptr; |
0 | 741 } |
742 | |
743 //----- (004610AA) -------------------------------------------------------- | |
1637 | 744 void __fastcall PrepareToLoadODM(unsigned int bLoading, ODMRenderParams *a2) |
0 | 745 { |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
746 pGameLoadingUI_ProgressBar->Reset(27); |
0 | 747 pSoundList->_4A9D79(0); |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
748 uCurrentlyLoadedLevelType = LEVEL_Outdoor; |
2099 | 749 ODM_LoadAndInitialize(pCurrentMapName, a2); |
750 if ( !bLoading ) | |
0 | 751 TeleportToStartingPoint(uLevel_StartingPointType); |
752 viewparams->_443365(); | |
753 PlayLevelMusic(); | |
754 } | |
755 // 6BE35C: using guessed type int uLevel_StartingPointType; | |
756 | |
757 //----- (00461103) -------------------------------------------------------- | |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
758 void _461103_load_level_sub() |
0 | 759 { |
760 int v4; // edx@8 | |
761 signed int v6; // esi@14 | |
762 signed int v8; // ecx@16 | |
763 int v12; // esi@25 | |
764 int v13; // eax@26 | |
765 __int16 v14; // ax@41 | |
766 signed int v17; // [sp+14h] [bp-48h]@3 | |
767 signed int v18; // [sp+14h] [bp-48h]@23 | |
768 int v19; // [sp+18h] [bp-44h]@1 | |
769 signed int v20; // [sp+18h] [bp-44h]@14 | |
770 int v21[16]; // [sp+1Ch] [bp-40h]@17 | |
771 | |
598 | 772 GenerateItemsInChest(); |
0 | 773 pGameLoadingUI_ProgressBar->Progress(); |
2101 | 774 pParty->uFlags |= 2; |
0 | 775 pParty->field_7B5_in_arena_quest = 0; |
776 dword_5C6DF8 = 1; | |
291 | 777 pNPCStats->uNewlNPCBufPos = 0; |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
778 v19 = pMapStats->GetMapInfo(pCurrentMapName); |
0 | 779 |
780 //v15 = 0; | |
781 for (uint i = 0; i < uNumActors; ++i) | |
782 //if ( (signed int)uNumActors > 0 ) | |
783 { | |
2099 | 784 //Actor* pActor = &pActors[i]; |
0 | 785 //v2 = (char *)&pActors[0].uNPC_ID; |
786 //do | |
787 //{ | |
2101 | 788 //v3 = pActors[i].pMonsterInfo.uID; |
0 | 789 v17 = 0; |
2099 | 790 if ( pActors[i].pMonsterInfo.uID >= 115 && pActors[i].pMonsterInfo.uID <= 186 |
791 || pActors[i].pMonsterInfo.uID >= 232 && pActors[i].pMonsterInfo.uID <= 249 ) | |
0 | 792 v17 = 1; |
793 //v1 = 0; | |
2101 | 794 v4 = (pActors[i].pMonsterInfo.uID - 1) % 3; |
0 | 795 if ( 2 == v4 ) |
796 { | |
2099 | 797 if ( pActors[i].sNPC_ID && pActors[i].sNPC_ID < 5000 ) |
0 | 798 continue; |
799 } | |
800 else | |
801 { | |
802 if ( v4 != 1 ) | |
803 { | |
2099 | 804 if ( v4 == 0 && pActors[i].sNPC_ID == 0 ) |
2101 | 805 pActors[i].sNPC_ID = 0; |
806 continue; | |
0 | 807 } |
808 } | |
2099 | 809 if ( pActors[i].sNPC_ID > 0 && pActors[i].sNPC_ID < 5000 ) |
0 | 810 continue; |
811 if ( v17 ) | |
812 { | |
2101 | 813 pNPCStats->InitializeAdditionalNPCs(&pNPCStats->pAdditionalNPC[pNPCStats->uNewlNPCBufPos], pActors[i].pMonsterInfo.uID, 0, v19); |
291 | 814 v14 = LOWORD(pNPCStats->uNewlNPCBufPos) + 5000; |
815 ++pNPCStats->uNewlNPCBufPos; | |
2099 | 816 pActors[i].sNPC_ID = v14; |
0 | 817 continue; |
818 } | |
2099 | 819 pActors[i].sNPC_ID = 0; |
0 | 820 //++v15; |
821 //v2 += 836; | |
822 //} | |
823 //while ( v15 < (signed int)uNumActors ); | |
824 } | |
825 | |
826 pGameLoadingUI_ProgressBar->Progress(); | |
827 | |
828 //v5 = uNumActors; | |
829 v6 = 0; | |
830 v20 = 0; | |
831 //v16 = v1; | |
832 | |
833 for (uint i = 0; i < uNumActors; ++i) | |
834 { | |
835 //v7 = (char *)&pActors[0].pMonsterInfo; | |
836 //do | |
837 //{ | |
2101 | 838 for ( v8 = 0; v8 < v6; ++v8 ) |
839 { | |
840 if ( v21[v8] == pActors[i].pMonsterInfo.uID - 1 ) | |
841 break; | |
842 } | |
843 | |
844 if ( v8 == v6 ) | |
845 { | |
846 v21[v6++] = pActors[i].pMonsterInfo.uID - 1; | |
847 v20 = v6; | |
848 if ( v6 == 16 ) | |
849 break; | |
850 } | |
851 //++v16; | |
852 //v7 += 836; | |
0 | 853 //} |
854 //while ( v16 < (signed int)v5 ); | |
855 } | |
856 | |
857 pGameLoadingUI_ProgressBar->Progress(); | |
858 | |
2101 | 859 for ( int _v0 = 0; _v0 < v6; ++_v0 ) |
0 | 860 { |
2101 | 861 for ( v18 = 4; v18; --v18 ) |
862 pSoundList->LoadSound(pMonsterList->pMonsters[v21[_v0]].pSoundSampleIDs[4 - v18], 0); | |
0 | 863 v12 = 0; |
864 do | |
2101 | 865 v13 = pSoundList->LoadSound(v12++ + word_4EE088_sound_ids[pMonsterStats->pInfos[v21[_v0] + 1].uSpell1ID], 1); |
0 | 866 while ( v13 ); |
867 } | |
868 //v0 = pGameLoadingUI_ProgressBar; | |
869 //v1 = 0; | |
870 | |
871 pGameLoadingUI_ProgressBar->Progress(); | |
872 | |
2061 | 873 if (dword_6BE368_debug_settings_2 & DEBUG_SETTINGS_NO_ACTORS) |
0 | 874 uNumActors = 0; |
2061 | 875 if ( dword_6BE368_debug_settings_2 & DEBUG_SETTINGS_NO_DECORATIONS) |
0 | 876 uNumLevelDecorations = 0; |
1459 | 877 init_event_triggers(); |
0 | 878 |
879 pGameLoadingUI_ProgressBar->Progress(); | |
1638
ccde94f02b75
class IndoorCamera split into BLVRenderParams and ODMRenderParams
Nomad
parents:
1637
diff
changeset
|
880 |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
881 pGame->pIndoorCameraD3D->vPartyPos.x = 0; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
882 pGame->pIndoorCameraD3D->vPartyPos.y = 0; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
883 pGame->pIndoorCameraD3D->vPartyPos.z = 100; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
884 pGame->pIndoorCameraD3D->sRotationX = 0; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
885 pGame->pIndoorCameraD3D->sRotationY = 0; |
1638
ccde94f02b75
class IndoorCamera split into BLVRenderParams and ODMRenderParams
Nomad
parents:
1637
diff
changeset
|
886 viewparams->bRedrawGameUI = true; |
783 | 887 uLevel_StartingPointType = MapStartPoint_Party; |
0 | 888 pSprites_LOD->_461397(); |
889 pPaletteManager->LockTestAll(); | |
890 if ( pParty->pPickedItem.uItemID != 0 ) | |
891 pMouse->SetCursorBitmapFromItemID(pParty->pPickedItem.uItemID); | |
892 } | |
893 | |
894 //----- (004613C4) -------------------------------------------------------- | |
1459 | 895 void init_event_triggers() |
0 | 896 { |
1459 | 897 uint id = pDecorationList->GetDecorIdByName("Event Trigger"); |
898 | |
899 num_event_triggers = 0; | |
900 for (uint i = 0; i < uNumLevelDecorations; ++i) | |
901 if (pLevelDecorations[i].uDecorationDescID == id) | |
902 event_triggers[num_event_triggers++] = i; | |
0 | 903 } |
904 | |
905 //----- (004627B7) -------------------------------------------------------- | |
762 | 906 void MainMenu_Loop() |
0 | 907 { |
908 GUIButton *pButton; // eax@27 | |
909 unsigned int pControlParam; // ecx@35 | |
2334 | 910 // int v10; // ecx@36 |
911 // int v11; // ecx@37 | |
0 | 912 unsigned int pY; // [sp-18h] [bp-54h]@39 |
913 Texture *pTexture; // [sp-14h] [bp-50h]@39 | |
2334 | 914 // GUIButton *pButton2; // [sp+0h] [bp-3Ch]@27 |
0 | 915 GUIWindow *pWindow; // [sp+4h] [bp-38h]@11 |
916 | |
151 | 917 pCurrentScreen = SCREEN_GAME; |
1038 | 918 |
0 | 919 pGUIWindow2 = 0; |
2216 | 920 pAudioPlayer->StopChannels(-1, -1);//îñòàíîâèòü/ïîäãîòîâèòü êàíàë |
2219 | 921 pMouse->RemoveHoldingItem();//èçáàâèòü êóðñîð îò âåùè |
762 | 922 |
923 pIcons_LOD->_inlined_sub2(); | |
924 | |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2212
diff
changeset
|
925 pWindow_MainMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_MainMenu, 0, 0); |
1980 | 926 Texture* pNew = pIcons_LOD->LoadTexturePtr("title_new", TEXTURE_16BIT_PALETTE); |
927 Texture* pLoad = pIcons_LOD->LoadTexturePtr("title_load", TEXTURE_16BIT_PALETTE); | |
928 Texture* pCredits = pIcons_LOD->LoadTexturePtr("title_cred", TEXTURE_16BIT_PALETTE); | |
929 Texture* pExit = pIcons_LOD->LoadTexturePtr("title_exit", TEXTURE_16BIT_PALETTE); | |
948 | 930 |
931 pMainMenu_BtnNew = pWindow_MainMenu->CreateButton(495, 172, pNew->uTextureWidth, pNew->uTextureHeight, 1, 0, UIMSG_MainMenu_ShowPartyCreationWnd, 0, 'N', "", pNew, 0); | |
932 pMainMenu_BtnLoad = pWindow_MainMenu->CreateButton(495, 227, pLoad->uTextureWidth, pLoad->uTextureHeight, 1, 0, UIMSG_MainMenu_ShowLoadWindow, 1, 'L', "", pLoad, 0); | |
933 pMainMenu_BtnCredits = pWindow_MainMenu->CreateButton(495, 282, pCredits->uTextureWidth, pCredits->uTextureHeight, 1, 0, UIMSG_ShowCredits, 2, 'C', "", pCredits, 0); | |
934 pMainMenu_BtnExit = pWindow_MainMenu->CreateButton(495, 337, pExit->uTextureWidth, pExit->uTextureHeight, 1, 0, UIMSG_ExitToWindows, 3, 0, "", pExit, 0); | |
935 | |
0 | 936 pTexture_PCX.Release(); |
937 pTexture_PCX.Load("title.pcx", 0); | |
938 SetCurrentMenuID(MENU_MAIN); | |
1984 | 939 SetForegroundWindow(window->GetApiHandle()); |
940 SendMessageW(window->GetApiHandle(), WM_ACTIVATEAPP, 1, 0); | |
0 | 941 while (GetCurrentMenuID() == MENU_MAIN || GetCurrentMenuID() == MENU_SAVELOAD) |
942 { | |
943 POINT pt; | |
944 pMouse->GetCursorPos(&pt); | |
945 pWindow = pWindow_MainMenu; | |
165 | 946 if ( GetCurrentMenuID() == MENU_SAVELOAD) |
0 | 947 { |
151 | 948 if ( pCurrentScreen != SCREEN_LOADGAME ) |
0 | 949 { |
950 pTexture_PCX.Release(); | |
951 pTexture_PCX.Load("lsave640.pcx", 0); | |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2212
diff
changeset
|
952 pGUIWindow2 = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_MainMenu, 0, 0); |
151 | 953 pCurrentScreen = SCREEN_LOADGAME; |
1033 | 954 LoadUI_Load(0); |
0 | 955 } |
956 pWindow = pGUIWindow_CurrentMenu; | |
957 } | |
958 | |
2061 | 959 for (MSG msg; PeekMessageW(&msg, 0, 0, 0, PM_REMOVE);) |
0 | 960 { |
961 if (msg.message == WM_QUIT) | |
962 Game_DeinitializeAndTerminate(0); | |
963 TranslateMessage(&msg); | |
2061 | 964 DispatchMessageW(&msg); |
0 | 965 } |
2061 | 966 |
967 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_APP_INACTIVE) | |
0 | 968 { |
969 WaitMessage(); | |
2061 | 970 continue; |
0 | 971 } |
2061 | 972 |
0 | 973 pRenderer->BeginScene(); |
974 pRenderer->DrawTextureRGB(0, 0, &pTexture_PCX); | |
1038 | 975 |
165 | 976 GUI_MainMenuMessageProc(); |
0 | 977 GUI_UpdateWindows(); |
1038 | 978 |
165 | 979 if (GetCurrentMenuID() != MENU_MAIN) |
980 { | |
961 | 981 if (GetCurrentMenuID() == MENU_LoadingProcInMainMenu) |
0 | 982 { |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
983 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
0 | 984 pGUIWindow_CurrentMenu->Release(); |
985 pGUIWindow_CurrentMenu = 0; | |
151 | 986 pCurrentScreen = SCREEN_GAME; |
0 | 987 viewparams->bRedrawGameUI = 1; |
988 } | |
989 } | |
990 else | |
991 { | |
1458 | 992 if ( !pModalWindow )// ??? |
0 | 993 { |
994 pButton = pWindow->pControlsHead; | |
995 for ( pButton = pWindow->pControlsHead; pButton; pButton = pButton->pNext ) | |
996 { | |
997 if ( pt.x >= (signed int)pButton->uX && pt.x <= (signed int)pButton->uZ | |
998 && pt.y >= (signed int)pButton->uY && pt.y <= (signed int)pButton->uW | |
999 && pWindow == pWindow_MainMenu ) | |
1000 { | |
832 | 1001 pControlParam = pButton->msg_param; |
0 | 1002 switch (pControlParam) // ïîäñâåòêà êíîïîê |
1003 { | |
1004 case 0: | |
1005 pTexture = pNew; | |
1006 pY = 172; | |
1007 break; | |
1008 case 1: | |
1009 pTexture = pLoad; | |
1010 pY = 227; | |
1011 break; | |
1012 case 2: | |
1013 pTexture = pCredits; | |
1014 pY = 282; | |
1015 break; | |
1016 case 3: | |
1017 pTexture = pExit; | |
1018 pY = 337; | |
1019 break; | |
1020 } | |
1021 pRenderer->DrawTextureIndexed(495, pY, pTexture); //ïîäñâåòêà êíîïîê | |
1022 } | |
1023 } | |
1024 } | |
1025 } | |
1026 pRenderer->EndScene(); | |
1027 pRenderer->Present(); | |
1028 } | |
970 | 1029 GUI_MainMenuMessageProc(); |
0 | 1030 pRenderer->BeginScene(); |
1031 GUI_UpdateWindows(); | |
1032 pRenderer->EndScene(); | |
1033 pRenderer->Present(); | |
961 | 1034 pTexture_PCX.Release(); |
0 | 1035 if ( pGUIWindow2 ) |
1036 { | |
1037 pGUIWindow2->Release(); | |
1038 pGUIWindow2 = 0; | |
1039 } | |
1040 pWindow_MainMenu->Release(); | |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
1041 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
0 | 1042 } |
1043 | |
1044 //----- (00464479) -------------------------------------------------------- | |
1583 | 1045 void ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows() |
0 | 1046 { |
1047 int v0; // esi@9 | |
1048 | |
1049 if (pMouse) | |
1050 pMouse->SetCursorBitmap("MICON1"); | |
1051 | |
1052 pPaletteManager->ResetNonLocked(); | |
1053 pBitmaps_LOD->ReleaseAll2(); | |
1054 pSprites_LOD->DeleteSomeOtherSprites(); | |
1055 pIcons_LOD->ReleaseAll2(); | |
2152 | 1056 |
0 | 1057 if (uCurrentlyLoadedLevelType == LEVEL_Indoor) |
1058 pIndoor->Release(); | |
1059 else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
1583 | 1060 pOutdoor->Release(); |
0 | 1061 |
1062 pAudioPlayer->StopChannels(-1, -1); | |
1063 pSoundList->_4A9D79(0); | |
1064 uCurrentlyLoadedLevelType = LEVEL_null; | |
1065 pSpriteFrameTable->ResetSomeSpriteFlags(); | |
1066 v0 = uNumVisibleWindows; | |
349 | 1067 pParty->armageddon_timer = 0; |
0 | 1068 while ( v0 > 0 ) |
1069 pWindowList[pVisibleWindowsIdxs[v0--] - 1].Release(); | |
1070 } | |
1071 | |
1072 //----- (004646F0) -------------------------------------------------------- | |
1458 | 1073 void PrepareWorld(unsigned int _0_box_loading_1_fullscreen) |
0 | 1074 { |
2154 | 1075 //if ( pRenderer->pRenderD3D ) |
0 | 1076 pGame->pVisInstance->_4C1A02(); |
1077 pEventTimer->Pause(); | |
1078 pMiscTimer->Pause(); | |
1079 pParty->uFlags = 2; | |
1517 | 1080 CastSpellInfoHelpers::_427D48(); |
0 | 1081 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows(); |
1458 | 1082 DoPrepareWorld(0, (_0_box_loading_1_fullscreen == 0) + 1); |
0 | 1083 pMiscTimer->Resume(); |
1084 pEventTimer->Resume(); | |
1085 } | |
1086 | |
1087 //----- (00464761) -------------------------------------------------------- | |
1583 | 1088 void Game_DeinitializeAndTerminate(int exitCode) |
0 | 1089 { |
1586 | 1090 SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS); |
0 | 1091 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows(); |
1092 pGame->Deinitialize(); | |
2155 | 1093 pRenderer->Release(); |
1802 | 1094 delete window; |
1095 //if ( !DestroyWindow(hWnd) ) | |
1096 // GetLastError(); | |
1583 | 1097 exit(exitCode); |
0 | 1098 } |
1099 | |
1100 //----- (004647AB) -------------------------------------------------------- | |
762 | 1101 void FinalInitialization() |
0 | 1102 { |
1103 pViewport->SetScreen(viewparams->uSomeX, viewparams->uSomeY, viewparams->uSomeZ, viewparams->uSomeW); | |
2151 | 1104 pViewport->SetFOV(flt_6BE3A0 * 65536.0f); |
0 | 1105 |
1638
ccde94f02b75
class IndoorCamera split into BLVRenderParams and ODMRenderParams
Nomad
parents:
1637
diff
changeset
|
1106 //pIndoorCamera = new IndoorCamera; |
ccde94f02b75
class IndoorCamera split into BLVRenderParams and ODMRenderParams
Nomad
parents:
1637
diff
changeset
|
1107 //pIndoorCamera->Initialize(65, viewparams->uScreen_BttmR_X - viewparams->uScreen_topL_X + 1, |
ccde94f02b75
class IndoorCamera split into BLVRenderParams and ODMRenderParams
Nomad
parents:
1637
diff
changeset
|
1108 // viewparams->uScreen_BttmR_Y - viewparams->uScreen_topL_Y + 1); |
0 | 1109 |
1110 InitializeTurnBasedAnimations(&stru_50C198); | |
762 | 1111 pBitmaps_LOD->_inlined_sub1(); |
1112 pSprites_LOD->_inlined_sub1(); | |
1113 pIcons_LOD->_inlined_sub1(); | |
0 | 1114 } |
1115 // 6BE3A0: using guessed type float flt_6BE3A0; | |
1116 | |
2331
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2314
diff
changeset
|
1117 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2314
diff
changeset
|
1118 //----- (0042F3D6) -------------------------------------------------------- |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2314
diff
changeset
|
1119 void InitializeTurnBasedAnimations(void *_this) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2314
diff
changeset
|
1120 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2314
diff
changeset
|
1121 for (unsigned int i = 0; i < pIconIDs_Turn.size(); ++i) |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2314
diff
changeset
|
1122 { |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2314
diff
changeset
|
1123 char icon_name[32]; |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2314
diff
changeset
|
1124 sprintf(icon_name, "turn%u", i); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2314
diff
changeset
|
1125 pIconIDs_Turn[i] = pIconsFrameTable->FindIcon(icon_name); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2314
diff
changeset
|
1126 pIconsFrameTable->InitializeAnimation(pIconIDs_Turn[i]); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2314
diff
changeset
|
1127 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2314
diff
changeset
|
1128 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2314
diff
changeset
|
1129 uIconID_TurnStop = pIconsFrameTable->FindIcon("turnstop"); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2314
diff
changeset
|
1130 uIconID_TurnHour = pIconsFrameTable->FindIcon("turnhour"); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2314
diff
changeset
|
1131 uIconID_TurnStart = pIconsFrameTable->FindIcon("turnstart"); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2314
diff
changeset
|
1132 uIconID_CharacterFrame = pIconsFrameTable->FindIcon("aframe1"); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2314
diff
changeset
|
1133 uSpriteID_Spell11 = pSpriteFrameTable->FastFindSprite("spell11"); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2314
diff
changeset
|
1134 |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2314
diff
changeset
|
1135 pIconsFrameTable->InitializeAnimation(uIconID_TurnHour); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2314
diff
changeset
|
1136 pIconsFrameTable->InitializeAnimation(uIconID_TurnStop); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2314
diff
changeset
|
1137 pIconsFrameTable->InitializeAnimation(uIconID_TurnStart); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2314
diff
changeset
|
1138 pIconsFrameTable->InitializeAnimation(uIconID_CharacterFrame); |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2314
diff
changeset
|
1139 } |
9551756f46c4
Moving functions out of mm7_6.cpp into appropriate classes as static methods or free functions
Grumpy7
parents:
2314
diff
changeset
|
1140 |
0 | 1141 //----- (00464866) -------------------------------------------------------- |
1458 | 1142 void DoPrepareWorld(unsigned int bLoading, int _1_fullscreen_loading_2_box) |
0 | 1143 { |
1458 | 1144 //int v2; // esi@1 |
0 | 1145 char *v3; // eax@1 |
1146 //char *v4; // eax@1 | |
1147 unsigned int v5; // eax@3 | |
1148 //size_t v6; // ecx@10 | |
1149 //char *v7; // eax@11 | |
1150 char Str1[20]; // [sp+Ch] [bp-18h]@1 | |
1151 unsigned int v9; // [sp+20h] [bp-4h]@1 | |
1152 | |
1153 v9 = bLoading; | |
1154 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows(); | |
1155 pDecalBuilder->Reset(0); | |
1458 | 1156 pGameLoadingUI_ProgressBar->Initialize(_1_fullscreen_loading_2_box == 1 ? GUIProgressBar::TYPE_Fullscreen : |
1157 GUIProgressBar::TYPE_Box); | |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1158 strcpy(Str1, pCurrentMapName); |
0 | 1159 v3 = strtok(Str1, "."); |
1160 strcpy(Str1, v3); | |
1161 Level_LoadEvtAndStr(Str1); | |
1162 LoadLevel_InitializeLevelEvt(); | |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1163 strcpy(Str1, pCurrentMapName); |
0 | 1164 _strrev(Str1); |
1165 strtok(Str1, "."); | |
1166 _strrev(Str1); | |
1167 | |
1168 for (uint i = 0; i < 1000; ++i) | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
496
diff
changeset
|
1169 pSpriteObjects[i].uObjectDescID = 0; |
0 | 1170 |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1171 v5 = pMapStats->GetMapInfo(pCurrentMapName); |
1541 | 1172 bUnderwater = false; |
0 | 1173 uLevelMapStatsID = v5; |
1174 pGame->uFlags2 &= 0xFFFFFFF7u; | |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1175 if ( !_stricmp(pCurrentMapName, "out15.odm") ) |
0 | 1176 { |
1541 | 1177 bUnderwater = true; |
1583 | 1178 pGame->uFlags2 |= GAME_FLAGS_2_ALTER_GRAVITY; |
0 | 1179 } |
831 | 1180 pParty->floor_face_pid = 0; |
1104 | 1181 if ( _stricmp(Str1, "blv") ) |
0 | 1182 PrepareToLoadODM(v9, 0); |
1183 else | |
1184 PrepareToLoadBLV(v9); | |
1185 pAudioPlayer->SetMapEAX(); | |
1459 | 1186 _461103_load_level_sub(); |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1187 if ( !_stricmp(pCurrentMapName, "d11.blv") || !_stricmp(pCurrentMapName, "d10.blv") ) |
0 | 1188 { |
1583 | 1189 //spawning grounds & walls of mist - no loot & exp from monsters |
0 | 1190 |
1191 for (uint i = 0; i < uNumActors; ++i) | |
1192 { | |
1193 pActors[i].pMonsterInfo.uTreasureType = 0; | |
1194 pActors[i].pMonsterInfo.uTreasureDiceRolls = 0; | |
1195 pActors[i].pMonsterInfo.uExp = 0; | |
1196 } | |
1197 } | |
1198 bDialogueUI_InitializeActor_NPC_ID = 0; | |
1199 OnMapLoad(); | |
1200 pGameLoadingUI_ProgressBar->Progress(); | |
1459 | 1201 memset(&pRenderer->pBillboardRenderListD3D, 0, sizeof(pRenderer->pBillboardRenderListD3D)); |
0 | 1202 pGameLoadingUI_ProgressBar->Release(); |
1203 _flushall(); | |
1204 } | |
1205 | |
1206 | |
1207 //----- (00464E17) -------------------------------------------------------- | |
1208 bool __fastcall CheckMM7CD(char c) | |
1209 { | |
1210 char DstBuf[256]; // [sp+Ch] [bp-218h]@1 | |
1211 char strCommand[256]; // [sp+10Ch] [bp-118h]@1 | |
1212 char Filename[20]; // [sp+20Ch] [bp-18h]@1 | |
1213 | |
1214 | |
1215 wchar_t pMagicPath[1024]; | |
1165
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1150
diff
changeset
|
1216 swprintf(pMagicPath, wcslen(L"%C:\\anims\\magic7.vid"), L"%C:\\anims\\magic7.vid", c); |
0 | 1217 if (GetFileAttributesW(pMagicPath) == -1) |
1218 return false; | |
1219 | |
1220 wsprintfA(strCommand, "open %c: type cdaudio alias CD", c); | |
1221 if (!mciSendStringA(strCommand, DstBuf, 0xFFu, 0)) | |
1222 { | |
1223 wsprintfA(strCommand, "info CD UPC wait"); | |
1224 mciSendStringA(strCommand, DstBuf, 0xFFu, 0); | |
1225 wsprintfA(strCommand, "close CD"); | |
1226 mciSendStringA(strCommand, DstBuf, 0xFFu, 0); | |
1227 } | |
1228 | |
1229 memcpy(Filename, "X:\\anims\\magic7.vid", sizeof(Filename)); | |
1230 *Filename = c; | |
1231 | |
1980 | 1232 FILE* f = fopen(Filename, "rb"); |
0 | 1233 if (!f) |
1234 return false; | |
1235 | |
1236 if (!fseek(f, 0, SEEK_END)) | |
1237 { | |
1238 if (!fseek(f, -100, SEEK_CUR)) | |
1239 fread(DstBuf, 1u, 0x64u, f); | |
1240 | |
1241 fclose(f); | |
1242 return true; | |
1243 } | |
1244 fclose(f); | |
1245 return false; | |
1246 } | |
1247 | |
1248 //----- (00464F1B) -------------------------------------------------------- | |
1249 signed int __stdcall InsertMM7CDDialogFunc(HWND hDlg, int a2, __int16 a3, int a4) | |
1250 { | |
1251 char v4; // zf@3 | |
1252 int v6; // eax@10 | |
1253 int v7; // eax@11 | |
1254 int v8; // eax@12 | |
1255 int v9; // eax@13 | |
1256 BOOL (__stdcall *v10)(HWND, int, LPCSTR); // edi@15 | |
1257 const CHAR *v11; // [sp-Ch] [bp-Ch]@15 | |
1258 INT_PTR v12; // [sp-4h] [bp-4h]@5 | |
1259 | |
1260 if ( a2 == 272 ) | |
1261 { | |
1262 hInsertCDWindow = hDlg; | |
1263 v6 = (GetUserDefaultLangID() & 0x3FF) - 7; | |
1264 if ( v6 ) | |
1265 { | |
1266 v7 = v6 - 3; | |
1267 if ( v7 ) | |
1268 { | |
1269 v8 = v7 - 2; | |
1270 if ( v8 ) | |
1271 { | |
1272 v9 = v8 - 4; | |
1273 if ( v9 ) | |
1274 { | |
1275 if ( v9 != 5 ) | |
1276 return 0; | |
1277 SetWindowTextA(hDlg, "Wloz CD-ROM numer 2"); | |
1278 v10 = SetDlgItemTextA; | |
1279 SetDlgItemTextA(hDlg, 1010, "Wloz CD-ROM numer 2 Might and Magic® VII."); | |
1280 v11 = "Odwolaj"; | |
1281 } | |
1282 else | |
1283 { | |
1284 SetWindowTextA(hDlg, "Inserire il secondo CD"); | |
1285 v10 = SetDlgItemTextA; | |
1286 SetDlgItemTextA(hDlg, 1010, "Inserire il secondo CD di Might and Magic® VII."); | |
1287 v11 = "Annulla"; | |
1288 } | |
1289 } | |
1290 else | |
1291 { | |
1292 SetWindowTextA(hDlg, "Insérez le CD 2"); | |
1293 v10 = SetDlgItemTextA; | |
1294 SetDlgItemTextA(hDlg, 1010, "Insérez Might & Magic® VII CD 2."); | |
1295 v11 = "Supprimer"; | |
1296 } | |
1297 } | |
1298 else | |
1299 { | |
1300 SetWindowTextA(hDlg, "Por favor, inserte disco 2"); | |
1301 v10 = SetDlgItemTextA; | |
1302 SetDlgItemTextA(hDlg, 1010, "Por favor, inserte disco 2 de Might & Magic® VII."); | |
1303 v11 = "Cancelar"; | |
1304 } | |
1305 } | |
1306 else | |
1307 { | |
1308 SetWindowTextA(hDlg, "Bitte CD 2 einlegen"); | |
1309 v10 = SetDlgItemTextA; | |
1310 SetDlgItemTextA(hDlg, 1010, "Bitte CD 2 von Might and Magic® VII einlegen."); | |
1311 v11 = "Abbrechen"; | |
1312 } | |
1313 v10(hDlg, 2, v11); | |
1314 return 0; | |
1315 } | |
1316 if ( a2 == 273 ) | |
1317 { | |
1318 if ( a3 == 2 ) | |
1319 { | |
1320 v12 = 0; | |
1321 EndDialog(hDlg, v12); | |
1322 return 1; | |
1323 } | |
1324 v4 = a3 == 1; | |
1325 } | |
1326 else | |
1327 { | |
1328 v4 = a2 == 1025; | |
1329 } | |
1330 if ( v4 ) | |
1331 { | |
1332 v12 = 1; | |
1416 | 1333 EndDialog(hDlg, v12); |
1334 return 1; | |
0 | 1335 } |
1336 return 0; | |
1337 } | |
1338 | |
1339 //----- (00465061) -------------------------------------------------------- | |
1340 bool __fastcall FindMM7CD(HWND hWnd, char *pCDDrive) | |
1341 { | |
1342 char drive[4] = {'X', ':', '\\', 0}; | |
1343 | |
1344 bool bGotCDFromRegistry = false; | |
1345 | |
1346 HKEY hSoftware = nullptr, | |
1347 hNWC = nullptr, | |
1348 hMM7 = nullptr, | |
1349 hVersion = nullptr; | |
1350 if (!RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE", 0, 0x2001Fu, &hSoftware)) | |
1351 { | |
1352 if (!RegOpenKeyExA(hSoftware, "New World Computing", 0, 0x2001Fu, &hNWC)) | |
1353 { | |
1354 if (!RegOpenKeyExA(hNWC, "Might and Magic VII", 0, 0x2001Fu, &hMM7)) | |
1355 { | |
1356 if (!RegOpenKeyExA(hMM7, "1.0", 0, 0x2001Fu, &hVersion)) | |
1357 { | |
1358 DWORD cbData = 3; | |
1359 if (!RegQueryValueExA(hVersion, "CDDrive", 0, 0, (BYTE *)drive, &cbData)) | |
1360 bGotCDFromRegistry = true; | |
1361 } | |
1362 RegCloseKey(hVersion); | |
1363 } | |
1364 RegCloseKey(hMM7); | |
1365 } | |
1366 RegCloseKey(hNWC); | |
1367 } | |
1368 RegCloseKey(hSoftware); | |
1369 | |
1370 if (bGotCDFromRegistry) | |
1371 if (CheckMM7CD(*drive)) | |
1372 { | |
1373 cMM7GameCDDriveLetter = *drive; | |
1374 return true; | |
1375 } | |
1376 | |
1377 while (true) | |
1378 { | |
1379 for (uint i = 0; i < 26; ++i) | |
1380 { | |
1381 drive[0] = 'A' + i; | |
1382 | |
1383 if (GetDriveTypeA(drive) == DRIVE_CDROM) | |
1384 if (CheckMM7CD(*drive)) | |
1385 { | |
1386 cMM7GameCDDriveLetter = *drive; | |
1387 WriteWindowsRegistryString("CDDrive", drive); | |
1388 return true; | |
1389 } | |
1390 } | |
1391 | |
1802 | 1392 if (DialogBoxParamA(GetModuleHandleW(nullptr), "InsertCD", hWnd, (DLGPROC)InsertMM7CDDialogFunc, 0)) |
0 | 1393 continue; |
1394 return false; | |
1395 } | |
1396 } | |
1397 | |
1398 //----- (004651F4) -------------------------------------------------------- | |
1655 | 1399 bool MM7_Initialize(int game_width, int game_height) |
0 | 1400 { |
1401 wchar_t pCurrentDir[1024]; | |
1402 _wgetcwd(pCurrentDir, 1024); | |
1403 | |
1404 wchar_t pMM6IniFile[1024]; | |
293 | 1405 wsprintfW(pMM6IniFile, L"%s\\mm6.ini", pCurrentDir); |
0 | 1406 |
1407 bCanLoadFromCD = GetPrivateProfileIntW(L"settings", L"use_cd", 1, pMM6IniFile); | |
1408 if (bNoCD) | |
1409 bCanLoadFromCD = false; | |
1410 if (bCanLoadFromCD) | |
1411 { | |
2151 | 1412 Log::Warning(L"Checking for CD..."); |
1802 | 1413 if (!FindMM7CD(nullptr, &cMM7GameCDDriveLetter)) |
0 | 1414 return false; |
2394 | 1415 Log::Warning(L"...done."); |
0 | 1416 } |
1417 | |
1418 | |
1419 srand(GetTickCount()); | |
1802 | 1420 |
1421 window = OSWindow::Create(L"Might and Magic® Trilogy", game_width, game_height); | |
0 | 1422 |
1423 pRenderer = Render::Create(); | |
1424 if (!pRenderer) | |
1425 { | |
1426 Log::Warning(L"Render creation failed"); | |
1427 return false; | |
1428 } | |
1429 else | |
1430 { | |
2069 | 1431 //bool bWindowMode = ReadWindowsRegistryInt("startinwindow", false); |
1802 | 1432 //uint uDefaultDevice = ReadWindowsRegistryInt("D3D Device", 1); |
0 | 1433 bool bColoredLights = ReadWindowsRegistryInt("Colored Lights", false); |
1434 uint uLevelOfDetail = ReadWindowsRegistryInt("Detail Level", 1); | |
1435 uint bTinting = ReadWindowsRegistryInt("Tinting", 1) != 0; | |
1436 | |
2069 | 1437 if (!pRenderer->Initialize(window, bColoredLights, uLevelOfDetail, bTinting)) |
0 | 1438 { |
1439 Log::Warning(L"Render failed to initialize"); | |
1440 return false; | |
1441 } | |
1442 } | |
492 | 1443 |
351 | 1444 game_starting_year = 1168; |
0 | 1445 |
1446 pParty = new Party; | |
147 | 1447 memset(&pParty->pHirelings, 0, sizeof(pParty->pHirelings)); |
0 | 1448 pParty->uWalkSpeed = GetPrivateProfileIntW(L"debug", L"walkspeed", 384, pMM6IniFile); |
1449 pParty->uDefaultEyelevel = GetPrivateProfileIntW(L"party", L"eyelevel", 160, pMM6IniFile); | |
1450 pParty->sEyelevel = pParty->uDefaultEyelevel; | |
1451 pParty->uDefaultPartyHeight = GetPrivateProfileIntW(L"party", L"height", 192, pMM6IniFile); | |
1452 pParty->uPartyHeight = pParty->uDefaultPartyHeight; | |
2151 | 1453 |
0 | 1454 MM6_Initialize(pMM6IniFile); |
1455 | |
1456 pKeyActionMap = new KeyboardActionMapping; | |
1457 | |
1458 pEventTimer = Timer::Create(); | |
1459 pEventTimer->Initialize(); | |
1460 | |
1461 OnTimer(1); | |
1462 GameUI_StatusBar_UpdateTimedString(1); | |
1463 pGame = Game::Create(); | |
1464 pMouse = pGame->pMouseInstance; | |
1655 | 1465 |
0 | 1466 |
1467 pIcons_LOD = new LODFile_IconsBitmaps; | |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1468 if (!pIcons_LOD->Load("data\\icons.lod", "icons")) |
0 | 1469 { |
2151 | 1470 MessageBoxW(nullptr, L"Some files are missing\n\nPlease Reinstall.", |
1471 L"Files Missing", MB_ICONEXCLAMATION); | |
0 | 1472 return false; |
1473 } | |
1474 pIcons_LOD->dword_011BA4 = 0; | |
1475 | |
1476 pEvents_LOD = new LODFile_IconsBitmaps; | |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1477 if (!pEvents_LOD->Load("data\\events.lod", "icons")) |
0 | 1478 { |
2151 | 1479 MessageBoxW(nullptr, L"Some files are missing\n\nPlease Reinstall.", |
1480 L"Files Missing", MB_ICONEXCLAMATION); | |
0 | 1481 return false; |
1482 } | |
1483 | |
1484 InitializeGameText(); | |
1485 | |
1486 pBitmaps_LOD = new LODFile_IconsBitmaps; | |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1487 if (!pBitmaps_LOD->Load("data\\bitmaps.lod", "bitmaps")) |
0 | 1488 { |
2151 | 1489 MessageBoxA(nullptr, pGlobalTXT_LocalizationStrings[63], |
1490 pGlobalTXT_LocalizationStrings[184], MB_ICONEXCLAMATION); | |
0 | 1491 return false; |
1492 } | |
1493 | |
1494 pSprites_LOD = new LODFile_Sprites; | |
2151 | 1495 if (!pSprites_LOD->LoadSprites("data\\sprites.lod")) |
0 | 1496 { |
1497 MessageBoxA(nullptr, | |
1498 pGlobalTXT_LocalizationStrings[63], | |
1499 pGlobalTXT_LocalizationStrings[184], MB_ICONEXCLAMATION); | |
1500 return false; | |
1501 } | |
1502 | |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1503 |
1543 | 1504 #if 0 |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1505 if (_access("../MM_VI/data/icons.lod", 0) == 0) |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1506 { |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1507 pIcons_LOD_mm6 = new LODFile_IconsBitmaps; |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1508 if (!pIcons_LOD_mm6->Load("../MM_VI/data/icons.lod", "icons")) |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1509 { |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1510 delete pIcons_LOD_mm6; |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1511 pIcons_LOD_mm6 = nullptr; |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1512 Log::Warning(L"Unable to load mm6:icons.lod"); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1513 } |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1514 } |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1515 else |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1516 Log::Warning(L"Unable to find mm6:icons.lod"); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1517 |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1518 if (_access("../MM_VI/data/bitmaps.lod", 0) == 0) |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1519 { |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1520 pBitmaps_LOD_mm6 = new LODFile_IconsBitmaps; |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1521 if (!pBitmaps_LOD_mm6->Load("../MM_VI/data/bitmaps.lod", "bitmaps")) |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1522 { |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1523 delete pBitmaps_LOD_mm6; |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1524 pBitmaps_LOD_mm6 = nullptr; |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1525 Log::Warning(L"Unable to load mm6:bitmaps.lod"); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1526 } |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1527 } |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1528 else |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1529 Log::Warning(L"Unable to find mm6:bitmaps.lod"); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1530 |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1531 auto mm6_sprite_container_name = bUseLoResSprites ? "../MM_VI/data/spriteLO.lod" |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1532 : "../MM_VI/data/sprites.lod"; |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1533 if (_access(mm6_sprite_container_name, 0) == 0) |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1534 { |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1535 pSprites_LOD_mm6 = new LODFile_Sprites; |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1536 if (!pSprites_LOD_mm6->LoadSprites(mm6_sprite_container_name)) |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1537 { |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1538 delete pSprites_LOD_mm6; |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1539 pSprites_LOD_mm6 = nullptr; |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1540 Log::Warning(L"Unable to load mm6:sprites.lod"); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1541 } |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1542 } |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1543 else |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1544 Log::Warning(L"Unable to find mm6:sprites.lod"); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1545 |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1546 |
1541 | 1547 if (_access("../mm8/data/icons.lod", 0) == 0) |
1548 { | |
1549 pIcons_LOD_mm8 = new LODFile_IconsBitmaps; | |
1550 if (!pIcons_LOD_mm8->Load("../mm8/data/icons.lod", "icons")) | |
1551 { | |
1552 delete pIcons_LOD_mm8; | |
1553 pIcons_LOD_mm8 = nullptr; | |
1554 Log::Warning(L"Unable to load mm8:icons.lod"); | |
1555 } | |
0 | 1556 } |
1557 else | |
1541 | 1558 Log::Warning(L"Unable to find mm8:icons.lod"); |
1559 | |
1560 | |
1561 if (_access("../mm8/data/bitmaps.lod", 0) == 0) | |
1562 { | |
1563 pBitmaps_LOD_mm8 = new LODFile_IconsBitmaps; | |
1564 if (!pBitmaps_LOD_mm8->Load("../mm8/data/bitmaps.lod", "bitmaps")) | |
1565 { | |
1566 delete pBitmaps_LOD_mm8; | |
1567 pBitmaps_LOD_mm8 = nullptr; | |
1568 Log::Warning(L"Unable to load mm8:bitmaps.lod"); | |
1569 } | |
1570 } | |
1571 else | |
1572 Log::Warning(L"Unable to find mm8:bitmaps.lod"); | |
1573 | |
1574 | |
1575 if (_access("../mm8/data/sprites.lod", 0) == 0) | |
1576 { | |
1577 pSprites_LOD_mm8 = new LODFile_Sprites; | |
1578 if (!pSprites_LOD_mm8->LoadSprites("../mm8/data/sprites.lod")) | |
1579 { | |
1580 delete pSprites_LOD_mm8; | |
1581 pSprites_LOD_mm8 = nullptr; | |
1582 Log::Warning(L"Unable to load mm8:sprites.lod"); | |
1583 } | |
1584 } | |
1585 else | |
1586 Log::Warning(L"Unable to find mm8:sprites.lod"); | |
1543 | 1587 #endif |
1541 | 1588 |
0 | 1589 { |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1590 void *sft_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dsft.bin", 1) : nullptr, |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1591 *sft_mm8 = nullptr; |
2151 | 1592 void *sft_mm7 = pEvents_LOD->LoadRaw("dsft.bin", 1); |
0 | 1593 pSpriteFrameTable = new SpriteFrameTable; |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1594 pSpriteFrameTable->FromFile(sft_mm6, sft_mm7, sft_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1595 free(sft_mm6); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1596 free(sft_mm7); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1597 free(sft_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1598 |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1599 void *tft_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dtft.bin", 1) : nullptr, |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1600 *tft_mm8 = nullptr; |
2151 | 1601 void *tft_mm7 = pEvents_LOD->LoadRaw("dtft.bin", 1); |
0 | 1602 pTextureFrameTable = new TextureFrameTable; |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1603 pTextureFrameTable->FromFile(tft_mm6, tft_mm7, tft_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1604 free(tft_mm6); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1605 free(tft_mm7); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1606 free(tft_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1607 |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1608 void *tiles_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dtile.bin", 1) : nullptr, |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1609 *tiles_mm8 = nullptr; |
2151 | 1610 void *tiles_mm7 = pEvents_LOD->LoadRaw("dtile.bin", 1); |
0 | 1611 pTileTable = new TileTable; |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1612 pTileTable->FromFile(tiles_mm6, tiles_mm7, tiles_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1613 free(tiles_mm6); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1614 free(tiles_mm7); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1615 free(tiles_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1616 |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1617 void *pft_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dpft.bin", 1) : nullptr, |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1618 *pft_mm8 = nullptr; |
2151 | 1619 void *pft_mm7 = pEvents_LOD->LoadRaw("dpft.bin", 1); |
0 | 1620 pPlayerFrameTable = new PlayerFrameTable; |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1621 pPlayerFrameTable->FromFile(pft_mm6, pft_mm7, pft_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1622 free(pft_mm6); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1623 free(pft_mm7); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1624 free(pft_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1625 |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1626 void *ift_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dift.bin", 1) : nullptr, |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1627 *ift_mm8 = nullptr; |
2151 | 1628 void *ift_mm7 = pEvents_LOD->LoadRaw("dift.bin", 1); |
0 | 1629 pIconsFrameTable = new IconFrameTable; |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1630 pIconsFrameTable->FromFile(ift_mm6, ift_mm7, ift_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1631 free(ift_mm6); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1632 free(ift_mm7); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1633 free(ift_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1634 |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1635 void *decs_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("ddeclist.bin", 1) : nullptr, |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1636 *decs_mm8 = nullptr; |
2151 | 1637 void *decs_mm7 = pEvents_LOD->LoadRaw("ddeclist.bin", 1); |
0 | 1638 pDecorationList = new DecorationList; |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1639 pDecorationList->FromFile(decs_mm6, decs_mm7, decs_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1640 free(decs_mm6); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1641 free(decs_mm7); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1642 free(decs_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1643 |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1644 void *objs_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dobjlist.bin", 1) : nullptr, |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1645 *objs_mm8 = nullptr; |
2151 | 1646 void *objs_mm7 = pEvents_LOD->LoadRaw("dobjlist.bin", 1); |
0 | 1647 pObjectList = new ObjectList; |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1648 pObjectList->FromFile(objs_mm6, objs_mm7, objs_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1649 free(objs_mm6); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1650 free(objs_mm7); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1651 free(objs_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1652 |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1653 void *mons_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dmonlist.bin", 1) : nullptr, |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1654 *mons_mm8 = nullptr; |
2151 | 1655 void *mons_mm7 = pEvents_LOD->LoadRaw("dmonlist.bin", 1); |
0 | 1656 pMonsterList = new MonsterList; |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1657 pMonsterList->FromFile(mons_mm6, mons_mm7, mons_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1658 free(mons_mm6); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1659 free(mons_mm7); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1660 free(mons_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1661 |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1662 void *chests_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dchest.bin", 1) : nullptr, |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1663 *chests_mm8 = nullptr; |
2151 | 1664 void *chests_mm7 = pEvents_LOD->LoadRaw("dchest.bin", 1); |
0 | 1665 pChestList = new ChestList; |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1666 pChestList->FromFile(chests_mm6, chests_mm7, chests_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1667 free(chests_mm6); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1668 free(chests_mm7); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1669 free(chests_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1670 |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1671 void *overlays_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("doverlay.bin", 1) : nullptr, |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1672 *overlays_mm8 = nullptr; |
2151 | 1673 void *overlays_mm7 = pEvents_LOD->LoadRaw("doverlay.bin", 1); |
0 | 1674 pOverlayList = new OverlayList; |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1675 pOverlayList->FromFile(overlays_mm6, overlays_mm7, overlays_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1676 free(overlays_mm6); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1677 free(overlays_mm7); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1678 free(overlays_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1679 |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1680 void *sounds_mm6 = pIcons_LOD_mm6 ? pIcons_LOD_mm6->LoadRaw("dsounds.bin", 1) : nullptr, |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1681 *sounds_mm8 = nullptr; |
2151 | 1682 void *sounds_mm7 = pEvents_LOD->LoadRaw("dsounds.bin", 1); |
0 | 1683 pSoundList = new SoundList; |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1684 pSoundList->FromFile(sounds_mm6, sounds_mm7, sounds_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1685 free(sounds_mm6); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1686 free(sounds_mm7); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
1687 free(sounds_mm8); |
0 | 1688 } |
1689 | |
1690 | |
1691 | |
492 | 1692 |
2069 | 1693 if (dword_6BE368_debug_settings_2 & DEBUG_SETTINGS_RUN_IN_WIDOW) |
0 | 1694 { |
2069 | 1695 //window->SetWindowedMode(game_width, game_height); |
1696 pRenderer->SwitchToWindow(); | |
0 | 1697 } |
1698 else | |
1699 { | |
2069 | 1700 __debugbreak(); // Nomad |
1701 window->SetFullscreenMode(); | |
1702 pRenderer->InitializeFullscreen(); | |
0 | 1703 } |
2151 | 1704 |
1705 uSoundVolumeMultiplier = min(9, ReadWindowsRegistryInt("soundflag", 9)); | |
1706 uMusicVolimeMultiplier = min(9, ReadWindowsRegistryInt("musicflag", 9)); | |
1707 uVoicesVolumeMultiplier = min(9, ReadWindowsRegistryInt("CharVoices", 9)); | |
0 | 1708 bShowDamage = ReadWindowsRegistryInt("ShowDamage", 1) != 0; |
2151 | 1709 |
1710 uGammaPos = min(4, ReadWindowsRegistryInt("GammaPos", 4)); | |
0 | 1711 pGame->pGammaController->Initialize(uGammaPos * 0.1 + 0.6); |
1712 | |
1713 if ( ReadWindowsRegistryInt("Bloodsplats", 1) ) | |
591 | 1714 pGame->uFlags2 |= GAME_FLAGS_2_DRAW_BLOODSPLATS; |
0 | 1715 else |
733 | 1716 pGame->uFlags2 &= ~GAME_FLAGS_2_DRAW_BLOODSPLATS; |
0 | 1717 |
1718 uTurnSpeed = ReadWindowsRegistryInt("TurnDelta", 0); | |
1719 | |
1720 if (!bNoSound) | |
1802 | 1721 pAudioPlayer->Initialize(); |
0 | 1722 |
1262 | 1723 pVideoPlayer = new VideoPlayer(); |
1802 | 1724 pVideoPlayer->Initialize(window); |
0 | 1725 |
2061 | 1726 dword_6BE364_game_settings_1 |= GAME_SETTINGS_4000; |
0 | 1727 |
1728 switch ( uTurnSpeed ) | |
1729 { | |
731 | 1730 case 0: // undefined turn option |
1067 | 1731 __debugbreak(); // really shouldn't use this mode |
731 | 1732 uTurnSpeed = (unsigned int)uCPUSpeed < 199 ? 128 : 64; // adjust turn speed to estimated fps |
1733 break; | |
1734 | |
1735 case 1u: // 16x | |
1736 Log::Warning(L"x16 Turn Speed"); // really shouldn't use this mode | |
0 | 1737 uTurnSpeed = 128; |
731 | 1738 break; |
1739 | |
1740 case 2u: // 32x | |
1741 Log::Warning(L"x32 Turn Speed"); // really shouldn't use this mode | |
0 | 1742 uTurnSpeed = 64; |
731 | 1743 break; |
1744 | |
1745 case 3u: // smooth | |
0 | 1746 uTurnSpeed = 0; |
731 | 1747 break; |
1748 } | |
1749 | |
0 | 1750 return true; |
1751 } | |
1752 | |
1753 //----- (00465D0B) -------------------------------------------------------- | |
1802 | 1754 void SecondaryInitialization() |
0 | 1755 { |
2151 | 1756 //__int16 v4; // ax@4 |
1757 //signed int v5; // esi@5 | |
1758 //int v6; // ecx@6 | |
1759 //int v7; // edx@7 | |
1760 //ObjectDesc *v8; // eax@7 | |
1761 //char pContainer[32]; // [sp+10h] [bp-Ch]@9 | |
0 | 1762 |
1802 | 1763 pMouse->Initialize(window); |
0 | 1764 |
1765 pItemsTable = new ItemsTable; | |
1766 pItemsTable->Initialize(); | |
1767 | |
2154 | 1768 //pBitmaps_LOD->can_load_hardware_sprites = 1; |
2069 | 1769 //pBitmaps_LOD->SetupPalettes(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits); |
1770 pBitmaps_LOD->SetupPalettes(5, 6, 5); | |
1771 //pIcons_LOD->SetupPalettes(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits); | |
1772 pIcons_LOD->SetupPalettes(5, 6, 5); | |
1773 //pPaletteManager->SetColorChannelInfo(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits); | |
1774 pPaletteManager->SetColorChannelInfo(5, 6, 5); | |
762 | 1775 |
1776 pPaletteManager->SetMistColor(128, 128, 128); | |
0 | 1777 pPaletteManager->RecalculateAll(); |
2154 | 1778 //pSprites_LOD->can_load_hardware_sprites = 1; |
0 | 1779 pObjectList->InitializeSprites(); |
1780 pOverlayList->InitializeSprites(); | |
2412 | 1781 |
0 | 1782 if (!bNoSound) |
1783 pSoundList->Initialize(); | |
1784 | |
1785 | |
1786 for (uint i = 0; i < 4; ++i) | |
1787 { | |
2151 | 1788 static const char *pUIAnimNames[4] = |
1789 { | |
1790 "glow03", "glow05", | |
1791 "torchA", "wizeyeA" | |
1792 }; | |
1793 static unsigned short _4E98D0[4][4] = | |
1794 { | |
1795 {479, 0, 329, 0}, | |
1796 {585, 0, 332, 0}, | |
1797 {468, 0, 0, 0}, | |
1798 {606, 0, 0, 0} | |
1799 }; | |
1800 | |
0 | 1801 pUIAnims[i]->uIconID = pIconsFrameTable->FindIcon(pUIAnimNames[i]); |
1802 pIconsFrameTable->InitializeAnimation(pUIAnims[i]->uIconID); | |
1803 | |
1804 pUIAnims[i]->uAnimLength = 0; | |
1805 pUIAnims[i]->uAnimTime = 0; | |
1806 pUIAnims[i]->x = _4E98D0[i][0]; | |
1807 pUIAnims[i]->y = _4E98D0[i][2]; | |
1808 } | |
1809 | |
2151 | 1810 for (unsigned int i = 0; i < pObjectList->uNumObjects; ++i) |
0 | 1811 { |
2151 | 1812 pObjectList->pObjects[i].uParticleTrailColor = pObjectList->pObjects[i].uParticleTrailColorB | |
1813 ((unsigned int)pObjectList->pObjects[i].uParticleTrailColorG << 8) | | |
1814 ((unsigned int)pObjectList->pObjects[i].uParticleTrailColorR << 16); | |
0 | 1815 } |
2151 | 1816 |
0 | 1817 MainMenuUI_Create(); |
1818 pGame->pStru6Instance->LoadAnimations(); | |
1819 | |
1820 for (uint i = 0; i < 7; ++i) | |
1821 { | |
2151 | 1822 char container_name[64]; |
1823 sprintf(container_name, "HDWTR%03u", i); | |
1824 pRenderer->pHDWaterBitmapIDs[i] = pBitmaps_LOD->LoadTexture(container_name); | |
0 | 1825 } |
1826 | |
1827 pNPCStats = new NPCStats; | |
110 | 1828 memset(pNPCStats->pNPCData, 0, 0x94BCu); |
0 | 1829 pNPCStats->Initialize(); |
1830 | |
1831 Initialize_GlobalEVT(); | |
762 | 1832 pBitmaps_LOD->_inlined_sub0(); |
1833 pSprites_LOD->_inlined_sub0(); | |
0 | 1834 pPaletteManager->LockAll(); |
1835 | |
1836 _mkdir("Saves"); | |
1837 for (uint i = 0; i < 5; ++i) | |
1838 for (uint j = 0; j < 6; ++j) | |
1839 { | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1203
diff
changeset
|
1840 sprintf(pTmpBuf.data(), "data\\lloyd%d%d.pcx", i, j); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1203
diff
changeset
|
1841 remove(pTmpBuf.data()); |
0 | 1842 } |
1843 | |
1844 Initialize_GamesLOD_NewLOD(); | |
1051 | 1845 _576E2C_current_minimap_zoom = 512; |
0 | 1846 dword_576E28 = 9; |
1847 } | |
1848 | |
522 | 1849 void IntegrityTest() |
1850 { | |
1869
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1851 static_assert(sizeof(MovieHeader) == 44, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1852 static_assert(sizeof(SoundDesc_mm6) == 112, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1853 static_assert(sizeof(SoundDesc) == 120, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1854 static_assert(sizeof(OverlayDesc) == 8, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1855 static_assert(sizeof(ChestDesc) == 36, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1856 static_assert(sizeof(ObjectDesc_mm6) == 52, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1857 static_assert(sizeof(ObjectDesc) == 56, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1858 static_assert(sizeof(DecorationDesc) == 84, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1859 static_assert(sizeof(IconFrame) == 32, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1860 static_assert(sizeof(PlayerFrame) == 10, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1861 static_assert(sizeof(TextureFrame) == 20, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1862 static_assert(sizeof(SpriteFrame) == 60, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1863 static_assert(sizeof(RenderVertexSoft) == 0x30, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1864 static_assert(sizeof(RenderBillboard) == 0x34, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1865 static_assert(sizeof(Texture) == 0x48, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1866 static_assert(sizeof(RGBTexture) == 0x28, "Wrong type size"); |
2154 | 1867 //static_assert(sizeof(LODFile_IconsBitmaps) == 0x11BB8 + 4, "Wrong type size"); // + virtual dtor ptr |
1869
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1868 static_assert(sizeof(AudioPlayer) == 0xC84, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1869 static_assert(sizeof(SoundDesc) == 0x78, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1870 static_assert(sizeof(stru339_spell_sound) == 0xAFD8, "Wrong type size"); |
2137
d24ee391fd1f
libavcodec playing movies and houses, loops not working yet
zipi
parents:
2135
diff
changeset
|
1871 //static_assert(sizeof(VideoPlayer) == 0x108 + 4, "Wrong type size"); |
1869
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1872 static_assert(sizeof(MovieHeader) == 0x2C, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1873 static_assert(sizeof(DecorationDesc) == 0x54, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1874 static_assert(sizeof(ObjectDesc) == 0x38, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1875 static_assert(sizeof(OverlayDesc) == 0x8, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1876 static_assert(sizeof(ChestDesc) == 0x24, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1877 static_assert(sizeof(TileDesc) == 0x1A, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1878 static_assert(sizeof(MonsterDesc_mm6) == 148, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1879 static_assert(sizeof(MonsterDesc) == 152, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1880 static_assert(sizeof(Timer) == 0x28, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1881 static_assert(sizeof(OtherOverlay) == 0x14, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1882 static_assert(sizeof(ItemGen) == 0x24, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1883 static_assert(sizeof(SpriteObject) == 0x70, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1884 static_assert(sizeof(ItemDesc) == 0x30, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1885 static_assert(sizeof(ItemsTable) == 0x117A0, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1886 static_assert(sizeof(Chest) == 0x14CC, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1887 static_assert(sizeof(MapInfo) == 0x44, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1888 static_assert(sizeof(SpellInfo) == 0x24, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1889 static_assert(sizeof(SpellData) == 0x14, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1890 static_assert(sizeof(SpellBuff) == 0x10, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1891 static_assert(sizeof(AIDirection) == 0x1C, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1892 static_assert(sizeof(ActorJob) == 0xC, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1893 static_assert(sizeof(Actor) == 0x344, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1894 static_assert(sizeof(LevelDecoration) == 0x20, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1895 static_assert(sizeof(KeyboardActionMapping) == 0x20C, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1896 static_assert(sizeof(UIAnimation) == 0xD, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1897 static_assert(sizeof(SpawnPointMM7) == 0x18, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1898 static_assert(sizeof(ODMFace) == 0x134, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1899 static_assert(sizeof(BSPNode) == 0x8, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1900 static_assert(sizeof(BSPModel) == 0xBC, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1901 static_assert(sizeof(OutdoorLocation) == 0x1C28C, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1902 static_assert(sizeof(BLVFace) == 0x60, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1903 static_assert(sizeof(BLVFaceExtra) == 0x24, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1904 static_assert(sizeof(BLVSector) == 0x74, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1905 static_assert(sizeof(BLVLightMM7) == 0x10, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1906 static_assert(sizeof(BLVDoor) == 0x50, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1907 static_assert(sizeof(IndoorLocation) == 0x690, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1908 //static_assert(sizeof(ODMRenderParams) == 0x74, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1909 static_assert(sizeof(Mouse) == 0x114, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1910 static_assert(sizeof(Particle_sw) == 0x68, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1911 static_assert(sizeof(Particle) == 0x68, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1912 static_assert(sizeof(ParticleEngine) == 0xE430, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1913 static_assert(sizeof(Lightmap) == 0xC1C, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1914 static_assert(sizeof(LightmapBuilder) == 0x3CBC38, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1915 static_assert(sizeof(Vis_SelectionList) == 0x2008, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1916 static_assert(sizeof(Vis) == 0x20D0, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1917 static_assert(sizeof(PlayerBuffAnim) == 0x10, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1918 static_assert(sizeof(ProjectileAnim) == 0x1C, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1919 static_assert(sizeof(stru6) == 0x5F8, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1920 static_assert(sizeof(IndoorCameraD3D_Vec3) == 0x10, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1921 static_assert(sizeof(IndoorCameraD3D_Vec4) == 0x18, "Wrong type size"); //should be 14 (10 vec3 + 4 vdtor) but 18 coz of his +4 from own vdtor, but it is odd since vdtor already present from vec3 |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1922 //static_assert(sizeof(IndoorCameraD3D) == 0x1A1384, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1923 static_assert(sizeof(StationaryLight) == 0xC, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1924 static_assert(sizeof(LightsStack_StationaryLight_) == 0x12C8, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1925 static_assert(sizeof(MobileLight) == 0x12, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1926 static_assert(sizeof(LightsStack_MobileLight_) == 0x1C28, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1927 static_assert(sizeof(Game) == 0xE78, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1928 static_assert(sizeof(stru141_actor_collision_object) == 0xA8, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1929 static_assert(sizeof(ActionQueue) == 0x7C, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1930 static_assert(sizeof(NPCData) == 0x4C, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1931 static_assert(sizeof(NPCStats) == 0x17FFC, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1932 static_assert(sizeof(BspRenderer) == 0x53740, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1933 static_assert(sizeof(PaletteManager) == 0x267AF0, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1934 static_assert(sizeof(ViewingParams) == 0x26C, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1935 //static_assert(sizeof(IndoorCamera) == 0x50, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1936 static_assert(sizeof(Bloodsplat) == 0x28, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1937 static_assert(sizeof(BloodsplatContainer) == 0xA0C, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1938 static_assert(sizeof(TrailParticle) == 0x18, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1939 static_assert(sizeof(EventIndex) == 0xC, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1940 static_assert(sizeof(_2devent) == 0x34, "Wrong type size"); |
2386 | 1941 static_assert(sizeof(MapsLongTimer) == 0x20, "Wrong type size"); |
1869
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1942 static_assert(sizeof(SavegameHeader) == 0x64, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1943 static_assert(sizeof(SavegameList) == 0x3138, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1944 static_assert(sizeof(StorylineText) == 0x160, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1945 static_assert(sizeof(FactionTable) == 0x1EF1, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1946 static_assert(sizeof(Decal) == 0xC20, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1947 static_assert(sizeof(DecalBuilder) == 0x30C038, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1948 static_assert(sizeof(MonsterInfo) == 0x58, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1949 static_assert(sizeof(MonsterStats) == 0x5BA0, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1950 static_assert(sizeof(RenderD3D) == 0x148, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1951 // static_assert(sizeof(Render) == 0x129844, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1952 static_assert(sizeof(Player) == 0x1B3C, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1953 static_assert(sizeof(PartyTimeStruct) == 0x678, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1954 static_assert(sizeof(Party) == 0x16238, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1955 static_assert(sizeof(GUIButton) == 0xBC, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1956 static_assert(sizeof(GUIWindow) == 0x54, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1957 static_assert(sizeof(GUIProgressBar) == 0x1B8, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1958 static_assert(sizeof(GUIFont) == 0x1020, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1959 // static_assert(sizeof(stru262_TurnBased) == 0x40, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1960 static_assert(sizeof(ArcomageGame) == 0xFB, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1961 static_assert(sizeof(CastSpellInfo) == 0x14, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1962 static_assert(sizeof(ArcomageCard) == 0x6C, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1963 static_assert(sizeof(stru320) == 0x3FC, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1964 static_assert(sizeof(TravelInfo) == 0x20, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1965 static_assert(sizeof(stru336) == 0x798, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1966 static_assert(sizeof(Vec3_short_) == 6, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1967 static_assert(sizeof(BLVFace) == 96, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1968 static_assert(sizeof(BLVFaceExtra) == 36, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1969 static_assert(sizeof(BLVSector) == 116, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1970 static_assert(sizeof(LevelDecoration) == 32, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1971 static_assert(sizeof(BLVLightMM7) == 16, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1972 static_assert(sizeof(BSPNode) == 8, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1973 static_assert(sizeof(SpawnPointMM7) == 24, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1974 static_assert(sizeof(DDM_DLV_Header) == 40, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1975 static_assert(sizeof(Actor) == 836, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1976 static_assert(sizeof(SpriteObject) == 112, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1977 static_assert(sizeof(Chest) == 5324, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1978 static_assert(sizeof(stru123) == 0xC8, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1979 static_assert(sizeof(BLVMapOutline) == 12, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
1980 static_assert(sizeof(LODSprite) == 0x28, "Wrong type size"); |
522 | 1981 } |
1982 | |
2277 | 1983 bool new_sky = false; //íîâîå íåáî(òðåáóþòñÿ òåêñòóðêè) |
1984 int max_flight_height = 4000; //ìàêñèìàëüíàÿ âûñîòà ïîë¸òà | |
2034 | 1985 |
2037
7a9477135943
Renamed Math.h -> OurMath.h (file resolution was sometimes ambiguous)
Nomad
parents:
2035
diff
changeset
|
1986 |
7a9477135943
Renamed Math.h -> OurMath.h (file resolution was sometimes ambiguous)
Nomad
parents:
2035
diff
changeset
|
1987 |
7a9477135943
Renamed Math.h -> OurMath.h (file resolution was sometimes ambiguous)
Nomad
parents:
2035
diff
changeset
|
1988 |
0 | 1989 //----- (00462C94) -------------------------------------------------------- |
1990 bool MM_Main(const wchar_t *pCmdLine) | |
1991 { | |
522 | 1992 IntegrityTest(); |
1706 | 1993 |
246 | 1994 char test[1024]; |
522 | 1995 sprintfex(test, "^Pi[%s]: çíàõàð^R[ü;êà;]", "Çîëòàí"); |
1996 | |
2052 | 1997 lua = new LuaVM; |
1998 lua->Initialize(); | |
2031 | 1999 |
1052 | 2000 bool bNoMargareth = false; |
0 | 2001 if (pCmdLine && *pCmdLine) |
2002 { | |
2061 | 2003 //if (wcsstr(pCmdLine, L"-usedefs")) |
2004 // bDebugResouces = 1; | |
0 | 2005 if (wcsstr(pCmdLine, L"-window")) |
2061 | 2006 dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_RUN_IN_WIDOW; |
0 | 2007 |
2008 if (wcsstr(pCmdLine, L"-nointro")) | |
2009 bNoIntro = true;//dword_6BE364_game_settings_1 |= 4; | |
2010 if (wcsstr(pCmdLine, L"-nologo")) | |
2011 bNoLogo = true;//dword_6BE364_game_settings_1 |= 8; | |
2012 if (wcsstr(pCmdLine, L"-nosound")) | |
2013 bNoSound = true; //dword_6BE364_game_settings_1 |= 0x10; | |
2014 | |
2015 bWalkSound = ReadWindowsRegistryInt("WalkSound", 1) != 0; | |
2016 if (wcsstr(pCmdLine, L"-nowalksound")) | |
2017 bWalkSound = false;//dword_6BE364_game_settings_1 |= 0x20; | |
256 | 2018 if (wcsstr(pCmdLine, L"-novideo")) |
0 | 2019 { |
2061 | 2020 dword_6BE364_game_settings_1 |= GAME_SETTINGS_NO_HOUSE_ANIM; |
0 | 2021 bNoVideo = true; |
2022 } | |
2023 if (wcsstr(pCmdLine, L"-nocd")) | |
2024 bNoCD = true; | |
168 | 2025 if (wcsstr(pCmdLine, L"-new_sky")) |
2026 new_sky = true; | |
1052 | 2027 if (wcsstr(pCmdLine, L"-nomarg")) |
2028 bNoMargareth = true; | |
0 | 2029 } |
2030 | |
731 | 2031 /*v8 = _4AC1C9_get_cpu_speed(0, (Vec4_int_ *)a2); |
0 | 2032 Rect.left = *(int *)v8; |
2033 Rect.top = *(int *)(v8 + 4); | |
2034 Rect.right = *(int *)(v8 + 8); | |
2035 Rect.bottom = *(int *)(v8 + 12); | |
731 | 2036 uCPUSpeed = Rect.bottom;*/ |
2037 uCPUSpeed = 2048; // about 2GHz | |
4 | 2038 |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2212
diff
changeset
|
2039 if (!MM7_Initialize(640, 480))//çàäà¸òñÿ ðàçìåð îêíà |
734 | 2040 { |
2041 Log::Warning(L"MM init: failed"); | |
2042 pGame->Deinitialize(); | |
2043 return 1; | |
2044 } | |
0 | 2045 |
2216 | 2046 pEventTimer->Pause(); |
2047 | |
2048 SetUserInterface(PartyAlignment_Neutral, false); | |
2290 | 2049 ShowLogoVideo(); |
2050 //ShowIntroVideo_and_LoadingScreen(); | |
2216 | 2051 WriteWindowsRegistryInt("Ran once", 1); |
2052 dword_6BE364_game_settings_1 |= GAME_SETTINGS_4000; | |
2053 pGame->InitializeGammaController(); | |
2054 SecondaryInitialization(); | |
2055 pRenderer->SetRasterClipRect(0, 0, window->GetWidth() - 1, window->GetHeight() - 1); | |
2056 FinalInitialization(); | |
2279 | 2057 |
2058 //Ritor1: include | |
2278 | 2059 MMT_MainMenu_Loop(); |
2279 | 2060 |
2394 | 2061 Log::Warning(L"MM: entering main loop"); |
2216 | 2062 while ( 1 ) |
2063 { | |
2064 MainMenuWindow* main_menu_window = MainMenuWindow::Create(); | |
2065 window->AddControl(main_menu_window); | |
2066 MainMenu_Loop(); | |
2067 uGameState = GAME_STATE_PLAYING; | |
0 | 2068 while ( 1 ) |
2069 { | |
2216 | 2070 if (uGameState == GAME_FINISHED || GetCurrentMenuID() == MENU_EXIT_GAME) |
2071 { | |
2072 pGame->Deinitialize(); | |
2073 return true; | |
2074 } | |
2075 | |
2076 if (GetCurrentMenuID() == MENU_NEWGAME) | |
0 | 2077 { |
2216 | 2078 if ( pAudioPlayer->hAILRedbook ) |
2079 AIL_redbook_stop(pAudioPlayer->hAILRedbook); | |
2080 pParty->Reset(); | |
2081 pOtherOverlayList->Reset(); | |
2082 strcpy(pCurrentMapName, pStartingMapName); | |
2083 pParty->CreateDefaultParty(0); | |
2084 PlayerCreationUI_Initialize(); | |
2085 if ( PlayerCreationUI_Loop() ) | |
982 | 2086 { |
0 | 2087 DeleteCCharFont(); |
2216 | 2088 break; |
2 | 2089 } |
2216 | 2090 DeleteCCharFont(); |
2091 bFlashQuestBook = true; | |
2092 PlayFullscreenMovie(MOVIE_Emerald); | |
2093 //pGame->pCShow->PlayMovie(MOVIE_Emerald, 0); | |
2094 SaveNewGame(); | |
2095 if (bNoMargareth) | |
2096 _449B7E_toggle_bit(pParty->_quest_bits, PARTY_QUEST_EMERALD_MARGARETH_OFF, 1); | |
2097 pGame->Loop(); | |
2098 if (uGameState == GAME_STATE_NEWGAME_OUT_GAMEMENU) | |
101 | 2099 { |
2100 SetCurrentMenuID(MENU_NEWGAME); | |
982 | 2101 uGameState = GAME_STATE_PLAYING; |
0 | 2102 continue; |
101 | 2103 } |
2216 | 2104 else if (uGameState == GAME_STATE_GAME_QUITTING_TO_MAIN_MENU) |
2105 break; | |
2106 assert(false && "Invalid game state"); | |
2107 } | |
2108 if (GetCurrentMenuID() == MENU_CREDITS) | |
2109 { | |
2110 if ( pAudioPlayer->hAILRedbook ) | |
2111 AIL_redbook_stop(pAudioPlayer->hAILRedbook); | |
2112 MainMenuUI_Credits_Loop(); | |
2113 break; | |
2114 } | |
2115 if (GetCurrentMenuID() == MENU_5 || GetCurrentMenuID() == MENU_LoadingProcInMainMenu) | |
2116 { | |
2117 uGameState = GAME_STATE_PLAYING; | |
2118 pGame->Loop(); | |
2119 } | |
2120 else | |
2121 { | |
2122 if (GetCurrentMenuID() == MENU_DebugBLVLevel) | |
907 | 2123 { |
2216 | 2124 pMouse->ChangeActivation(0); |
2125 pParty->Reset(); | |
2126 pParty->CreateDefaultParty(1); | |
2127 | |
2128 __debugbreak(); | |
2129 /*extern void CreateDefaultBLVLevel(); | |
2130 CreateDefaultBLVLevel(); | |
2131 | |
2132 OPENFILENAMEA ofn; | |
2133 if ( !GetOpenFileNameA((LPOPENFILENAMEA)&ofn) ) | |
2134 { | |
2135 pMouse->ChangeActivation(1); | |
2136 break; | |
2137 } | |
2138 _chdir("..\\"); | |
2139 strcpy(pCurrentMapName, ofn.lpstrFileTitle);*/ | |
2140 pMouse->ChangeActivation(1); | |
2141 pGame->Loop(); | |
907 | 2142 } |
0 | 2143 } |
2216 | 2144 if ( uGameState == GAME_STATE_LOADING_GAME ) |
2145 { | |
2146 SetCurrentMenuID(MENU_5); | |
2147 uGameState = GAME_STATE_PLAYING; | |
2148 continue; | |
2149 } | |
2150 if ( uGameState == GAME_STATE_NEWGAME_OUT_GAMEMENU ) | |
0 | 2151 { |
2216 | 2152 SetCurrentMenuID(MENU_NEWGAME); |
2153 uGameState = GAME_STATE_PLAYING; | |
2154 continue; | |
2155 } | |
2156 if ( uGameState == GAME_STATE_GAME_QUITTING_TO_MAIN_MENU)// from the loaded game | |
2157 { | |
2158 pAudioPlayer->StopChannels(-1, -1); | |
2159 uGameState = GAME_STATE_PLAYING; | |
2160 break; | |
0 | 2161 } |
2162 } | |
2216 | 2163 if (!bNoSound && pAudioPlayer->hAILRedbook) |
2164 { | |
2165 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f); | |
2166 AIL_redbook_stop(pAudioPlayer->hAILRedbook); | |
2167 unsigned int startms, end_ms; | |
2168 AIL_redbook_track_info(pAudioPlayer->hAILRedbook, 14, &startms, &end_ms); | |
2169 AIL_redbook_play(pAudioPlayer->hAILRedbook, startms + 1, end_ms); | |
2170 } | |
2171 } | |
2050 | 2172 //lua_close(L); |
0 | 2173 pGame->Deinitialize(); |
734 | 2174 return 1; |
0 | 2175 } |
2176 | |
2177 | |
2178 //----- (00466082) -------------------------------------------------------- | |
2179 void MM6_Initialize(const wchar_t *pIniFilename) | |
2180 { | |
2181 //int v0; // eax@1 | |
2151 | 2182 //UINT v1; // eax@18 |
0 | 2183 size_t v2; // eax@31 |
2184 size_t v3; // ebx@32 | |
2185 size_t v4; // edi@36 | |
2186 //char v5[120]; // [sp+Ch] [bp-17Ch]@1 | |
2187 //char String[120]; // [sp+84h] [bp-104h]@32 | |
2188 char pDefaultGroundTexture[16]; // [sp+FCh] [bp-8Ch]@32 | |
2189 //char pIniFilename[120]; // [sp+10Ch] [bp-7Ch]@1 | |
2190 unsigned int v9; // [sp+184h] [bp-4h]@28 | |
2191 | |
2192 //_getcwd(v5, 120); | |
2193 //sprintfex(pIniFilename, "%s\\mm6.ini", v5); | |
2194 viewparams = new ViewingParams; | |
819 | 2195 game_viewport_x = viewparams->uScreen_topL_X = GetPrivateProfileIntW(L"screen", L"vx1", 8, pIniFilename); |
2196 game_viewport_y = viewparams->uScreen_topL_Y = GetPrivateProfileIntW(L"screen", L"vy1", 8, pIniFilename); | |
2197 game_viewport_z = viewparams->uScreen_BttmR_X = GetPrivateProfileIntW(L"screen", L"vx2", 468, pIniFilename); | |
2198 game_viewport_w = viewparams->uScreen_BttmR_Y = GetPrivateProfileIntW(L"screen", L"vy2", 351, pIniFilename); | |
2199 game_viewport_width = game_viewport_z - game_viewport_x; | |
2200 game_viewport_height = game_viewport_w - game_viewport_y + 1; | |
0 | 2201 |
2202 | |
2203 pAudioPlayer = new AudioPlayer; | |
2204 pAudioPlayer->uMixerChannels = GetPrivateProfileIntW(L"settings", L"mixerchannels", 16, pIniFilename); | |
2205 if ( pAudioPlayer->uMixerChannels > 16 ) | |
2206 pAudioPlayer->uMixerChannels = 16; | |
2207 | |
2208 | |
2209 if (GetPrivateProfileIntW(L"debug", L"nomonster", 0, pIniFilename)) | |
2061 | 2210 dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_NO_ACTORS; |
2151 | 2211 if (ReadWindowsRegistryInt("startinwindow", 0)) |
2061 | 2212 dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_RUN_IN_WIDOW; |
0 | 2213 if (GetPrivateProfileIntW(L"debug", L"showFR", 0, pIniFilename)) |
2061 | 2214 dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_0002_SHOW_FR; |
0 | 2215 if (GetPrivateProfileIntW(L"debug", L"nodamage", 0, pIniFilename)) |
2061 | 2216 dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_NO_DAMAGE; |
0 | 2217 if (GetPrivateProfileIntW(L"debug", L"nodecoration", 0, pIniFilename)) |
2061 | 2218 dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_NO_DECORATIONS; |
0 | 2219 |
2220 wchar_t pStartingMapNameW[1024]; | |
2221 GetPrivateProfileStringW(L"file", L"startmap", L"out01.odm", pStartingMapNameW, 0x20u, pIniFilename); | |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
2222 sprintf(pStartingMapName, "%S", pStartingMapNameW); |
0 | 2223 |
2224 v9 = 0; | |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
2225 if ( strlen(pStartingMapName) ) |
0 | 2226 { |
2227 do | |
2228 { | |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
2229 if ( pStartingMapName[v9] == ' ' ) |
0 | 2230 pStartingMapName[v9] = 0; |
2231 ++v9; | |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
2232 v2 = strlen(pStartingMapName); |
0 | 2233 } |
2234 while ( v9 < v2 ); | |
2235 } | |
2236 | |
1637 | 2237 pODMRenderParams = new ODMRenderParams; |
2238 pODMRenderParams->outdoor_no_mist = GetPrivateProfileIntW(L"debug", L"noMist", 0, pIniFilename); | |
2239 pODMRenderParams->bNoSky = GetPrivateProfileIntW(L"outdoor", L"nosky", 0, pIniFilename); | |
2240 pODMRenderParams->bDoNotRenderDecorations = GetPrivateProfileIntW(L"render", L"nodecorations", 0, pIniFilename); | |
2241 pODMRenderParams->outdoor_no_wavy_water = GetPrivateProfileIntW(L"outdoor", L"nowavywater", 0, pIniFilename); | |
0 | 2242 outdoor_grid_band_1 = GetPrivateProfileIntW(L"outdoor", L"gridband1", 10, pIniFilename); |
2243 outdoor_grid_band_2 = GetPrivateProfileIntW(L"outdoor", L"gridband2", 15, pIniFilename); | |
2244 outdoor_grid_band_3 = GetPrivateProfileIntW(L"outdoor", L"gridband3", 25, pIniFilename); | |
1637 | 2245 pODMRenderParams->terrain_gamma = GetPrivateProfileIntW(L"outdoor", L"ter_gamma", 0, pIniFilename); |
2246 pODMRenderParams->building_gamme = GetPrivateProfileIntW(L"outdoor", L"bld_gamma", 0, pIniFilename); | |
2247 pODMRenderParams->shading_dist_shade = GetPrivateProfileIntW(L"shading", L"dist_shade", 2048, pIniFilename); | |
2248 pODMRenderParams->shading_dist_shademist = GetPrivateProfileIntW(L"shading", L"dist_shademist", 4096, pIniFilename); | |
1765 | 2249 |
2277 | 2250 //int dist = 0x2000; |
2251 | |
2252 //if ( new_draw_object_dist ) | |
2253 //dist = 0x6000; | |
2254 pODMRenderParams->shading_dist_mist = GetPrivateProfileIntW(L"shading", L"dist_mist", 0x2000, pIniFilename);//äàëüíîñòü îòðèñîâêè 0x2000 | |
0 | 2255 |
2256 wchar_t pDefaultSkyTextureW[1024]; | |
2257 GetPrivateProfileStringW(L"textures", L"sky", L"plansky1", pDefaultSkyTextureW, 0x10u, pIniFilename); | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1203
diff
changeset
|
2258 sprintf(pDefaultSkyTexture.data(), "%S", pDefaultSkyTextureW); |
0 | 2259 |
2260 wchar_t pDefaultGroundTextureW[1024]; | |
2261 GetPrivateProfileStringW(L"textures", L"default", L"dirt", pDefaultGroundTextureW, 0x10u, pIniFilename); | |
2262 sprintf(pDefaultGroundTexture, "%S", pDefaultGroundTextureW); | |
2263 | |
2264 wchar_t pFloat[1024]; | |
2265 GetPrivateProfileStringW(L"debug", L"recmod1", L"1.0", pFloat, 0x10u, pIniFilename); | |
2266 swscanf(pFloat, L"%f", &flt_6BE3A4_debug_recmod1); | |
2267 | |
2268 GetPrivateProfileStringW(L"debug", L"recmod2", L"1.0", pFloat, 0x10u, pIniFilename); | |
2269 swscanf(pFloat, L"%f", &flt_6BE3A8_debug_recmod2); | |
2270 | |
2271 flt_6BE3AC_debug_recmod1_x_1_6 = flt_6BE3A4_debug_recmod1 * 1.666666666666667; | |
2272 | |
2273 v3 = 0; | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1203
diff
changeset
|
2274 if ( strlen(pDefaultSkyTexture.data()) ) |
0 | 2275 { |
2276 do | |
2277 { | |
2278 if ( pDefaultSkyTexture[v3] == ' ' ) | |
2279 pDefaultSkyTexture[v3] = 0; | |
2280 ++v3; | |
2281 } | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1203
diff
changeset
|
2282 while ( v3 < strlen(pDefaultSkyTexture.data()) ); |
0 | 2283 } |
2284 v4 = 0; | |
2285 if ( strlen(pDefaultGroundTexture) ) | |
2286 { | |
2287 do | |
2288 { | |
2289 if ( pDefaultGroundTexture[v4] == ' ' ) | |
2290 pDefaultGroundTexture[v4] = 0; | |
2291 ++v4; | |
2292 } | |
2293 while ( v4 < strlen(pDefaultGroundTexture) ); | |
2294 } | |
2295 | |
2296 MM7Initialization(); | |
2297 } | |
2298 | |
2299 //----- (004666D5) -------------------------------------------------------- | |
2151 | 2300 void MM7Initialization() |
0 | 2301 { |
2302 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor ) | |
2303 { | |
2151 | 2304 /*if (byte_6BE388_graphicsmode == 0) |
0 | 2305 { |
2306 outdoor_grid_band_1 = 10; | |
2307 outdoor_grid_band_2 = 15; | |
2308 outdoor_grid_band_3 = 20; | |
1637 | 2309 pODMRenderParams->shading_dist_mist = 8192; |
2310 pODMRenderParams->bNoSky = false; | |
0 | 2311 LOBYTE(viewparams->field_20) = 0; |
2151 | 2312 }*/ |
1637 | 2313 pODMRenderParams->shading_dist_shade = 2048; |
2314 pODMRenderParams->terrain_gamma = 0; | |
2315 pODMRenderParams->building_gamme = 0; | |
2316 pODMRenderParams->shading_dist_shademist = 4096; | |
2317 pODMRenderParams->outdoor_no_wavy_water = 0; | |
1410
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1409
diff
changeset
|
2318 //_47F4D3_initialize_terrain_bezier_stuff(outdoor_grid_band_1, outdoor_grid_band_2, outdoor_grid_band_3); |
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1409
diff
changeset
|
2319 { |
1637 | 2320 pODMRenderParams->outdoor_grid_band_3 = outdoor_grid_band_3; |
2321 pODMRenderParams->uPickDepth = outdoor_grid_band_3 * 512; | |
1410
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1409
diff
changeset
|
2322 } |
0 | 2323 } |
2324 else | |
2325 LOBYTE(viewparams->field_20) = 0; | |
2101 | 2326 pParty->uFlags |= 2; |
692 | 2327 viewparams->uSomeY = viewparams->uScreen_topL_Y; |
2328 viewparams->uSomeX = viewparams->uScreen_topL_X; | |
2329 viewparams->uSomeZ = viewparams->uScreen_BttmR_X; | |
2330 viewparams->uSomeW = viewparams->uScreen_BttmR_Y; | |
2331 | |
2332 pViewport->SetScreen(viewparams->uScreen_topL_X, viewparams->uScreen_topL_Y, viewparams->uScreen_BttmR_X, viewparams->uScreen_BttmR_Y); | |
0 | 2333 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor ) |
1637 | 2334 pODMRenderParams->Initialize(); |
0 | 2335 } |
2336 | |
2337 //----- (00466C40) -------------------------------------------------------- | |
2338 const wchar_t *MENU_STATE_to_string(MENU_STATE m) | |
2339 { | |
2340 switch (m) | |
2341 { | |
982 | 2342 case -1: return L"-1"; |
2343 case MENU_MAIN: return L"MENU_MAIN"; | |
2344 case MENU_NEWGAME: return L"MENU_NEWGAME"; | |
2345 case MENU_CREDITS: return L"MENU_CREDITS"; | |
2346 case MENU_SAVELOAD: return L"MENU_SAVELOAD"; | |
2347 case MENU_EXIT_GAME: return L"MENU_EXIT_GAME"; | |
2348 case MENU_5: return L"MENU_5"; | |
2349 case MENU_CREATEPARTY: return L"MENU_CREATEPARTY"; | |
165 | 2350 case MENU_NAMEPANELESC: return L"MENU_NAMEPANELESC"; |
982 | 2351 case MENU_CREDITSPROC: return L"MENU_CREDITSPROC"; |
961 | 2352 case MENU_LoadingProcInMainMenu: return L"MENU_LoadingProcInMainMenu"; |
1458 | 2353 case MENU_DebugBLVLevel: return L"MENU_DebugBLVLevel"; |
165 | 2354 case MENU_CREDITSCLOSE: return L"MENU_CREDITSCLOSE"; |
2278 | 2355 case MENU_MMT_MAIN_MENU: return L"MENU_MMT_MAIN_MENU"; |
982 | 2356 default: return L"unk"; |
0 | 2357 }; |
2358 }; | |
2359 void SetCurrentMenuID(MENU_STATE uMenu) | |
2360 { | |
2006 | 2361 sCurrentMenuID = uMenu; |
0 | 2362 |
2393 | 2363 Log::Warning(L"CurrentMenu = %s \n", MENU_STATE_to_string(uMenu)); |
0 | 2364 } |
2365 | |
2366 //----- (00466CA0) -------------------------------------------------------- | |
2367 MENU_STATE GetCurrentMenuID() | |
2368 { | |
2006 | 2369 return sCurrentMenuID; |
0 | 2370 } |
2371 | |
2372 | |
2373 //----- (0046BDA8) -------------------------------------------------------- | |
1458 | 2374 unsigned int GetGravityStrength() |
0 | 2375 { |
2376 int v0; // eax@1 | |
2377 | |
2378 v0 = ~LOBYTE(pGame->uFlags2) & 8; | |
2379 LOBYTE(v0) = v0 | 2; | |
2380 return (unsigned int)v0 >> 1; | |
2381 } | |
2382 | |
2383 //----- (0046BDC0) -------------------------------------------------------- | |
1458 | 2384 void UpdateUserInput_and_MapSpecificStuff() |
0 | 2385 { |
2061 | 2386 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_0080_SKIP_USER_INPUT_THIS_FRAME) |
0 | 2387 { |
2061 | 2388 dword_6BE364_game_settings_1 &= ~GAME_SETTINGS_0080_SKIP_USER_INPUT_THIS_FRAME; |
2389 return; | |
0 | 2390 } |
2061 | 2391 |
630 | 2392 if (uCurrentlyLoadedLevelType == LEVEL_Indoor) |
0 | 2393 BLV_UpdateUserInputAndOther(); |
630 | 2394 else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor) |
0 | 2395 ODM_UpdateUserInputAndOther(); |
630 | 2396 |
783 | 2397 area_of_effect__damage_evaluate(); |
0 | 2398 } |
2399 | |
2400 //----- (0046BFFA) -------------------------------------------------------- | |
2401 bool __fastcall _46BFFA_check_object_intercept(unsigned int uLayingItemID, signed int a2) | |
2402 { | |
2101 | 2403 ObjectDesc *object; // ebx@1 |
0 | 2404 unsigned int v8; // eax@19 |
2405 signed int v10; // ebx@19 | |
2406 char *v11; // edx@20 | |
2407 unsigned __int16 v12; // ax@23 | |
2408 int v13; // eax@27 | |
2334 | 2409 // unsigned int v14; // ebx@33 |
0 | 2410 int v16; // eax@36 |
2334 | 2411 // unsigned int v17; // eax@37 |
0 | 2412 __int16 v18; // di@37 |
2413 signed int v19; // edx@37 | |
2334 | 2414 // unsigned __int8 v20; // sf@37 |
2415 // char *v21; // ecx@38 | |
0 | 2416 unsigned __int16 v22; // ax@41 |
2334 | 2417 // unsigned int v23; // eax@46 |
0 | 2418 signed int v24; // ebx@46 |
2419 char *v25; // edx@47 | |
2420 int v26; // edx@54 | |
2421 int v27; // edx@55 | |
2422 int v28; // edx@56 | |
2423 int v29; // edx@57 | |
2334 | 2424 // unsigned __int16 v30; // ax@60 |
2425 // unsigned int v31; // ecx@60 | |
2426 // int v32; // edi@60 | |
2427 // unsigned int v33; // eax@65 | |
0 | 2428 signed int v34; // edx@65 |
2334 | 2429 // char *v35; // ecx@66 |
0 | 2430 unsigned __int16 v36; // ax@69 |
2431 int v37; // ST14_4@72 | |
2432 int v38; // eax@72 | |
2433 int v39; // ST10_4@72 | |
2434 int v40; // ST0C_4@72 | |
2435 int v41; // edx@76 | |
2436 int v42; // edx@77 | |
2437 int v43; // edx@78 | |
2438 unsigned __int8 v44; // zf@79 | |
2439 int v45; // edx@79 | |
2440 unsigned __int16 v46; // ax@80 | |
2441 int v47; // eax@81 | |
2442 int v48; // edx@87 | |
2443 int v49; // edx@88 | |
2444 int v50; // edx@89 | |
2445 signed int v52; // ebx@93 | |
2334 | 2446 // char *v53; // edx@94 |
2447 // unsigned __int16 v54; // ax@98 | |
2448 // unsigned int v55; // ecx@98 | |
0 | 2449 signed int v56; // ebx@98 |
2334 | 2450 // char *v57; // edx@99 |
0 | 2451 unsigned __int16 v58; // ax@102 |
2452 unsigned __int16 v59; // ax@107 | |
2334 | 2453 // unsigned int v60; // ecx@107 |
0 | 2454 signed int v61; // ebx@107 |
2334 | 2455 // char *v62; // edx@108 |
0 | 2456 unsigned __int16 v63; // ax@111 |
2457 int v64; // ebx@114 | |
2458 signed int v65; // eax@114 | |
2334 | 2459 // unsigned int v66; // edi@123 |
2460 // unsigned __int16 v67; // ax@124 | |
2461 // unsigned int v68; // ecx@124 | |
0 | 2462 signed int v69; // ebx@124 |
2334 | 2463 // char *v70; // edx@125 |
0 | 2464 unsigned __int16 v71; // ax@128 |
2465 unsigned int v72; // ebx@131 | |
2466 int v78; // eax@133 | |
2467 char v79; // zf@139 | |
2334 | 2468 // unsigned int v80; // eax@140 |
0 | 2469 signed int v81; // edx@140 |
2334 | 2470 // char *v82; // ecx@141 |
0 | 2471 unsigned __int16 v83; // ax@144 |
2334 | 2472 // unsigned __int16 v84; // ax@151 |
2473 // unsigned int v85; // ecx@151 | |
0 | 2474 signed int v86; // ebx@151 |
2334 | 2475 // char *v87; // edx@152 |
0 | 2476 unsigned __int16 v88; // ax@155 |
2477 unsigned int v89; // eax@158 | |
2478 int v90; // ST34_4@159 | |
2479 int v91; // eax@159 | |
2480 unsigned int v92; // eax@163 | |
2334 | 2481 // unsigned int v93; // eax@177 |
2482 // char *v94; // ecx@178 | |
0 | 2483 unsigned __int16 v95; // ax@181 |
2484 unsigned __int16 v96; // ax@184 | |
2485 int v97; // eax@185 | |
2334 | 2486 // unsigned __int16 v98; // ax@191 |
0 | 2487 char v100; // ST18_1@198 |
2488 int v102; // eax@198 | |
2489 signed int v106; // eax@208 | |
2490 unsigned int v107; // edx@220 | |
2491 signed int v108; // ebx@225 | |
2334 | 2492 // unsigned int v109; // eax@234 |
0 | 2493 signed int v110; // ebx@234 |
2334 | 2494 // char *v111; // ecx@235 |
0 | 2495 unsigned __int16 v112; // ax@238 |
2496 unsigned __int16 v113; // si@241 | |
2497 int v114; // eax@242 | |
2498 int v115; // eax@245 | |
2334 | 2499 // unsigned __int16 v117; // ax@251 |
2500 // unsigned int v118; // ecx@251 | |
0 | 2501 signed int v119; // ebx@251 |
2334 | 2502 // char *v120; // edx@252 |
0 | 2503 unsigned __int16 v121; // ax@255 |
2334 | 2504 // unsigned int v122; // eax@260 |
2505 // char *v123; // edx@261 | |
0 | 2506 int v124; // eax@267 |
2507 int v125; // [sp-20h] [bp-4Ch]@28 | |
2508 char v132; // [sp-8h] [bp-34h]@131 | |
2509 char v134; // [sp-4h] [bp-30h]@131 | |
2510 signed int v135; // [sp-4h] [bp-30h]@217 | |
2511 int v136; // [sp+Ch] [bp-20h]@208 | |
2512 int v137; // [sp+10h] [bp-1Ch]@208 | |
2513 signed int v138; // [sp+14h] [bp-18h]@207 | |
2514 signed int v139; // [sp+18h] [bp-14h]@208 | |
2334 | 2515 // char *v140; // [sp+1Ch] [bp-10h]@61 |
0 | 2516 signed int v141; // [sp+1Ch] [bp-10h]@117 |
2517 unsigned int v142; // [sp+1Ch] [bp-10h]@158 | |
2518 signed int v143; // [sp+1Ch] [bp-10h]@172 | |
2334 | 2519 // char *v144; // [sp+1Ch] [bp-10h]@192 |
0 | 2520 signed int v146; // [sp+20h] [bp-Ch]@60 |
2521 int v147; // [sp+20h] [bp-Ch]@72 | |
2522 signed int v148; // [sp+20h] [bp-Ch]@158 | |
2523 unsigned __int16 v150; // [sp+20h] [bp-Ch]@208 | |
2524 signed int v152; // [sp+24h] [bp-8h]@208 | |
2101 | 2525 |
2526 //ïðèìåíåíèå: ôàåðáîëò â õðàìå ëóíû | |
2527 object = &pObjectList->pObjects[pSpriteObjects[uLayingItemID].uObjectDescID]; | |
2528 //v151 = PID_TYPE(a2); | |
848 | 2529 if ( PID_TYPE(a2) == OBJECT_Actor) |
2530 { | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
2531 if ( PID_TYPE(pSpriteObjects[uLayingItemID].spell_caster_pid) == OBJECT_Actor |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
2532 && !pActors[PID_ID(pSpriteObjects[uLayingItemID].spell_caster_pid)].GetActorsRelation(&pActors[PID_ID(a2)]) ) |
0 | 2533 return 1; |
2534 } | |
2535 else | |
2536 { | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
2537 if ( PID_TYPE(a2) == OBJECT_Player && PID_TYPE(pSpriteObjects[uLayingItemID].spell_caster_pid) == OBJECT_Player) |
0 | 2538 return 1; |
2539 } | |
2540 if ( pParty->bTurnBasedModeOn == 1 ) | |
2541 { | |
2101 | 2542 if ( pSpriteObjects[uLayingItemID].uAttributes & 4 ) |
0 | 2543 { |
1450 | 2544 --pTurnEngine->pending_actions; |
2101 | 2545 pSpriteObjects[uLayingItemID].uAttributes &= 0xFFFB; |
0 | 2546 } |
2547 } | |
2101 | 2548 if ( PID_TYPE(a2) == OBJECT_BModel && PID_TYPE(pSpriteObjects[uLayingItemID].spell_caster_pid) != OBJECT_Player) |
1280 | 2549 { |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
2550 if (PID_ID(pSpriteObjects[uLayingItemID].spell_caster_pid) < 500) //bugfix PID_ID(v2->spell_caster_pid)==1000 |
2166 | 2551 pActors[PID_ID(pSpriteObjects[uLayingItemID].spell_caster_pid)].uAttributes |= 0x40000; |
1280 | 2552 } |
2553 | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
2554 //v6 = v2->uType; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
2555 //v7 = v2->uType; |
2396 | 2556 |
2557 switch (pSpriteObjects[uLayingItemID].uType) | |
2558 { | |
2559 | |
2560 case 1060: | |
2561 case 2030: | |
2562 case 9010: | |
2563 { | |
2564 //v9 = 0; | |
2565 if (PID_TYPE(a2) == 6 || PID_TYPE(a2) == 5 || !PID_TYPE(a2)) | |
2566 return 1; | |
2567 if (PID_TYPE(a2) != 2) | |
2568 { | |
2569 sub_43A97E(uLayingItemID, a2); | |
2570 ++pSpriteObjects[uLayingItemID].uType; | |
2571 v95 = 0; | |
2572 for (v52 = 0; v52 < (signed int)pObjectList->uNumObjects; ++v52) | |
2573 { | |
2574 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v52].uObjectID) | |
2575 v95 = v52; | |
2576 } | |
2577 pSpriteObjects[uLayingItemID].uObjectDescID = v95; | |
2578 if (!v95) | |
2579 SpriteObject::OnInteraction(uLayingItemID); | |
2580 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
2581 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
2582 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
2583 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
2584 if (!pSpriteObjects[uLayingItemID].uSoundID) | |
2585 v97 = 0; | |
2586 else | |
2587 v97 = (signed __int16)pSpriteObjects[uLayingItemID].uSoundID + 4; | |
2588 v124 = 8 * uLayingItemID; | |
2589 LOBYTE(v124) = v124 | 2; | |
2590 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
2591 pAudioPlayer->PlaySound((SoundID)v125, v124, 0, -1, 0, v97, 0, 0); | |
2592 return 0; | |
2593 } | |
2594 pSpriteObjects[uLayingItemID].uType = pSpriteObjects[uLayingItemID].uType + 1; | |
2595 v121 = 0; | |
2596 for (v119 = 0; v119 < (signed int)pObjectList->uNumObjects; ++v119) | |
2597 { | |
2598 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v119].uObjectID) | |
2599 v121 = v119; | |
2600 } | |
2601 pSpriteObjects[uLayingItemID].uObjectDescID = v121; | |
2602 if (!v121) | |
2603 SpriteObject::OnInteraction(uLayingItemID); | |
2604 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
2605 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
2606 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
2607 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
2608 v13 = 8 * uLayingItemID; | |
2609 LOBYTE(v13) = PID(OBJECT_Item, uLayingItemID); | |
2610 pAudioPlayer->PlaySound(SOUND_8, v13, 0, -1, 0, 0, 0, 0); | |
2611 return 0; | |
2612 } | |
2613 | |
2614 | |
2615 case 500: | |
2616 case 505: | |
2617 case 510: | |
2618 case 515: | |
2619 case 520: | |
2620 case 525: | |
2621 case 530: | |
2622 case 535: | |
2623 case 540: | |
2624 { | |
2625 sub_43A97E(uLayingItemID, a2); | |
2626 ++pSpriteObjects[uLayingItemID].uType; | |
2627 v12 = 0; | |
2628 for (v10 = 0; v10 < (signed int)pObjectList->uNumObjects; ++v10) | |
2629 { | |
2630 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v10].uObjectID) | |
2631 v12 = v10; | |
2632 } | |
2633 pSpriteObjects[uLayingItemID].uObjectDescID = v12; | |
2634 if (!v12) | |
2635 SpriteObject::OnInteraction(uLayingItemID); | |
2636 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
2637 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
2638 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
2639 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
2640 if (pSpriteObjects[uLayingItemID].uType == 555) | |
2641 { | |
2642 v13 = 8 * uLayingItemID; | |
2643 LOBYTE(v13) = PID(OBJECT_Item, uLayingItemID); | |
2644 pAudioPlayer->PlaySound(SOUND_8, v13, 0, -1, 0, 0, 0, 0); | |
2645 } | |
2646 return 0; | |
2647 } | |
2648 | |
2649 case 545: | |
2650 case 550: | |
2651 { | |
2652 if (pSpriteObjects[uLayingItemID].stru_24.uItemID != 405 && pSpriteObjects[uLayingItemID].stru_24.uSpecEnchantmentType != 3) | |
2653 { | |
2654 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
2655 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
2656 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
2657 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
2658 sub_43A97E(uLayingItemID, a2); | |
2659 SpriteObject::OnInteraction(uLayingItemID); | |
2660 if (pSpriteObjects[uLayingItemID].uSoundID == 0) | |
2661 v16 = 0; | |
2662 else | |
2663 v16 = (signed __int16)pSpriteObjects[uLayingItemID].uSoundID + 4; | |
2664 v124 = 8 * uLayingItemID; | |
2665 LOBYTE(v124) = v124 | 2; | |
2666 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id] + 1; | |
2667 pAudioPlayer->PlaySound((SoundID)v125, v124, 0, -1, 0, v16, 0, 0); | |
2668 return 0; | |
2669 } | |
2670 v18 = 0; | |
2671 pSpriteObjects[uLayingItemID].uType = 600; | |
2672 v22 = 0; | |
2673 for (v19 = 0; v19 < (signed int)pObjectList->uNumObjects; ++v19) | |
2674 { | |
2675 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v19].uObjectID) | |
2676 v22 = v19; | |
2677 } | |
2678 pSpriteObjects[uLayingItemID].uObjectDescID = v22; | |
2679 if (!v22) | |
2680 SpriteObject::OnInteraction(uLayingItemID); | |
2681 pSpriteObjects[uLayingItemID].vVelocity.z = v18; | |
2682 pSpriteObjects[uLayingItemID].vVelocity.y = v18; | |
2683 pSpriteObjects[uLayingItemID].vVelocity.x = v18; | |
2684 pSpriteObjects[uLayingItemID].uSpriteFrameID = v18; | |
2685 v12 = 0; | |
2686 for (v10; v10 < (signed int)v8; ++v10) | |
2687 { | |
2688 v11 += 56; | |
2689 if (pSpriteObjects[uLayingItemID].uType != *(short *)v11) | |
2690 v12 = v10; | |
2691 } | |
2692 pSpriteObjects[uLayingItemID].uObjectDescID = v12; | |
2693 if (!v12) | |
2694 SpriteObject::OnInteraction(uLayingItemID); | |
2695 v44 = pSpriteObjects[uLayingItemID].uType == 555; | |
2696 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
2697 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
2698 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
2699 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
2700 if (!v44) | |
2701 { | |
2702 v13 = 8 * uLayingItemID; | |
2703 LOBYTE(v13) = PID(OBJECT_Item, uLayingItemID); | |
2704 pAudioPlayer->PlaySound(SOUND_8, v13, 0, -1, 0, 0, 0, 0); | |
2705 return 0; | |
2706 } | |
2707 return 0; | |
2708 } | |
2709 | |
2710 case 600: | |
2711 { | |
2712 pSpriteObjects[uLayingItemID].uType = 601; | |
2713 v36 = 0; | |
2714 for (v34 = 0; v34 < (signed int)pObjectList->uNumObjects; ++v34) | |
2715 { | |
2716 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v34].uObjectID) | |
2717 v36 = v34; | |
2718 } | |
2719 pSpriteObjects[uLayingItemID].uObjectDescID = v36; | |
2720 if (!v36) | |
2721 SpriteObject::OnInteraction(uLayingItemID); | |
2722 v37 = pSpriteObjects[uLayingItemID].vPosition.z; | |
2723 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
2724 v38 = 8 * uLayingItemID; | |
2725 v39 = pSpriteObjects[uLayingItemID].vPosition.y; | |
2726 LOBYTE(v38) = PID(OBJECT_Item, uLayingItemID); | |
2727 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
2728 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
2729 v40 = pSpriteObjects[uLayingItemID].vPosition.x; | |
2730 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
2731 v147 = v38; | |
2732 AttackerInfo.Add(v38, 512, v40, v39, v37, 0, 0); | |
2733 if (object->uFlags & OBJECT_DESC_TRIAL_PARTICLE) | |
2734 trail_particle_generator.GenerateTrailParticles(pSpriteObjects[uLayingItemID].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y, pSpriteObjects[uLayingItemID].vPosition.z, object->uParticleTrailColor); | |
2735 pAudioPlayer->PlaySound(SOUND_8, v147, 0, -1, 0, 0, 0, 0); | |
2736 return 0; | |
2737 } | |
2738 | |
2739 case 1010: | |
2740 case 1100: | |
2741 case 2060: | |
2742 case 3010: | |
2743 case 3030: | |
2744 case 3060: | |
2745 case 4000: | |
2746 case 4030: | |
2747 case 4050: | |
2748 case 4100: | |
2749 case 6010: | |
2750 case 6090: | |
2751 { | |
2752 sub_43A97E(uLayingItemID, a2); | |
2753 ++pSpriteObjects[uLayingItemID].uType; | |
2754 v95 = 0; | |
2755 for (v52 = 0; v52 < (signed int)pObjectList->uNumObjects; ++v52) | |
2756 { | |
2757 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v52].uObjectID) | |
2758 v95 = v52; | |
2759 } | |
2760 pSpriteObjects[uLayingItemID].uObjectDescID = v95; | |
2761 if (!v95) | |
2762 SpriteObject::OnInteraction(uLayingItemID); | |
2763 v96 = pSpriteObjects[uLayingItemID].uSoundID; | |
2764 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
2765 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
2766 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
2767 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
2768 if (!v96) | |
2769 v97 = 0; | |
2770 else | |
2771 v97 = (signed __int16)v96 + 4; | |
2772 v124 = 8 * uLayingItemID; | |
2773 LOBYTE(v124) = v124 | 2; | |
2774 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
2775 pAudioPlayer->PlaySound((SoundID)v125, v124, 0, -1, 0, v97, 0, 0); | |
2776 return 0; | |
2777 } | |
2778 | |
2779 | |
2780 case 555: | |
2781 { | |
2782 sub_43A97E(uLayingItemID, a2); | |
2783 ++pSpriteObjects[uLayingItemID].uType; | |
2784 v18 = 0; | |
2785 v22 = 0; | |
2786 v25 = (char *)&pObjectList->pObjects->uObjectID; | |
2787 for (v24 = 0; v24 < (signed int)pObjectList->uNumObjects; ++v24) | |
2788 { | |
2789 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v24].uObjectID) | |
2790 v22 = v24; | |
2791 } | |
2792 pSpriteObjects[uLayingItemID].uObjectDescID = v22; | |
2793 if (v22 == v18) | |
2794 SpriteObject::OnInteraction(uLayingItemID); | |
2795 pSpriteObjects[uLayingItemID].vVelocity.z = v18; | |
2796 pSpriteObjects[uLayingItemID].vVelocity.y = v18; | |
2797 pSpriteObjects[uLayingItemID].vVelocity.x = v18; | |
2798 pSpriteObjects[uLayingItemID].uSpriteFrameID = v18; | |
2799 return 0; | |
2800 } | |
2801 | |
2802 case 3090: | |
2803 { | |
2804 //v9 = 0; | |
2805 pSpriteObjects[uLayingItemID].uType = pSpriteObjects[uLayingItemID].uType + 2; | |
2806 v63 = 0; | |
2807 for (v61 = 0; v61 < (signed int)pObjectList->uNumObjects; ++v61) | |
2808 { | |
2809 if (v59 == pObjectList->pObjects[v61].uObjectID) | |
2810 v63 = v61; | |
2811 } | |
2812 pSpriteObjects[uLayingItemID].uObjectDescID = v63; | |
2813 if (!v63) | |
2814 SpriteObject::OnInteraction(uLayingItemID); | |
2815 v64 = pSpriteObjects[uLayingItemID].uFacing - stru_5C6E00->uIntegerDoublePi; | |
2816 v44 = pSpriteObjects[uLayingItemID].spell_skill == 4; | |
2817 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
2818 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
2819 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
2820 v65 = 7; | |
2821 if (v44) | |
2822 v65 = 9; | |
2823 if (v65 > 0) | |
2824 { | |
2825 v141 = v65; | |
2826 do | |
2827 { | |
2828 v64 += (signed int)stru_5C6E00->uIntegerHalfPi / 2; | |
2829 pSpriteObjects[uLayingItemID].Create(v64, 0, 1000, 0); | |
2830 --v141; | |
2831 } while (v141); | |
2832 } | |
2833 SpriteObject::OnInteraction(uLayingItemID); | |
2834 if (!pSpriteObjects[uLayingItemID].uSoundID) | |
2835 v16 = 0; | |
2836 else | |
2837 v16 = (signed __int16)pSpriteObjects[uLayingItemID].uSoundID + 4; | |
2838 v124 = 8 * uLayingItemID; | |
2839 LOBYTE(v124) = v124 | 2; | |
2840 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
2841 pAudioPlayer->PlaySound((SoundID)v125, v124, 0, -1, 0, v16, 0, 0); | |
2842 return 0; | |
2843 } | |
2844 | |
2845 case 3092: | |
2846 { | |
2847 pSpriteObjects[uLayingItemID].uType = pSpriteObjects[uLayingItemID].uType - 1; | |
2848 v58 = 0; | |
2849 for (v56 = 0; v56 < (signed int)pObjectList->uNumObjects; ++v56) | |
2850 { | |
2851 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v56].uObjectID) | |
2852 v58 = v56; | |
2853 } | |
2854 pSpriteObjects[uLayingItemID].uObjectDescID = v58; | |
2855 if (!v58) | |
2856 SpriteObject::OnInteraction(uLayingItemID); | |
2857 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
2858 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
2859 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
2860 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
2861 sub_43A97E(uLayingItemID, a2); | |
2862 if (!pSpriteObjects[uLayingItemID].uSoundID) | |
2863 v16 = 0; | |
2864 else | |
2865 v16 = (signed __int16)pSpriteObjects[uLayingItemID].uSoundID + 4; | |
2866 v124 = 8 * uLayingItemID; | |
2867 LOBYTE(v124) = v124 | 2; | |
2868 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
2869 pAudioPlayer->PlaySound((SoundID)v125, v124, 0, -1, 0, v16, 0, 0); | |
2870 return 0; | |
2871 } | |
2872 | |
2873 case 4070: | |
2874 { | |
2875 if (PID_TYPE(a2) == 6 || PID_TYPE(a2) == 5 || !PID_TYPE(a2)) | |
2876 return 1; | |
2877 pSpriteObjects[uLayingItemID].uType = pSpriteObjects[uLayingItemID].uType + 1; | |
2878 v71 = 0; | |
2879 for (v69 = 0; v69 < (signed int)pObjectList->uNumObjects; ++v69) | |
2880 { | |
2881 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v69].uObjectID) | |
2882 v71 = v69; | |
2883 } | |
2884 pSpriteObjects[uLayingItemID].uObjectDescID = v71; | |
2885 if (!v71) | |
2886 SpriteObject::OnInteraction(uLayingItemID); | |
2887 v134 = 0; | |
2888 v72 = uLayingItemID; | |
2889 v132 = 0; | |
2890 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
2891 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
2892 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
2893 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
2894 AttackerInfo.Add(PID(OBJECT_Item, v72), 512, pSpriteObjects[uLayingItemID].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y, pSpriteObjects[uLayingItemID].vPosition.z, v132, v134); | |
2895 if (!pSpriteObjects[uLayingItemID].uSoundID) | |
2896 v78 = 0; | |
2897 else | |
2898 v78 = (signed __int16)pSpriteObjects[uLayingItemID].uSoundID + 4; | |
2899 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
2900 pAudioPlayer->PlaySound((SoundID)v125, pSpriteObjects[uLayingItemID].vPosition.x, 0, -1, 0, v78, 0, 0); | |
2901 return 0; | |
2902 } | |
2903 | |
2904 case 4090: | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
2905 { |
2396 | 2906 //v9 = 0; |
2907 pSpriteObjects[uLayingItemID].uType = pSpriteObjects[uLayingItemID].uType + 2; | |
2908 v88 = 0; | |
2909 for (v86 = 0; v86 < (signed int)pObjectList->uNumObjects; ++v86) | |
2910 { | |
2911 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v86].uObjectID) | |
2912 v88 = v86; | |
2913 } | |
2914 pSpriteObjects[uLayingItemID].uObjectDescID = v88; | |
2915 if (!v88) | |
2916 SpriteObject::OnInteraction(uLayingItemID); | |
2917 v89 = pSpriteObjects[uLayingItemID].uFacing - stru_5C6E00->uIntegerDoublePi; | |
2918 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
2919 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
2920 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
2921 v142 = v89; | |
2922 v148 = 7; | |
2923 do | |
2924 { | |
2925 pRnd->SetRange(-128, 128); | |
2926 v90 = pRnd->GetInRange(); | |
2927 pRnd->SetRange(5, 500); | |
2928 v91 = pRnd->GetInRange(); | |
2929 v142 += (signed int)stru_5C6E00->uIntegerHalfPi >> 1; | |
2930 pSpriteObjects[uLayingItemID].Create(v90 + v142, 0, v91, 0); | |
2931 --v148; | |
2932 } while (v148); | |
2933 SpriteObject::OnInteraction(uLayingItemID); | |
2934 if (!pSpriteObjects[uLayingItemID].uSoundID) | |
2935 v16 = 0; | |
2936 else | |
2937 v16 = (signed __int16)pSpriteObjects[uLayingItemID].uSoundID + 4; | |
2938 v124 = 8 * uLayingItemID; | |
2939 LOBYTE(v124) = v124 | 2; | |
2940 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
2941 pAudioPlayer->PlaySound((SoundID)v125, v124, 0, -1, 0, v16, 0, 0); | |
2942 return 0; | |
2943 } | |
2944 | |
2945 case 4092: | |
2946 { | |
2947 pSpriteObjects[uLayingItemID].uType = 4091; | |
2948 v83 = 0; | |
2949 for (v81 = 0; v81 < (signed int)pObjectList->uNumObjects; ++v81) | |
2950 { | |
2951 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v81].uObjectID) | |
2952 v83 = v81; | |
2953 } | |
2954 pSpriteObjects[uLayingItemID].uObjectDescID = v83; | |
2955 if (!v83) | |
2956 SpriteObject::OnInteraction(uLayingItemID); | |
2957 v134 = 0; | |
2958 //v72 = uLayingItemID; | |
2959 v132 = pSpriteObjects[uLayingItemID].field_61; | |
2960 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
2961 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
2962 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
2963 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
2964 AttackerInfo.Add(PID(OBJECT_Item, uLayingItemID), 512, pSpriteObjects[uLayingItemID].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y, pSpriteObjects[uLayingItemID].vPosition.z, v132, v134); | |
2965 if (!pSpriteObjects[uLayingItemID].uSoundID) | |
2966 v78 = 0; | |
2967 else | |
2968 v78 = (signed __int16)pSpriteObjects[uLayingItemID].uSoundID + 4; | |
2969 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
2970 pAudioPlayer->PlaySound((SoundID)v125, pSpriteObjects[uLayingItemID].vPosition.x, 0, -1, 0, v78, 0, 0); | |
2971 return 0; | |
0 | 2972 } |
2396 | 2973 |
2974 case 8010: | |
2975 { | |
2976 if (PID_TYPE(a2) == 3 | |
2977 && MonsterStats::BelongsToSupertype(pActors[PID_ID(a2)].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD)) | |
2978 sub_43A97E(uLayingItemID, a2); | |
2979 ++pSpriteObjects[uLayingItemID].uType; | |
2980 //v9 = 0; | |
2981 v95 = 0; | |
2982 for (v52 = 0; v52 < (signed int)pObjectList->uNumObjects; ++v52) | |
2983 { | |
2984 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v52].uObjectID) | |
2985 v95 = v52; | |
2986 } | |
2987 pSpriteObjects[uLayingItemID].uObjectDescID = v95; | |
2988 if (!v95) | |
2989 SpriteObject::OnInteraction(uLayingItemID); | |
2990 v96 = pSpriteObjects[uLayingItemID].uSoundID; | |
2991 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
2992 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
2993 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
2994 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
2995 if (!v96) | |
2996 v97 = 0; | |
2997 else | |
2998 v97 = (signed __int16)v96 + 4; | |
2999 v92 = uLayingItemID; | |
3000 v124 = 8 * v92; | |
3001 LOBYTE(v124) = v124 | 2; | |
3002 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
3003 pAudioPlayer->PlaySound((SoundID)v125, v124, 0, -1, 0, v97, 0, 0); | |
3004 return 0; | |
3005 } | |
3006 | |
3007 case 7030: | |
3008 case 7090: | |
3009 case 8000: | |
3010 case 8090: | |
3011 { | |
3012 sub_43A97E(uLayingItemID, a2); | |
3013 ++pSpriteObjects[uLayingItemID].uType; | |
3014 v95 = 0; | |
3015 for (v52 = 0; v52 < (signed int)pObjectList->uNumObjects; ++v52) | |
3016 { | |
3017 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v52].uObjectID) | |
3018 v95 = v52; | |
3019 } | |
3020 pSpriteObjects[uLayingItemID].uObjectDescID = v95; | |
3021 if (!v95) | |
3022 SpriteObject::OnInteraction(uLayingItemID); | |
3023 v96 = pSpriteObjects[uLayingItemID].uSoundID; | |
3024 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
3025 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
3026 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
3027 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
3028 if (!v96) | |
3029 v97 = 0; | |
3030 else | |
3031 v97 = (signed __int16)v96 + 4; | |
3032 v124 = 8 * uLayingItemID; | |
3033 LOBYTE(v124) = v124 | 2; | |
3034 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
3035 pAudioPlayer->PlaySound((SoundID)v125, v124, 0, -1, 0, v97, 0, 0); | |
3036 return 0; | |
3037 } | |
3038 | |
3039 case 6040: | |
3040 case 8030: | |
3041 case 9030: | |
3042 { | |
3043 v143 = 17030; | |
3044 switch (pSpriteObjects[uLayingItemID].uType) | |
3045 { | |
3046 case 0x1798u: | |
3047 v143 = 15040; | |
3048 break; | |
3049 case 0xFAAu: | |
3050 v143 = 13010; | |
3051 break; | |
3052 case 0x2346u: | |
3053 v143 = 18030; | |
3054 break; | |
3055 } | |
3056 v138 = 1; | |
3057 if (PID_TYPE(a2) != OBJECT_Actor) | |
3058 { | |
3059 if (pSpriteObjects[uLayingItemID].uType != 9030 || pSpriteObjects[uLayingItemID].spell_skill != 4) | |
3060 { | |
3061 SpriteObject::OnInteraction(uLayingItemID); | |
3062 return 0; | |
3063 } | |
3064 pSpriteObjects[uLayingItemID]._46BEF1_apply_spells_aoe(); | |
3065 if (!v138) | |
3066 { | |
3067 ++pSpriteObjects[uLayingItemID].uType; | |
3068 v112 = 0; | |
3069 for (v110 = 0; v110 < (signed int)pObjectList->uNumObjects; ++v110) | |
3070 { | |
3071 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v110].uObjectID) | |
3072 v112 = v110; | |
3073 } | |
3074 pSpriteObjects[uLayingItemID].uObjectDescID = v112; | |
3075 if (!v112) | |
3076 SpriteObject::OnInteraction(uLayingItemID); | |
3077 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
3078 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
3079 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
3080 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
3081 v113 = pSpriteObjects[uLayingItemID].uSoundID; | |
3082 if (v113) | |
3083 v114 = (signed __int16)v113 + 4; | |
3084 else | |
3085 v114 = 0; | |
3086 v115 = 8 * uLayingItemID; | |
3087 LOBYTE(v115) = PID(OBJECT_Item, uLayingItemID); | |
3088 v125 = v143 + 1; | |
3089 pAudioPlayer->PlaySound((SoundID)v125, v115, 0, -1, 0, v114, 0, 0); | |
3090 } | |
3091 else | |
3092 SpriteObject::OnInteraction(uLayingItemID); | |
3093 return 0; | |
3094 } | |
3095 v106 = a2; | |
3096 v150 = 0; | |
3097 v139 = PID_ID(v106); | |
3098 v137 = pSpriteObjects[uLayingItemID].spell_level; | |
3099 v152 = pSpriteObjects[uLayingItemID].spell_skill; | |
3100 v136 = pSpriteObjects[uLayingItemID].spell_id; | |
3101 if (pSpriteObjects[uLayingItemID].uType == 9030) | |
3102 { | |
3103 v150 = 2; | |
3104 if (v152 == 2) | |
3105 { | |
3106 v150 = 3; | |
3107 } | |
3108 else | |
3109 { | |
3110 if (v152 >= 3) | |
3111 v150 = 4; | |
3112 } | |
3113 pActors[v139].uAttributes |= 0x80000; | |
3114 v107 = v135; | |
3115 } | |
3116 if (pSpriteObjects[uLayingItemID].uType == 6040) | |
3117 { | |
3118 v135 = 7; | |
3119 v107 = v135; | |
3120 } | |
3121 else | |
3122 { | |
3123 if (pSpriteObjects[uLayingItemID].uType == 8030) | |
3124 { | |
3125 v135 = 9; | |
3126 v107 = v135; | |
3127 } | |
3128 else | |
3129 { | |
3130 if (pSpriteObjects[uLayingItemID].uType != 9030) | |
3131 { | |
3132 v107 = v136; | |
3133 } | |
3134 if (pSpriteObjects[uLayingItemID].uType == 9030) | |
3135 { | |
3136 v135 = 10; | |
3137 v107 = v135; | |
3138 } | |
3139 } | |
3140 } | |
3141 if (pSpriteObjects[uLayingItemID].uType != 9030 || v152 != 4) | |
3142 { | |
3143 v108 = v139; | |
3144 if (pActors[v139].DoesDmgTypeDoDamage((DAMAGE_TYPE)v107)) | |
3145 { | |
3146 v138 = 0; | |
3147 if (pSpriteObjects[uLayingItemID].uType == 8030) | |
3148 { | |
3149 pActors[v108].uAIState = Standing; | |
3150 pActors[v108].UpdateAnimation(); | |
3151 } | |
3152 pActors[v108].pActorBuffs[v136].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(v137 << 7) * 0.033333335), | |
3153 v152, v150, 0, 0); | |
3154 } | |
3155 } | |
3156 else | |
3157 { | |
3158 pSpriteObjects[uLayingItemID]._46BEF1_apply_spells_aoe(); | |
3159 } | |
3160 pSpriteObjects[uLayingItemID].spell_level = 0; | |
3161 pSpriteObjects[uLayingItemID].spell_skill = 0; | |
3162 pSpriteObjects[uLayingItemID].spell_id = 0; | |
3163 if (!v138) | |
3164 { | |
3165 ++pSpriteObjects[uLayingItemID].uType; | |
3166 v112 = 0; | |
3167 for (v110 = 0; v110 < (signed int)pObjectList->uNumObjects; ++v110) | |
3168 { | |
3169 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v110].uObjectID) | |
3170 v112 = v110; | |
3171 } | |
3172 pSpriteObjects[uLayingItemID].uObjectDescID = v112; | |
3173 if (!v112) | |
3174 SpriteObject::OnInteraction(uLayingItemID); | |
3175 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
3176 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
3177 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
3178 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
3179 v113 = pSpriteObjects[uLayingItemID].uSoundID; | |
3180 if (v113) | |
3181 v114 = (signed __int16)v113 + 4; | |
3182 else | |
3183 v114 = 0; | |
3184 v115 = 8 * uLayingItemID; | |
3185 LOBYTE(v115) = PID(OBJECT_Item, uLayingItemID); | |
3186 v125 = v143 + 1; | |
3187 pAudioPlayer->PlaySound((SoundID)v125, v115, 0, -1, 0, v114, 0, 0); | |
3188 } | |
3189 else | |
3190 SpriteObject::OnInteraction(uLayingItemID); | |
3191 return 0; | |
3192 } | |
3193 | |
3194 case 9040: | |
3195 { | |
3196 sub_43A97E(uLayingItemID, a2); | |
3197 ++pSpriteObjects[uLayingItemID].uType; | |
3198 v95 = 0; | |
3199 for (v52 = 0; v52 < (signed int)pObjectList->uNumObjects; ++v52) | |
3200 { | |
3201 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v52].uObjectID) | |
3202 v95 = v52; | |
3203 } | |
3204 pSpriteObjects[uLayingItemID].uObjectDescID = v95; | |
3205 if (!v95) | |
3206 SpriteObject::OnInteraction(uLayingItemID); | |
3207 v96 = pSpriteObjects[uLayingItemID].uSoundID; | |
3208 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
3209 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
3210 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
3211 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
3212 if (!v96) | |
3213 v97 = 0; | |
3214 else | |
3215 v97 = (signed __int16)v96 + 4; | |
3216 v124 = 8 * uLayingItemID; | |
3217 LOBYTE(v124) = v124 | 2; | |
3218 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
3219 pAudioPlayer->PlaySound((SoundID)v125, v124, 0, -1, 0, v97, 0, 0); | |
3220 return 0; | |
3221 } | |
3222 | |
3223 /* | |
3224 case 1080: | |
3225 case 2100: | |
3226 { | |
3227 if (PID_TYPE(a2) != 3) | |
3228 { | |
3229 //v32 = 0; | |
3230 pSpriteObjects[uLayingItemID].uType = pSpriteObjects[uLayingItemID].uType + 1; | |
3231 v46 = 0; | |
3232 for (v146 = 0; v146 < (signed int)pObjectList->uNumObjects; ++v146) | |
3233 { | |
3234 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v146].uObjectID) | |
3235 v46 = v146; | |
3236 } | |
3237 pSpriteObjects[uLayingItemID].uObjectDescID = v46; | |
3238 if (!v46) | |
3239 SpriteObject::OnInteraction(uLayingItemID); | |
3240 v100 = pSpriteObjects[uLayingItemID].field_61; | |
3241 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
3242 v102 = 8 * uLayingItemID; | |
3243 LOBYTE(v102) = PID(OBJECT_Item, uLayingItemID); | |
3244 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
3245 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
3246 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
3247 AttackerInfo.Add(v102, 512, pSpriteObjects[uLayingItemID].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y, pSpriteObjects[uLayingItemID].vPosition.z, v100, 0); | |
3248 if (object->uFlags & OBJECT_DESC_TRIAL_PARTICLE) | |
3249 trail_particle_generator.GenerateTrailParticles(pSpriteObjects[uLayingItemID].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y, pSpriteObjects[uLayingItemID].vPosition.z, object->uParticleTrailColor); | |
3250 if (!pSpriteObjects[uLayingItemID].uSoundID) | |
3251 v47 = 0; | |
3252 else | |
3253 v47 = (signed __int16)pSpriteObjects[uLayingItemID].uSoundID + 4; | |
3254 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
3255 pAudioPlayer->PlaySound((SoundID)v125, v102, 0, -1, 0, v47, 0, 0); | |
3256 return 0; | |
3257 } | |
3258 return 1; | |
3259 }*/ | |
3260 | |
3261 case 1080: | |
3262 case 2100: | |
3263 { | |
3264 if (PID_TYPE(a2) == 3) | |
3265 return 1; | |
3266 //else go to next case | |
3267 } | |
3268 | |
3269 case 1050: | |
3270 case 9080: | |
3271 { | |
3272 v95 = 0; | |
3273 pSpriteObjects[uLayingItemID].uType = pSpriteObjects[uLayingItemID].uType + 1; | |
3274 for (v146 = 0; v146 < (signed int)pObjectList->uNumObjects; ++v146) | |
3275 { | |
3276 if (pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v146].uObjectID) | |
3277 v95 = v146; | |
3278 } | |
3279 pSpriteObjects[uLayingItemID].uObjectDescID = v95; | |
3280 if (!v95) | |
3281 SpriteObject::OnInteraction(uLayingItemID); | |
3282 v100 = pSpriteObjects[uLayingItemID].field_61; | |
3283 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
3284 v102 = 8 * uLayingItemID; | |
3285 LOBYTE(v102) = PID(OBJECT_Item, uLayingItemID); | |
3286 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
3287 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
3288 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
3289 AttackerInfo.Add(v102, 512, pSpriteObjects[uLayingItemID].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y, pSpriteObjects[uLayingItemID].vPosition.z, v100, 0); | |
3290 if (object->uFlags & OBJECT_DESC_TRIAL_PARTICLE) | |
3291 trail_particle_generator.GenerateTrailParticles(pSpriteObjects[uLayingItemID].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y, pSpriteObjects[uLayingItemID].vPosition.z, object->uParticleTrailColor); | |
3292 if (!pSpriteObjects[uLayingItemID].uSoundID) | |
3293 v47 = 0; | |
3294 else | |
3295 v47 = (signed __int16)pSpriteObjects[uLayingItemID].uSoundID + 4; | |
3296 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
3297 pAudioPlayer->PlaySound((SoundID)v125, v102, 0, -1, 0, v47, 0, 0); | |
3298 return 0; | |
3299 } | |
3300 | |
3301 default: | |
3302 return 0; | |
0 | 3303 } |
2396 | 3304 |
0 | 3305 } |