Mercurial > mm7
annotate mm7_2.cpp @ 2257:8878fba164fd
simplifying a loop in immolation effect
author | Grumpy7 |
---|---|
date | Thu, 27 Feb 2014 00:36:31 +0100 |
parents | 4c9fef516e0a |
children | 43a508455445 |
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> | |
1545 | 4 |
5 #include "OSAPI.h" | |
1016 | 6 |
1262 | 7 #include "Texture.h" |
8 #include "mm7_data.h" | |
2152 | 9 #include "mm7_unsorted_subs.h" |
1016 | 10 #include "VideoPlayer.h" |
11 #include "Sprites.h" | |
12 #include "BSPModel.h" | |
13 | |
14 #include "LightmapBuilder.h" | |
15 #include "DecalBuilder.h" | |
16 #include "ParticleEngine.h" | |
17 #include "Mouse.h" | |
18 #include "Keyboard.h" | |
19 #include "CShow.h" | |
20 #include "GammaControl.h" | |
21 #include "stru6.h" | |
22 | |
1935 | 23 #include "Actor.h" |
1016 | 24 #include "Vis.h" |
0 | 25 #include "MapInfo.h" |
26 #include "Game.h" | |
27 #include "GUIWindow.h" | |
28 #include "GUIFont.h" | |
29 #include "Party.h" | |
30 #include "AudioPlayer.h" | |
31 #include "Outdoor.h" | |
1637 | 32 #include "Outdoor_stuff.h" |
0 | 33 #include "Overlays.h" |
34 #include "Arcomage.h" | |
35 #include "LOD.h" | |
36 #include "Actor.h" | |
37 #include "Events.h" | |
38 #include "Viewport.h" | |
39 #include "FrameTableInc.h" | |
2037
7a9477135943
Renamed Math.h -> OurMath.h (file resolution was sometimes ambiguous)
Nomad
parents:
2035
diff
changeset
|
40 #include "OurMath.h" |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
496
diff
changeset
|
41 #include "SpriteObject.h" |
0 | 42 #include "ObjectList.h" |
43 #include "Chest.h" | |
44 #include "PaletteManager.h" | |
45 #include "DecorationList.h" | |
46 #include "SaveLoad.h" | |
47 #include "stru123.h" | |
522 | 48 #include "stru176.h" |
2044 | 49 #include "Timer.h" |
0 | 50 #include "IconFrameTable.h" |
51 #include "GUIProgressBar.h" | |
52 #include "Bink_Smacker.h" | |
53 #include "PlayerFrameTable.h" | |
54 #include "TurnEngine.h" | |
55 #include "FactionTable.h" | |
56 #include "StorylineTextTable.h" | |
57 #include "Random.h" | |
924 | 58 #include "CastSpellInfo.h" |
0 | 59 #include "stru298.h" |
60 #include "Events2D.h" | |
61 #include "Log.h" | |
1299 | 62 #include "UI\UIHouses.h" |
189 | 63 #include "texts.h" |
522 | 64 #include "MM7.h" |
1262 | 65 #include "Lights.h" |
1815 | 66 #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
|
67 #include "Level/Decoration.h" |
2052 | 68 #include "LuaVM.h" |
69 | |
70 //#include "lib/lua/lua.h" | |
2033 | 71 |
1913 | 72 int __stdcall aWinProc(HWND hWnd, UINT Msg, WPARAM wParam, unsigned int lParam); |
73 int __stdcall InsertMM7CDDialogFunc(HWND hDlg, int a2, __int16 a3, int a4); | |
74 bool __fastcall FindMM7CD(HWND hWnd, char *pCDDrive); | |
75 bool __fastcall Initialize(HINSTANCE hInst, char *pCmdLine); | |
76 | |
77 //----- (004A1780) mm6_chinese--------------------------------------------- | |
78 __int64 fixpoint_div(int a1, int a2) | |
79 { | |
80 return ((__int64)a1 << 16) / a2; | |
81 } | |
82 | |
83 __int64 fixpoint_sub_unknown(int a1, int a2) | |
84 { | |
85 return (((__int64)a1 << 16) * a2) >> 16; | |
86 } | |
87 | |
88 //----- (0042EBBE) -------------------------------------------------------- | |
89 //----- (004453C0) mm6----------------------------------------------------- | |
90 //----- (004A1760) mm6_chinese--------------------------------------------- | |
91 __int64 fixpoint_mul(int a1, int a2) | |
92 { | |
93 return ((__int64)a1 * (__int64)a2) >> 16; | |
94 } | |
95 | |
96 __int64 fixpoint_dot(int x1, int x2, int y1, int y2, int z1, int z2) | |
97 { | |
98 return fixpoint_mul(x1, x2) + | |
99 fixpoint_mul(y1, y2) + | |
100 fixpoint_mul(z1, z2); | |
101 } | |
102 | |
0 | 103 //----- (004BB756) -------------------------------------------------------- |
1413 | 104 int UseNPCSkill(NPCProf profession) |
0 | 105 { |
1413 | 106 switch (profession) |
107 { | |
108 case Healer: | |
109 { | |
110 for (int i = 0; i < 4; ++i) | |
111 pParty->pPlayers[i].sHealth = pParty->pPlayers[i].GetMaxHealth(); | |
112 } | |
113 break; | |
114 | |
115 case ExpertHealer: | |
116 { | |
117 for (int i = 0; i < 4; ++i) | |
118 { | |
1980 | 119 Player* player = &pParty->pPlayers[i]; |
1413 | 120 player->sHealth = player->GetMaxHealth(); |
121 | |
122 for (int j = 0; j < 14; ++j) | |
123 player->pConditions[i] = 0; | |
124 player->pConditions[18] = 0; | |
125 } | |
126 } | |
127 break; | |
128 | |
129 case MasterHealer: | |
130 { | |
131 for (int i = 0; i < 4; ++i) | |
132 { | |
1980 | 133 Player* player = &pParty->pPlayers[i]; |
1413 | 134 player->sHealth = player->GetMaxHealth(); |
135 | |
1980 | 136 int v5 = LODWORD(player->pConditions[19]);//*((int *)v4 - 32); |
137 int v6 = HIDWORD(player->pConditions[19]);//*((int *)v4 - 31); | |
1826 | 138 memset(player->pConditions.data(), 0, 0xA0u); |
1413 | 139 |
140 __debugbreak(); | |
2197 | 141 *(int *)&player->pActiveSkills[PLAYER_SKILL_SHIELD] = v5; |
142 *(int *)&player->pActiveSkills[PLAYER_SKILL_CHAIN] = v6; | |
1413 | 143 } |
144 } | |
145 break; | |
146 | |
2197 | 147 case Cook://Ïîâàð |
1413 | 148 { |
149 if (pParty->uNumFoodRations >= 13) | |
150 return 1; | |
151 | |
152 Party::GiveFood(1); | |
153 } | |
154 break; | |
155 | |
156 case Chef: | |
157 { | |
158 if (pParty->uNumFoodRations >= 13) | |
159 return 1; | |
160 | |
161 if (pParty->uNumFoodRations == 13) | |
162 Party::GiveFood(1); | |
163 else | |
164 Party::GiveFood(2); | |
165 } | |
166 break; | |
167 | |
168 case WindMaster: | |
0 | 169 { |
1413 | 170 if (uCurrentlyLoadedLevelType == LEVEL_Indoor) |
171 { | |
172 ShowStatusBarString(pGlobalTXT_LocalizationStrings[494], 2); | |
173 pAudioPlayer->PlaySound(SOUND_203, 0, 0, -1, 0, 0, 0, 0); | |
174 } | |
175 else | |
176 { | |
1980 | 177 int v19 = pOtherOverlayList->_4418B1(10008, 203, 0, 65536); |
1413 | 178 pParty->pPartyBuffs[PARTY_BUFF_FLY].Apply(pParty->uTimePlayed + 60 * (256 * 2), 3, 1, v19, 0); |
179 pParty->pPartyBuffs[PARTY_BUFF_FLY].uFlags |= 1u; | |
180 pAudioPlayer->PlaySound(SOUND_11090, 0, 0, -1, 0, 0, 0, 0); | |
181 } | |
182 } | |
183 break; | |
184 | |
185 case WaterMaster: | |
186 { | |
1980 | 187 int v20 = pOtherOverlayList->_4418B1(10005, 201, 0, 65536); |
1413 | 188 pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].Apply(pParty->uTimePlayed + 60 * (256 * (2 + 1)), 3, 0, v20, 0); |
189 pParty->pPartyBuffs[PARTY_BUFF_WATER_WALK].uFlags |= 1u; | |
190 pAudioPlayer->PlaySound(SOUND_12040, 0, 0, -1, 0, 0, 0, 0); | |
191 } | |
192 break; | |
193 | |
194 case GateMaster: | |
195 { | |
196 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 0, 0); | |
197 dword_50C9DC = 195; | |
198 ptr_50C9E0 = GetNPCData(sDialogue_SpeakingActorNPC_ID); | |
199 } | |
200 break; | |
201 | |
202 case Acolyte: _42777D_CastSpell_UseWand_ShootArrow(46, 0, 133, 0, 0); break; | |
203 case Piper: _42777D_CastSpell_UseWand_ShootArrow(51, 0, 133, 0, 0); break; | |
204 case FallenWizard: _42777D_CastSpell_UseWand_ShootArrow(86, 0, 133, 0, 0); break; | |
205 | |
206 case Teacher: | |
207 case Instructor: | |
208 case Armsmaster: | |
209 case Weaponsmaster: | |
210 case Apprentice: | |
211 case Mystic: | |
212 case Spellmaster: | |
213 case Trader: | |
214 case Merchant: | |
215 case Scout: | |
216 case Herbalist: | |
217 case Apothecary: | |
218 case Tinker: | |
219 case Locksmith: | |
220 case Fool: | |
221 case ChimneySweep: | |
222 case Porter: | |
223 case QuarterMaster: | |
224 case Factor: | |
225 case Banker: | |
226 case Horseman: | |
227 case Bard: | |
228 case Enchanter: | |
229 case Cartographer: | |
230 case Explorer: | |
231 case Pirate: | |
232 case Squire: | |
233 case Psychic: | |
234 case Gypsy: | |
235 case Diplomat: | |
236 case Duper: | |
237 case Burglar: | |
238 case Acolyte2: | |
239 case Initiate: | |
240 case Prelate: | |
241 case Monk: | |
242 case Sage: | |
243 case Hunter: | |
244 break; | |
245 | |
246 default: | |
247 assert(false && "Invalid enum value"); | |
248 } | |
249 return 0; | |
0 | 250 } |
251 | |
252 //----- (004BBA85) -------------------------------------------------------- | |
1529 | 253 void CheckBountyRespawnAndAward() |
0 | 254 { |
255 int i; // eax@2 | |
1529 | 256 int rand_monster_id; // edx@3 |
0 | 257 |
258 uDialogueType = 83; | |
259 pDialogueWindow->Release(); | |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2212
diff
changeset
|
260 pDialogueWindow = GUIWindow::Create(0, 0, window->GetWidth(), 350, WINDOW_MainMenu, 0, 0); |
1529 | 261 pBtn_ExitCancel = pDialogueWindow->CreateButton(471, 445, 169, 35, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[34],// "Cancel" |
945 | 262 pIcons_LOD->GetTexture(uExitCancelTextureId), 0); |
832 | 263 pDialogueWindow->CreateButton(0, 0, 0, 0, 1, 0, UIMSG_BuyInShop_Identify_Repair, 0, 0, "", 0); |
1529 | 264 pDialogueWindow->CreateButton(480, 160, 140, 30, 1, 0, UIMSG_0, 83, 0, "", 0); |
972 | 265 pDialogueWindow->_41D08F_set_keyboard_control_group(1, 1, 0, 2); |
747 | 266 dialog_menu_id = HOUSE_DIALOGUE_OTHER; |
1529 | 267 //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
|
268 if ( pParty->PartyTimes.bountyHunting_next_generation_time[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] < (signed __int64)pParty->uTimePlayed ) |
1529 | 269 { |
270 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
|
271 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 | 272 for ( i = rand(); ; i = rand() ) |
273 { | |
1529 | 274 rand_monster_id = i % 258 + 1; |
275 pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] = rand_monster_id; | |
276 if ( (unsigned __int16)rand_monster_id < 0x73u || (unsigned __int16)rand_monster_id > 0x84u ) | |
0 | 277 { |
1529 | 278 if ( ((unsigned __int16)rand_monster_id < 0xEBu || (unsigned __int16)rand_monster_id > 0xFCu) |
279 && ((unsigned __int16)rand_monster_id < 0x85u || (unsigned __int16)rand_monster_id > 0x96u) | |
280 && ((unsigned __int16)rand_monster_id < 0x97u || (unsigned __int16)rand_monster_id > 0xBAu) | |
281 && ((unsigned __int16)rand_monster_id < 0xC4u || (unsigned __int16)rand_monster_id > 0xC6u) ) | |
0 | 282 break; |
283 } | |
284 } | |
285 } | |
1529 | 286 bountyHunting_monster_id_for_hunting = pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)]; |
287 if ( !pParty->monster_for_hunting_killed[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] ) | |
288 { | |
289 bountyHunting_text = pNPCTopics[351].pText; | |
290 if ( !pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] ) | |
291 bountyHunting_text = pNPCTopics[353].pText; | |
292 } | |
293 else//get prize | |
294 { | |
295 if ( pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] ) | |
0 | 296 { |
1828
35c1e4ff6ba7
party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents:
1826
diff
changeset
|
297 pParty->PartyFindsGold(100 * pMonsterStats->pInfos[(unsigned __int16)pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)]].uLevel, 0); |
1529 | 298 for ( uint i = 0; i < 4; ++i ) |
299 pParty->pPlayers[i].SetVariable(VAR_Award, 86); | |
300 pParty->uNumBountiesCollected += 100 * pMonsterStats->pInfos[pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)]].uLevel; | |
301 pParty->monster_id_for_hunting[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] = 0; | |
302 pParty->monster_for_hunting_killed[(int)((char *)window_SpeakInHouse->ptr_1C - 102)] = false; | |
0 | 303 } |
1529 | 304 bountyHunting_text = pNPCTopics[352].pText; |
305 } | |
0 | 306 } |
307 | |
308 //----- (004BBCDD) -------------------------------------------------------- | |
1914 | 309 void Arena_SelectionFightLevel() |
0 | 310 { |
311 signed int v0; // ebp@3 | |
90 | 312 Actor *v1; // eax@4 |
0 | 313 __int16 v2; // cx@5 |
314 int v3; // esi@8 | |
315 Player *v4; // esi@14 | |
316 GUIButton *v5; // eax@18 | |
317 GUIButton *v6; // esi@19 | |
318 size_t v7; // [sp+10h] [bp-4h]@4 | |
319 | |
320 if ( pParty->field_7B5_in_arena_quest ) | |
321 { | |
322 if ( pParty->field_7B5_in_arena_quest == -1 ) | |
323 { | |
324 uDialogueType = 92; | |
325 } | |
326 else | |
327 { | |
328 v0 = 0; | |
90 | 329 if ( (signed int)uNumActors > 0 ) |
330 { | |
1202 | 331 v1 = pActors.data();//[0].uAIState; |
90 | 332 v7 = uNumActors; |
333 do | |
334 { | |
335 v2 = v1->uAIState; | |
848 | 336 if ( v1->uAIState == Dead || v2 == Removed || v2 == Disabled || (v3 = v1->uSummonerID) != 0 && PID_TYPE(v3) == OBJECT_Player) |
90 | 337 ++v0; |
338 ++v1; | |
339 --v7; | |
340 } | |
341 while ( v7 ); | |
342 } | |
343 if ( v0 >= (signed int)uNumActors || (signed int)uNumActors <= 0) | |
344 { | |
0 | 345 uDialogueType = 91; |
1861
a86c60679949
changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
Grumpy7
parents:
1842
diff
changeset
|
346 v4 = pParty->pPlayers.data(); |
1529 | 347 ++*((char *)&pParty->monster_for_hunting_killed[3] + (unsigned __int8)pParty->field_7B5_in_arena_quest + 1); |
0 | 348 do |
349 { | |
350 v4->SetVariable(VAR_Award, (unsigned __int8)pParty->field_7B5_in_arena_quest + 3); | |
351 ++v4; | |
352 } | |
1861
a86c60679949
changing most of party arrays to std::arrays, some minor cleanups in actor.cpp
Grumpy7
parents:
1842
diff
changeset
|
353 while ( (signed int)v4 < (signed int)pParty->pHirelings.data() ); |
1828
35c1e4ff6ba7
party_finds_gold to Party::PartyFindsGold, cleaned up, moved Level/Decoration.h reference out of Indoor.h
Grumpy7
parents:
1826
diff
changeset
|
354 pParty->PartyFindsGold(gold_transaction_amount, 0); |
0 | 355 pAudioPlayer->PlaySound((SoundID)14060, 0, 0, -1, 0, 0, 0, 0); |
356 pParty->field_7B5_in_arena_quest = -1; | |
357 } | |
358 else | |
359 { | |
360 uDialogueType = 90; | |
361 pParty->vPosition.x = 3849; | |
362 pParty->vPosition.y = 5770; | |
363 pParty->vPosition.z = 1; | |
364 pParty->uFallStartY = 1; | |
365 pParty->sRotationY = 512; | |
366 pParty->sRotationX = 0; | |
367 pParty->uFallSpeed = 0; | |
368 pAudioPlayer->PlaySound((SoundID)14060, 0, 0, -1, 0, 0, 0, 0); | |
369 } | |
370 } | |
371 } | |
372 else | |
373 { | |
374 uDialogueType = 89; | |
375 v5 = pDialogueWindow->pControlsHead; | |
376 if ( v5 ) | |
377 { | |
378 do | |
379 { | |
380 v6 = v5->pNext; | |
1583 | 381 free(v5); |
0 | 382 v5 = v6; |
383 } | |
384 while ( v6 ); | |
385 } | |
386 pDialogueWindow->pControlsHead = 0; | |
387 pDialogueWindow->pControlsTail = 0; | |
388 pDialogueWindow->uNumControls = 0; | |
832 | 389 pBtn_ExitCancel = pDialogueWindow->CreateButton(0x1D7u, 0x1BDu, 0xA9u, 0x23u, 1, 0, UIMSG_Escape, 0, 0, pGlobalTXT_LocalizationStrings[79], |
945 | 390 pIcons_LOD->GetTexture(uExitCancelTextureId), 0); |
832 | 391 pDialogueWindow->CreateButton(0x1E0u, 0xA0u, 0x8Cu, 0x1Eu, 1, 0, UIMSG_SelectNPCDialogueOption, 0x55u, 0, "", 0); |
392 pDialogueWindow->CreateButton(0x1E0u, 0xBEu, 0x8Cu, 0x1Eu, 1, 0, UIMSG_SelectNPCDialogueOption, 0x56u, 0, "", 0); | |
393 pDialogueWindow->CreateButton(0x1E0u, 0xDCu, 0x8Cu, 0x1Eu, 1, 0, UIMSG_SelectNPCDialogueOption, 0x57u, 0, "", 0); | |
394 pDialogueWindow->CreateButton(0x1E0u, 0xFAu, 0x8Cu, 0x1Eu, 1, 0, UIMSG_SelectNPCDialogueOption, 0x58u, 0, "", 0); | |
972 | 395 pDialogueWindow->_41D08F_set_keyboard_control_group(4, 1, 0, 1); |
0 | 396 } |
397 } | |
398 | |
399 //----- (004BC109) -------------------------------------------------------- | |
2154 | 400 void ArenaFight() |
0 | 401 { |
402 int v0; // edi@1 | |
403 char *v1; // eax@7 | |
404 Player *v2; // edi@9 | |
405 int v3; // eax@10 | |
406 signed int v4; // esi@10 | |
2135 | 407 //signed __int64 v5; // qax@18 |
0 | 408 signed int v6; // ebx@34 |
2135 | 409 //char *v7; // edi@34 |
0 | 410 int v8; // eax@37 |
2135 | 411 //int v9; // esi@43 |
412 //int v10; // eax@44 | |
0 | 413 unsigned __int8 v11; // sf@44 |
414 unsigned __int8 v12; // of@44 | |
415 signed int v13; // eax@49 | |
416 int v14; // esi@49 | |
417 int v15; // edx@50 | |
418 int v16; // eax@51 | |
419 signed int v17; // ecx@51 | |
420 int v18; // edx@53 | |
421 int i; // edi@55 | |
422 int monster_y; // ST18_4@56 | |
423 int v21; // eax@56 | |
424 signed int v22; // [sp-4h] [bp-144h]@51 | |
425 __int16 v23[100]; // [sp+Ch] [bp-134h]@39 | |
426 GUIWindow window; // [sp+D4h] [bp-6Ch]@1 | |
427 __int16 monster_ids[6]; // [sp+128h] [bp-18h]@56 | |
428 int v26; // [sp+134h] [bp-Ch]@1 | |
2135 | 429 //int v27; // [sp+138h] [bp-8h]@23 |
0 | 430 int num_monsters; // [sp+13Ch] [bp-4h]@17 |
431 | |
432 v26 = 0; | |
433 pParty->field_7B5_in_arena_quest = uDialogueType; | |
434 memcpy(&window, pDialogueWindow, sizeof(window)); | |
819 | 435 window.uFrameWidth = game_viewport_width; |
0 | 436 window.uFrameZ = 452; |
437 v0 = pFontArrus->CalcTextHeight(pGlobalTXT_LocalizationStrings[575], &window, 13, 0) + 7; | |
438 pRenderer->BeginSceneD3D(); | |
439 | |
440 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) | |
441 pIndoor->Draw(); | |
442 else if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor ) | |
2135 | 443 pOutdoor->Draw(); |
0 | 444 |
445 pRenderer->DrawBillboards_And_MaybeRenderSpecialEffects_And_EndScene(); | |
446 pRenderer->BeginScene(); | |
2154 | 447 //if ( pRenderer->pRenderD3D ) |
448 pRenderer->FillRectFast(pViewport->uViewportTL_X, pViewport->uViewportTL_Y, | |
449 pViewport->uViewportBR_X - pViewport->uViewportTL_X, | |
450 pViewport->uViewportBR_Y - pViewport->uViewportTL_Y + 1, | |
2155 | 451 0x7FF); |
0 | 452 |
1980 | 453 Texture* pTex = pIcons_LOD->GetTexture(uTextureID_Leather); |
1496 | 454 pRenderer->GetLeather(8, 352 - v0, pTex, pTex->uTextureHeight - v0); |
0 | 455 |
2135 | 456 pRenderer->DrawTextureIndexed(8, 347 - v0, pTexture_591428); |
457 v1 = FitTextInAWindow(pGlobalTXT_LocalizationStrings[575], pFontArrus, &window, 0xDu, 0);//Ïîæàëóéñòà, ïîäîæäèòå ïîêà ÿ âûçûâàþ ñóùåñòâ. Óäà÷è. | |
0 | 458 pDialogueWindow->DrawText(pFontArrus, 13, 354 - v0, 0, v1, 0, 0, 0); |
459 pRenderer->EndScene(); | |
460 pRenderer->Present(); | |
461 pParty->vPosition.x = 3849; | |
462 pParty->vPosition.y = 5770; | |
463 pParty->vPosition.z = 1; | |
464 pParty->uFallStartY = 1; | |
465 pParty->sRotationY = 512; | |
466 pParty->sRotationX = 0; | |
467 pParty->uFallSpeed = 0; | |
437 | 468 /*if ( (signed int)pMessageQueue_50CBD0->uNumMessages < 40 ) |
0 | 469 { |
990 | 470 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].eType = UIMSG_Escape; |
0 | 471 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1; |
472 *(&pMessageQueue_50CBD0->uNumMessages + 3 * pMessageQueue_50CBD0->uNumMessages + 3) = 0; | |
473 ++pMessageQueue_50CBD0->uNumMessages; | |
437 | 474 }*/ |
475 pMessageQueue_50CBD0->AddMessage(UIMSG_Escape, 1, 0); | |
2135 | 476 //v2 = pParty->pPlayers.data(); |
477 for ( uint i = 0; i < 4; i++ ) | |
0 | 478 { |
2135 | 479 v3 = pParty->pPlayers[i].GetActualLevel(); |
0 | 480 v4 = v26; |
481 if ( v3 > v26 ) | |
482 { | |
2135 | 483 v26 = pParty->pPlayers[i].GetActualLevel(); |
484 v4 = pParty->pPlayers[i].GetActualLevel(); | |
0 | 485 } |
2135 | 486 //++v2; |
0 | 487 } |
2135 | 488 //while ( (signed int)v2 < (signed int)pParty->pHirelings.data() ); |
489 if ( uDialogueType == DIALOGUE_ARENA_SELECT_PAGE ) | |
0 | 490 { |
491 num_monsters = v4; | |
1416 | 492 v4 /= 2; |
493 } | |
2135 | 494 else if ( uDialogueType == DIALOGUE_ARENA_SELECT_SQUIRE ) |
0 | 495 { |
2135 | 496 //v5 = (signed __int64)((double)v26 * 1.5); |
497 num_monsters = (int)((double)v26 * 1.5); | |
1416 | 498 v4 /= 2; |
499 } | |
2135 | 500 else if ( uDialogueType == DIALOGUE_ARENA_SELECT_KNIGHT ) |
0 | 501 { |
2135 | 502 //LODWORD(v5) = 2 * v4; |
503 num_monsters = 2 * v4; | |
0 | 504 v4 /= 2; |
1416 | 505 } |
2135 | 506 else if ( uDialogueType == DIALOGUE_ARENA_SELECT_CHAMPION ) |
1416 | 507 { |
2135 | 508 num_monsters = 2 * v4; |
509 v4 /= 2; | |
1416 | 510 } |
0 | 511 if ( v4 < 1 ) |
512 v4 = 1; | |
513 if ( v4 > 100 ) | |
514 v4 = 100; | |
515 if ( num_monsters > 100 ) | |
516 num_monsters = 100; | |
517 if ( v4 < 2 ) | |
518 v4 = 2; | |
519 if ( num_monsters < 2 ) | |
520 num_monsters = 2; | |
521 v6 = 0; | |
2135 | 522 //v27 = 1; |
523 //v7 = (char *)&pMonsterStats->pInfos[1].uLevel; | |
524 for ( uint i = 1; i <= 258; i++ ) | |
0 | 525 { |
2135 | 526 if ( pMonsterStats->pInfos[i].uAIType != 1 )//if ( v7[8] != 1 ) |
0 | 527 { |
2135 | 528 if ( !MonsterStats::BelongsToSupertype(pMonsterStats->pInfos[i].uID, MONSTER_SUPERTYPE_8) ) //!MonsterStats::BelongsToSupertype(*((short *)v7 + 22), MONSTER_SUPERTYPE_8) |
0 | 529 { |
2135 | 530 //v8 = (unsigned __int8)pMonsterStats->pInfos[i].uLevel; |
531 if ( pMonsterStats->pInfos[i].uLevel >= v4 ) | |
0 | 532 { |
2135 | 533 if ( pMonsterStats->pInfos[i].uLevel <= num_monsters ) |
534 v23[v6++] = i; | |
0 | 535 } |
536 } | |
537 } | |
2135 | 538 // ++v27; |
539 //v7 += 88; | |
0 | 540 } |
2135 | 541 //while ( (signed int)v7 <= (signed int)&pMonsterStats->pInfos[258].uLevel ); |
0 | 542 num_monsters = 6; |
543 if ( v6 < 6 ) | |
544 num_monsters = v6; | |
2135 | 545 //v9 = 0; |
0 | 546 if ( num_monsters > 0 ) |
547 { | |
2135 | 548 for ( uint i = 0; i < num_monsters; i++ ) |
0 | 549 { |
2135 | 550 //v10 = rand(); |
551 //++v9; | |
552 //v12 = __OFSUB__(v9, num_monsters); | |
553 //v11 = v9 - num_monsters < 0; | |
554 //*((short *)&window.pControlsTail + v9 + 1) = v23[rand() % v6]; | |
555 monster_ids[i] = v23[rand() % v6]; | |
0 | 556 } |
2135 | 557 //while ( v11 ^ v12 ); |
0 | 558 } |
2135 | 559 if ( uDialogueType == DIALOGUE_ARENA_SELECT_PAGE ) |
0 | 560 { |
561 v16 = rand(); | |
562 v17 = 3; | |
563 v22 = 50; | |
1416 | 564 v18 = v16 % v17; |
565 v13 = v22; | |
566 v14 = v18 + 6; | |
567 } | |
2135 | 568 else if ( uDialogueType == DIALOGUE_ARENA_SELECT_SQUIRE ) |
0 | 569 { |
570 v16 = rand(); | |
571 v17 = 7; | |
572 v22 = 100; | |
573 v18 = v16 % v17; | |
574 v13 = v22; | |
575 v14 = v18 + 6; | |
1416 | 576 } |
2135 | 577 else if ( uDialogueType == DIALOGUE_ARENA_SELECT_KNIGHT ) |
0 | 578 { |
579 v15 = rand() % 11; | |
580 v13 = 200; | |
581 v14 = v15 + 10; | |
582 } | |
583 else | |
584 { | |
2135 | 585 if ( uDialogueType == DIALOGUE_ARENA_SELECT_CHAMPION ) |
0 | 586 { |
587 v13 = 500; | |
588 v14 = 20; | |
589 } | |
2135 | 590 //else |
591 //{ | |
592 //v14 = v27; | |
593 //v13 = gold_transaction_amount; | |
594 //} | |
0 | 595 } |
2135 | 596 gold_transaction_amount = v26 * v13; |
597 for ( i = 0; i < v14; ++i ) | |
2169 | 598 Actor::Arena_summon_actor(monster_ids[rand() % num_monsters], pMonsterArenaPlacements[i].x, pMonsterArenaPlacements[i].y, 1); |
0 | 599 pAudioPlayer->PlaySound((SoundID)14060, 0, 0, -1, 0, 0, 0, 0); |
600 } | |
601 | |
602 //----- (004BD8B5) -------------------------------------------------------- | |
1919 | 603 int HouseDialogPressCloseBtn() |
0 | 604 { |
605 if ( pMessageQueue_50CBD0->uNumMessages ) | |
606 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
1459 | 607 pKeyActionMap->SetWindowInputStatus(WINDOW_INPUT_CANCELLED); |
0 | 608 pKeyActionMap->ResetKeys(); |
520
35f28d4c0ff9
GlobalEventInfo changed to LevelDecoration* activeLevelDecoration
Gloval
parents:
519
diff
changeset
|
609 activeLevelDecoration = NULL; |
827 | 610 current_npc_text = 0; |
1917 | 611 if ( pDialogueNPCCount == 0) |
1919 | 612 return 0; |
613 | |
614 if ( dialog_menu_id == HOUSE_DIALOGUE_SHOP_BUY_SPECIAL && ShopTexture ) | |
0 | 615 { |
1919 | 616 ShopTexture->Release(); |
1917 | 617 ShopTexture = 0; |
618 } | |
619 | |
1919 | 620 switch(dialog_menu_id) |
1917 | 621 { |
1919 | 622 case -1: |
623 _4B4224_UpdateNPCTopics((int)((char *)pDialogueNPCCount - 1)); | |
624 pVideoPlayer->_4BF5B2(); | |
625 break; | |
626 | |
627 case HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT: | |
628 case HOUSE_DIALOGUE_LEARN_SKILLS: | |
629 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_MAIN: | |
630 pVideoPlayer->_4BF5B2(); | |
631 UI_CreateEndConversationButton(); | |
632 dialog_menu_id = HOUSE_DIALOGUE_MAIN; | |
633 InitializaDialogueOptions(in_current_building_type); | |
634 break; | |
635 | |
636 case HOUSE_DIALOGUE_SHOP_SELL: | |
637 case HOUSE_DIALOGUE_SHOP_IDENTIFY: | |
638 case HOUSE_DIALOGUE_SHOP_REPAIR: | |
639 UI_CreateEndConversationButton(); | |
640 dialog_menu_id = HOUSE_DIALOGUE_SHOP_DISPLAY_EQUIPMENT; | |
641 InitializaDialogueOptions_Shops(in_current_building_type); | |
642 break; | |
643 | |
644 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RULES: | |
645 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_VICTORY_CONDITIONS: | |
646 case HOUSE_DIALOGUE_TAVERN_ARCOMAGE_RESULT: | |
647 pVideoPlayer->_4BF5B2(); | |
648 UI_CreateEndConversationButton(); | |
649 dialog_menu_id = HOUSE_DIALOGUE_TAVERN_ARCOMAGE_MAIN; | |
650 InitializaDialogueOptions_Tavern(in_current_building_type); | |
651 break; | |
652 | |
653 case HOUSE_DIALOGUE_NULL: | |
654 case HOUSE_DIALOGUE_MAIN: | |
655 pDialogueNPCCount = 0; | |
656 pDialogueWindow->Release(); | |
657 dialog_menu_id = HOUSE_DIALOGUE_NULL; | |
658 pDialogueWindow = 0; | |
659 pIcons_LOD->SyncLoadedFilesCount(); | |
660 | |
661 if ( uNumDialogueNPCPortraits == 1 ) | |
662 return 0; | |
663 | |
664 pBtn_ExitCancel = window_SpeakInHouse->pControlsHead; | |
665 if ( uNumDialogueNPCPortraits > 0 ) | |
666 { | |
667 for ( uint i = 0; i < (unsigned int)uNumDialogueNPCPortraits; ++i ) | |
668 { | |
669 HouseNPCPortraitsButtonsList[i] = window_SpeakInHouse->CreateButton(pNPCPortraits_x[uNumDialogueNPCPortraits - 1][i], | |
670 pNPCPortraits_y[uNumDialogueNPCPortraits - 1][i], | |
671 63, 73, 1, 0, UIMSG_ClickHouseNPCPortrait, i, 0, byte_591180[i].data(), 0, 0, 0); | |
672 } | |
673 } | |
674 | |
675 pVideoPlayer->_4BF5B2(); | |
676 break; | |
677 | |
678 default: | |
679 pVideoPlayer->_4BF5B2(); | |
680 dialog_menu_id = HOUSE_DIALOGUE_MAIN; | |
681 InitializaDialogueOptions(in_current_building_type); | |
682 break; | |
0 | 683 } |
1917 | 684 return 1; |
0 | 685 } |
686 | |
687 //----- (004BF91E) -------------------------------------------------------- | |
2061 | 688 unsigned int GameOverMenu(void *ecx0) |
0 | 689 { |
1838 | 690 const char *v1; // eax@2 |
0 | 691 unsigned int result; // eax@3 |
89 | 692 Player *v3; // eax@7 |
1838 | 693 const char *v4; // ST24_4@9 |
0 | 694 int v5; // eax@9 |
1838 | 695 const char *v6; // eax@10 |
696 const char *v7; // edx@10 | |
697 const char *v8; // ecx@12 | |
698 const char *v9; // eax@14 | |
0 | 699 unsigned int v10; // eax@25 |
700 GUIWindow pWindow; // [sp+34h] [bp-9Ch]@1 | |
1532 | 701 //MSG Msg; // [sp+88h] [bp-48h]@22 |
0 | 702 unsigned int v14; // [sp+A4h] [bp-2Ch]@5 |
703 void *v15; // [sp+A8h] [bp-28h]@1 | |
1838 | 704 const char *pInString; // [sp+ACh] [bp-24h]@5 |
0 | 705 unsigned int v17; // [sp+B0h] [bp-20h]@5 |
706 unsigned int v18; // [sp+B4h] [bp-1Ch]@5 | |
707 unsigned int v19; // [sp+B8h] [bp-18h]@5 | |
708 int v20; // [sp+BCh] [bp-14h]@7 | |
89 | 709 Player *i; // [sp+C0h] [bp-10h]@7 |
0 | 710 GUIFont *pFont; // [sp+C4h] [bp-Ch]@1 |
711 unsigned __int64 v23; // [sp+C8h] [bp-8h]@5 | |
712 | |
713 v15 = ecx0; | |
714 | |
715 RGBTexture _this; // [sp+Ch] [bp-C4h]@1 | |
716 //RGBTexture::RGBTexture(&this); | |
717 | |
2061 | 718 dword_6BE364_game_settings_1 &= ~GAME_SETTINGS_4000; |
0 | 719 bGameoverLoop = 1; |
720 pVideoPlayer->bStopBeforeSchedule = 0; | |
721 pAudioPlayer->StopChannels(-1, -1); | |
722 pRenderer->BeginScene(); | |
723 pRenderer->ClearBlack(); | |
724 pRenderer->EndScene(); | |
725 pRenderer->Present(); | |
165 | 726 pVideoPlayer->pResetflag = 0; |
484 | 727 _449B57_test_bit(pParty->_quest_bits, 99); |
0 | 728 _this.Load("winbg.pcx", 2); |
729 pRenderer->BeginScene(); | |
730 pRenderer->DrawTextureRGB(0, 0, &_this); | |
731 pRenderer->EndScene(); | |
732 free(_this.pPixels); | |
733 _this.pPixels = 0; | |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2212
diff
changeset
|
734 window_SpeakInHouse = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_MainMenu, 0, 0); |
0 | 735 pWindow.uFrameX = 75; |
736 pWindow.uFrameY = 60; | |
737 pWindow.uFrameWidth = 469; | |
738 pWindow.uFrameHeight = 338; | |
739 pWindow.uFrameZ = 543; | |
740 pWindow.uFrameW = 397; | |
180 | 741 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
|
742 if ( pParty->IsPartyGood() ) |
2133 | 743 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 | 744 else |
745 { | |
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
|
746 result = pParty->IsPartyEvil(); |
0 | 747 if ( !(short)result ) |
748 return result; | |
2133 | 749 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 | 750 } |
751 pInString = v1; | |
752 v23 = pParty->uTimePlayed - 138240; | |
753 v19 = (unsigned int)((signed __int64)((double)(pParty->uTimePlayed - 138240) * 0.234375) / 60 / 60) / 0x18; | |
754 v14 = (unsigned int)((signed __int64)((double)(pParty->uTimePlayed - 138240) * 0.234375) / 60 / 60) / 0x18 / 0x1C / 0xC; | |
755 v18 = (unsigned int)((signed __int64)((double)(pParty->uTimePlayed - 138240) * 0.234375) / 60 / 60) / 0x18 / 0x1C % 0xC; | |
756 v17 = v19 % 0x1C; | |
757 if ( !v19 ) | |
758 v19 = 1; | |
759 pRenderer->BeginScene(); | |
2133 | 760 pWindow.DrawTitleText(pFont, 1, 0x23, 1, pGlobalTXT_LocalizationStrings[9], 3);//Congratulations! |
0 | 761 v23 = 0i64; |
762 v20 = 0; | |
2133 | 763 for ( uint i = 0; i < 4; i++ ) |
89 | 764 { |
2133 | 765 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[129], pParty->pPlayers[i].pName, pParty->pPlayers[i].GetBaseLevel(), pClassNames[pParty->pPlayers[i].classType]);//%s the Level %u %s |
766 pWindow.DrawTitleText(pFont, 1, i * (LOBYTE(pFont->uFontHeight) - 2) + LOBYTE(pFont->uFontHeight) + 46, 1, pTmpBuf.data(), 3); | |
767 v23 += pParty->pPlayers[i].uExperience;//__PAIR__(*(int *)(i - 4), *(int *)(i - 8)); | |
0 | 768 } |
769 v23 = (signed __int64)v23 / v19; | |
2133 | 770 v6 = FitTextInAWindow(pInString, pFont, &pWindow, 0xC, 0); |
771 pWindow.DrawTitleText(pFont, 1, 5 * (LOBYTE(pFont->uFontHeight) + 11), 1, v6, 0); | |
772 strcpy(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[37]);//Total Time: | |
0 | 773 v7 = pGlobalTXT_LocalizationStrings[56]; |
774 if ( v17 != 1 ) | |
775 v7 = pGlobalTXT_LocalizationStrings[57]; | |
776 v8 = pGlobalTXT_LocalizationStrings[146]; | |
777 if ( v18 != 1 ) | |
778 v8 = pGlobalTXT_LocalizationStrings[148]; | |
779 v9 = pGlobalTXT_LocalizationStrings[245]; | |
780 if ( v14 != 1 ) | |
781 v9 = pGlobalTXT_LocalizationStrings[132]; | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1203
diff
changeset
|
782 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
|
783 strcat(pTmpBuf.data(), pTmpBuf2.data()); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1203
diff
changeset
|
784 pWindow.DrawTitleText(pFont, 1u, pWindow.uFrameHeight - 2 * LOBYTE(pFont->uFontHeight) - 5, 1u, pTmpBuf.data(), 3u); |
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1203
diff
changeset
|
785 sprintf(pTmpBuf.data(), pGlobalTXT_LocalizationStrings[94], v23); |
2133 | 786 pWindow.DrawTitleText(pFont, 1, pWindow.uFrameHeight, 1u, pTmpBuf.data(), 3); |
2061 | 787 dword_6BE364_game_settings_1 |= GAME_SETTINGS_4000; |
0 | 788 pRenderer->EndScene(); |
789 pRenderer->Present(); | |
2153 | 790 //if ( pRenderer->pRenderD3D ) |
0 | 791 pRenderer->pBeforePresentFunction(); |
2069 | 792 pRenderer->SaveWinnersCertificate("MM7_Win.Pcx"); |
1583 | 793 free(pFont); |
336 | 794 window_SpeakInHouse->Release(); |
795 window_SpeakInHouse = 0; | |
0 | 796 if ( v15 == (void *)2 ) |
797 { | |
798 result = pMessageQueue_50CBD0->uNumMessages; | |
799 } | |
800 else | |
801 { | |
802 LODWORD(v23) = GetTickCount() + 5000; | |
803 while ( (unsigned int)v23 > GetTickCount() ) | |
804 ; | |
1532 | 805 for (MSG msg; PeekMessage(&msg, 0, 0, 0, PM_REMOVE);) |
0 | 806 { |
1532 | 807 if (msg.message == WM_QUIT) |
0 | 808 Game_DeinitializeAndTerminate(0); |
1532 | 809 TranslateMessage(&msg); |
810 DispatchMessage(&msg); | |
0 | 811 } |
812 if ( pMessageQueue_50CBD0->uNumMessages ) | |
813 { | |
814 LOBYTE(v10) = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
815 pMessageQueue_50CBD0->uNumMessages = v10; | |
816 } | |
817 pKeyActionMap->ResetKeys(); | |
818 pKeyActionMap->uLastKeyPressed = 0; | |
819 do | |
820 { | |
1532 | 821 for (MSG msg; PeekMessage(&msg, 0, 0, 0, PM_REMOVE);) |
0 | 822 { |
1532 | 823 if (msg.message == WM_QUIT) |
0 | 824 Game_DeinitializeAndTerminate(0); |
1532 | 825 TranslateMessage(&msg); |
826 DispatchMessage(&msg); | |
0 | 827 } |
828 } | |
829 while ( !pKeyActionMap->uLastKeyPressed ); | |
830 result = pMessageQueue_50CBD0->uNumMessages; | |
831 if ( pMessageQueue_50CBD0->uNumMessages ) | |
832 { | |
833 result = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
834 pMessageQueue_50CBD0->uNumMessages = pMessageQueue_50CBD0->pMessages[0].field_8 != 0; | |
835 } | |
836 } | |
837 if ( v15 ) | |
838 { | |
437 | 839 /*if ( (signed int)result < 40 ) |
840 { | |
841 pMessageQueue_50CBD0->pMessages[result].eType = UIMSG_Quit; | |
842 }*/ | |
843 pMessageQueue_50CBD0->AddMessage(UIMSG_Quit, 1, 0); | |
0 | 844 } |
845 else | |
846 { | |
437 | 847 pMessageQueue_50CBD0->AddMessage(UIMSG_ShowFinalWindow, 1, 0); |
848 /*if ( (signed int)result < 40 ) | |
849 { | |
850 pMessageQueue_50CBD0->pMessages[result].eType = UIMSG_C5; | |
0 | 851 pMessageQueue_50CBD0->pMessages[pMessageQueue_50CBD0->uNumMessages].param = 1; |
852 result = 3 * pMessageQueue_50CBD0->uNumMessages + 3; | |
853 *(&pMessageQueue_50CBD0->uNumMessages + result) = 0; | |
854 ++pMessageQueue_50CBD0->uNumMessages; | |
437 | 855 }*/ |
0 | 856 } |
857 bGameoverLoop = 0; | |
858 return result; | |
859 } | |
860 | |
1391
cc9a3a24d61d
Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents:
1359
diff
changeset
|
861 |
cc9a3a24d61d
Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents:
1359
diff
changeset
|
862 |
cc9a3a24d61d
Moved stru11, stru12 and some SW Rendering stuff to the archives.
Nomad
parents:
1359
diff
changeset
|
863 |
0 | 864 //----- (00451007) -------------------------------------------------------- |
1148
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
865 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 | 866 unsigned short *pDst, int dstWidth, int dstHeight, int dstPitch, |
867 int a10, int a11) | |
868 { | |
869 int result; // eax@1 | |
870 float v17; // ST3C_4@12 | |
871 float v18; // ST38_4@12 | |
872 unsigned int v19; // esi@12 | |
873 int v21; // eax@18 | |
874 unsigned int v22; // ecx@25 | |
875 unsigned int v23; // eax@29 | |
1146
b4ade2580ae3
sub_451007_scale_image_bicubic cleanup - some variable renaming, code shuffling
Grumpy7
parents:
1145
diff
changeset
|
876 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
|
877 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
|
878 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
|
879 unsigned int widthRatioPlusOne; // [sp+14h] [bp-74h]@218 |
0 | 880 int v160; // [sp+3Ch] [bp-4Ch]@13 |
881 unsigned __int16 *v175; // [sp+4Ch] [bp-3Ch]@13 | |
882 unsigned __int16 *v193; // [sp+5Ch] [bp-2Ch]@7 | |
883 signed int v231; // [sp+78h] [bp-10h]@7 | |
884 __int64 v240; // [sp+7Ch] [bp-Ch]@12 | |
885 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
|
886 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
|
887 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
|
888 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
|
889 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
|
890 int field_0_bits; |
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
891 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
|
892 |
1146
b4ade2580ae3
sub_451007_scale_image_bicubic cleanup - some variable renaming, code shuffling
Grumpy7
parents:
1145
diff
changeset
|
893 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
|
894 switch(field0value) |
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
895 { |
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
896 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
|
897 break; |
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
898 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
|
899 break; |
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
900 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
|
901 break; |
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
902 default: |
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
903 return field0value; |
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
904 } |
1144
f544cd6f7168
sub_451007_scale_image_bicubic cleanup - preparations for further condition body extractions
Grumpy7
parents:
1140
diff
changeset
|
905 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
|
906 switch(field20value) |
1129
9362028fccd1
sub_451007_scale_image_bicubic cleanup - extracting common bodies from conditions
Grumpy7
parents:
1128
diff
changeset
|
907 { |
1148
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
908 case 8: field_20_bits = 1; |
1129
9362028fccd1
sub_451007_scale_image_bicubic cleanup - extracting common bodies from conditions
Grumpy7
parents:
1128
diff
changeset
|
909 break; |
1148
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
910 case 16: field_20_bits = 2; |
1129
9362028fccd1
sub_451007_scale_image_bicubic cleanup - extracting common bodies from conditions
Grumpy7
parents:
1128
diff
changeset
|
911 break; |
1148
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
912 case 32: field_20_bits = 4; |
1129
9362028fccd1
sub_451007_scale_image_bicubic cleanup - extracting common bodies from conditions
Grumpy7
parents:
1128
diff
changeset
|
913 break; |
9362028fccd1
sub_451007_scale_image_bicubic cleanup - extracting common bodies from conditions
Grumpy7
parents:
1128
diff
changeset
|
914 default: |
1144
f544cd6f7168
sub_451007_scale_image_bicubic cleanup - preparations for further condition body extractions
Grumpy7
parents:
1140
diff
changeset
|
915 return field20value; |
1129
9362028fccd1
sub_451007_scale_image_bicubic cleanup - extracting common bodies from conditions
Grumpy7
parents:
1128
diff
changeset
|
916 } |
1148
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
917 |
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
918 result = (int)pDst; |
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
919 v193 = pDst; |
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
920 if ( dstHeight <= 0 ) |
1129
9362028fccd1
sub_451007_scale_image_bicubic cleanup - extracting common bodies from conditions
Grumpy7
parents:
1128
diff
changeset
|
921 return result; |
1600
0016b08ab621
stru350::sub_451007_scale_image_bicubic - fixing a memory access bug
Grumpy7
parents:
1546
diff
changeset
|
922 |
2212 | 923 //do |
924 for ( v231 = 0; v231 < dstHeight; v231++ ) | |
1148
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
925 { |
1149
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
926 for (int counter = 0; counter < dstWidth; counter++) |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
927 { |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
928 a6s = (double)counter / (double)dstWidth * (double)srcWidth; |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
929 widthRatio = bankersRounding(a6s); |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
930 a6t = (double)(counter + 1) / (double)dstWidth * (double)srcWidth; |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
931 widthRatioPlusOne = bankersRounding(a6t); |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
932 v17 = (double)v231 / (double)dstHeight * (double)srcHeight; |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
933 heightRatio = bankersRounding(v17); |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
934 v18 = (double)(v231 + 1) / (double)dstHeight * (double)srcHeight; |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
935 heightRatioPlusOne = bankersRounding(v18); |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
936 v251 = 0; |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
937 v19 = (heightRatioPlusOne - heightRatio) * (widthRatioPlusOne - widthRatio); |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
938 v252 = 0; |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
939 a6b = 0; |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
940 v240 = 0i64; |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
941 |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
942 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
|
943 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
|
944 { |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
945 int ratioDiff = widthRatioPlusOne - widthRatio; |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
946 for(int i = 0; i < ratioDiff; i++) |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
947 { |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
948 if(field0value == 32) |
1600
0016b08ab621
stru350::sub_451007_scale_image_bicubic - fixing a memory access bug
Grumpy7
parents:
1546
diff
changeset
|
949 v21 = _450FB1(((int*)v175)[i]); |
1149
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
950 else if(field0value == 16) |
1600
0016b08ab621
stru350::sub_451007_scale_image_bicubic - fixing a memory access bug
Grumpy7
parents:
1546
diff
changeset
|
951 v21 = _450FB1(((_WORD*)v175)[i]); |
1901 | 952 else if (field0value == 8) |
1600
0016b08ab621
stru350::sub_451007_scale_image_bicubic - fixing a memory access bug
Grumpy7
parents:
1546
diff
changeset
|
953 v21 = _450FB1(((unsigned __int8*)v175)[i]); |
1149
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
954 v240 += ((unsigned int)v21 >> 24); |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
955 a6b += BYTE2(v21); |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
956 v252 += BYTE1(v21); |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
957 v251 += (unsigned __int8)v21; |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
958 } |
1901 | 959 if (field0value == 32) |
1149
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
960 v175 += 2 * srcPitch; |
1901 | 961 else if (field0value == 16) |
1149
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
962 v175 += srcPitch; |
1901 | 963 else if (field0value == 8) |
1149
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
964 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
|
965 } |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
966 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
|
967 if ( v19 ) |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
968 { |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
969 a6b /= v19; |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
970 v252 /= v19; |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
971 v251 /= v19; |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
972 } |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
973 if ( v22 != 255 ) |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
974 v22 &= 0x7FFFFFFFu; |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
975 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
|
976 *(_DWORD *)v193 = v23; |
05b30ed00d7c
sub_451007_scale_image_bicubic cleanup - changing if+dowhile pair to for
Grumpy7
parents:
1148
diff
changeset
|
977 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
|
978 } |
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
979 v193 = (unsigned __int16 *)((char *)v193 + field_20_bits * (dstPitch - dstWidth)); |
2212 | 980 //++v231; |
1148
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
981 result = v231; |
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
982 } |
2212 | 983 //while(v231 < dstHeight); |
1148
ee6bccef32e8
sub_451007_scale_image_bicubic cleanup - final condition collapsing, remaining labels removed, etc
Grumpy7
parents:
1147
diff
changeset
|
984 return result; |
0 | 985 } |
986 | |
987 //----- (0044F57C) -------------------------------------------------------- | |
988 void SpawnEncounter(MapInfo *pMapInfo, SpawnPointMM7 *spawn, int a3, int a4, int a5) | |
989 { | |
990 //MapInfo *v5; // esi@1 | |
991 //SpawnPointMM7 *v6; // ebx@1 | |
992 int v7; // eax@2 | |
993 char v8; // zf@5 | |
994 int v9; // edi@9 | |
995 int v10; // eax@9 | |
996 int v11; // ecx@9 | |
997 int v12; // edx@9 | |
998 int v13; // eax@9 | |
999 int v14; // eax@14 | |
1000 int v15; // ecx@14 | |
1001 int v16; // eax@19 | |
1002 int v17; // ecx@19 | |
1003 int v18; // esi@31 | |
1004 //int pPosX; // ecx@32 | |
1005 //int v20; // edx@32 | |
1006 //int v21; // eax@32 | |
1007 Actor *pMonster; // esi@35 | |
1008 int v23; // edx@36 | |
1009 signed int v24; // edi@36 | |
1010 int v25; // ecx@36 | |
1011 unsigned __int16 v26; // ax@47 | |
1012 MonsterDesc *v27; // edi@48 | |
1013 signed int v28; // eax@48 | |
1014 __int16 v29; // cx@50 | |
1015 __int16 v30; // ax@50 | |
1016 __int16 v31; // ax@50 | |
1017 int v32; // eax@50 | |
1018 int v33; // edi@50 | |
1019 int v34; // eax@50 | |
1020 int v35; // eax@50 | |
1021 int v36; // eax@50 | |
1022 int v37; // eax@51 | |
1023 int v38; // eax@52 | |
1024 int v39; // edi@52 | |
1025 std::string v40; // [sp-18h] [bp-100h]@60 | |
1026 void *v41; // [sp-14h] [bp-FCh]@50 | |
1027 //void *v42; // [sp-10h] [bp-F8h]@50 | |
1028 //size_t v43; // [sp-Ch] [bp-F4h]@50 | |
1029 const char *v44; // [sp-8h] [bp-F0h]@13 | |
1030 char *pTexture; // [sp-4h] [bp-ECh]@9 | |
1031 char Str[32]; // [sp+Ch] [bp-DCh]@60 | |
1032 char Str2[120]; // [sp+2Ch] [bp-BCh]@29 | |
1033 unsigned int uFaceID; // [sp+A4h] [bp-44h]@52 | |
1034 MonsterInfo *Src; // [sp+A8h] [bp-40h]@50 | |
1035 int v50; // [sp+ACh] [bp-3Ch]@47 | |
1036 char Source[32]; // [sp+B0h] [bp-38h]@20 | |
1037 int v52; // [sp+D0h] [bp-18h]@34 | |
1038 int v53; // [sp+D4h] [bp-14h]@34 | |
1039 int pSector; // [sp+D8h] [bp-10h]@32 | |
1040 int pPosX; // [sp+DCh] [bp-Ch]@32 | |
1041 int v56; // [sp+E0h] [bp-8h]@8 | |
1042 int v57; // [sp+E4h] [bp-4h]@1 | |
1043 | |
1044 //auto a2 = spawn; | |
1045 v57 = 0; | |
1046 //v5 = pMapInfo; | |
1047 //v6 = spawn; | |
1048 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) | |
1049 v7 = pOutdoor->ddm.field_C_alert; | |
1050 else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
1051 v7 = pIndoor->dlv.field_C_alert; | |
1052 else | |
1053 v7 = 0; | |
1054 if (v7) | |
1055 v8 = (spawn->uAttributes & 1) == 0; | |
1056 else | |
1057 v8 = (spawn->uAttributes & 1) == 1; | |
1058 if (v8) | |
1059 return; | |
1060 //result = (void *)(spawn->uIndex - 1); | |
1061 v56 = 1; | |
1062 switch (spawn->uIndex - 1) | |
1063 { | |
2173 | 1064 case 0: |
1065 //v9 = pMapInfo->uEncounterMonster1AtLeast; | |
1066 //v10 = rand(); | |
1067 //v11 = pMapInfo->uEncounterMonster1AtMost; | |
1068 //pTexture = pMapInfo->pEncounterMonster1Texture; | |
1069 v12 = rand() % (pMapInfo->uEncounterMonster1AtMost - pMapInfo->uEncounterMonster1AtLeast + 1); | |
1070 //v13 = pMapInfo->Dif_M1; | |
1071 v57 = pMapInfo->Dif_M1; | |
1072 v56 = pMapInfo->uEncounterMonster1AtLeast + v12; | |
1073 strcpy(Source, pMapInfo->pEncounterMonster1Texture); | |
1416 | 1074 break; |
2173 | 1075 case 3: |
1076 //pTexture = pMapInfo->pEncounterMonster1Texture; | |
1077 //v44 = "%s A"; | |
1078 sprintf(Source, "%s A", pMapInfo->pEncounterMonster1Texture); | |
1416 | 1079 break; |
2173 | 1080 case 4: |
1081 //pTexture = pMapInfo->pEncounterMonster2Texture; | |
1082 //v44 = "%s A"; | |
1083 sprintf(Source, "%s A", pMapInfo->pEncounterMonster2Texture); | |
1416 | 1084 break; |
2173 | 1085 case 5: |
1086 //pTexture = pMapInfo->pEncounterMonster3Texture; | |
1087 //v44 = "%s A"; | |
1088 sprintf(Source, "%s A", pMapInfo->pEncounterMonster3Texture); | |
1416 | 1089 break; |
2173 | 1090 case 1: |
1091 //v9 = pMapInfo->uEncounterMonster2AtLeast; | |
1092 //v14 = rand(); | |
1093 //v15 = pMapInfo->uEncounterMonster2AtMost; | |
1094 //pTexture = pMapInfo->pEncounterMonster2Texture; | |
1095 v12 = rand() % (pMapInfo->uEncounterMonster2AtMost - pMapInfo->uEncounterMonster2AtLeast + 1); | |
1096 //v13 = pMapInfo->Dif_M2; | |
1097 v57 = pMapInfo->Dif_M2; | |
1098 v56 = pMapInfo->uEncounterMonster2AtLeast + v12; | |
1099 strcpy(Source, pMapInfo->pEncounterMonster2Texture); | |
1416 | 1100 break; |
2173 | 1101 case 6: |
1102 //pTexture = pMapInfo->pEncounterMonster1Texture; | |
1103 //v44 = "%s B"; | |
1104 sprintf(Source, "%s B", pMapInfo->pEncounterMonster1Texture); | |
1416 | 1105 break; |
2173 | 1106 case 7: |
1107 //pTexture = pMapInfo->pEncounterMonster2Texture; | |
1108 //v44 = "%s B"; | |
1109 sprintf(Source, "%s B", pMapInfo->pEncounterMonster2Texture); | |
1416 | 1110 break; |
2173 | 1111 case 8: |
1112 //pTexture = pMapInfo->pEncounterMonster3Texture; | |
1113 //v44 = "%s B"; | |
1114 sprintf(Source, "%s B", pMapInfo->pEncounterMonster3Texture); | |
1416 | 1115 break; |
2173 | 1116 case 2: |
1117 //v9 = pMapInfo->uEncounterMonster3AtLeast; | |
1118 //v16 = rand(); | |
1119 //v17 = pMapInfo->uEncounterMonster3AtMost; | |
1120 //pTexture = pMapInfo->pEncounterMonster3Texture; | |
1121 v12 = rand() % (pMapInfo->uEncounterMonster3AtMost - pMapInfo->uEncounterMonster3AtLeast + 1); | |
1122 //v13 = pMapInfo->Dif_M3; | |
1123 v57 = pMapInfo->Dif_M3; | |
1124 v56 = pMapInfo->uEncounterMonster3AtLeast + v12; | |
1125 strcpy(Source, pMapInfo->pEncounterMonster3Texture); | |
1416 | 1126 break; |
2173 | 1127 case 9: |
1128 //pTexture = pMapInfo->pEncounterMonster1Texture; | |
1129 //v44 = "%s C"; | |
1130 sprintf(Source, "%s C", pMapInfo->pEncounterMonster1Texture); | |
1416 | 1131 break; |
2173 | 1132 case 10: |
1133 //pTexture = pMapInfo->pEncounterMonster2Texture; | |
1134 //v44 = "%s C"; | |
1135 sprintf(Source, "%s C", pMapInfo->pEncounterMonster2Texture); | |
1416 | 1136 break; |
2173 | 1137 case 11: |
1138 //pTexture = pMapInfo->pEncounterMonster3Texture; | |
1139 //v44 = "%s C"; | |
1140 sprintf(Source, "%s C", pMapInfo->pEncounterMonster3Texture); | |
0 | 1141 break; |
2173 | 1142 default: |
0 | 1143 return; |
1144 } | |
2173 | 1145 if (Source[0] == '0') |
1146 return; | |
1147 v57 += a3; | |
1148 if ( v57 > 4 ) | |
1149 v57 = 4; | |
1150 strcpy(Str2, Source); | |
1151 if ( a4 ) | |
1152 v56 = a4; | |
1153 v18 = v56; | |
1154 if ( (signed int)(v56 + uNumActors) >= 500 ) | |
1155 return; | |
1156 pSector = 0; | |
1157 pPosX = spawn->vPosition.x; | |
1158 a4 = spawn->vPosition.y; | |
1159 a3 = spawn->vPosition.z; | |
1160 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) | |
1161 pSector = pIndoor->GetSector(spawn->vPosition.x, spawn->vPosition.y, spawn->vPosition.z); | |
1162 v53 = 0; | |
1163 v52 = (((uCurrentlyLoadedLevelType != LEVEL_Outdoor) - 1) & 0x40) + 64; | |
1164 if ( v18 <= 0 ) | |
1165 return; | |
0 | 1166 for (uint i = v53; i < v56; ++i) |
1167 { | |
1168 pMonster = &pActors[uNumActors]; | |
1169 pActors[uNumActors].Reset(); | |
1170 if ( v57 ) | |
1171 { | |
1172 v23 = rand() % 100; | |
1173 v24 = 3; | |
1174 v25 = (unsigned __int16)word_4E8152[3 * v57]; | |
1175 if ( v23 >= v25 ) | |
1176 { | |
1177 if ( v23 < v25 + (unsigned __int16)word_4E8152[3 * v57 + 1] ) | |
1178 v24 = 2; | |
1179 } | |
1180 else | |
1181 { | |
1182 v24 = 1; | |
1183 } | |
1184 if ( v24 == 1 ) | |
1185 { | |
1186 pTexture = Source; | |
1187 v44 = "%s A"; | |
1188 } | |
1189 else | |
1190 { | |
1191 if ( v24 == 2 ) | |
1192 { | |
1193 pTexture = Source; | |
1194 v44 = "%s B"; | |
1195 } | |
1196 else | |
1197 { | |
1198 if ( v24 != 3 ) | |
1416 | 1199 continue; |
0 | 1200 pTexture = Source; |
1201 v44 = "%s C"; | |
1202 } | |
1203 } | |
1204 sprintf(Str2, v44, pTexture); | |
1205 } | |
751 | 1206 v50 = pMonsterList->GetMonsterIDByName(Str2); |
0 | 1207 pTexture = Str2; |
751 | 1208 if ( (signed __int16)v50 == -1 ) |
0 | 1209 { |
1210 sprintf(Str, "Can't create random monster: '%s'! See MapStats.txt and Monsters.txt!", pTexture); | |
1211 MessageBoxA(nullptr, Str, nullptr, 0); | |
1212 ExitProcess(0); | |
1213 } | |
751 | 1214 v27 = &pMonsterList->pMonsters[(signed __int16)v50]; |
1215 v28 = pMonsterStats->FindMonsterByTextureName(pTexture); | |
0 | 1216 if ( !v28 ) |
1217 v28 = 1; | |
1218 Src = &pMonsterStats->pInfos[v28]; | |
1219 strcpy(pMonster->pActorName, Src->pName); | |
1220 pMonster->sCurrentHP = Src->uHP; | |
1221 assert(sizeof(MonsterInfo) == 88); | |
1222 memcpy(&pMonster->pMonsterInfo, Src, sizeof(MonsterInfo)); | |
1223 pMonster->word_000086_some_monster_id = v50 + 1; | |
1224 pMonster->uActorRadius = v27->uMonsterRadius; | |
1225 pMonster->uActorHeight = v27->uMonsterHeight; | |
1226 pMonster->uMovementSpeed = v27->uMovementSpeed; | |
1227 pMonster->vInitialPosition.x = spawn->vPosition.x; | |
1228 pMonster->vPosition.x = spawn->vPosition.x; | |
1229 pMonster->uTetherDistance = 256; | |
1230 pMonster->vInitialPosition.y = a4; | |
1231 pMonster->vPosition.y = a4; | |
1232 pMonster->vInitialPosition.z = a3; | |
1233 pMonster->vPosition.z = a3; | |
1234 pMonster->uSectorID = pSector; | |
1235 pMonster->uGroup = spawn->uGroup; | |
2195 | 1236 pMonster->PrepareSprites(0); |
0 | 1237 pMonster->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly; |
1238 v32 = rand(); | |
2173 | 1239 a3 = fixpoint_mul(stru_5C6E00->Cos(v32 % 2048), v52); |
0 | 1240 pPosX = a3 + spawn->vPosition.x; |
2173 | 1241 a3 = fixpoint_mul(stru_5C6E00->Sin(v32 % 2048), v52); |
0 | 1242 a4 = a3 + spawn->vPosition.y; |
1243 a3 = spawn->vPosition.z; | |
1244 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor ) | |
1416 | 1245 { |
1246 if ( a5 ) | |
1247 pMonster->uAttributes |= 0x080000; | |
1248 ++uNumActors; | |
1249 continue; | |
1250 } | |
2173 | 1251 v37 = pIndoor->GetSector(pPosX, a4, spawn->vPosition.z); |
0 | 1252 if ( v37 == pSector ) |
1253 { | |
723 | 1254 v38 = BLV_GetFloorLevel(pPosX, a4, a3, v37, &uFaceID); |
0 | 1255 v39 = v38; |
1256 if ( v38 != -30000 ) | |
1257 { | |
1258 if ( abs(v38 - a3) <= 1024 ) | |
1259 { | |
1260 a3 = v39; | |
1261 if ( a5 ) | |
1262 pMonster->uAttributes |= 0x080000; | |
1263 ++uNumActors; | |
1416 | 1264 continue; |
0 | 1265 } |
1266 } | |
1267 } | |
1268 ; | |
1269 //v53 = (char *)v53 + 1; | |
1270 //result = v53; | |
1271 } | |
1272 //while ( (signed int)v53 < v56 ); | |
1273 } | |
1274 | |
1275 //----- (0044FA4C) -------------------------------------------------------- | |
1276 signed int __fastcall sub_44FA4C_spawn_light_elemental(int a1, int a2, int a3) | |
1277 { | |
1278 signed int v3; // ecx@6 | |
90 | 1279 Actor *v4; // edx@7 |
0 | 1280 signed int result; // eax@13 |
1281 Actor *v6; // esi@16 | |
1282 char *v7; // ebx@16 | |
1283 MonsterDesc *v8; // edi@16 | |
1284 unsigned __int16 v9; // ax@16 | |
1285 int v10; // ebx@16 | |
1052 | 1286 //int v11; // edi@16 |
1287 //int v12; // eax@16 | |
1288 //int v13; // ecx@16 | |
1289 //int v14; // ebx@16 | |
0 | 1290 const char *v15; // [sp-4h] [bp-24h]@2 |
1052 | 1291 //unsigned __int16 v16; // [sp+0h] [bp-20h]@1 |
1292 //int v17; // [sp+4h] [bp-1Ch]@1 | |
0 | 1293 unsigned int uFaceID; // [sp+8h] [bp-18h]@16 |
1294 int v19; // [sp+Ch] [bp-14h]@16 | |
1295 size_t v20; // [sp+10h] [bp-10h]@6 | |
1296 int v21; // [sp+14h] [bp-Ch]@14 | |
1052 | 1297 //int v22; // [sp+18h] [bp-8h]@14 |
0 | 1298 unsigned int v23; // [sp+1Ch] [bp-4h]@6 |
1299 | |
1052 | 1300 //v16 = a2; |
1301 //v17 = a1; | |
0 | 1302 if ( a2 == 4 ) |
1303 { | |
1304 v15 = "Elemental Light C"; | |
1305 } | |
1052 | 1306 else if ( a2 == 3 ) |
0 | 1307 v15 = "Elemental Light B"; |
1308 else | |
1309 v15 = "Elemental Light A"; | |
1052 | 1310 |
751 | 1311 v23 = pMonsterList->GetMonsterIDByName(v15); |
0 | 1312 v3 = 0; |
1313 v20 = uNumActors; | |
1314 if ( (signed int)uNumActors > 0 ) | |
1315 { | |
1202 | 1316 v4 = pActors.data();//[0].uAIState; |
90 | 1317 while ( v4->uAIState != Removed ) |
0 | 1318 { |
1052 | 1319 ++v3; |
90 | 1320 ++v4; |
0 | 1321 if ( v3 >= (signed int)uNumActors ) |
90 | 1322 break; |
1323 } | |
1324 if( v3 < (signed int)uNumActors ) | |
1325 v20 = v3; | |
1326 } | |
0 | 1327 if ( v20 != uNumActors || (result = uNumActors + 1, (signed int)(uNumActors + 1) < 500) ) |
1328 { | |
1329 v21 = 0; | |
1052 | 1330 //v22 = pParty->vPosition.z; |
0 | 1331 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) |
1332 v21 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z); | |
1333 v6 = &pActors[v20]; | |
1334 v7 = (char *)&pMonsterStats->pInfos[v23 + 1]; | |
1335 v19 = (((uCurrentlyLoadedLevelType != LEVEL_Outdoor) - 1) & 0x40) + 64; | |
1336 v6->Reset(); | |
1337 v8 = &pMonsterList->pMonsters[v23]; | |
1338 strcpy(v6->pActorName, *(const char **)v7); | |
1339 v6->sCurrentHP = *((short *)v7 + 32); | |
1340 memcpy(&v6->pMonsterInfo, v7, 0x58u); | |
1341 v6->word_000086_some_monster_id = v23 + 1; | |
1342 v6->uActorRadius = v8->uMonsterRadius; | |
1343 v6->uActorHeight = v8->uMonsterHeight; | |
1344 v9 = v8->uMovementSpeed; | |
1345 v6->pMonsterInfo.uTreasureDiceRolls = 0; | |
1346 v6->pMonsterInfo.uTreasureType = 0; | |
1347 v6->pMonsterInfo.uExp = 0; | |
1348 v6->uMovementSpeed = v9; | |
1349 v10 = rand() % 2048; | |
1643 | 1350 //v11 = pParty->vPosition.x + fixpoint_mul(stru_5C6E00->Cos(v10), v19); |
323 | 1351 uFaceID = stru_5C6E00->Sin(v10); |
1052 | 1352 //v12 = pParty->vPosition.y; |
1643 | 1353 //v13 = fixpoint_mul(uFaceID, v19); |
1354 //v14 = pParty->vPosition.y + fixpoint_mul(uFaceID, v19); | |
1052 | 1355 //LOWORD(v12) = v22; |
1643 | 1356 v6->vInitialPosition.x = pParty->vPosition.x + fixpoint_mul(stru_5C6E00->Cos(v10), v19); |
1052 | 1357 v6->vPosition.x = v6->vInitialPosition.x; |
1643 | 1358 v6->vInitialPosition.y = pParty->vPosition.y + fixpoint_mul(uFaceID, v19); |
1052 | 1359 v6->vPosition.y = v6->vInitialPosition.y; |
1360 v6->vInitialPosition.z = pParty->vPosition.z; | |
1361 v6->vPosition.z = v6->vInitialPosition.z; | |
1362 //LOWORD(v12) = v21; | |
0 | 1363 v6->uTetherDistance = 256; |
1052 | 1364 v6->uSectorID = v21; |
0 | 1365 v6->PrepareSprites(0); |
1366 v6->pMonsterInfo.uHostilityType = MonsterInfo::Hostility_Friendly; | |
1367 v6->uAlly = 9999; | |
1368 v6->uGroup = 0; | |
1369 v6->uCurrentActionTime = 0; | |
1370 v6->uAIState = Summoned; | |
1371 v6->uCurrentActionLength = 256; | |
1372 v6->UpdateAnimation(); | |
1373 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor | |
1052 | 1374 || (result = pIndoor->GetSector(v6->vPosition.x, v6->vPosition.y, v6->vPosition.z), |
0 | 1375 result == v21) |
1052 | 1376 && (result = BLV_GetFloorLevel(v6->vPosition.x, v6->vPosition.y, v6->vPosition.z, result, &uFaceID), result != -30000) |
1377 && (result = abs(result - pParty->vPosition.z), result <= 1024) ) | |
0 | 1378 { |
1379 if ( v20 == uNumActors ) | |
1380 ++uNumActors; | |
1052 | 1381 v6->uSummonerID = PID(OBJECT_Player, a1); |
1948
7fd4bfa175fd
pActorBuffs[2] to pActorBuffs[ACTOR_BUFF_SUMMONED]
Grumpy7
parents:
1935
diff
changeset
|
1382 result = v6->pActorBuffs[ACTOR_BUFF_SUMMONED].Apply(pParty->uTimePlayed + (a3 * 128) / 30.0f, |
1052 | 1383 a2, |
1384 a1, | |
0 | 1385 0, |
1386 0); | |
1387 } | |
1388 } | |
1389 return result; | |
1390 } | |
1391 | |
1392 //----- (0044FFD8) -------------------------------------------------------- | |
1393 int MapInfo::SpawnRandomTreasure(SpawnPointMM7 *a2) | |
1394 { | |
472 | 1395 //MapInfo *v2; // ebx@1 |
1396 //SpawnPointMM7 *v3; // esi@1 | |
1397 //int v4; // eax@1 | |
0 | 1398 int v5; // edx@1 |
1399 int v6; // eax@1 | |
1400 int v7; // ecx@1 | |
1401 int v8; // ebx@1 | |
1402 int v9; // eax@1 | |
1403 signed int v10; // ebx@1 | |
1404 signed int result; // eax@1 | |
1405 signed __int64 v12; // qtt@1 | |
1406 int v13; // ebx@1 | |
1407 int v14; // edx@10 | |
1408 signed int v15; // ebx@20 | |
1409 unsigned __int16 v16; // dx@20 | |
1417 | 1410 ObjectDesc *v17; // ecx@21 |
0 | 1411 unsigned __int16 v18; // ax@24 |
1412 int v19; // ST0C_4@27 | |
1413 int v20; // ST08_4@27 | |
1414 int v21; // ST04_4@27 | |
1415 int v22; // eax@27 | |
1416 signed int v23; // ebx@29 | |
1417 unsigned __int16 v24; // dx@29 | |
1417 | 1418 ObjectDesc *v25; // ecx@30 |
0 | 1419 unsigned __int16 v26; // ax@33 |
472 | 1420 //int v27; // ecx@35 |
1421 //int v28; // eax@35 | |
1422 //int v29; // esi@35 | |
1423 //__int16 v30; // ax@35 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
496
diff
changeset
|
1424 SpriteObject a1a; // [sp+Ch] [bp-7Ch]@1 |
472 | 1425 //int v32; // [sp+7Ch] [bp-Ch]@1 |
1426 //int v33; // [sp+80h] [bp-8h]@1 | |
0 | 1427 int v34; // [sp+84h] [bp-4h]@1 |
1428 | |
472 | 1429 //auto a1 = this; |
1430 //v2 = a1; | |
1431 //v3 = a2; | |
1432 //v4 = rand(); | |
0 | 1433 v34 = 0; |
472 | 1434 v5 = rand() % 100; |
436 | 1435 // v6 = 2 * (v2->Treasure_prob + 7 * v3->uIndex) - 14; |
472 | 1436 v7 = (unsigned __int8)byte_4E8168[a2->uIndex - 1][2 * Treasure_prob]; |
1437 v8 = (unsigned __int8)byte_4E8168[a2->uIndex - 1][2 * Treasure_prob + 1]; | |
1438 //v32 = v5; | |
1439 //v33 = v7; | |
0 | 1440 v9 = rand(); |
472 | 1441 v10 = v8 - v7 + 1; |
0 | 1442 v12 = v9; |
1443 result = v9 / v10; | |
472 | 1444 v13 = v7 + (unsigned __int64)(v12 % v10); |
0 | 1445 if ( v13 < 7 ) |
1446 { | |
472 | 1447 if ( v5 < 20 ) |
0 | 1448 return result; |
472 | 1449 if ( v5 >= 60 ) |
1450 { | |
1451 v19 = a2->vPosition.z; | |
1452 v20 = a2->vPosition.y; | |
1453 v21 = a2->vPosition.x; | |
0 | 1454 v22 = rand(); |
1455 return sub_450521_ProllyDropItemAt(v13, v22 % 27 + 20, v21, v20, v19, 0); | |
1456 } | |
472 | 1457 if ( a2->uIndex == 1 ) |
0 | 1458 { |
1459 v14 = rand() % 51 + 50; | |
1417 | 1460 a1a.stru_24.uItemID = 197; |
1461 v34 = v14; | |
1462 } | |
1463 else if ( a2->uIndex == 2 ) | |
0 | 1464 { |
1417 | 1465 v14 = rand() % 101 + 100; |
1466 a1a.stru_24.uItemID = 197; | |
1467 v34 = v14; | |
1468 } | |
1469 else if ( a2->uIndex == 3 ) | |
0 | 1470 { |
1471 v14 = rand() % 301 + 200; | |
1417 | 1472 a1a.stru_24.uItemID = 198; |
1473 v34 = v14; | |
0 | 1474 } |
1417 | 1475 else if ( a2->uIndex == 4 ) |
0 | 1476 { |
1417 | 1477 v14 = rand() % 501 + 500; |
1478 a1a.stru_24.uItemID = 198; | |
1479 v34 = v14; | |
1480 } | |
1481 else if ( a2->uIndex == 5 ) | |
1482 { | |
1483 v14 = rand() % 1001 + 1000; | |
0 | 1484 a1a.stru_24.uItemID = 199; |
1485 v34 = v14; | |
1486 } | |
1417 | 1487 else if ( a2->uIndex == 6 ) |
1488 { | |
1489 v14 = rand() % 3001 + 2000; | |
1490 a1a.stru_24.uItemID = 199; | |
1491 v34 = v14; | |
1492 } | |
1493 v15 = 0; | |
1494 v16 = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID; | |
1495 a1a.uType = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID; | |
1496 v18 = 0; | |
1497 for( int i = 0; i < pObjectList->uNumObjects; i++ ) | |
1498 { | |
1499 if ( pObjectList->pObjects[i].uObjectID == v16 ) | |
1500 { | |
1501 v18 = i; | |
1502 break; | |
1503 } | |
1504 } | |
1505 a1a.stru_24.SetIdentified(); | |
1506 a1a.uObjectDescID = v18; | |
1507 a1a.stru_24.uSpecEnchantmentType = v34; | |
0 | 1508 } |
1509 else | |
1510 { | |
1417 | 1511 result = a1a.stru_24.GenerateArtifact(); |
1512 if ( !result ) | |
1513 return result; | |
1514 v23 = 0; | |
1515 v24 = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID; | |
1516 a1a.uType = pItemsTable->pItems[a1a.stru_24.uItemID].uSpriteID; | |
1517 v26 = 0; | |
1518 for( int i = 0; i < pObjectList->uNumObjects; i++ ) | |
1519 { | |
1520 if( v24 == pObjectList->pObjects[i].uObjectID ) | |
1521 { | |
1522 v26 = i; | |
1523 break; | |
1524 } | |
1525 } | |
1526 a1a.uObjectDescID = v26; | |
1527 a1a.stru_24.Reset(); | |
1528 } | |
472 | 1529 a1a.vPosition.y = a2->vPosition.y; |
0 | 1530 a1a.uAttributes = 0; |
1531 a1a.uSoundID = 0; | |
1532 a1a.uFacing = 0; | |
472 | 1533 a1a.vPosition.z = a2->vPosition.z; |
1534 a1a.vPosition.x = a2->vPosition.x; | |
822 | 1535 a1a.spell_skill = 0; |
1536 a1a.spell_level = 0; | |
1537 a1a.spell_id = 0; | |
823 | 1538 a1a.spell_target_pid = 0; |
822 | 1539 a1a.spell_caster_pid = 0; |
0 | 1540 a1a.uSpriteFrameID = 0; |
472 | 1541 a1a.uSectorID = pIndoor->GetSector(a2->vPosition.x, a2->vPosition.y, a2->vPosition.z);; |
0 | 1542 return a1a.Create(0, 0, 0, 0); |
1543 } | |
1544 | |
1545 //----- (00450521) -------------------------------------------------------- | |
1459 | 1546 int __fastcall sub_450521_ProllyDropItemAt(int ecx0, signed int a2, int a3, int a4, int a5, unsigned __int16 a6) |
0 | 1547 { |
1548 int v6; // edi@1 | |
1549 int v7; // esi@1 | |
1550 signed int v8; // edi@1 | |
1551 unsigned __int16 v9; // cx@1 | |
1552 char *v10; // edx@2 | |
1553 unsigned __int16 v11; // ax@5 | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
496
diff
changeset
|
1554 SpriteObject a1; // [sp+8h] [bp-70h]@1 |
0 | 1555 |
1556 v6 = ecx0; | |
1557 v7 = a2; | |
1558 pItemsTable->GenerateItem(v6, v7, &a1.stru_24); | |
1559 v8 = 0; | |
1560 v9 = pItemsTable->pItems[a1.stru_24.uItemID].uSpriteID; | |
515
cb0ad52d6a26
LayingItem -> SpriteObject (long-waited rename, old name was inaccurate and confused people)
Nomad
parents:
496
diff
changeset
|
1561 a1.uType = pItemsTable->pItems[a1.stru_24.uItemID].uSpriteID; |
1417 | 1562 v11 = 0; |
1563 for( int i = 0; i < pObjectList->uNumObjects; i++ ) | |
1564 { | |
1565 if( v9 == pObjectList->pObjects[i].uObjectID ) | |
1566 { | |
1567 v11 = i; | |
1568 break; | |
1569 } | |
1570 } | |
0 | 1571 a1.uObjectDescID = v11; |
1572 a1.vPosition.y = a4; | |
1573 a1.vPosition.x = a3; | |
1574 a1.vPosition.z = a5; | |
1575 a1.uFacing = a6; | |
1576 a1.uAttributes = 0; | |
1577 a1.uSectorID = pIndoor->GetSector(a3, a4, a5); | |
1578 a1.uSpriteFrameID = 0; | |
1579 return a1.Create(0, 0, 0, 0); | |
1580 } | |
1581 | |
1582 //----- (0045063B) -------------------------------------------------------- | |
1415 | 1583 int __fastcall _45063B_spawn_some_monster(MapInfo *a1, int a2) |
0 | 1584 { |
1585 int result; // eax@8 | |
1586 int v6; // edi@11 | |
1587 int v7; // ebx@11 | |
1588 int v8; // edi@11 | |
1589 int v9; // ebx@12 | |
1590 int v10; // eax@12 | |
1591 char v11; // zf@16 | |
1592 int v12; // edi@20 | |
1593 int v13; // eax@20 | |
1594 int v14; // ebx@20 | |
1595 int v15; // eax@20 | |
1596 int v16; // eax@20 | |
1597 int v17; // eax@20 | |
1598 int v18; // eax@21 | |
1599 SpawnPointMM7 v19; // [sp+Ch] [bp-38h]@1 | |
1600 int v22; // [sp+2Ch] [bp-18h]@3 | |
1601 unsigned int uFaceID; // [sp+38h] [bp-Ch]@10 | |
1602 int v26; // [sp+3Ch] [bp-8h]@11 | |
1603 int v27; // [sp+40h] [bp-4h]@11 | |
1415 | 1604 |
1605 if (!uNumActors) | |
1606 return 0; | |
1607 | |
2207 | 1608 for ( uint mon_id = 0; mon_id < uNumActors; ++mon_id ) |
0 | 1609 { |
2207 | 1610 if ((pActors[mon_id].pMonsterInfo.uID < 121 || pActors[mon_id].pMonsterInfo.uID > 123) && // Dwarf FemaleC A-C |
1611 (pActors[mon_id].pMonsterInfo.uID < 124 || pActors[mon_id].pMonsterInfo.uID > 126) && // Dwarf MaleA A-C | |
1612 (pActors[mon_id].pMonsterInfo.uID < 133 || pActors[mon_id].pMonsterInfo.uID > 135) && // Peasant Elf FemaleA A-C | |
1613 pActors[mon_id].CanAct()) | |
0 | 1614 { |
2207 | 1615 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor ) |
1616 { | |
1617 v22 = 0; | |
1618 uint face_id = 0; | |
1619 for ( face_id; face_id < 100; ++face_id ) | |
1620 { | |
1621 v6 = rand() % 1024 + 512; | |
1622 v7 = rand() % (signed int)stru_5C6E00->uIntegerDoublePi; | |
1623 v19.vPosition.x = pParty->vPosition.x + fixpoint_mul(stru_5C6E00->Cos(v7), v6); | |
1624 v8 = 0; | |
1625 v19.uIndex = a2; | |
1626 v19.vPosition.y = fixpoint_mul(stru_5C6E00->Sin(v7), v6) + pParty->vPosition.y; | |
1627 v19.vPosition.z = pParty->vPosition.z; | |
1628 v26 = 0; | |
1629 v27 = 0; | |
1630 v19.vPosition.z = ODM_GetFloorLevel(v19.vPosition.x, v19.vPosition.y, pParty->vPosition.z, 0, &v26, &v27, 0); | |
1631 for( int i = 0; i < pOutdoor->uNumBModels; i++ ) | |
1632 { | |
1633 v9 = abs(v19.vPosition.y - pOutdoor->pBModels[i].vBoundingCenter.y); | |
1634 v10 = abs(v19.vPosition.x - pOutdoor->pBModels[i].vBoundingCenter.x); | |
1635 if ( int_get_vector_length(v10, v9, 0) < pOutdoor->pBModels[i].sBoundingRadius + 256 ) | |
1636 { | |
1637 v22 = 1; | |
1638 break; | |
1639 } | |
1640 } | |
1641 if ( v22 ) | |
1642 { | |
1643 v11 = face_id == 100; | |
1644 break; | |
1645 } | |
1646 } | |
1647 v11 = face_id == 100; | |
1648 } | |
1649 else if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) | |
1650 { | |
1651 v22 = pIndoor->GetSector(pParty->vPosition.x, pParty->vPosition.y, pParty->vPosition.z); | |
1652 for ( uint i = 0; i < 100; ++i ) | |
1653 { | |
1654 v12 = rand() % 512 + 256; | |
1655 v13 = rand(); | |
1656 v14 = v13 % (signed int)stru_5C6E00->uIntegerDoublePi; | |
1657 v15 = stru_5C6E00->Cos(v13 % (signed int)stru_5C6E00->uIntegerDoublePi); | |
1658 v19.vPosition.x = pParty->vPosition.x + fixpoint_mul(v15, v12); | |
1659 v16 = stru_5C6E00->Sin(v13 % (signed int)stru_5C6E00->uIntegerDoublePi); | |
1660 v19.vPosition.y = fixpoint_mul(v16, v12) + pParty->vPosition.y; | |
1661 v19.vPosition.z = pParty->vPosition.z; | |
1662 v19.uIndex = a2; | |
1663 v17 = pIndoor->GetSector(v19.vPosition.x, v19.vPosition.y, pParty->vPosition.z); | |
1664 if ( v17 == v22 ) | |
1665 { | |
1666 v18 = BLV_GetFloorLevel(v19.vPosition.x, v19.vPosition.y, v19.vPosition.z, v17, &uFaceID); | |
1667 v19.vPosition.z = v18; | |
1668 if ( v18 != -30000 ) | |
1669 { | |
1670 if ( abs(v18 - pParty->vPosition.z) <= 1024 ) | |
1671 break; | |
1672 } | |
1673 } | |
1674 } | |
1675 v11 = v26 == 100; | |
1676 } | |
1677 if ( v11 ) | |
1678 result = 0; | |
1679 else | |
1680 { | |
1681 SpawnEncounter(a1, &v19, 0, 0, 1); | |
1682 result = a2; | |
1683 } | |
0 | 1684 } |
1415 | 1685 |
2207 | 1686 //break; |
1415 | 1687 //v22 = v3->pMonsterInfo.uID - 1; |
1688 //v4 = (signed __int64)((double)v22 * 0.3333333333333333); | |
1689 //if ( (int)v4 != 40 ) | |
1690 //{ | |
1691 // if ( (int)v4 != 41 && (int)v4 != 44 && v3->CanAct() ) | |
1692 // break; | |
1693 //} | |
1694 //++v2; | |
1695 //++v3; | |
1696 //if ( v2 >= (signed int)uNumActors ) | |
1697 // goto LABEL_8; | |
0 | 1698 } |
1699 return result; | |
1700 } | |
1701 | |
1702 //----- (00450AAA) -------------------------------------------------------- | |
1703 void RespawnGlobalDecorations() | |
1704 { | |
1822 | 1705 memset(stru_5E4C90_MapPersistVars._decor_events.data(), 0, 125); |
0 | 1706 |
1707 uint decorEventIdx = 0; | |
1708 for (uint i = 0; i < uNumLevelDecorations; ++i) | |
1709 { | |
1980 | 1710 LevelDecoration* decor = &pLevelDecorations[i]; |
0 | 1711 |
1514
965af46e8793
Rename LevelDecoration::field_16_event_id to LevelDecoration::uEventID.
yoctozepto
parents:
1513
diff
changeset
|
1712 if (!decor->uEventID) |
0 | 1713 { |
1714 if (decor->IsInteractive()) | |
1715 { | |
1716 if (decorEventIdx < 124) | |
1717 { | |
1718 decor->_idx_in_stru123 = decorEventIdx + 75; | |
1736
c6fe09a06712
Player::CompareVariable finished, renamed stru_5E4C90 to stru_5E4C90_MapPersistVars, party::field_4A0 to party::CounterEventValues
Grumpy7
parents:
1706
diff
changeset
|
1719 stru_5E4C90_MapPersistVars._decor_events[decorEventIdx++] = decor->GetGlobalEvent(); |
0 | 1720 } |
1721 } | |
1722 } | |
1723 } | |
1724 } | |
1725 | |
1726 //----- (00450B0A) -------------------------------------------------------- | |
1727 bool __fastcall SpawnActor(unsigned int uMonsterID) | |
1728 { | |
1729 unsigned int v1; // ebx@1 | |
1730 bool result; // eax@2 | |
1731 MonsterDesc *v3; // esi@5 | |
1732 MonsterInfo *v4; // edi@5 | |
1733 Vec3_int_ v5; // ST08_12@5 | |
1734 unsigned int v6; // ecx@5 | |
1735 Actor *v7; // eax@7 | |
1736 Actor actor; // [sp+4h] [bp-350h]@5 | |
1737 Vec3_int_ pOut; // [sp+348h] [bp-Ch]@5 | |
1738 | |
1739 v1 = uMonsterID; | |
1740 if ( uNumActors == 499 ) | |
1741 { | |
1742 result = 0; | |
1743 } | |
1744 else | |
1745 { | |
1746 if ( (signed int)uMonsterID >= (signed int)pMonsterList->uNumMonsters ) | |
1747 v1 = 0; | |
1748 v3 = &pMonsterList->pMonsters[v1]; | |
1749 v4 = &pMonsterStats->pInfos[v1 + 1]; | |
1750 memset(&actor, 0, 0x344u); | |
1751 strcpy(actor.pActorName, v4->pName); | |
1752 actor.sCurrentHP = LOWORD(v4->uHP); | |
1753 memcpy(&actor.pMonsterInfo, &pMonsterStats->pInfos[v1 + 1], 0x58u); | |
1754 actor.word_000086_some_monster_id = v1 + 1; | |
1755 actor.uActorRadius = v3->uMonsterRadius; | |
1756 actor.uActorHeight = v3->uMonsterHeight; | |
1757 actor.uMovementSpeed = v3->uMovementSpeed; | |
1758 v5 = pParty->vPosition; | |
1759 Vec3_int_::Rotate(200, pParty->sRotationY, 0, v5, &pOut.x, &pOut.z, &pOut.y); | |
1760 actor.vInitialPosition.x = pOut.x; | |
1761 actor.vPosition.x = pOut.x; | |
1762 actor.uTetherDistance = 256; | |
1763 actor.vInitialPosition.y = LOWORD(pOut.z); | |
1764 actor.vPosition.y = LOWORD(pOut.z); | |
1765 actor.vInitialPosition.z = LOWORD(pOut.y); | |
1766 actor.vPosition.z = LOWORD(pOut.y); | |
1767 pSprites_LOD->DeleteSomeSprites(); | |
1768 pPaletteManager->ResetNonTestLocked(); | |
1769 v6 = uNumActors - 1; | |
1770 if ( dword_5C6DF8 == 1 ) | |
1771 { | |
1772 dword_5C6DF8 = 0; | |
1773 v6 = uNumActors++; | |
1774 } | |
1775 v7 = &pActors[v6]; | |
1776 memcpy(v7, &actor, 0x344u); | |
1777 v7->PrepareSprites(1); | |
1778 result = 1; | |
1779 } | |
1780 return result; | |
1781 } | |
1782 // 5C6DF8: using guessed type int dword_5C6DF8; | |
1783 | |
1784 //----- (00450DA3) -------------------------------------------------------- | |
1458 | 1785 int GetAlertStatus() |
0 | 1786 { |
1787 int result; // eax@2 | |
1788 | |
1789 if ( uCurrentlyLoadedLevelType == LEVEL_Indoor ) | |
1790 result = pOutdoor->ddm.field_C_alert; | |
1791 else | |
1792 result = uCurrentlyLoadedLevelType == LEVEL_Outdoor ? pIndoor->dlv.field_C_alert : 0; | |
1793 return result; | |
1794 } | |
1795 | |
1796 //----- (00450DDE) -------------------------------------------------------- | |
1797 stru350 *stru350::_450DDE() | |
1798 { | |
1799 _450DF1(&stru_4E82A4, &stru_4E82A4); | |
1800 return this; | |
1801 } | |
1802 | |
1803 //----- (00450DF1) -------------------------------------------------------- | |
1804 bool stru350::_450DF1(const stru355 *p1, const stru355 *p2) | |
1805 { | |
1806 //stru350 *v3; // esi@1 | |
1807 //void *result; // eax@1 | |
1808 unsigned int v5; // ecx@2 | |
1809 int v6; // edi@2 | |
1810 int v7; // edx@2 | |
1811 unsigned int v8; // ecx@8 | |
1812 int v9; // edi@8 | |
1813 int v10; // edx@8 | |
1814 int v11; // ecx@12 | |
1815 int v12; // edi@12 | |
1816 unsigned int v13; // ecx@12 | |
1817 int v14; // edx@12 | |
1818 int v15; // ecx@16 | |
1819 unsigned int v16; // edx@16 | |
1820 int v17; // ecx@16 | |
1821 int v18; // edi@16 | |
1822 char v19; // zf@20 | |
1823 unsigned int v20; // ecx@21 | |
1824 int v21; // edi@21 | |
1825 int v22; // edx@21 | |
1826 unsigned int v23; // ecx@27 | |
1827 int v24; // edi@27 | |
1828 int v25; // edx@27 | |
1829 int v26; // ecx@31 | |
1830 int v27; // edi@31 | |
1831 unsigned int v28; // ecx@31 | |
1832 int v29; // edx@31 | |
1833 int v30; // ebx@35 | |
1834 int v31; // ecx@35 | |
1835 int v32; // edi@35 | |
1836 int v33; // edx@35 | |
1837 unsigned int i; // ecx@35 | |
1838 int v35; // ecx@39 | |
1839 unsigned int v36; // edx@39 | |
1840 int v37; // ecx@39 | |
1841 int v38; // ebx@39 | |
1842 | |
1843 //v3 = this; | |
1844 memcpy(&field_0, p1, sizeof(stru355)); | |
1845 memcpy(&field_20, p2, sizeof(stru355)); | |
1846 //result = memcpy(&v3->field_20, p2, 0x20u); | |
1847 //LOBYTE(result) = 1; | |
1848 if (field_0.field_4 & 1) | |
1849 { | |
1850 v5 = field_0.field_1C; | |
1851 v6 = 0; | |
1852 v7 = 0; | |
1853 while ( !(v5 & 1) ) | |
1854 { | |
1855 ++v6; | |
1856 v5 >>= 1; | |
1857 } | |
1858 do | |
1859 { | |
1860 v5 >>= 1; | |
1861 ++v7; | |
1862 } | |
1863 while ( v5 & 1 ); | |
1864 field_40 = 32 - v7 - v6; | |
1865 } | |
1866 else | |
1867 { | |
1868 field_40 = 0; | |
1869 } | |
1870 v8 = field_0.field_10; | |
1871 v9 = 0; | |
1872 v10 = 0; | |
1873 while ( !(v8 & 1) ) | |
1874 { | |
1875 ++v9; | |
1876 v8 >>= 1; | |
1877 } | |
1878 do | |
1879 { | |
1880 v8 >>= 1; | |
1881 ++v10; | |
1882 } | |
1883 while ( v8 & 1 ); | |
1884 v11 = 24 - v10 - v9; | |
1885 v12 = 0; | |
1886 field_48 = v11; | |
1887 v13 = field_0.field_14; | |
1888 v14 = 0; | |
1889 while ( !(v13 & 1) ) | |
1890 { | |
1891 ++v12; | |
1892 v13 >>= 1; | |
1893 } | |
1894 do | |
1895 { | |
1896 v13 >>= 1; | |
1897 ++v14; | |
1898 } | |
1899 while ( v13 & 1 ); | |
1900 v15 = 16 - v14; | |
1901 v16 = field_0.field_18; | |
1902 field_50 = v15 - v12; | |
1903 v17 = 0; | |
1904 v18 = 0; | |
1905 while ( !(v16 & 1) ) | |
1906 { | |
1907 ++v17; | |
1908 v16 >>= 1; | |
1909 } | |
1910 do | |
1911 { | |
1912 v16 >>= 1; | |
1913 ++v18; | |
1914 } | |
1915 while ( v16 & 1 ); | |
1916 v19 = (field_20.field_4 & 1) == 0; | |
1917 field_58 = v17 - v18 + 8; | |
1918 if ( v19 ) | |
1919 { | |
1920 field_44 = 0; | |
1921 } | |
1922 else | |
1923 { | |
1924 v20 = field_20.field_1C; | |
1925 v21 = 0; | |
1926 v22 = 0; | |
1927 while ( !(v20 & 1) ) | |
1928 { | |
1929 ++v21; | |
1930 v20 >>= 1; | |
1931 } | |
1932 do | |
1933 { | |
1934 v20 >>= 1; | |
1935 ++v22; | |
1936 } | |
1937 while ( v20 & 1 ); | |
1938 field_44 = 32 - v22 - v21; | |
1939 } | |
1940 v23 = field_20.field_10; | |
1941 v24 = 0; | |
1942 v25 = 0; | |
1943 while ( !(v23 & 1) ) | |
1944 { | |
1945 ++v24; | |
1946 v23 >>= 1; | |
1947 } | |
1948 do | |
1949 { | |
1950 v23 >>= 1; | |
1951 ++v25; | |
1952 } | |
1953 while ( v23 & 1 ); | |
1954 v26 = 24 - v25 - v24; | |
1955 v27 = 0; | |
1956 field_4C = v26; | |
1957 v28 = field_20.field_14; | |
1958 v29 = 0; | |
1959 while ( !(v28 & 1) ) | |
1960 { | |
1961 ++v27; | |
1962 v28 >>= 1; | |
1963 } | |
1964 do | |
1965 { | |
1966 v28 >>= 1; | |
1967 ++v29; | |
1968 } | |
1969 while ( v28 & 1 ); | |
1970 v30 = 0; | |
1971 v31 = 16 - v29 - v27; | |
1972 v32 = field_20.field_18; | |
1973 field_54 = v31; | |
1974 v33 = 0; | |
1975 for ( i = v32; !(i & 1); i >>= 1 ) | |
1976 ++v30; | |
1977 do | |
1978 { | |
1979 i >>= 1; | |
1980 ++v33; | |
1981 } | |
1982 while ( i & 1 ); | |
1983 v35 = 32 - v33; | |
1984 v36 = v32; | |
1985 field_5C = v35 - v30; | |
1986 v37 = 0; | |
1987 v38 = 0; | |
1988 while ( !(v36 & 1) ) | |
1989 { | |
1990 ++v37; | |
1991 v36 >>= 1; | |
1992 } | |
1993 do | |
1994 { | |
1995 v36 >>= 1; | |
1996 ++v38; | |
1997 } | |
1998 while ( v36 & 1 ); | |
1999 field_5C = v37 - v38 + 8; | |
2000 return true; | |
2001 } | |
2002 | |
2003 //----- (00450F55) -------------------------------------------------------- | |
2004 unsigned int stru350::_450F55(int a2) | |
2005 { | |
2006 int v2 = a2 & stru_4E82A4.field_1C; | |
2007 if (field_20.field_4 & 1) | |
2008 v2 = (unsigned int)v2 >> this->field_44; | |
2009 return v2 & field_20.field_1C | | |
2010 field_20.field_10 & ((a2 & (unsigned int)stru_4E82A4.field_10) >> field_4C) | | |
2011 field_20.field_14 & ((a2 & (unsigned int)stru_4E82A4.field_14) >> field_54) | | |
2012 field_20.field_18 & ((a2 & (unsigned int)stru_4E82A4.field_18) >> field_5C); | |
2013 } | |
2014 | |
2015 //----- (00450FB1) -------------------------------------------------------- | |
2016 int stru350::_450FB1(int a2) | |
2017 { | |
2018 int v2 = 0; | |
2019 int v4 = field_0.field_4 & 1; | |
2020 if ( v4 ) | |
2021 v2 = a2 & field_0.field_1C; | |
2022 if ( v4 ) | |
2023 v2 <<= field_40; | |
2024 return v2 | ((a2 & field_0.field_10) << field_48) | ((a2 & field_0.field_14) << field_50) | ((a2 & field_0.field_18) << field_58); | |
2025 } | |
2026 | |
2027 //----- (00452442) -------------------------------------------------------- | |
1583 | 2028 unsigned int __fastcall _452442_color_cvt(unsigned __int16 a1, unsigned __int16 a2, int a3, int a4) |
0 | 2029 { |
2030 int v4; // ebx@0 | |
2031 __int16 v5; // ST14_2@1 | |
2032 __int16 v6; // dx@1 | |
2033 int v7; // ecx@1 | |
2034 __int16 v8; // ST10_2@1 | |
2035 int v9; // edi@1 | |
2036 unsigned __int16 v10; // dh@1@1 | |
2037 int v11; // ebx@1 | |
2038 int v12; // ebx@1 | |
2039 __int16 a3a; // [sp+1Ch] [bp+8h]@1 | |
2040 | |
2041 v5 = a2 >> 2; | |
2042 v6 = (unsigned __int16)a4 >> 2; | |
2043 v8 = a1 >> 2; | |
2044 a3a = (unsigned __int16)a3 >> 2; | |
2045 LOWORD(v7) = a3a; | |
2046 v9 = v7; | |
2047 LOWORD(v4) = ((unsigned __int16)a4 >> 2) & 0xE0; | |
2048 LOWORD(v7) = a3a & 0xE0; | |
2049 LOWORD(v9) = v9 & 0x1C00; | |
2050 v11 = v7 + v4; | |
2051 LOWORD(v7) = v5 & 0xE0; | |
2052 v12 = v7 + v11; | |
2053 LOWORD(v7) = v8 & 0xE0; | |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1408
diff
changeset
|
2054 __debugbreak(); // warning C4700: uninitialized local variable 'v10' used |
848 | 2055 return (PID_TYPE(v8) + PID_TYPE(v5) + PID_TYPE(a3a) + PID_TYPE(v6)) | (v7 + v12) | ((v8 & 0x1C00) |
0 | 2056 + (v5 & 0x1C00) |
2057 + v9 | |
2058 + (__PAIR__(v10, (unsigned __int16)a4 >> 2) & 0x1C00)); | |
2059 } | |
2060 | |
2061 //----- (0045281E) -------------------------------------------------------- | |
2062 // Calculates atan2(y/x) | |
2063 // return value: angle in integer format (multiplier of Pi/1024) | |
2064 unsigned int stru193_math::Atan2(int x, int y) | |
2065 { | |
2066 signed int quadrant; | |
2067 __int64 dividend; | |
2068 int quotient; | |
2069 int lowIdx; | |
2070 int highIdx; | |
2071 int angle; | |
2072 | |
1980 | 2073 int X = x; |
2074 int Y = y; | |
0 | 2075 |
2076 if ( abs(X) < 65536 ) | |
2077 { | |
2078 if ( (abs(Y) >> 15) >= abs(X) ) | |
2079 X = 0; | |
2080 } | |
2081 | |
2082 if ( !X ) | |
2083 { | |
2084 if ( Y > 0 ) | |
2085 { | |
2086 return uIntegerHalfPi; //Pi/2 | |
2087 } | |
2088 else | |
2089 { | |
2090 return uIntegerHalfPi + uIntegerPi; //3*(Pi/2) | |
2091 } | |
2092 } | |
2093 | |
2094 if ( Y ) | |
2095 { | |
2096 if ( X < 0 ) | |
2097 { | |
2098 X = -X; | |
2099 if ( Y > 0 ) | |
2100 { | |
2101 quadrant = 4; | |
2102 } | |
2103 else | |
2104 { | |
2105 quadrant = 3; | |
2106 } | |
2107 } | |
2108 else | |
2109 { | |
2110 if ( Y > 0 ) | |
2111 { | |
2112 quadrant = 1; | |
2113 } | |
2114 else | |
2115 { | |
2116 quadrant = 2; | |
2117 } | |
2118 } | |
2119 | |
2120 if ( Y < 0 ) | |
2121 Y = -Y; | |
2122 | |
2123 LODWORD(dividend) = Y << 16; | |
2124 HIDWORD(dividend) = Y >> 16; | |
2125 quotient = dividend / X; | |
2126 | |
2127 //looks like binary search | |
2128 { | |
2129 int i; | |
2130 highIdx = uIntegerHalfPi; | |
2131 lowIdx = 0; | |
2132 | |
2133 for (i = 0; i < 6; ++i) | |
2134 { | |
2135 if (quotient <= pTanTable[(lowIdx + highIdx) / 2]) | |
2136 highIdx = (lowIdx + highIdx) / 2; | |
2137 else | |
2138 lowIdx = (lowIdx + highIdx) / 2; | |
2139 } | |
2140 } | |
2141 | |
2142 angle = lowIdx + 1; | |
2143 while ( angle < (highIdx - 1) && quotient >= pTanTable[angle] ) | |
2144 ++angle; | |
2145 | |
2146 switch (quadrant) | |
2147 { | |
2148 case 1: //X > 0, Y > 0 | |
2149 return angle; | |
2150 | |
2151 case 2: //X > 0, Y < 0 | |
2152 return uIntegerDoublePi - angle; //2*Pi - angle | |
2153 | |
2154 case 3: //X > 0, Y < 0 | |
2155 return uIntegerPi + angle; //Pi + angle | |
2156 | |
2157 case 4: //X < 0, Y > 0 | |
2158 return uIntegerPi - angle; //Pi - angle | |
2159 } | |
2160 | |
2161 //should newer get here | |
2162 return 0; | |
2163 } | |
2164 | |
2165 if ( X < 0 ) //Y == 0, X < 0 | |
2166 return uIntegerPi; | |
2167 | |
2168 return 0; | |
2169 } | |
2170 | |
2171 //----- (00452969) -------------------------------------------------------- | |
2172 stru193_math::stru193_math() | |
2173 { | |
2174 double v3; // ST18_8@2 | |
1214
0d6c7ff3cddd
simplified stru193_math constructor and class definition
Grumpy7
parents:
1205
diff
changeset
|
2175 |
0 | 2176 this->pTanTable[0] = 0; |
2177 this->pCosTable[0] = 65536; | |
2178 this->pInvCosTable[0] = 65536; | |
1214
0d6c7ff3cddd
simplified stru193_math constructor and class definition
Grumpy7
parents:
1205
diff
changeset
|
2179 for(int i = 1; i < (signed int)this->uIntegerHalfPi; i++) |
0d6c7ff3cddd
simplified stru193_math constructor and class definition
Grumpy7
parents:
1205
diff
changeset
|
2180 { |
0d6c7ff3cddd
simplified stru193_math constructor and class definition
Grumpy7
parents:
1205
diff
changeset
|
2181 v3 = (double)i * 3.141592653589793 / (double)uIntegerPi; |
0d6c7ff3cddd
simplified stru193_math constructor and class definition
Grumpy7
parents:
1205
diff
changeset
|
2182 pTanTable[i] = (signed __int64)(tan(v3) * (double)this->pCosTable[0] + 0.5); |
0d6c7ff3cddd
simplified stru193_math constructor and class definition
Grumpy7
parents:
1205
diff
changeset
|
2183 pCosTable[i] = (signed __int64)(cos(v3) * (double)this->pCosTable[0] + 0.5); |
0d6c7ff3cddd
simplified stru193_math constructor and class definition
Grumpy7
parents:
1205
diff
changeset
|
2184 pInvCosTable[i] = (signed __int64)(1.0 / cos(v3) * (double)this->pCosTable[0] + 0.5); |
0d6c7ff3cddd
simplified stru193_math constructor and class definition
Grumpy7
parents:
1205
diff
changeset
|
2185 } |
0d6c7ff3cddd
simplified stru193_math constructor and class definition
Grumpy7
parents:
1205
diff
changeset
|
2186 for(int i = this->uIntegerHalfPi; i < 520; i++) |
0d6c7ff3cddd
simplified stru193_math constructor and class definition
Grumpy7
parents:
1205
diff
changeset
|
2187 { |
0d6c7ff3cddd
simplified stru193_math constructor and class definition
Grumpy7
parents:
1205
diff
changeset
|
2188 this->pTanTable[i] = 0xEFFFFFFFu; |
0d6c7ff3cddd
simplified stru193_math constructor and class definition
Grumpy7
parents:
1205
diff
changeset
|
2189 this->pCosTable[i] = 0; |
0d6c7ff3cddd
simplified stru193_math constructor and class definition
Grumpy7
parents:
1205
diff
changeset
|
2190 this->pInvCosTable[i] = 0xEFFFFFFFu; |
0 | 2191 } |
2192 } | |
2193 | |
2194 //----- (00452A9E) -------------------------------------------------------- | |
295 | 2195 int integer_sqrt(int val) |
0 | 2196 { |
2197 signed int result; // eax@2 | |
295 | 2198 unsigned int v2; // edx@3 |
271 | 2199 unsigned int v3; // edi@3 |
2200 //signed int v4; // ebx@3 | |
0 | 2201 int v5; // esi@4 |
2202 | |
295 | 2203 if (val < 1) |
2204 return val; | |
271 | 2205 |
0 | 2206 v2 = 0; |
295 | 2207 v3 = val; |
0 | 2208 result = 0; |
271 | 2209 //v4 = 16; |
2210 for (uint i = 0; i < 16; ++i) | |
2211 { | |
0 | 2212 result *= 2; |
271 | 2213 v2 = (v3 >> 30) | 4 * v2; |
0 | 2214 v5 = 2 * result + 1; |
2215 v3 *= 4; | |
295 | 2216 if ( v2 >= v5 ) |
0 | 2217 { |
2218 ++result; | |
2219 v2 -= v5; | |
2220 } | |
271 | 2221 //--v4; |
2222 } | |
2223 //while ( v4 ); | |
295 | 2224 if ( val - result * result >= (unsigned int)(result - 1) ) |
0 | 2225 ++result; |
295 | 2226 return result; |
0 | 2227 } |
2228 | |
2229 //----- (00452B2E) -------------------------------------------------------- | |
2230 int __fastcall GetDiceResult(unsigned int uNumDice, unsigned int uDiceSides) | |
2231 { | |
2232 int v3; // esi@1 | |
2101 | 2233 |
0 | 2234 v3 = 0; |
2235 if ( uDiceSides ) | |
2236 { | |
2101 | 2237 for ( uint i = 0; i < uNumDice; ++i) |
2238 v3 += rand() % uDiceSides + 1; | |
2239 return v3; | |
0 | 2240 } |
2101 | 2241 return 0; |
0 | 2242 } |
2243 | |
2244 //----- (00453F62) -------------------------------------------------------- | |
2245 void MapStats::Initialize() | |
2246 { | |
237 | 2247 char work_str[32]; // [sp+Ch] [bp-34h]@3 |
2248 int work_str_pos; | |
2249 int work_str_len; | |
2250 int i; | |
2251 char* test_string; | |
2252 unsigned char c; | |
2253 bool break_loop; | |
2254 unsigned int temp_str_len; | |
2255 char* tmp_pos; | |
2256 int decode_step; | |
2257 int item_counter; | |
2258 | |
0 | 2259 if ( pMapStatsTXT_Raw ) |
1583 | 2260 free(pMapStatsTXT_Raw); |
237 | 2261 pMapStatsTXT_Raw = NULL; |
0 | 2262 pMapStatsTXT_Raw = (char *)pEvents_LOD->LoadRaw("MapStats.txt", 0); |
2263 strtok(pMapStatsTXT_Raw, "\r"); | |
237 | 2264 strtok(NULL, "\r"); |
2265 strtok(NULL, "\r"); | |
2266 | |
2267 for (i=1; i<77; ++i) | |
2268 { | |
2269 test_string = strtok(NULL, "\r") + 1; | |
2270 break_loop = false; | |
2271 decode_step=0; | |
2272 do | |
2273 { | |
2274 c = *(unsigned char*)test_string; | |
2275 temp_str_len = 0; | |
2276 while((c!='\t')&&(c>0)) | |
2277 { | |
2278 ++temp_str_len; | |
2279 c=test_string[temp_str_len]; | |
2280 } | |
2281 tmp_pos=test_string+temp_str_len; | |
2282 if (*tmp_pos == 0) | |
2283 break_loop = true; | |
2284 *tmp_pos = 0; | |
2285 if (temp_str_len) | |
2286 { | |
2287 switch (decode_step) | |
2288 { | |
2289 case 1: | |
2290 pInfos[i].pName = RemoveQuotes(test_string); | |
2291 break; | |
2292 case 2: | |
2293 pInfos[i].pFilename = RemoveQuotes(test_string); | |
2294 break; | |
2295 case 3: | |
2296 pInfos[i].uNumResets = atoi(test_string); | |
2297 break; | |
2298 case 4: | |
2299 pInfos[i].uFirstVisitedAt = atoi(test_string); | |
2300 break; | |
2301 case 5: | |
2302 pInfos[i]._per = atoi(test_string); | |
2303 break; | |
2304 case 6: | |
2305 pInfos[i].uRespawnIntervalDays = atoi(test_string); | |
2306 break; | |
2307 case 7: | |
2308 pInfos[i]._alert_days = atoi(test_string); | |
2309 break; | |
2310 case 8: | |
2311 pInfos[i]._steal_perm = atoi(test_string); | |
2312 break; | |
2313 case 9: | |
2314 pInfos[i].LockX5 = atoi(test_string); | |
2315 break; | |
2316 case 10: | |
2317 pInfos[i].Trap_D20 = atoi(test_string); | |
2318 break; | |
2319 case 11: | |
2320 pInfos[i].Treasure_prob = atoi(test_string); | |
2321 break; | |
2322 case 12: | |
2323 pInfos[i].Encounter_percent = atoi(test_string); | |
2324 break; | |
2325 case 13: | |
2326 pInfos[i].EncM1percent = atoi(test_string); | |
2327 break; | |
2328 case 14: | |
2329 pInfos[i].EncM2percent = atoi(test_string); | |
2330 break; | |
2331 case 15: | |
2332 pInfos[i].EncM3percent = atoi(test_string); | |
2333 break; | |
2334 case 16: | |
2335 pInfos[i].pEncounterMonster1Texture = RemoveQuotes(test_string); | |
2336 break; | |
2337 case 18: | |
2338 pInfos[i].Dif_M1 = atoi(test_string); | |
2339 break; | |
2340 case 19: | |
2341 pInfos[i].uEncounterMonster1AtLeast = 1; | |
2342 pInfos[i].uEncounterMonster1AtMost = 1; | |
2343 strcpy(work_str, test_string); | |
2344 work_str_pos = 0; | |
2345 work_str_len=strlen(work_str); | |
2346 if (work_str_len ) | |
2347 { | |
2348 while (work_str[work_str_pos] != '-' ) | |
2349 { | |
2350 ++work_str_pos; | |
2351 if (work_str_pos >= work_str_len ) | |
2352 break; | |
2353 } | |
2354 work_str[work_str_pos] = 0; | |
2355 pInfos[i].uEncounterMonster1AtLeast = atoi(work_str); | |
2356 if ( work_str_pos < work_str_len ) | |
2357 pInfos[i].uEncounterMonster1AtMost = atoi(&work_str[work_str_pos + 1]); | |
2358 else | |
2359 pInfos[i].uEncounterMonster1AtMost = pInfos[i].uEncounterMonster1AtLeast; | |
2360 } | |
2361 break; | |
2362 case 20: | |
2363 pInfos[i].pEncounterMonster2Texture = RemoveQuotes(test_string); | |
2364 break; | |
2365 case 22: | |
2366 pInfos[i].Dif_M2 = atoi(test_string); | |
2367 break; | |
2368 case 23: | |
2369 pInfos[i].uEncounterMonster2AtLeast = 1; | |
2370 pInfos[i].uEncounterMonster2AtMost = 1; | |
2371 strcpy(work_str, test_string); | |
2372 work_str_pos = 0; | |
2373 work_str_len=strlen(work_str); | |
2374 if (work_str_len ) | |
2375 { | |
2376 while (work_str[work_str_pos] != '-' ) | |
2377 { | |
2378 ++work_str_pos; | |
2379 if (work_str_pos >= work_str_len ) | |
2380 break; | |
2381 } | |
2382 work_str[work_str_pos] = 0; | |
2383 pInfos[i].uEncounterMonster2AtLeast = atoi(work_str); | |
2384 if ( work_str_pos < work_str_len ) | |
2385 pInfos[i].uEncounterMonster2AtMost = atoi(&work_str[work_str_pos + 1]); | |
2386 else | |
2387 pInfos[i].uEncounterMonster2AtMost = pInfos[i].uEncounterMonster2AtLeast; | |
2388 } | |
2389 break; | |
2390 case 24: | |
2391 pInfos[i].pEncounterMonster3Texture = RemoveQuotes(test_string); | |
2392 break; | |
2393 case 26: | |
2394 pInfos[i].Dif_M3 = atoi(test_string); | |
2395 break; | |
2396 case 27: | |
2397 pInfos[i].uEncounterMonster3AtLeast = 1; | |
2398 pInfos[i].uEncounterMonster3AtMost = 1; | |
2399 strcpy(work_str, test_string); | |
2400 work_str_pos = 0; | |
2401 work_str_len=strlen(work_str); | |
2402 if (work_str_len ) | |
2403 { | |
2404 while (work_str[work_str_pos] != '-' ) | |
2405 { | |
2406 ++work_str_pos; | |
2407 if (work_str_pos >= work_str_len ) | |
2408 break; | |
2409 } | |
2410 work_str[work_str_pos] = 0; | |
2411 pInfos[i].uEncounterMonster3AtLeast = atoi(work_str); | |
2412 if ( work_str_pos < work_str_len ) | |
2413 pInfos[i].uEncounterMonster3AtMost = atoi(&work_str[work_str_pos + 1]); | |
2414 else | |
2415 pInfos[i].uEncounterMonster3AtMost = pInfos[i].uEncounterMonster3AtLeast; | |
2416 } | |
2417 break; | |
2418 case 28: | |
2419 pInfos[i].uRedbookTrackID = atoi(test_string); | |
2420 break; | |
2421 case 29: | |
2422 { | |
2423 if ( !strcmp(test_string, "CAVE") ) | |
2424 { | |
2425 pInfos[i].uEAXEnv = 8; | |
2426 break; | |
2427 } | |
2428 if ( !strcmp(test_string, "STONEROOM") ) | |
2429 { | |
2430 pInfos[i].uEAXEnv = 5; | |
2431 break; | |
2432 } | |
2433 if ( !strcmp(test_string, "MOUNTAINS") ) | |
2434 { | |
2435 pInfos[i].uEAXEnv = 17; | |
2436 break; | |
2437 } | |
2438 if ( !strcmp(test_string, "PLAIN") ) | |
2439 { | |
2440 pInfos[i].uEAXEnv = 19; | |
2441 break; | |
2442 } | |
2443 if ( !strcmp(test_string, "FOREST") ) | |
2444 { | |
2445 pInfos[i].uEAXEnv = 15; | |
2446 break; | |
2447 } | |
2448 if ( !strcmp(test_string, "CITY") ) | |
2449 { | |
2450 pInfos[i].uEAXEnv = 16; | |
2451 break; | |
2452 } | |
2453 if ( !strcmp(test_string, "UNDERWATER") ) | |
2454 { | |
2455 pInfos[i].uEAXEnv = 22; | |
2456 break; | |
2457 } | |
2458 if ( !strcmp(test_string, "ARENA") ) | |
2459 { | |
2460 pInfos[i].uEAXEnv = 9; | |
2461 break; | |
2462 } | |
2463 if ( !strcmp(test_string, "GENERIC") ) | |
2464 { | |
2465 pInfos[i].uEAXEnv = 0; | |
2466 break; | |
2467 } | |
2468 if ( !strcmp(test_string, "PADDEDCELL") ) | |
2469 { | |
2470 pInfos[i].uEAXEnv = 1; | |
2471 break; | |
2472 } | |
2473 if ( !strcmp(test_string, "ROOM") ) | |
2474 { | |
2475 pInfos[i].uEAXEnv = 2; | |
2476 break; | |
2477 } | |
2478 if ( !strcmp(test_string, "BATHROOM") ) | |
2479 { | |
2480 pInfos[i].uEAXEnv = 3; | |
2481 break; | |
2482 } | |
2483 if ( !strcmp(test_string, "LIVINGROOM") ) | |
2484 { | |
2485 pInfos[i].uEAXEnv = 4; | |
2486 break; | |
2487 } | |
2488 if ( !strcmp(test_string, "AUDITORIUM") ) | |
2489 { | |
2490 pInfos[i].uEAXEnv = 6; | |
2491 break; | |
2492 } | |
2493 if ( !strcmp(test_string, "CONCERTHALL") ) | |
2494 { | |
2495 pInfos[i].uEAXEnv = 7; | |
2496 break; | |
2497 } | |
2498 if ( !strcmp(test_string, "HANGAR") ) | |
2499 { | |
2500 pInfos[i].uEAXEnv = 10; | |
2501 break; | |
2502 } | |
2503 if ( !strcmp(test_string, "CARPETEDHALLWAY") ) | |
2504 { | |
2505 pInfos[i].uEAXEnv = 11; | |
2506 break; | |
2507 } | |
2508 if ( !strcmp(test_string, "HALLWAY") ) | |
2509 { | |
2510 pInfos[i].uEAXEnv = 12; | |
2511 break; | |
2512 } | |
2513 if ( !strcmp(test_string, "STONECORRIDOR") ) | |
2514 { | |
2515 pInfos[i].uEAXEnv = 13; | |
2516 break; | |
2517 } | |
2518 if ( !strcmp(test_string, "ALLEY") ) | |
2519 { | |
2520 pInfos[i].uEAXEnv = 14; | |
2521 break; | |
2522 } | |
2523 if ( !strcmp(test_string, "QUARRY") ) | |
2524 { | |
2525 pInfos[i].uEAXEnv = 18; | |
2526 break; | |
2527 } | |
2528 if ( !strcmp(test_string, "PARKINGLOT") ) | |
2529 { | |
2530 pInfos[i].uEAXEnv = 20; | |
2531 break; | |
2532 } | |
2533 if ( !strcmp(test_string, "SEWERPIPE") ) | |
2534 { | |
2535 pInfos[i].uEAXEnv = 21; | |
2536 break; | |
2537 } | |
2538 if ( !strcmp(test_string, "DRUGGED") ) | |
2539 { | |
2540 pInfos[i].uEAXEnv = 23; | |
2541 break; | |
2542 } | |
2543 if ( !strcmp(test_string, "DIZZY") ) | |
2544 { | |
2545 pInfos[i].uEAXEnv = 24; | |
2546 break; | |
2547 } | |
2548 if ( !strcmp(test_string, "PSYCHOTIC") ) | |
2549 { | |
2550 pInfos[i].uEAXEnv = 25; | |
2551 break; | |
2552 } | |
2553 pInfos[i].uEAXEnv = 26; | |
2554 | |
2555 } | |
2556 break; | |
2557 } | |
2558 } | |
2559 else | |
2560 { | |
2561 break_loop = true; | |
2562 } | |
2563 ++decode_step; | |
2564 test_string=tmp_pos+1; | |
2565 } while ((decode_step<31)&&!break_loop); | |
2566 } | |
2567 | |
2568 uNumMaps = 77; | |
0 | 2569 } |
2570 // 453F62: using guessed type char Str[32]; | |
2571 | |
2572 //----- (004547A3) -------------------------------------------------------- | |
767 | 2573 MAP_TYPE MapStats::GetMapInfo(const char *Str2) |
2574 { | |
2575 assert(uNumMaps >= 2); | |
2576 | |
2577 for (uint i = 1; i < uNumMaps; ++i) | |
1165
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1150
diff
changeset
|
2578 if (!_stricmp(pInfos[i].pFilename, Str2)) |
767 | 2579 return (MAP_TYPE)i; |
2580 | |
2581 assert(false && "Map not found!"); | |
0 | 2582 } |
2583 | |
2584 //----- (004547E4) -------------------------------------------------------- | |
2585 void FactionTable::Initialize() | |
2586 { | |
237 | 2587 int i; |
2588 char* test_string; | |
2589 unsigned char c; | |
2590 bool break_loop; | |
2591 unsigned int temp_str_len; | |
2592 char* tmp_pos; | |
2593 int decode_step; | |
2594 int item_counter; | |
2595 | |
0 | 2596 if ( pHostileTXT_Raw ) |
1583 | 2597 free(pHostileTXT_Raw); |
237 | 2598 pHostileTXT_Raw = NULL; |
0 | 2599 pHostileTXT_Raw = (char *)pEvents_LOD->LoadRaw("hostile.txt", 0); |
2600 strtok(pHostileTXT_Raw, "\r"); | |
2101 | 2601 for ( i=0; i < 89; ++i ) |
2602 { | |
2603 test_string = strtok(NULL, "\r") + 1; | |
2604 break_loop = false; | |
2605 decode_step=0; | |
2606 do | |
2607 { | |
2608 c = *(unsigned char*)test_string; | |
2609 temp_str_len = 0; | |
2610 while((c!='\t') && (c > 0)) | |
2611 { | |
2612 ++temp_str_len; | |
2613 c = test_string[temp_str_len]; | |
2614 } | |
2615 tmp_pos=test_string+temp_str_len; | |
2616 if (*tmp_pos == 0) | |
2617 break_loop = true; | |
2618 *tmp_pos = 0; | |
2619 if (temp_str_len) | |
2620 { | |
2621 if ( decode_step >= 1 && decode_step < 90 ) | |
2622 relations[decode_step-1][i] = atoi(test_string); | |
2623 } | |
2624 else | |
2625 break_loop = true; | |
2626 ++decode_step; | |
2627 test_string=tmp_pos+1; | |
2628 } | |
2629 while ((decode_step < 92) && !break_loop ); | |
2630 } | |
237 | 2631 if ( pHostileTXT_Raw) |
0 | 2632 { |
1583 | 2633 free(pHostileTXT_Raw); |
237 | 2634 pHostileTXT_Raw = NULL; |
0 | 2635 } |
2636 } | |
2637 | |
2638 //----- (00458244) -------------------------------------------------------- | |
1783 | 2639 unsigned int SkillToMastery( unsigned int skill_value ) |
1067 | 2640 { |
1064 | 2641 switch (skill_value & 0x1C0) |
983 | 2642 { |
2643 case 0x100: return 4; // Grandmaster | |
2644 case 0x80: return 3; // Master | |
2645 case 0x40: return 2; // Expert | |
2646 case 0x00: return 1; // Normal | |
1409
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1408
diff
changeset
|
2647 } |
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1408
diff
changeset
|
2648 assert(false); |
c9e3b93ec570
Highlighted locations with "using uninitialized variable" warning.
Nomad
parents:
1408
diff
changeset
|
2649 return 0; |
0 | 2650 } |
2651 | |
2652 //----- (0045828B) -------------------------------------------------------- | |
2653 unsigned int __fastcall GetSpellColor(signed int a1) | |
2654 { | |
1799 | 2655 if ( a1 == 0 ) |
2069 | 2656 return Color16(0, 0, 0); |
1799 | 2657 if ( a1 < 12 ) |
2069 | 2658 return Color16(255, 85, 0); |
1799 | 2659 if ( a1 < 23 ) |
2069 | 2660 return Color16(150, 212, 255); |
1799 | 2661 if ( a1 < 34 ) |
2069 | 2662 return Color16(0, 128, 255); |
1799 | 2663 if ( a1 < 45 ) |
2069 | 2664 return Color16(128, 128, 128); |
1799 | 2665 if ( a1 < 56 ) |
2069 | 2666 return Color16(225, 225, 225); |
1799 | 2667 if ( a1 < 67 ) |
2069 | 2668 return Color16(235, 15, 255); |
1799 | 2669 if ( a1 < 78 ) |
2069 | 2670 return Color16(255, 128, 0); |
1799 | 2671 if ( a1 < 89 ) |
2069 | 2672 return Color16(255, 255, 155); |
1799 | 2673 if ( a1 < 100 ) |
2069 | 2674 return Color16(192, 192, 240); |
0 | 2675 } |
2676 | |
2677 //----- (004610AA) -------------------------------------------------------- | |
1637 | 2678 void __fastcall PrepareToLoadODM(unsigned int bLoading, ODMRenderParams *a2) |
0 | 2679 { |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
2680 pGameLoadingUI_ProgressBar->Reset(27); |
0 | 2681 pSoundList->_4A9D79(0); |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
2682 uCurrentlyLoadedLevelType = LEVEL_Outdoor; |
2099 | 2683 ODM_LoadAndInitialize(pCurrentMapName, a2); |
2684 if ( !bLoading ) | |
0 | 2685 TeleportToStartingPoint(uLevel_StartingPointType); |
2686 viewparams->_443365(); | |
2687 PlayLevelMusic(); | |
2688 } | |
2689 // 6BE35C: using guessed type int uLevel_StartingPointType; | |
2690 | |
2691 //----- (00461103) -------------------------------------------------------- | |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
2692 void _461103_load_level_sub() |
0 | 2693 { |
2694 //GUIProgressBar *v0; // ebx@1 | |
2695 //signed int v1; // ebp@1 | |
2696 //char *v2; // esi@2 | |
2101 | 2697 //__int16 v3; // cx@3 |
0 | 2698 int v4; // edx@8 |
2699 //size_t v5; // edi@14 | |
2700 signed int v6; // esi@14 | |
2701 //char *v7; // edx@15 | |
2702 signed int v8; // ecx@16 | |
2703 int v9; // ecx@23 | |
2704 MonsterInfo *v10; // ebx@23 | |
2705 //int *v11; // esi@23 | |
2706 int v12; // esi@25 | |
2707 int v13; // eax@26 | |
2708 __int16 v14; // ax@41 | |
2709 //signed int v15; // [sp+10h] [bp-4Ch]@1 | |
2710 //signed int v16; // [sp+10h] [bp-4Ch]@14 | |
2711 signed int v17; // [sp+14h] [bp-48h]@3 | |
2712 signed int v18; // [sp+14h] [bp-48h]@23 | |
2713 int v19; // [sp+18h] [bp-44h]@1 | |
2714 signed int v20; // [sp+18h] [bp-44h]@14 | |
2715 int v21[16]; // [sp+1Ch] [bp-40h]@17 | |
2716 | |
598 | 2717 GenerateItemsInChest(); |
0 | 2718 pGameLoadingUI_ProgressBar->Progress(); |
2101 | 2719 pParty->uFlags |= 2; |
0 | 2720 pParty->field_7B5_in_arena_quest = 0; |
2721 dword_5C6DF8 = 1; | |
291 | 2722 pNPCStats->uNewlNPCBufPos = 0; |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
2723 v19 = pMapStats->GetMapInfo(pCurrentMapName); |
0 | 2724 |
2725 //v15 = 0; | |
2726 for (uint i = 0; i < uNumActors; ++i) | |
2727 //if ( (signed int)uNumActors > 0 ) | |
2728 { | |
2099 | 2729 //Actor* pActor = &pActors[i]; |
0 | 2730 //v2 = (char *)&pActors[0].uNPC_ID; |
2731 //do | |
2732 //{ | |
2101 | 2733 //v3 = pActors[i].pMonsterInfo.uID; |
0 | 2734 v17 = 0; |
2099 | 2735 if ( pActors[i].pMonsterInfo.uID >= 115 && pActors[i].pMonsterInfo.uID <= 186 |
2736 || pActors[i].pMonsterInfo.uID >= 232 && pActors[i].pMonsterInfo.uID <= 249 ) | |
0 | 2737 v17 = 1; |
2738 //v1 = 0; | |
2101 | 2739 v4 = (pActors[i].pMonsterInfo.uID - 1) % 3; |
0 | 2740 if ( 2 == v4 ) |
2741 { | |
2099 | 2742 if ( pActors[i].sNPC_ID && pActors[i].sNPC_ID < 5000 ) |
0 | 2743 continue; |
2744 } | |
2745 else | |
2746 { | |
2747 if ( v4 != 1 ) | |
2748 { | |
2099 | 2749 if ( v4 == 0 && pActors[i].sNPC_ID == 0 ) |
2101 | 2750 pActors[i].sNPC_ID = 0; |
2751 continue; | |
0 | 2752 } |
2753 } | |
2099 | 2754 if ( pActors[i].sNPC_ID > 0 && pActors[i].sNPC_ID < 5000 ) |
0 | 2755 continue; |
2756 if ( v17 ) | |
2757 { | |
2101 | 2758 pNPCStats->InitializeAdditionalNPCs(&pNPCStats->pAdditionalNPC[pNPCStats->uNewlNPCBufPos], pActors[i].pMonsterInfo.uID, 0, v19); |
291 | 2759 v14 = LOWORD(pNPCStats->uNewlNPCBufPos) + 5000; |
2760 ++pNPCStats->uNewlNPCBufPos; | |
2099 | 2761 pActors[i].sNPC_ID = v14; |
0 | 2762 continue; |
2763 } | |
2099 | 2764 pActors[i].sNPC_ID = 0; |
0 | 2765 //++v15; |
2766 //v2 += 836; | |
2767 //} | |
2768 //while ( v15 < (signed int)uNumActors ); | |
2769 } | |
2770 | |
2771 pGameLoadingUI_ProgressBar->Progress(); | |
2772 | |
2773 //v5 = uNumActors; | |
2774 v6 = 0; | |
2775 v20 = 0; | |
2776 //v16 = v1; | |
2777 | |
2778 for (uint i = 0; i < uNumActors; ++i) | |
2779 { | |
2780 //v7 = (char *)&pActors[0].pMonsterInfo; | |
2781 //do | |
2782 //{ | |
2101 | 2783 for ( v8 = 0; v8 < v6; ++v8 ) |
2784 { | |
2785 if ( v21[v8] == pActors[i].pMonsterInfo.uID - 1 ) | |
2786 break; | |
2787 } | |
2788 | |
2789 if ( v8 == v6 ) | |
2790 { | |
2791 v21[v6++] = pActors[i].pMonsterInfo.uID - 1; | |
2792 v20 = v6; | |
2793 if ( v6 == 16 ) | |
2794 break; | |
2795 } | |
2796 //++v16; | |
2797 //v7 += 836; | |
0 | 2798 //} |
2799 //while ( v16 < (signed int)v5 ); | |
2800 } | |
2801 | |
2802 pGameLoadingUI_ProgressBar->Progress(); | |
2803 | |
2101 | 2804 for ( int _v0 = 0; _v0 < v6; ++_v0 ) |
0 | 2805 { |
2101 | 2806 for ( v18 = 4; v18; --v18 ) |
2807 pSoundList->LoadSound(pMonsterList->pMonsters[v21[_v0]].pSoundSampleIDs[4 - v18], 0); | |
0 | 2808 v12 = 0; |
2809 do | |
2101 | 2810 v13 = pSoundList->LoadSound(v12++ + word_4EE088_sound_ids[pMonsterStats->pInfos[v21[_v0] + 1].uSpell1ID], 1); |
0 | 2811 while ( v13 ); |
2812 } | |
2813 //v0 = pGameLoadingUI_ProgressBar; | |
2814 //v1 = 0; | |
2815 | |
2816 pGameLoadingUI_ProgressBar->Progress(); | |
2817 | |
2061 | 2818 if (dword_6BE368_debug_settings_2 & DEBUG_SETTINGS_NO_ACTORS) |
0 | 2819 uNumActors = 0; |
2061 | 2820 if ( dword_6BE368_debug_settings_2 & DEBUG_SETTINGS_NO_DECORATIONS) |
0 | 2821 uNumLevelDecorations = 0; |
1459 | 2822 init_event_triggers(); |
0 | 2823 |
2824 pGameLoadingUI_ProgressBar->Progress(); | |
1638
ccde94f02b75
class IndoorCamera split into BLVRenderParams and ODMRenderParams
Nomad
parents:
1637
diff
changeset
|
2825 |
1640
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
2826 pGame->pIndoorCameraD3D->vPartyPos.x = 0; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
2827 pGame->pIndoorCameraD3D->vPartyPos.y = 0; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
2828 pGame->pIndoorCameraD3D->vPartyPos.z = 100; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
2829 pGame->pIndoorCameraD3D->sRotationX = 0; |
afc1c3514dd5
Some common code from ODM and BLV RenderParams moved to IndoorCameraD3D
Nomad
parents:
1638
diff
changeset
|
2830 pGame->pIndoorCameraD3D->sRotationY = 0; |
1638
ccde94f02b75
class IndoorCamera split into BLVRenderParams and ODMRenderParams
Nomad
parents:
1637
diff
changeset
|
2831 viewparams->bRedrawGameUI = true; |
783 | 2832 uLevel_StartingPointType = MapStartPoint_Party; |
0 | 2833 pSprites_LOD->_461397(); |
2834 pPaletteManager->LockTestAll(); | |
2835 if ( pParty->pPickedItem.uItemID != 0 ) | |
2836 pMouse->SetCursorBitmapFromItemID(pParty->pPickedItem.uItemID); | |
2837 } | |
2838 | |
2839 //----- (004613C4) -------------------------------------------------------- | |
1459 | 2840 void init_event_triggers() |
0 | 2841 { |
1459 | 2842 uint id = pDecorationList->GetDecorIdByName("Event Trigger"); |
2843 | |
2844 num_event_triggers = 0; | |
2845 for (uint i = 0; i < uNumLevelDecorations; ++i) | |
2846 if (pLevelDecorations[i].uDecorationDescID == id) | |
2847 event_triggers[num_event_triggers++] = i; | |
0 | 2848 } |
2849 | |
2850 //----- (004627B7) -------------------------------------------------------- | |
762 | 2851 void MainMenu_Loop() |
0 | 2852 { |
2853 GUIButton *pButton; // eax@27 | |
2854 unsigned int pControlParam; // ecx@35 | |
2855 int v10; // ecx@36 | |
2856 int v11; // ecx@37 | |
2857 unsigned int pY; // [sp-18h] [bp-54h]@39 | |
2858 Texture *pTexture; // [sp-14h] [bp-50h]@39 | |
2859 GUIButton *pButton2; // [sp+0h] [bp-3Ch]@27 | |
2860 GUIWindow *pWindow; // [sp+4h] [bp-38h]@11 | |
2861 | |
151 | 2862 pCurrentScreen = SCREEN_GAME; |
1038 | 2863 |
0 | 2864 pGUIWindow2 = 0; |
2216 | 2865 pAudioPlayer->StopChannels(-1, -1);//îñòàíîâèòü/ïîäãîòîâèòü êàíàë |
2219 | 2866 pMouse->RemoveHoldingItem();//èçáàâèòü êóðñîð îò âåùè |
762 | 2867 |
2868 pIcons_LOD->_inlined_sub2(); | |
2869 | |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2212
diff
changeset
|
2870 pWindow_MainMenu = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_MainMenu, 0, 0); |
1980 | 2871 Texture* pNew = pIcons_LOD->LoadTexturePtr("title_new", TEXTURE_16BIT_PALETTE); |
2872 Texture* pLoad = pIcons_LOD->LoadTexturePtr("title_load", TEXTURE_16BIT_PALETTE); | |
2873 Texture* pCredits = pIcons_LOD->LoadTexturePtr("title_cred", TEXTURE_16BIT_PALETTE); | |
2874 Texture* pExit = pIcons_LOD->LoadTexturePtr("title_exit", TEXTURE_16BIT_PALETTE); | |
948 | 2875 |
2876 pMainMenu_BtnNew = pWindow_MainMenu->CreateButton(495, 172, pNew->uTextureWidth, pNew->uTextureHeight, 1, 0, UIMSG_MainMenu_ShowPartyCreationWnd, 0, 'N', "", pNew, 0); | |
2877 pMainMenu_BtnLoad = pWindow_MainMenu->CreateButton(495, 227, pLoad->uTextureWidth, pLoad->uTextureHeight, 1, 0, UIMSG_MainMenu_ShowLoadWindow, 1, 'L', "", pLoad, 0); | |
2878 pMainMenu_BtnCredits = pWindow_MainMenu->CreateButton(495, 282, pCredits->uTextureWidth, pCredits->uTextureHeight, 1, 0, UIMSG_ShowCredits, 2, 'C', "", pCredits, 0); | |
2879 pMainMenu_BtnExit = pWindow_MainMenu->CreateButton(495, 337, pExit->uTextureWidth, pExit->uTextureHeight, 1, 0, UIMSG_ExitToWindows, 3, 0, "", pExit, 0); | |
2880 | |
0 | 2881 pTexture_PCX.Release(); |
2882 pTexture_PCX.Load("title.pcx", 0); | |
2883 SetCurrentMenuID(MENU_MAIN); | |
1984 | 2884 SetForegroundWindow(window->GetApiHandle()); |
2885 SendMessageW(window->GetApiHandle(), WM_ACTIVATEAPP, 1, 0); | |
0 | 2886 while (GetCurrentMenuID() == MENU_MAIN || GetCurrentMenuID() == MENU_SAVELOAD) |
2887 { | |
2888 POINT pt; | |
2889 pMouse->GetCursorPos(&pt); | |
2890 pWindow = pWindow_MainMenu; | |
165 | 2891 if ( GetCurrentMenuID() == MENU_SAVELOAD) |
0 | 2892 { |
151 | 2893 if ( pCurrentScreen != SCREEN_LOADGAME ) |
0 | 2894 { |
2895 pTexture_PCX.Release(); | |
2896 pTexture_PCX.Load("lsave640.pcx", 0); | |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2212
diff
changeset
|
2897 pGUIWindow2 = GUIWindow::Create(0, 0, window->GetWidth(), window->GetHeight(), WINDOW_MainMenu, 0, 0); |
151 | 2898 pCurrentScreen = SCREEN_LOADGAME; |
1033 | 2899 LoadUI_Load(0); |
0 | 2900 } |
2901 pWindow = pGUIWindow_CurrentMenu; | |
2902 } | |
2903 | |
2061 | 2904 for (MSG msg; PeekMessageW(&msg, 0, 0, 0, PM_REMOVE);) |
0 | 2905 { |
2906 if (msg.message == WM_QUIT) | |
2907 Game_DeinitializeAndTerminate(0); | |
2908 TranslateMessage(&msg); | |
2061 | 2909 DispatchMessageW(&msg); |
0 | 2910 } |
2061 | 2911 |
2912 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_APP_INACTIVE) | |
0 | 2913 { |
2914 WaitMessage(); | |
2061 | 2915 continue; |
0 | 2916 } |
2061 | 2917 |
0 | 2918 pRenderer->BeginScene(); |
2919 pRenderer->DrawTextureRGB(0, 0, &pTexture_PCX); | |
1038 | 2920 |
165 | 2921 GUI_MainMenuMessageProc(); |
0 | 2922 GUI_UpdateWindows(); |
1038 | 2923 |
165 | 2924 if (GetCurrentMenuID() != MENU_MAIN) |
2925 { | |
961 | 2926 if (GetCurrentMenuID() == MENU_LoadingProcInMainMenu) |
0 | 2927 { |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
2928 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
0 | 2929 pGUIWindow_CurrentMenu->Release(); |
2930 pGUIWindow_CurrentMenu = 0; | |
151 | 2931 pCurrentScreen = SCREEN_GAME; |
0 | 2932 viewparams->bRedrawGameUI = 1; |
2933 } | |
2934 } | |
2935 else | |
2936 { | |
1458 | 2937 if ( !pModalWindow )// ??? |
0 | 2938 { |
2939 pButton = pWindow->pControlsHead; | |
2940 for ( pButton = pWindow->pControlsHead; pButton; pButton = pButton->pNext ) | |
2941 { | |
2942 if ( pt.x >= (signed int)pButton->uX && pt.x <= (signed int)pButton->uZ | |
2943 && pt.y >= (signed int)pButton->uY && pt.y <= (signed int)pButton->uW | |
2944 && pWindow == pWindow_MainMenu ) | |
2945 { | |
832 | 2946 pControlParam = pButton->msg_param; |
0 | 2947 switch (pControlParam) // ïîäñâåòêà êíîïîê |
2948 { | |
2949 case 0: | |
2950 pTexture = pNew; | |
2951 pY = 172; | |
2952 break; | |
2953 case 1: | |
2954 pTexture = pLoad; | |
2955 pY = 227; | |
2956 break; | |
2957 case 2: | |
2958 pTexture = pCredits; | |
2959 pY = 282; | |
2960 break; | |
2961 case 3: | |
2962 pTexture = pExit; | |
2963 pY = 337; | |
2964 break; | |
2965 } | |
2966 pRenderer->DrawTextureIndexed(495, pY, pTexture); //ïîäñâåòêà êíîïîê | |
2967 } | |
2968 } | |
2969 } | |
2970 } | |
2971 pRenderer->EndScene(); | |
2972 pRenderer->Present(); | |
2973 } | |
970 | 2974 GUI_MainMenuMessageProc(); |
0 | 2975 pRenderer->BeginScene(); |
2976 GUI_UpdateWindows(); | |
2977 pRenderer->EndScene(); | |
2978 pRenderer->Present(); | |
961 | 2979 pTexture_PCX.Release(); |
0 | 2980 if ( pGUIWindow2 ) |
2981 { | |
2982 pGUIWindow2->Release(); | |
2983 pGUIWindow2 = 0; | |
2984 } | |
2985 pWindow_MainMenu->Release(); | |
1405
c0b273d33338
RemoveTexturesPackFromTextureList and RemoveTexturesFromTextureList
Ritor1
parents:
1404
diff
changeset
|
2986 pIcons_LOD->RemoveTexturesPackFromTextureList(); |
0 | 2987 } |
2988 | |
2989 | |
2990 //----- (00464479) -------------------------------------------------------- | |
1583 | 2991 void ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows() |
0 | 2992 { |
2993 int v0; // esi@9 | |
2994 | |
2995 if (pMouse) | |
2996 pMouse->SetCursorBitmap("MICON1"); | |
2997 | |
2998 pPaletteManager->ResetNonLocked(); | |
2999 pBitmaps_LOD->ReleaseAll2(); | |
3000 pSprites_LOD->DeleteSomeOtherSprites(); | |
3001 pIcons_LOD->ReleaseAll2(); | |
2152 | 3002 |
0 | 3003 if (uCurrentlyLoadedLevelType == LEVEL_Indoor) |
3004 pIndoor->Release(); | |
3005 else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor) | |
1583 | 3006 pOutdoor->Release(); |
0 | 3007 |
3008 pAudioPlayer->StopChannels(-1, -1); | |
3009 pSoundList->_4A9D79(0); | |
3010 uCurrentlyLoadedLevelType = LEVEL_null; | |
3011 pSpriteFrameTable->ResetSomeSpriteFlags(); | |
3012 v0 = uNumVisibleWindows; | |
349 | 3013 pParty->armageddon_timer = 0; |
0 | 3014 while ( v0 > 0 ) |
3015 pWindowList[pVisibleWindowsIdxs[v0--] - 1].Release(); | |
3016 } | |
3017 | |
3018 //----- (004646F0) -------------------------------------------------------- | |
1458 | 3019 void PrepareWorld(unsigned int _0_box_loading_1_fullscreen) |
0 | 3020 { |
2154 | 3021 //if ( pRenderer->pRenderD3D ) |
0 | 3022 pGame->pVisInstance->_4C1A02(); |
3023 pEventTimer->Pause(); | |
3024 pMiscTimer->Pause(); | |
3025 pParty->uFlags = 2; | |
1517 | 3026 CastSpellInfoHelpers::_427D48(); |
0 | 3027 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows(); |
1458 | 3028 DoPrepareWorld(0, (_0_box_loading_1_fullscreen == 0) + 1); |
0 | 3029 pMiscTimer->Resume(); |
3030 pEventTimer->Resume(); | |
3031 } | |
3032 | |
3033 //----- (00464761) -------------------------------------------------------- | |
1583 | 3034 void Game_DeinitializeAndTerminate(int exitCode) |
0 | 3035 { |
1586 | 3036 SetPriorityClass(GetCurrentProcess(), NORMAL_PRIORITY_CLASS); |
0 | 3037 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows(); |
3038 pGame->Deinitialize(); | |
2155 | 3039 pRenderer->Release(); |
1802 | 3040 delete window; |
3041 //if ( !DestroyWindow(hWnd) ) | |
3042 // GetLastError(); | |
1583 | 3043 exit(exitCode); |
0 | 3044 } |
3045 | |
3046 //----- (004647AB) -------------------------------------------------------- | |
762 | 3047 void FinalInitialization() |
0 | 3048 { |
3049 pViewport->SetScreen(viewparams->uSomeX, viewparams->uSomeY, viewparams->uSomeZ, viewparams->uSomeW); | |
2151 | 3050 pViewport->SetFOV(flt_6BE3A0 * 65536.0f); |
0 | 3051 |
1638
ccde94f02b75
class IndoorCamera split into BLVRenderParams and ODMRenderParams
Nomad
parents:
1637
diff
changeset
|
3052 //pIndoorCamera = new IndoorCamera; |
ccde94f02b75
class IndoorCamera split into BLVRenderParams and ODMRenderParams
Nomad
parents:
1637
diff
changeset
|
3053 //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
|
3054 // viewparams->uScreen_BttmR_Y - viewparams->uScreen_topL_Y + 1); |
0 | 3055 |
3056 InitializeTurnBasedAnimations(&stru_50C198); | |
762 | 3057 pBitmaps_LOD->_inlined_sub1(); |
3058 pSprites_LOD->_inlined_sub1(); | |
3059 pIcons_LOD->_inlined_sub1(); | |
0 | 3060 } |
3061 // 6BE3A0: using guessed type float flt_6BE3A0; | |
3062 | |
3063 //----- (00464839) -------------------------------------------------------- | |
1583 | 3064 char Is_out15odm_underwater() |
0 | 3065 { |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3066 return _stricmp(pCurrentMapName, "out15.odm") == 0; |
0 | 3067 } |
3068 | |
3069 //----- (00464851) -------------------------------------------------------- | |
1583 | 3070 void SetUnderwaterFog() |
0 | 3071 { |
3072 day_fogrange_1 = 50; | |
3073 day_fogrange_2 = 5000; | |
3074 } | |
3075 | |
3076 //----- (00464866) -------------------------------------------------------- | |
1458 | 3077 void DoPrepareWorld(unsigned int bLoading, int _1_fullscreen_loading_2_box) |
0 | 3078 { |
1458 | 3079 //int v2; // esi@1 |
0 | 3080 char *v3; // eax@1 |
3081 //char *v4; // eax@1 | |
3082 unsigned int v5; // eax@3 | |
3083 //size_t v6; // ecx@10 | |
3084 //char *v7; // eax@11 | |
3085 char Str1[20]; // [sp+Ch] [bp-18h]@1 | |
3086 unsigned int v9; // [sp+20h] [bp-4h]@1 | |
3087 | |
3088 v9 = bLoading; | |
3089 ResetCursor_Palettes_LODs_Level_Audio_SFT_Windows(); | |
3090 pDecalBuilder->Reset(0); | |
1458 | 3091 pGameLoadingUI_ProgressBar->Initialize(_1_fullscreen_loading_2_box == 1 ? GUIProgressBar::TYPE_Fullscreen : |
3092 GUIProgressBar::TYPE_Box); | |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3093 strcpy(Str1, pCurrentMapName); |
0 | 3094 v3 = strtok(Str1, "."); |
3095 strcpy(Str1, v3); | |
3096 Level_LoadEvtAndStr(Str1); | |
3097 LoadLevel_InitializeLevelEvt(); | |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3098 strcpy(Str1, pCurrentMapName); |
0 | 3099 _strrev(Str1); |
3100 strtok(Str1, "."); | |
3101 _strrev(Str1); | |
3102 | |
3103 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
|
3104 pSpriteObjects[i].uObjectDescID = 0; |
0 | 3105 |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3106 v5 = pMapStats->GetMapInfo(pCurrentMapName); |
1541 | 3107 bUnderwater = false; |
0 | 3108 uLevelMapStatsID = v5; |
3109 pGame->uFlags2 &= 0xFFFFFFF7u; | |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3110 if ( !_stricmp(pCurrentMapName, "out15.odm") ) |
0 | 3111 { |
1541 | 3112 bUnderwater = true; |
1583 | 3113 pGame->uFlags2 |= GAME_FLAGS_2_ALTER_GRAVITY; |
0 | 3114 } |
831 | 3115 pParty->floor_face_pid = 0; |
1104 | 3116 if ( _stricmp(Str1, "blv") ) |
0 | 3117 PrepareToLoadODM(v9, 0); |
3118 else | |
3119 PrepareToLoadBLV(v9); | |
3120 pAudioPlayer->SetMapEAX(); | |
1459 | 3121 _461103_load_level_sub(); |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3122 if ( !_stricmp(pCurrentMapName, "d11.blv") || !_stricmp(pCurrentMapName, "d10.blv") ) |
0 | 3123 { |
1583 | 3124 //spawning grounds & walls of mist - no loot & exp from monsters |
0 | 3125 |
3126 for (uint i = 0; i < uNumActors; ++i) | |
3127 { | |
3128 pActors[i].pMonsterInfo.uTreasureType = 0; | |
3129 pActors[i].pMonsterInfo.uTreasureDiceRolls = 0; | |
3130 pActors[i].pMonsterInfo.uExp = 0; | |
3131 } | |
3132 } | |
3133 bDialogueUI_InitializeActor_NPC_ID = 0; | |
3134 OnMapLoad(); | |
3135 pGameLoadingUI_ProgressBar->Progress(); | |
1459 | 3136 memset(&pRenderer->pBillboardRenderListD3D, 0, sizeof(pRenderer->pBillboardRenderListD3D)); |
0 | 3137 pGameLoadingUI_ProgressBar->Release(); |
3138 _flushall(); | |
3139 } | |
3140 | |
3141 //----- (004649EF) -------------------------------------------------------- | |
3142 int __fastcall ReadWindowsRegistryInt(const char *pKey, int uDefValue) | |
3143 { | |
3144 int v3; // [sp+4h] [bp-24h]@1 | |
3145 DWORD cbData; // [sp+8h] [bp-20h]@1 | |
3146 LPCSTR lpValueName; // [sp+Ch] [bp-1Ch]@1 | |
3147 DWORD dwDisposition; // [sp+10h] [bp-18h]@2 | |
3148 BYTE Data[4]; // [sp+14h] [bp-14h]@5 | |
3149 HKEY hKey; // [sp+18h] [bp-10h]@1 | |
3150 HKEY phkResult; // [sp+1Ch] [bp-Ch]@1 | |
3151 HKEY v10; // [sp+20h] [bp-8h]@1 | |
3152 HKEY v11; // [sp+24h] [bp-4h]@1 | |
3153 | |
3154 v3 = uDefValue; | |
3155 lpValueName = pKey; | |
3156 v11 = 0; | |
3157 v10 = 0; | |
3158 hKey = 0; | |
3159 phkResult = 0; | |
3160 cbData = 4; | |
27 | 3161 if ( !RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE", 0, KEY_READ|KEY_WOW64_32KEY, &hKey) )// for 64 bit |
0 | 3162 { |
3163 if ( !RegCreateKeyExA(hKey, "New World Computing", 0, "", 0, 0xF003Fu, 0, &phkResult, &dwDisposition) ) | |
3164 { | |
3165 if ( !RegCreateKeyExA(phkResult, "Might and Magic VII", 0, "", 0, 0xF003Fu, 0, &v10, &dwDisposition) ) | |
3166 { | |
3167 if ( !RegCreateKeyExA(v10, "1.0", 0, "", 0, 0xF003Fu, 0, &v11, &dwDisposition) ) | |
3168 { | |
3169 if ( RegQueryValueExA(v11, lpValueName, 0, 0, Data, &cbData) ) | |
3170 { | |
3171 *(int *)Data = v3; | |
3172 RegSetValueExA(v11, lpValueName, 0, 4u, Data, 4u); | |
3173 } | |
3174 RegCloseKey(v11); | |
3175 } | |
3176 RegCloseKey(v10); | |
3177 } | |
3178 RegCloseKey(phkResult); | |
3179 } | |
3180 RegCloseKey(hKey); | |
3181 } | |
3182 return *(int *)Data; | |
3183 } | |
3184 | |
3185 //----- (00464B02) -------------------------------------------------------- | |
3186 void __fastcall WriteWindowsRegistryString(const char *pKey, const char *pString) | |
3187 { | |
3188 size_t v2; // eax@5 | |
3189 const char *lpValueName; // [sp+4h] [bp-1Ch]@1 | |
3190 const char *Str; // [sp+8h] [bp-18h]@1 | |
3191 DWORD dwDisposition; // [sp+Ch] [bp-14h]@2 | |
3192 HKEY hKey; // [sp+10h] [bp-10h]@1 | |
3193 HKEY phkResult; // [sp+14h] [bp-Ch]@1 | |
3194 HKEY v8; // [sp+18h] [bp-8h]@1 | |
3195 HKEY v9; // [sp+1Ch] [bp-4h]@1 | |
3196 | |
3197 Str = pString; | |
3198 lpValueName = pKey; | |
3199 v9 = 0; | |
3200 v8 = 0; | |
3201 hKey = 0; | |
3202 phkResult = 0; | |
3203 if ( !RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE", 0, 0x2001Fu, &hKey) ) | |
3204 { | |
3205 if ( !RegCreateKeyExA(hKey, "New World Computing", 0, "", 0, 0xF003Fu, 0, &phkResult, &dwDisposition) ) | |
3206 { | |
3207 if ( !RegCreateKeyExA(phkResult, "Might and Magic VII", 0, "", 0, 0xF003Fu, 0, &v8, &dwDisposition) ) | |
3208 { | |
3209 if ( !RegCreateKeyExA(v8, "1.0", 0, "", 0, 0xF003Fu, 0, &v9, &dwDisposition) ) | |
3210 { | |
3211 v2 = strlen(Str); | |
3212 RegSetValueExA(v9, lpValueName, 0, 1u, (const BYTE *)Str, v2 + 1); | |
3213 RegCloseKey(v9); | |
3214 } | |
3215 RegCloseKey(v8); | |
3216 } | |
3217 RegCloseKey(phkResult); | |
3218 } | |
3219 RegCloseKey(hKey); | |
3220 } | |
3221 } | |
3222 | |
3223 //----- (00464BEF) -------------------------------------------------------- | |
3224 void __fastcall ReadWindowsRegistryString(const char *pKeyName, char *pOutString, int uBufLen, const char *pDefaultValue) | |
3225 { | |
3226 LSTATUS (__stdcall *v4)(HKEY); // esi@1 | |
3227 LSTATUS result; // eax@7 | |
3228 DWORD Type; // [sp+Ch] [bp-24h]@5 | |
3229 LPCSTR lpValueName; // [sp+10h] [bp-20h]@1 | |
3230 DWORD cbData; // [sp+14h] [bp-1Ch]@1 | |
3231 LPBYTE Dest; // [sp+18h] [bp-18h]@1 | |
3232 DWORD dwDisposition; // [sp+1Ch] [bp-14h]@2 | |
3233 HKEY phkResult; // [sp+20h] [bp-10h]@1 | |
3234 HKEY hKey; // [sp+24h] [bp-Ch]@1 | |
3235 HKEY v13; // [sp+28h] [bp-8h]@1 | |
3236 HKEY v14; // [sp+2Ch] [bp-4h]@1 | |
3237 | |
3238 cbData = uBufLen; | |
3239 Dest = (LPBYTE)pOutString; | |
3240 lpValueName = pKeyName; | |
3241 v14 = 0; | |
3242 v13 = 0; | |
3243 hKey = 0; | |
3244 phkResult = 0; | |
3245 v4 = RegCloseKey; | |
3246 if ( RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE", 0, 0x2001Fu, &hKey) | |
3247 || RegCreateKeyExA(hKey, "New World Computing", 0, "", 0, 0xF003Fu, 0, &phkResult, &dwDisposition) | |
3248 || RegCreateKeyExA(phkResult, "Might and Magic VII", 0, "", 0, 0xF003Fu, 0, &v13, &dwDisposition) | |
3249 || RegCreateKeyExA(v13, "1.0", 0, "", 0, 0xF003Fu, 0, &v14, &dwDisposition) ) | |
1416 | 3250 { |
3251 result = (LSTATUS)strncpy((char *)Dest, pDefaultValue, uBufLen); | |
3252 } | |
3253 else if ( RegQueryValueExA(v14, lpValueName, 0, &Type, Dest, &cbData) ) | |
0 | 3254 { |
3255 RegCloseKey(v14); | |
3256 v14 = 0; | |
3257 result = (LSTATUS)strncpy((char *)Dest, pDefaultValue, uBufLen); | |
1416 | 3258 } |
3259 else | |
3260 { | |
3261 v4 = RegCloseKey; | |
3262 RegCloseKey(v14); | |
3263 v14 = 0; | |
3264 RegCloseKey(v13); | |
3265 v13 = 0; | |
3266 RegCloseKey(phkResult); | |
3267 phkResult = 0; | |
3268 result = RegCloseKey(hKey); | |
3269 hKey = 0; | |
3270 } | |
0 | 3271 if ( v14 ) |
3272 result = v4(v14); | |
3273 if ( v13 ) | |
3274 result = v4(v13); | |
3275 if ( hKey ) | |
3276 result = v4(hKey); | |
3277 if ( phkResult ) | |
3278 result = v4(phkResult); | |
3279 } | |
3280 | |
3281 //----- (00464D32) -------------------------------------------------------- | |
3282 void __fastcall WriteWindowsRegistryInt(const char *pKey, int val) | |
3283 { | |
3284 const char *lpValueName; // [sp+4h] [bp-1Ch]@1 | |
3285 BYTE Data[4]; // [sp+8h] [bp-18h]@1 | |
3286 DWORD dwDisposition; // [sp+Ch] [bp-14h]@2 | |
3287 HKEY hKey; // [sp+10h] [bp-10h]@1 | |
3288 HKEY phkResult; // [sp+14h] [bp-Ch]@1 | |
3289 HKEY v7; // [sp+18h] [bp-8h]@1 | |
3290 HKEY v8; // [sp+1Ch] [bp-4h]@1 | |
3291 | |
3292 *(int *)Data = val; | |
3293 lpValueName = pKey; | |
3294 v8 = 0; | |
3295 v7 = 0; | |
3296 hKey = 0; | |
3297 phkResult = 0; | |
3298 if ( !RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE", 0, 0x2001Fu, &hKey) ) | |
3299 { | |
3300 if ( !RegCreateKeyExA(hKey, "New World Computing", 0, "", 0, 0xF003Fu, 0, &phkResult, &dwDisposition) ) | |
3301 { | |
3302 if ( !RegCreateKeyExA(phkResult, "Might and Magic VII", 0, "", 0, 0xF003Fu, 0, &v7, &dwDisposition) ) | |
3303 { | |
3304 if ( !RegCreateKeyExA(v7, "1.0", 0, "", 0, 0xF003Fu, 0, &v8, &dwDisposition) ) | |
3305 { | |
2101 | 3306 RegSetValueExA(v8, lpValueName, 0, 4, Data, 4); |
0 | 3307 RegCloseKey(v8); |
3308 } | |
3309 RegCloseKey(v7); | |
3310 } | |
3311 RegCloseKey(phkResult); | |
3312 } | |
3313 RegCloseKey(hKey); | |
3314 } | |
3315 } | |
3316 | |
3317 //----- (00464E17) -------------------------------------------------------- | |
3318 bool __fastcall CheckMM7CD(char c) | |
3319 { | |
3320 char DstBuf[256]; // [sp+Ch] [bp-218h]@1 | |
3321 char strCommand[256]; // [sp+10Ch] [bp-118h]@1 | |
3322 char Filename[20]; // [sp+20Ch] [bp-18h]@1 | |
3323 | |
3324 | |
3325 wchar_t pMagicPath[1024]; | |
1165
29a8defbad9e
temporary _CRT_SECURE_NO_WARNINGS to remove some warnings
Grumpy7
parents:
1150
diff
changeset
|
3326 swprintf(pMagicPath, wcslen(L"%C:\\anims\\magic7.vid"), L"%C:\\anims\\magic7.vid", c); |
0 | 3327 if (GetFileAttributesW(pMagicPath) == -1) |
3328 return false; | |
3329 | |
3330 wsprintfA(strCommand, "open %c: type cdaudio alias CD", c); | |
3331 if (!mciSendStringA(strCommand, DstBuf, 0xFFu, 0)) | |
3332 { | |
3333 wsprintfA(strCommand, "info CD UPC wait"); | |
3334 mciSendStringA(strCommand, DstBuf, 0xFFu, 0); | |
3335 wsprintfA(strCommand, "close CD"); | |
3336 mciSendStringA(strCommand, DstBuf, 0xFFu, 0); | |
3337 } | |
3338 | |
3339 memcpy(Filename, "X:\\anims\\magic7.vid", sizeof(Filename)); | |
3340 *Filename = c; | |
3341 | |
1980 | 3342 FILE* f = fopen(Filename, "rb"); |
0 | 3343 if (!f) |
3344 return false; | |
3345 | |
3346 if (!fseek(f, 0, SEEK_END)) | |
3347 { | |
3348 if (!fseek(f, -100, SEEK_CUR)) | |
3349 fread(DstBuf, 1u, 0x64u, f); | |
3350 | |
3351 fclose(f); | |
3352 return true; | |
3353 } | |
3354 fclose(f); | |
3355 return false; | |
3356 } | |
3357 | |
3358 //----- (00464F1B) -------------------------------------------------------- | |
3359 signed int __stdcall InsertMM7CDDialogFunc(HWND hDlg, int a2, __int16 a3, int a4) | |
3360 { | |
3361 char v4; // zf@3 | |
3362 int v6; // eax@10 | |
3363 int v7; // eax@11 | |
3364 int v8; // eax@12 | |
3365 int v9; // eax@13 | |
3366 BOOL (__stdcall *v10)(HWND, int, LPCSTR); // edi@15 | |
3367 const CHAR *v11; // [sp-Ch] [bp-Ch]@15 | |
3368 INT_PTR v12; // [sp-4h] [bp-4h]@5 | |
3369 | |
3370 if ( a2 == 272 ) | |
3371 { | |
3372 hInsertCDWindow = hDlg; | |
3373 v6 = (GetUserDefaultLangID() & 0x3FF) - 7; | |
3374 if ( v6 ) | |
3375 { | |
3376 v7 = v6 - 3; | |
3377 if ( v7 ) | |
3378 { | |
3379 v8 = v7 - 2; | |
3380 if ( v8 ) | |
3381 { | |
3382 v9 = v8 - 4; | |
3383 if ( v9 ) | |
3384 { | |
3385 if ( v9 != 5 ) | |
3386 return 0; | |
3387 SetWindowTextA(hDlg, "Wloz CD-ROM numer 2"); | |
3388 v10 = SetDlgItemTextA; | |
3389 SetDlgItemTextA(hDlg, 1010, "Wloz CD-ROM numer 2 Might and Magic® VII."); | |
3390 v11 = "Odwolaj"; | |
3391 } | |
3392 else | |
3393 { | |
3394 SetWindowTextA(hDlg, "Inserire il secondo CD"); | |
3395 v10 = SetDlgItemTextA; | |
3396 SetDlgItemTextA(hDlg, 1010, "Inserire il secondo CD di Might and Magic® VII."); | |
3397 v11 = "Annulla"; | |
3398 } | |
3399 } | |
3400 else | |
3401 { | |
3402 SetWindowTextA(hDlg, "Insérez le CD 2"); | |
3403 v10 = SetDlgItemTextA; | |
3404 SetDlgItemTextA(hDlg, 1010, "Insérez Might & Magic® VII CD 2."); | |
3405 v11 = "Supprimer"; | |
3406 } | |
3407 } | |
3408 else | |
3409 { | |
3410 SetWindowTextA(hDlg, "Por favor, inserte disco 2"); | |
3411 v10 = SetDlgItemTextA; | |
3412 SetDlgItemTextA(hDlg, 1010, "Por favor, inserte disco 2 de Might & Magic® VII."); | |
3413 v11 = "Cancelar"; | |
3414 } | |
3415 } | |
3416 else | |
3417 { | |
3418 SetWindowTextA(hDlg, "Bitte CD 2 einlegen"); | |
3419 v10 = SetDlgItemTextA; | |
3420 SetDlgItemTextA(hDlg, 1010, "Bitte CD 2 von Might and Magic® VII einlegen."); | |
3421 v11 = "Abbrechen"; | |
3422 } | |
3423 v10(hDlg, 2, v11); | |
3424 return 0; | |
3425 } | |
3426 if ( a2 == 273 ) | |
3427 { | |
3428 if ( a3 == 2 ) | |
3429 { | |
3430 v12 = 0; | |
3431 EndDialog(hDlg, v12); | |
3432 return 1; | |
3433 } | |
3434 v4 = a3 == 1; | |
3435 } | |
3436 else | |
3437 { | |
3438 v4 = a2 == 1025; | |
3439 } | |
3440 if ( v4 ) | |
3441 { | |
3442 v12 = 1; | |
1416 | 3443 EndDialog(hDlg, v12); |
3444 return 1; | |
0 | 3445 } |
3446 return 0; | |
3447 } | |
3448 | |
3449 //----- (00465061) -------------------------------------------------------- | |
3450 bool __fastcall FindMM7CD(HWND hWnd, char *pCDDrive) | |
3451 { | |
3452 char drive[4] = {'X', ':', '\\', 0}; | |
3453 | |
3454 bool bGotCDFromRegistry = false; | |
3455 | |
3456 HKEY hSoftware = nullptr, | |
3457 hNWC = nullptr, | |
3458 hMM7 = nullptr, | |
3459 hVersion = nullptr; | |
3460 if (!RegOpenKeyExA(HKEY_LOCAL_MACHINE, "SOFTWARE", 0, 0x2001Fu, &hSoftware)) | |
3461 { | |
3462 if (!RegOpenKeyExA(hSoftware, "New World Computing", 0, 0x2001Fu, &hNWC)) | |
3463 { | |
3464 if (!RegOpenKeyExA(hNWC, "Might and Magic VII", 0, 0x2001Fu, &hMM7)) | |
3465 { | |
3466 if (!RegOpenKeyExA(hMM7, "1.0", 0, 0x2001Fu, &hVersion)) | |
3467 { | |
3468 DWORD cbData = 3; | |
3469 if (!RegQueryValueExA(hVersion, "CDDrive", 0, 0, (BYTE *)drive, &cbData)) | |
3470 bGotCDFromRegistry = true; | |
3471 } | |
3472 RegCloseKey(hVersion); | |
3473 } | |
3474 RegCloseKey(hMM7); | |
3475 } | |
3476 RegCloseKey(hNWC); | |
3477 } | |
3478 RegCloseKey(hSoftware); | |
3479 | |
3480 if (bGotCDFromRegistry) | |
3481 if (CheckMM7CD(*drive)) | |
3482 { | |
3483 cMM7GameCDDriveLetter = *drive; | |
3484 return true; | |
3485 } | |
3486 | |
3487 while (true) | |
3488 { | |
3489 for (uint i = 0; i < 26; ++i) | |
3490 { | |
3491 drive[0] = 'A' + i; | |
3492 | |
3493 if (GetDriveTypeA(drive) == DRIVE_CDROM) | |
3494 if (CheckMM7CD(*drive)) | |
3495 { | |
3496 cMM7GameCDDriveLetter = *drive; | |
3497 WriteWindowsRegistryString("CDDrive", drive); | |
3498 return true; | |
3499 } | |
3500 } | |
3501 | |
1802 | 3502 if (DialogBoxParamA(GetModuleHandleW(nullptr), "InsertCD", hWnd, (DLGPROC)InsertMM7CDDialogFunc, 0)) |
0 | 3503 continue; |
3504 return false; | |
3505 } | |
3506 } | |
3507 | |
1655 | 3508 |
3509 | |
0 | 3510 //----- (004651F4) -------------------------------------------------------- |
1655 | 3511 bool MM7_Initialize(int game_width, int game_height) |
0 | 3512 { |
3513 wchar_t pCurrentDir[1024]; | |
3514 _wgetcwd(pCurrentDir, 1024); | |
3515 | |
3516 wchar_t pMM6IniFile[1024]; | |
293 | 3517 wsprintfW(pMM6IniFile, L"%s\\mm6.ini", pCurrentDir); |
0 | 3518 |
3519 bCanLoadFromCD = GetPrivateProfileIntW(L"settings", L"use_cd", 1, pMM6IniFile); | |
3520 if (bNoCD) | |
3521 bCanLoadFromCD = false; | |
3522 if (bCanLoadFromCD) | |
3523 { | |
2151 | 3524 Log::Warning(L"Checking for CD..."); |
1802 | 3525 if (!FindMM7CD(nullptr, &cMM7GameCDDriveLetter)) |
0 | 3526 return false; |
2151 | 3527 Log::Warning(L"...done."); |
0 | 3528 } |
3529 | |
3530 | |
3531 srand(GetTickCount()); | |
1802 | 3532 |
3533 window = OSWindow::Create(L"Might and Magic® Trilogy", game_width, game_height); | |
0 | 3534 |
3535 pRenderer = Render::Create(); | |
3536 if (!pRenderer) | |
3537 { | |
3538 Log::Warning(L"Render creation failed"); | |
3539 return false; | |
3540 } | |
3541 else | |
3542 { | |
2069 | 3543 //bool bWindowMode = ReadWindowsRegistryInt("startinwindow", false); |
1802 | 3544 //uint uDefaultDevice = ReadWindowsRegistryInt("D3D Device", 1); |
0 | 3545 bool bColoredLights = ReadWindowsRegistryInt("Colored Lights", false); |
3546 uint uLevelOfDetail = ReadWindowsRegistryInt("Detail Level", 1); | |
3547 uint bTinting = ReadWindowsRegistryInt("Tinting", 1) != 0; | |
3548 | |
2069 | 3549 if (!pRenderer->Initialize(window, bColoredLights, uLevelOfDetail, bTinting)) |
0 | 3550 { |
3551 Log::Warning(L"Render failed to initialize"); | |
3552 return false; | |
3553 } | |
3554 } | |
492 | 3555 |
351 | 3556 game_starting_year = 1168; |
0 | 3557 |
3558 pParty = new Party; | |
147 | 3559 memset(&pParty->pHirelings, 0, sizeof(pParty->pHirelings)); |
0 | 3560 pParty->uWalkSpeed = GetPrivateProfileIntW(L"debug", L"walkspeed", 384, pMM6IniFile); |
3561 pParty->uDefaultEyelevel = GetPrivateProfileIntW(L"party", L"eyelevel", 160, pMM6IniFile); | |
3562 pParty->sEyelevel = pParty->uDefaultEyelevel; | |
3563 pParty->uDefaultPartyHeight = GetPrivateProfileIntW(L"party", L"height", 192, pMM6IniFile); | |
3564 pParty->uPartyHeight = pParty->uDefaultPartyHeight; | |
2151 | 3565 |
0 | 3566 MM6_Initialize(pMM6IniFile); |
3567 | |
3568 pKeyActionMap = new KeyboardActionMapping; | |
3569 | |
3570 pEventTimer = Timer::Create(); | |
3571 pEventTimer->Initialize(); | |
3572 | |
3573 OnTimer(1); | |
3574 GameUI_StatusBar_UpdateTimedString(1); | |
3575 pGame = Game::Create(); | |
3576 pMouse = pGame->pMouseInstance; | |
1655 | 3577 |
0 | 3578 |
3579 pIcons_LOD = new LODFile_IconsBitmaps; | |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3580 if (!pIcons_LOD->Load("data\\icons.lod", "icons")) |
0 | 3581 { |
2151 | 3582 MessageBoxW(nullptr, L"Some files are missing\n\nPlease Reinstall.", |
3583 L"Files Missing", MB_ICONEXCLAMATION); | |
0 | 3584 return false; |
3585 } | |
3586 pIcons_LOD->dword_011BA4 = 0; | |
3587 | |
3588 pEvents_LOD = new LODFile_IconsBitmaps; | |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3589 if (!pEvents_LOD->Load("data\\events.lod", "icons")) |
0 | 3590 { |
2151 | 3591 MessageBoxW(nullptr, L"Some files are missing\n\nPlease Reinstall.", |
3592 L"Files Missing", MB_ICONEXCLAMATION); | |
0 | 3593 return false; |
3594 } | |
3595 | |
3596 InitializeGameText(); | |
3597 | |
3598 pBitmaps_LOD = new LODFile_IconsBitmaps; | |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3599 if (!pBitmaps_LOD->Load("data\\bitmaps.lod", "bitmaps")) |
0 | 3600 { |
2151 | 3601 MessageBoxA(nullptr, pGlobalTXT_LocalizationStrings[63], |
3602 pGlobalTXT_LocalizationStrings[184], MB_ICONEXCLAMATION); | |
0 | 3603 return false; |
3604 } | |
3605 | |
3606 pSprites_LOD = new LODFile_Sprites; | |
2151 | 3607 if (!pSprites_LOD->LoadSprites("data\\sprites.lod")) |
0 | 3608 { |
3609 MessageBoxA(nullptr, | |
3610 pGlobalTXT_LocalizationStrings[63], | |
3611 pGlobalTXT_LocalizationStrings[184], MB_ICONEXCLAMATION); | |
3612 return false; | |
3613 } | |
3614 | |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3615 |
1543 | 3616 #if 0 |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3617 if (_access("../MM_VI/data/icons.lod", 0) == 0) |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3618 { |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3619 pIcons_LOD_mm6 = new LODFile_IconsBitmaps; |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3620 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
|
3621 { |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3622 delete pIcons_LOD_mm6; |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3623 pIcons_LOD_mm6 = nullptr; |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3624 Log::Warning(L"Unable to load mm6:icons.lod"); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3625 } |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3626 } |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3627 else |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3628 Log::Warning(L"Unable to find mm6:icons.lod"); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3629 |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3630 if (_access("../MM_VI/data/bitmaps.lod", 0) == 0) |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3631 { |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3632 pBitmaps_LOD_mm6 = new LODFile_IconsBitmaps; |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3633 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
|
3634 { |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3635 delete pBitmaps_LOD_mm6; |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3636 pBitmaps_LOD_mm6 = nullptr; |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3637 Log::Warning(L"Unable to load mm6:bitmaps.lod"); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3638 } |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3639 } |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3640 else |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3641 Log::Warning(L"Unable to find mm6:bitmaps.lod"); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3642 |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3643 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
|
3644 : "../MM_VI/data/sprites.lod"; |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3645 if (_access(mm6_sprite_container_name, 0) == 0) |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3646 { |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3647 pSprites_LOD_mm6 = new LODFile_Sprites; |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3648 if (!pSprites_LOD_mm6->LoadSprites(mm6_sprite_container_name)) |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3649 { |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3650 delete pSprites_LOD_mm6; |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3651 pSprites_LOD_mm6 = nullptr; |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3652 Log::Warning(L"Unable to load mm6:sprites.lod"); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3653 } |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3654 } |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3655 else |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3656 Log::Warning(L"Unable to find mm6:sprites.lod"); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3657 |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3658 |
1541 | 3659 if (_access("../mm8/data/icons.lod", 0) == 0) |
3660 { | |
3661 pIcons_LOD_mm8 = new LODFile_IconsBitmaps; | |
3662 if (!pIcons_LOD_mm8->Load("../mm8/data/icons.lod", "icons")) | |
3663 { | |
3664 delete pIcons_LOD_mm8; | |
3665 pIcons_LOD_mm8 = nullptr; | |
3666 Log::Warning(L"Unable to load mm8:icons.lod"); | |
3667 } | |
0 | 3668 } |
3669 else | |
1541 | 3670 Log::Warning(L"Unable to find mm8:icons.lod"); |
3671 | |
3672 | |
3673 if (_access("../mm8/data/bitmaps.lod", 0) == 0) | |
3674 { | |
3675 pBitmaps_LOD_mm8 = new LODFile_IconsBitmaps; | |
3676 if (!pBitmaps_LOD_mm8->Load("../mm8/data/bitmaps.lod", "bitmaps")) | |
3677 { | |
3678 delete pBitmaps_LOD_mm8; | |
3679 pBitmaps_LOD_mm8 = nullptr; | |
3680 Log::Warning(L"Unable to load mm8:bitmaps.lod"); | |
3681 } | |
3682 } | |
3683 else | |
3684 Log::Warning(L"Unable to find mm8:bitmaps.lod"); | |
3685 | |
3686 | |
3687 if (_access("../mm8/data/sprites.lod", 0) == 0) | |
3688 { | |
3689 pSprites_LOD_mm8 = new LODFile_Sprites; | |
3690 if (!pSprites_LOD_mm8->LoadSprites("../mm8/data/sprites.lod")) | |
3691 { | |
3692 delete pSprites_LOD_mm8; | |
3693 pSprites_LOD_mm8 = nullptr; | |
3694 Log::Warning(L"Unable to load mm8:sprites.lod"); | |
3695 } | |
3696 } | |
3697 else | |
3698 Log::Warning(L"Unable to find mm8:sprites.lod"); | |
1543 | 3699 #endif |
1541 | 3700 |
0 | 3701 { |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3702 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
|
3703 *sft_mm8 = nullptr; |
2151 | 3704 void *sft_mm7 = pEvents_LOD->LoadRaw("dsft.bin", 1); |
0 | 3705 pSpriteFrameTable = new SpriteFrameTable; |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3706 pSpriteFrameTable->FromFile(sft_mm6, sft_mm7, sft_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3707 free(sft_mm6); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3708 free(sft_mm7); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3709 free(sft_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3710 |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3711 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
|
3712 *tft_mm8 = nullptr; |
2151 | 3713 void *tft_mm7 = pEvents_LOD->LoadRaw("dtft.bin", 1); |
0 | 3714 pTextureFrameTable = new TextureFrameTable; |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3715 pTextureFrameTable->FromFile(tft_mm6, tft_mm7, tft_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3716 free(tft_mm6); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3717 free(tft_mm7); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3718 free(tft_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3719 |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3720 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
|
3721 *tiles_mm8 = nullptr; |
2151 | 3722 void *tiles_mm7 = pEvents_LOD->LoadRaw("dtile.bin", 1); |
0 | 3723 pTileTable = new TileTable; |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3724 pTileTable->FromFile(tiles_mm6, tiles_mm7, tiles_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3725 free(tiles_mm6); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3726 free(tiles_mm7); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3727 free(tiles_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3728 |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3729 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
|
3730 *pft_mm8 = nullptr; |
2151 | 3731 void *pft_mm7 = pEvents_LOD->LoadRaw("dpft.bin", 1); |
0 | 3732 pPlayerFrameTable = new PlayerFrameTable; |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3733 pPlayerFrameTable->FromFile(pft_mm6, pft_mm7, pft_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3734 free(pft_mm6); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3735 free(pft_mm7); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3736 free(pft_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3737 |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3738 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
|
3739 *ift_mm8 = nullptr; |
2151 | 3740 void *ift_mm7 = pEvents_LOD->LoadRaw("dift.bin", 1); |
0 | 3741 pIconsFrameTable = new IconFrameTable; |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3742 pIconsFrameTable->FromFile(ift_mm6, ift_mm7, ift_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3743 free(ift_mm6); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3744 free(ift_mm7); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3745 free(ift_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3746 |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3747 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
|
3748 *decs_mm8 = nullptr; |
2151 | 3749 void *decs_mm7 = pEvents_LOD->LoadRaw("ddeclist.bin", 1); |
0 | 3750 pDecorationList = new DecorationList; |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3751 pDecorationList->FromFile(decs_mm6, decs_mm7, decs_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3752 free(decs_mm6); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3753 free(decs_mm7); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3754 free(decs_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3755 |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3756 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
|
3757 *objs_mm8 = nullptr; |
2151 | 3758 void *objs_mm7 = pEvents_LOD->LoadRaw("dobjlist.bin", 1); |
0 | 3759 pObjectList = new ObjectList; |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3760 pObjectList->FromFile(objs_mm6, objs_mm7, objs_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3761 free(objs_mm6); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3762 free(objs_mm7); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3763 free(objs_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3764 |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3765 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
|
3766 *mons_mm8 = nullptr; |
2151 | 3767 void *mons_mm7 = pEvents_LOD->LoadRaw("dmonlist.bin", 1); |
0 | 3768 pMonsterList = new MonsterList; |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3769 pMonsterList->FromFile(mons_mm6, mons_mm7, mons_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3770 free(mons_mm6); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3771 free(mons_mm7); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3772 free(mons_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3773 |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3774 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
|
3775 *chests_mm8 = nullptr; |
2151 | 3776 void *chests_mm7 = pEvents_LOD->LoadRaw("dchest.bin", 1); |
0 | 3777 pChestList = new ChestList; |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3778 pChestList->FromFile(chests_mm6, chests_mm7, chests_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3779 free(chests_mm6); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3780 free(chests_mm7); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3781 free(chests_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3782 |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3783 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
|
3784 *overlays_mm8 = nullptr; |
2151 | 3785 void *overlays_mm7 = pEvents_LOD->LoadRaw("doverlay.bin", 1); |
0 | 3786 pOverlayList = new OverlayList; |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3787 pOverlayList->FromFile(overlays_mm6, overlays_mm7, overlays_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3788 free(overlays_mm6); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3789 free(overlays_mm7); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3790 free(overlays_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3791 |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3792 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
|
3793 *sounds_mm8 = nullptr; |
2151 | 3794 void *sounds_mm7 = pEvents_LOD->LoadRaw("dsounds.bin", 1); |
0 | 3795 pSoundList = new SoundList; |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3796 pSoundList->FromFile(sounds_mm6, sounds_mm7, sounds_mm8); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3797 free(sounds_mm6); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3798 free(sounds_mm7); |
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
3799 free(sounds_mm8); |
0 | 3800 } |
3801 | |
3802 | |
3803 | |
492 | 3804 |
2069 | 3805 if (dword_6BE368_debug_settings_2 & DEBUG_SETTINGS_RUN_IN_WIDOW) |
0 | 3806 { |
2069 | 3807 //window->SetWindowedMode(game_width, game_height); |
3808 pRenderer->SwitchToWindow(); | |
0 | 3809 } |
3810 else | |
3811 { | |
2069 | 3812 __debugbreak(); // Nomad |
3813 window->SetFullscreenMode(); | |
3814 pRenderer->InitializeFullscreen(); | |
0 | 3815 } |
2151 | 3816 |
3817 uSoundVolumeMultiplier = min(9, ReadWindowsRegistryInt("soundflag", 9)); | |
3818 uMusicVolimeMultiplier = min(9, ReadWindowsRegistryInt("musicflag", 9)); | |
3819 uVoicesVolumeMultiplier = min(9, ReadWindowsRegistryInt("CharVoices", 9)); | |
0 | 3820 bShowDamage = ReadWindowsRegistryInt("ShowDamage", 1) != 0; |
2151 | 3821 |
3822 uGammaPos = min(4, ReadWindowsRegistryInt("GammaPos", 4)); | |
0 | 3823 pGame->pGammaController->Initialize(uGammaPos * 0.1 + 0.6); |
3824 | |
3825 if ( ReadWindowsRegistryInt("Bloodsplats", 1) ) | |
591 | 3826 pGame->uFlags2 |= GAME_FLAGS_2_DRAW_BLOODSPLATS; |
0 | 3827 else |
733 | 3828 pGame->uFlags2 &= ~GAME_FLAGS_2_DRAW_BLOODSPLATS; |
0 | 3829 |
3830 uTurnSpeed = ReadWindowsRegistryInt("TurnDelta", 0); | |
3831 | |
3832 if (!bNoSound) | |
1802 | 3833 pAudioPlayer->Initialize(); |
0 | 3834 |
1262 | 3835 pVideoPlayer = new VideoPlayer(); |
1802 | 3836 pVideoPlayer->Initialize(window); |
0 | 3837 |
2061 | 3838 dword_6BE364_game_settings_1 |= GAME_SETTINGS_4000; |
0 | 3839 |
3840 switch ( uTurnSpeed ) | |
3841 { | |
731 | 3842 case 0: // undefined turn option |
1067 | 3843 __debugbreak(); // really shouldn't use this mode |
731 | 3844 uTurnSpeed = (unsigned int)uCPUSpeed < 199 ? 128 : 64; // adjust turn speed to estimated fps |
3845 break; | |
3846 | |
3847 case 1u: // 16x | |
3848 Log::Warning(L"x16 Turn Speed"); // really shouldn't use this mode | |
0 | 3849 uTurnSpeed = 128; |
731 | 3850 break; |
3851 | |
3852 case 2u: // 32x | |
3853 Log::Warning(L"x32 Turn Speed"); // really shouldn't use this mode | |
0 | 3854 uTurnSpeed = 64; |
731 | 3855 break; |
3856 | |
3857 case 3u: // smooth | |
0 | 3858 uTurnSpeed = 0; |
731 | 3859 break; |
3860 } | |
3861 | |
0 | 3862 return true; |
3863 } | |
3864 | |
3865 //----- (00465D0B) -------------------------------------------------------- | |
1802 | 3866 void SecondaryInitialization() |
0 | 3867 { |
2151 | 3868 //__int16 v4; // ax@4 |
3869 //signed int v5; // esi@5 | |
3870 //int v6; // ecx@6 | |
3871 //int v7; // edx@7 | |
3872 //ObjectDesc *v8; // eax@7 | |
3873 //char pContainer[32]; // [sp+10h] [bp-Ch]@9 | |
0 | 3874 |
1802 | 3875 pMouse->Initialize(window); |
0 | 3876 |
3877 pItemsTable = new ItemsTable; | |
3878 pItemsTable->Initialize(); | |
3879 | |
2154 | 3880 //pBitmaps_LOD->can_load_hardware_sprites = 1; |
2069 | 3881 //pBitmaps_LOD->SetupPalettes(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits); |
3882 pBitmaps_LOD->SetupPalettes(5, 6, 5); | |
3883 //pIcons_LOD->SetupPalettes(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits); | |
3884 pIcons_LOD->SetupPalettes(5, 6, 5); | |
3885 //pPaletteManager->SetColorChannelInfo(pRenderer->uTargetRBits, pRenderer->uTargetGBits, pRenderer->uTargetBBits); | |
3886 pPaletteManager->SetColorChannelInfo(5, 6, 5); | |
762 | 3887 |
3888 pPaletteManager->SetMistColor(128, 128, 128); | |
0 | 3889 pPaletteManager->RecalculateAll(); |
2154 | 3890 //pSprites_LOD->can_load_hardware_sprites = 1; |
0 | 3891 pObjectList->InitializeSprites(); |
3892 pOverlayList->InitializeSprites(); | |
3893 if (!bNoSound) | |
3894 pSoundList->Initialize(); | |
3895 | |
3896 | |
3897 for (uint i = 0; i < 4; ++i) | |
3898 { | |
2151 | 3899 static const char *pUIAnimNames[4] = |
3900 { | |
3901 "glow03", "glow05", | |
3902 "torchA", "wizeyeA" | |
3903 }; | |
3904 static unsigned short _4E98D0[4][4] = | |
3905 { | |
3906 {479, 0, 329, 0}, | |
3907 {585, 0, 332, 0}, | |
3908 {468, 0, 0, 0}, | |
3909 {606, 0, 0, 0} | |
3910 }; | |
3911 | |
0 | 3912 pUIAnims[i]->uIconID = pIconsFrameTable->FindIcon(pUIAnimNames[i]); |
3913 pIconsFrameTable->InitializeAnimation(pUIAnims[i]->uIconID); | |
3914 | |
3915 pUIAnims[i]->uAnimLength = 0; | |
3916 pUIAnims[i]->uAnimTime = 0; | |
3917 pUIAnims[i]->x = _4E98D0[i][0]; | |
3918 pUIAnims[i]->y = _4E98D0[i][2]; | |
3919 } | |
3920 | |
2151 | 3921 for (unsigned int i = 0; i < pObjectList->uNumObjects; ++i) |
0 | 3922 { |
2151 | 3923 pObjectList->pObjects[i].uParticleTrailColor = pObjectList->pObjects[i].uParticleTrailColorB | |
3924 ((unsigned int)pObjectList->pObjects[i].uParticleTrailColorG << 8) | | |
3925 ((unsigned int)pObjectList->pObjects[i].uParticleTrailColorR << 16); | |
0 | 3926 } |
2151 | 3927 |
0 | 3928 MainMenuUI_Create(); |
3929 pGame->pStru6Instance->LoadAnimations(); | |
3930 | |
3931 for (uint i = 0; i < 7; ++i) | |
3932 { | |
2151 | 3933 char container_name[64]; |
3934 sprintf(container_name, "HDWTR%03u", i); | |
3935 pRenderer->pHDWaterBitmapIDs[i] = pBitmaps_LOD->LoadTexture(container_name); | |
0 | 3936 } |
3937 | |
3938 pNPCStats = new NPCStats; | |
110 | 3939 memset(pNPCStats->pNPCData, 0, 0x94BCu); |
0 | 3940 pNPCStats->Initialize(); |
3941 | |
3942 Initialize_GlobalEVT(); | |
762 | 3943 pBitmaps_LOD->_inlined_sub0(); |
3944 pSprites_LOD->_inlined_sub0(); | |
0 | 3945 pPaletteManager->LockAll(); |
3946 | |
3947 _mkdir("Saves"); | |
3948 for (uint i = 0; i < 5; ++i) | |
3949 for (uint j = 0; j < 6; ++j) | |
3950 { | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1203
diff
changeset
|
3951 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
|
3952 remove(pTmpBuf.data()); |
0 | 3953 } |
3954 | |
3955 Initialize_GamesLOD_NewLOD(); | |
1051 | 3956 _576E2C_current_minimap_zoom = 512; |
0 | 3957 dword_576E28 = 9; |
3958 } | |
3959 | |
522 | 3960 void IntegrityTest() |
3961 { | |
1869
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
3962 static_assert(sizeof(MovieHeader) == 44, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
3963 static_assert(sizeof(SoundDesc_mm6) == 112, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
3964 static_assert(sizeof(SoundDesc) == 120, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
3965 static_assert(sizeof(OverlayDesc) == 8, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
3966 static_assert(sizeof(ChestDesc) == 36, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
3967 static_assert(sizeof(ObjectDesc_mm6) == 52, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
3968 static_assert(sizeof(ObjectDesc) == 56, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
3969 static_assert(sizeof(DecorationDesc) == 84, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
3970 static_assert(sizeof(IconFrame) == 32, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
3971 static_assert(sizeof(PlayerFrame) == 10, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
3972 static_assert(sizeof(TextureFrame) == 20, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
3973 static_assert(sizeof(SpriteFrame) == 60, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
3974 static_assert(sizeof(RenderVertexSoft) == 0x30, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
3975 static_assert(sizeof(RenderBillboard) == 0x34, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
3976 static_assert(sizeof(Texture) == 0x48, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
3977 static_assert(sizeof(RGBTexture) == 0x28, "Wrong type size"); |
2154 | 3978 //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
|
3979 static_assert(sizeof(AudioPlayer) == 0xC84, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
3980 static_assert(sizeof(SoundDesc) == 0x78, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
3981 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
|
3982 //static_assert(sizeof(VideoPlayer) == 0x108 + 4, "Wrong type size"); |
1869
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
3983 static_assert(sizeof(MovieHeader) == 0x2C, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
3984 static_assert(sizeof(DecorationDesc) == 0x54, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
3985 static_assert(sizeof(ObjectDesc) == 0x38, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
3986 static_assert(sizeof(OverlayDesc) == 0x8, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
3987 static_assert(sizeof(ChestDesc) == 0x24, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
3988 static_assert(sizeof(TileDesc) == 0x1A, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
3989 static_assert(sizeof(MonsterDesc_mm6) == 148, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
3990 static_assert(sizeof(MonsterDesc) == 152, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
3991 static_assert(sizeof(Timer) == 0x28, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
3992 static_assert(sizeof(OtherOverlay) == 0x14, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
3993 static_assert(sizeof(ItemGen) == 0x24, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
3994 static_assert(sizeof(SpriteObject) == 0x70, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
3995 static_assert(sizeof(ItemDesc) == 0x30, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
3996 static_assert(sizeof(ItemsTable) == 0x117A0, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
3997 static_assert(sizeof(Chest) == 0x14CC, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
3998 static_assert(sizeof(MapInfo) == 0x44, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
3999 static_assert(sizeof(SpellInfo) == 0x24, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4000 static_assert(sizeof(SpellData) == 0x14, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4001 static_assert(sizeof(SpellBuff) == 0x10, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4002 static_assert(sizeof(AIDirection) == 0x1C, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4003 static_assert(sizeof(ActorJob) == 0xC, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4004 static_assert(sizeof(Actor) == 0x344, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4005 static_assert(sizeof(LevelDecoration) == 0x20, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4006 static_assert(sizeof(KeyboardActionMapping) == 0x20C, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4007 static_assert(sizeof(UIAnimation) == 0xD, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4008 static_assert(sizeof(SpawnPointMM7) == 0x18, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4009 static_assert(sizeof(ODMFace) == 0x134, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4010 static_assert(sizeof(BSPNode) == 0x8, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4011 static_assert(sizeof(BSPModel) == 0xBC, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4012 static_assert(sizeof(OutdoorLocation) == 0x1C28C, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4013 static_assert(sizeof(BLVFace) == 0x60, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4014 static_assert(sizeof(BLVFaceExtra) == 0x24, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4015 static_assert(sizeof(BLVSector) == 0x74, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4016 static_assert(sizeof(BLVLightMM7) == 0x10, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4017 static_assert(sizeof(BLVDoor) == 0x50, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4018 static_assert(sizeof(IndoorLocation) == 0x690, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4019 //static_assert(sizeof(ODMRenderParams) == 0x74, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4020 static_assert(sizeof(Mouse) == 0x114, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4021 static_assert(sizeof(Particle_sw) == 0x68, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4022 static_assert(sizeof(Particle) == 0x68, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4023 static_assert(sizeof(ParticleEngine) == 0xE430, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4024 static_assert(sizeof(Lightmap) == 0xC1C, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4025 static_assert(sizeof(LightmapBuilder) == 0x3CBC38, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4026 static_assert(sizeof(Vis_SelectionList) == 0x2008, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4027 static_assert(sizeof(Vis) == 0x20D0, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4028 static_assert(sizeof(PlayerBuffAnim) == 0x10, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4029 static_assert(sizeof(ProjectileAnim) == 0x1C, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4030 static_assert(sizeof(stru6) == 0x5F8, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4031 static_assert(sizeof(IndoorCameraD3D_Vec3) == 0x10, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4032 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
|
4033 //static_assert(sizeof(IndoorCameraD3D) == 0x1A1384, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4034 static_assert(sizeof(StationaryLight) == 0xC, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4035 static_assert(sizeof(LightsStack_StationaryLight_) == 0x12C8, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4036 static_assert(sizeof(MobileLight) == 0x12, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4037 static_assert(sizeof(LightsStack_MobileLight_) == 0x1C28, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4038 static_assert(sizeof(Game) == 0xE78, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4039 static_assert(sizeof(stru141_actor_collision_object) == 0xA8, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4040 static_assert(sizeof(ActionQueue) == 0x7C, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4041 static_assert(sizeof(NPCData) == 0x4C, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4042 static_assert(sizeof(NPCStats) == 0x17FFC, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4043 static_assert(sizeof(BspRenderer) == 0x53740, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4044 static_assert(sizeof(PaletteManager) == 0x267AF0, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4045 static_assert(sizeof(ViewingParams) == 0x26C, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4046 //static_assert(sizeof(IndoorCamera) == 0x50, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4047 static_assert(sizeof(Bloodsplat) == 0x28, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4048 static_assert(sizeof(BloodsplatContainer) == 0xA0C, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4049 static_assert(sizeof(TrailParticle) == 0x18, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4050 static_assert(sizeof(EventIndex) == 0xC, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4051 static_assert(sizeof(_2devent) == 0x34, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4052 static_assert(sizeof(stru176) == 0x20, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4053 static_assert(sizeof(SavegameHeader) == 0x64, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4054 static_assert(sizeof(SavegameList) == 0x3138, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4055 static_assert(sizeof(StorylineText) == 0x160, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4056 static_assert(sizeof(FactionTable) == 0x1EF1, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4057 static_assert(sizeof(Decal) == 0xC20, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4058 static_assert(sizeof(DecalBuilder) == 0x30C038, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4059 static_assert(sizeof(MonsterInfo) == 0x58, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4060 static_assert(sizeof(MonsterStats) == 0x5BA0, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4061 static_assert(sizeof(RenderD3D) == 0x148, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4062 // static_assert(sizeof(Render) == 0x129844, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4063 static_assert(sizeof(Player) == 0x1B3C, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4064 static_assert(sizeof(PartyTimeStruct) == 0x678, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4065 static_assert(sizeof(Party) == 0x16238, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4066 static_assert(sizeof(GUIButton) == 0xBC, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4067 static_assert(sizeof(GUIWindow) == 0x54, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4068 static_assert(sizeof(GUIProgressBar) == 0x1B8, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4069 static_assert(sizeof(GUIFont) == 0x1020, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4070 // static_assert(sizeof(stru262_TurnBased) == 0x40, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4071 static_assert(sizeof(ArcomageGame) == 0xFB, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4072 static_assert(sizeof(CastSpellInfo) == 0x14, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4073 static_assert(sizeof(ArcomageCard) == 0x6C, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4074 static_assert(sizeof(stru320) == 0x3FC, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4075 static_assert(sizeof(TravelInfo) == 0x20, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4076 static_assert(sizeof(stru336) == 0x798, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4077 static_assert(sizeof(Vec3_short_) == 6, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4078 static_assert(sizeof(BLVFace) == 96, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4079 static_assert(sizeof(BLVFaceExtra) == 36, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4080 static_assert(sizeof(BLVSector) == 116, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4081 static_assert(sizeof(LevelDecoration) == 32, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4082 static_assert(sizeof(BLVLightMM7) == 16, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4083 static_assert(sizeof(BSPNode) == 8, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4084 static_assert(sizeof(SpawnPointMM7) == 24, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4085 static_assert(sizeof(DDM_DLV_Header) == 40, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4086 static_assert(sizeof(Actor) == 836, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4087 static_assert(sizeof(SpriteObject) == 112, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4088 static_assert(sizeof(Chest) == 5324, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4089 static_assert(sizeof(stru123) == 0xC8, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4090 static_assert(sizeof(BLVMapOutline) == 12, "Wrong type size"); |
bc7a6ee34316
IntegrityTest size tests changed to static_asserts
Grumpy7
parents:
1861
diff
changeset
|
4091 static_assert(sizeof(LODSprite) == 0x28, "Wrong type size"); |
522 | 4092 } |
4093 | |
168 | 4094 bool new_sky = false; |
1765 | 4095 bool new_draw_object_dist = true; |
2128 | 4096 bool change_seasons = false; |
894 | 4097 bool all_magic = true; |
1511 | 4098 bool wizard_eye = false; |
1837 | 4099 bool debug_information = false; |
4100 bool show_picked_face = false; | |
1507 | 4101 bool draw_debug_line = false; |
2173 | 4102 bool new_speed = true; |
2043
2ccf638342d6
int max_flight_height and GetCeilingHeight function
Ritor1
parents:
2042
diff
changeset
|
4103 int max_flight_height = 4000; |
2034 | 4104 |
2037
7a9477135943
Renamed Math.h -> OurMath.h (file resolution was sometimes ambiguous)
Nomad
parents:
2035
diff
changeset
|
4105 |
7a9477135943
Renamed Math.h -> OurMath.h (file resolution was sometimes ambiguous)
Nomad
parents:
2035
diff
changeset
|
4106 |
7a9477135943
Renamed Math.h -> OurMath.h (file resolution was sometimes ambiguous)
Nomad
parents:
2035
diff
changeset
|
4107 |
0 | 4108 //----- (00462C94) -------------------------------------------------------- |
4109 bool MM_Main(const wchar_t *pCmdLine) | |
4110 { | |
522 | 4111 IntegrityTest(); |
1706 | 4112 |
246 | 4113 char test[1024]; |
522 | 4114 sprintfex(test, "^Pi[%s]: çíàõàð^R[ü;êà;]", "Çîëòàí"); |
4115 | |
2052 | 4116 lua = new LuaVM; |
4117 lua->Initialize(); | |
2031 | 4118 |
1052 | 4119 bool bNoMargareth = false; |
0 | 4120 if (pCmdLine && *pCmdLine) |
4121 { | |
2061 | 4122 //if (wcsstr(pCmdLine, L"-usedefs")) |
4123 // bDebugResouces = 1; | |
0 | 4124 if (wcsstr(pCmdLine, L"-window")) |
2061 | 4125 dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_RUN_IN_WIDOW; |
0 | 4126 |
4127 if (wcsstr(pCmdLine, L"-nointro")) | |
4128 bNoIntro = true;//dword_6BE364_game_settings_1 |= 4; | |
4129 if (wcsstr(pCmdLine, L"-nologo")) | |
4130 bNoLogo = true;//dword_6BE364_game_settings_1 |= 8; | |
4131 if (wcsstr(pCmdLine, L"-nosound")) | |
4132 bNoSound = true; //dword_6BE364_game_settings_1 |= 0x10; | |
4133 | |
4134 bWalkSound = ReadWindowsRegistryInt("WalkSound", 1) != 0; | |
4135 if (wcsstr(pCmdLine, L"-nowalksound")) | |
4136 bWalkSound = false;//dword_6BE364_game_settings_1 |= 0x20; | |
256 | 4137 if (wcsstr(pCmdLine, L"-novideo")) |
0 | 4138 { |
2061 | 4139 dword_6BE364_game_settings_1 |= GAME_SETTINGS_NO_HOUSE_ANIM; |
0 | 4140 bNoVideo = true; |
4141 } | |
4142 if (wcsstr(pCmdLine, L"-nocd")) | |
4143 bNoCD = true; | |
168 | 4144 if (wcsstr(pCmdLine, L"-new_sky")) |
4145 new_sky = true; | |
1052 | 4146 if (wcsstr(pCmdLine, L"-nomarg")) |
4147 bNoMargareth = true; | |
0 | 4148 } |
4149 | |
731 | 4150 /*v8 = _4AC1C9_get_cpu_speed(0, (Vec4_int_ *)a2); |
0 | 4151 Rect.left = *(int *)v8; |
4152 Rect.top = *(int *)(v8 + 4); | |
4153 Rect.right = *(int *)(v8 + 8); | |
4154 Rect.bottom = *(int *)(v8 + 12); | |
731 | 4155 uCPUSpeed = Rect.bottom;*/ |
4156 uCPUSpeed = 2048; // about 2GHz | |
4 | 4157 |
2191 | 4158 constructors(); |
4 | 4159 |
2215
e9625ad08541
fog fix and change 640,480 - window->GetWidth(), window->GetHeight()
Ritor1
parents:
2212
diff
changeset
|
4160 if (!MM7_Initialize(640, 480))//çàäà¸òñÿ ðàçìåð îêíà |
734 | 4161 { |
4162 Log::Warning(L"MM init: failed"); | |
4163 pGame->Deinitialize(); | |
4164 return 1; | |
4165 } | |
0 | 4166 |
2216 | 4167 pEventTimer->Pause(); |
4168 | |
4169 SetUserInterface(PartyAlignment_Neutral, false); | |
4170 ShowIntroVideo_and_LoadingScreen(); | |
4171 WriteWindowsRegistryInt("Ran once", 1); | |
4172 dword_6BE364_game_settings_1 |= GAME_SETTINGS_4000; | |
4173 pGame->InitializeGammaController(); | |
4174 SecondaryInitialization(); | |
4175 pRenderer->SetRasterClipRect(0, 0, window->GetWidth() - 1, window->GetHeight() - 1); | |
4176 FinalInitialization(); | |
4177 Log::Warning(L"MM: entering main loop"); | |
4178 while ( 1 ) | |
4179 { | |
4180 MainMenuWindow* main_menu_window = MainMenuWindow::Create(); | |
4181 window->AddControl(main_menu_window); | |
4182 MainMenu_Loop(); | |
4183 uGameState = GAME_STATE_PLAYING; | |
0 | 4184 while ( 1 ) |
4185 { | |
2216 | 4186 if (uGameState == GAME_FINISHED || GetCurrentMenuID() == MENU_EXIT_GAME) |
4187 { | |
4188 pGame->Deinitialize(); | |
4189 return true; | |
4190 } | |
4191 | |
4192 if (GetCurrentMenuID() == MENU_NEWGAME) | |
0 | 4193 { |
2216 | 4194 if ( pAudioPlayer->hAILRedbook ) |
4195 AIL_redbook_stop(pAudioPlayer->hAILRedbook); | |
4196 pParty->Reset(); | |
4197 pOtherOverlayList->Reset(); | |
4198 strcpy(pCurrentMapName, pStartingMapName); | |
4199 pParty->CreateDefaultParty(0); | |
4200 PlayerCreationUI_Initialize(); | |
4201 if ( PlayerCreationUI_Loop() ) | |
982 | 4202 { |
0 | 4203 DeleteCCharFont(); |
2216 | 4204 break; |
2 | 4205 } |
2216 | 4206 DeleteCCharFont(); |
4207 bFlashQuestBook = true; | |
4208 PlayFullscreenMovie(MOVIE_Emerald); | |
4209 //pGame->pCShow->PlayMovie(MOVIE_Emerald, 0); | |
4210 SaveNewGame(); | |
4211 if (bNoMargareth) | |
4212 _449B7E_toggle_bit(pParty->_quest_bits, PARTY_QUEST_EMERALD_MARGARETH_OFF, 1); | |
4213 pGame->Loop(); | |
4214 if (uGameState == GAME_STATE_NEWGAME_OUT_GAMEMENU) | |
101 | 4215 { |
4216 SetCurrentMenuID(MENU_NEWGAME); | |
982 | 4217 uGameState = GAME_STATE_PLAYING; |
0 | 4218 continue; |
101 | 4219 } |
2216 | 4220 else if (uGameState == GAME_STATE_GAME_QUITTING_TO_MAIN_MENU) |
4221 break; | |
4222 assert(false && "Invalid game state"); | |
4223 } | |
4224 if (GetCurrentMenuID() == MENU_CREDITS) | |
4225 { | |
4226 if ( pAudioPlayer->hAILRedbook ) | |
4227 AIL_redbook_stop(pAudioPlayer->hAILRedbook); | |
4228 MainMenuUI_Credits_Loop(); | |
4229 break; | |
4230 } | |
4231 if (GetCurrentMenuID() == MENU_5 || GetCurrentMenuID() == MENU_LoadingProcInMainMenu) | |
4232 { | |
4233 uGameState = GAME_STATE_PLAYING; | |
4234 pGame->Loop(); | |
4235 } | |
4236 else | |
4237 { | |
4238 if (GetCurrentMenuID() == MENU_DebugBLVLevel) | |
907 | 4239 { |
2216 | 4240 pMouse->ChangeActivation(0); |
4241 pParty->Reset(); | |
4242 pParty->CreateDefaultParty(1); | |
4243 | |
4244 __debugbreak(); | |
4245 /*extern void CreateDefaultBLVLevel(); | |
4246 CreateDefaultBLVLevel(); | |
4247 | |
4248 OPENFILENAMEA ofn; | |
4249 if ( !GetOpenFileNameA((LPOPENFILENAMEA)&ofn) ) | |
4250 { | |
4251 pMouse->ChangeActivation(1); | |
4252 break; | |
4253 } | |
4254 _chdir("..\\"); | |
4255 strcpy(pCurrentMapName, ofn.lpstrFileTitle);*/ | |
4256 pMouse->ChangeActivation(1); | |
4257 pGame->Loop(); | |
907 | 4258 } |
0 | 4259 } |
2216 | 4260 if ( uGameState == GAME_STATE_LOADING_GAME ) |
4261 { | |
4262 SetCurrentMenuID(MENU_5); | |
4263 uGameState = GAME_STATE_PLAYING; | |
4264 continue; | |
4265 } | |
4266 if ( uGameState == GAME_STATE_NEWGAME_OUT_GAMEMENU ) | |
0 | 4267 { |
2216 | 4268 SetCurrentMenuID(MENU_NEWGAME); |
4269 uGameState = GAME_STATE_PLAYING; | |
4270 continue; | |
4271 } | |
4272 if ( uGameState == GAME_STATE_GAME_QUITTING_TO_MAIN_MENU)// from the loaded game | |
4273 { | |
4274 pAudioPlayer->StopChannels(-1, -1); | |
4275 uGameState = GAME_STATE_PLAYING; | |
4276 break; | |
0 | 4277 } |
4278 } | |
2216 | 4279 if (!bNoSound && pAudioPlayer->hAILRedbook) |
4280 { | |
4281 pAudioPlayer->SetMusicVolume(pSoundVolumeLevels[uMusicVolimeMultiplier] * 64.0f); | |
4282 AIL_redbook_stop(pAudioPlayer->hAILRedbook); | |
4283 unsigned int startms, end_ms; | |
4284 AIL_redbook_track_info(pAudioPlayer->hAILRedbook, 14, &startms, &end_ms); | |
4285 AIL_redbook_play(pAudioPlayer->hAILRedbook, startms + 1, end_ms); | |
4286 } | |
4287 } | |
2050 | 4288 //lua_close(L); |
0 | 4289 pGame->Deinitialize(); |
734 | 4290 return 1; |
0 | 4291 } |
4292 | |
4293 //----- (004637E0) -------------------------------------------------------- | |
1458 | 4294 char sub_4637E0_is_there_popup_onscreen() |
0 | 4295 { |
4296 return dword_507BF0_is_there_popup_onscreen == 1; | |
4297 } | |
4298 // 507BF0: using guessed type int dword_507BF0_is_there_popup_onscreen; | |
4299 | |
4300 //----- (00466082) -------------------------------------------------------- | |
4301 void MM6_Initialize(const wchar_t *pIniFilename) | |
4302 { | |
4303 //int v0; // eax@1 | |
2151 | 4304 //UINT v1; // eax@18 |
0 | 4305 size_t v2; // eax@31 |
4306 size_t v3; // ebx@32 | |
4307 size_t v4; // edi@36 | |
4308 //char v5[120]; // [sp+Ch] [bp-17Ch]@1 | |
4309 //char String[120]; // [sp+84h] [bp-104h]@32 | |
4310 char pDefaultGroundTexture[16]; // [sp+FCh] [bp-8Ch]@32 | |
4311 //char pIniFilename[120]; // [sp+10Ch] [bp-7Ch]@1 | |
4312 unsigned int v9; // [sp+184h] [bp-4h]@28 | |
4313 | |
4314 //_getcwd(v5, 120); | |
4315 //sprintfex(pIniFilename, "%s\\mm6.ini", v5); | |
4316 viewparams = new ViewingParams; | |
819 | 4317 game_viewport_x = viewparams->uScreen_topL_X = GetPrivateProfileIntW(L"screen", L"vx1", 8, pIniFilename); |
4318 game_viewport_y = viewparams->uScreen_topL_Y = GetPrivateProfileIntW(L"screen", L"vy1", 8, pIniFilename); | |
4319 game_viewport_z = viewparams->uScreen_BttmR_X = GetPrivateProfileIntW(L"screen", L"vx2", 468, pIniFilename); | |
4320 game_viewport_w = viewparams->uScreen_BttmR_Y = GetPrivateProfileIntW(L"screen", L"vy2", 351, pIniFilename); | |
4321 game_viewport_width = game_viewport_z - game_viewport_x; | |
4322 game_viewport_height = game_viewport_w - game_viewport_y + 1; | |
0 | 4323 |
4324 | |
4325 pAudioPlayer = new AudioPlayer; | |
4326 pAudioPlayer->uMixerChannels = GetPrivateProfileIntW(L"settings", L"mixerchannels", 16, pIniFilename); | |
4327 if ( pAudioPlayer->uMixerChannels > 16 ) | |
4328 pAudioPlayer->uMixerChannels = 16; | |
4329 | |
4330 | |
4331 if (GetPrivateProfileIntW(L"debug", L"nomonster", 0, pIniFilename)) | |
2061 | 4332 dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_NO_ACTORS; |
2151 | 4333 if (ReadWindowsRegistryInt("startinwindow", 0)) |
2061 | 4334 dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_RUN_IN_WIDOW; |
0 | 4335 if (GetPrivateProfileIntW(L"debug", L"showFR", 0, pIniFilename)) |
2061 | 4336 dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_0002_SHOW_FR; |
0 | 4337 if (GetPrivateProfileIntW(L"debug", L"nodamage", 0, pIniFilename)) |
2061 | 4338 dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_NO_DAMAGE; |
0 | 4339 if (GetPrivateProfileIntW(L"debug", L"nodecoration", 0, pIniFilename)) |
2061 | 4340 dword_6BE368_debug_settings_2 |= DEBUG_SETTINGS_NO_DECORATIONS; |
0 | 4341 |
4342 wchar_t pStartingMapNameW[1024]; | |
4343 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
|
4344 sprintf(pStartingMapName, "%S", pStartingMapNameW); |
0 | 4345 |
4346 v9 = 0; | |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
4347 if ( strlen(pStartingMapName) ) |
0 | 4348 { |
4349 do | |
4350 { | |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
4351 if ( pStartingMapName[v9] == ' ' ) |
0 | 4352 pStartingMapName[v9] = 0; |
4353 ++v9; | |
1477
7ef4b64f6329
* LODFile::LoadBitmaps & LODFile::LoadIconsOrEvents are merged into LODFile::Load
Nomad
parents:
1467
diff
changeset
|
4354 v2 = strlen(pStartingMapName); |
0 | 4355 } |
4356 while ( v9 < v2 ); | |
4357 } | |
4358 | |
1637 | 4359 pODMRenderParams = new ODMRenderParams; |
4360 pODMRenderParams->outdoor_no_mist = GetPrivateProfileIntW(L"debug", L"noMist", 0, pIniFilename); | |
4361 pODMRenderParams->bNoSky = GetPrivateProfileIntW(L"outdoor", L"nosky", 0, pIniFilename); | |
4362 pODMRenderParams->bDoNotRenderDecorations = GetPrivateProfileIntW(L"render", L"nodecorations", 0, pIniFilename); | |
4363 pODMRenderParams->outdoor_no_wavy_water = GetPrivateProfileIntW(L"outdoor", L"nowavywater", 0, pIniFilename); | |
0 | 4364 outdoor_grid_band_1 = GetPrivateProfileIntW(L"outdoor", L"gridband1", 10, pIniFilename); |
4365 outdoor_grid_band_2 = GetPrivateProfileIntW(L"outdoor", L"gridband2", 15, pIniFilename); | |
4366 outdoor_grid_band_3 = GetPrivateProfileIntW(L"outdoor", L"gridband3", 25, pIniFilename); | |
1637 | 4367 pODMRenderParams->terrain_gamma = GetPrivateProfileIntW(L"outdoor", L"ter_gamma", 0, pIniFilename); |
4368 pODMRenderParams->building_gamme = GetPrivateProfileIntW(L"outdoor", L"bld_gamma", 0, pIniFilename); | |
4369 pODMRenderParams->shading_dist_shade = GetPrivateProfileIntW(L"shading", L"dist_shade", 2048, pIniFilename); | |
4370 pODMRenderParams->shading_dist_shademist = GetPrivateProfileIntW(L"shading", L"dist_shademist", 4096, pIniFilename); | |
1765 | 4371 |
4372 int dist = 0x2000; | |
4373 extern bool new_draw_object_dist; | |
4374 if ( new_draw_object_dist ) | |
4375 dist = 0x6000; | |
4376 pODMRenderParams->shading_dist_mist = GetPrivateProfileIntW(L"shading", L"dist_mist", dist, pIniFilename); | |
0 | 4377 |
4378 wchar_t pDefaultSkyTextureW[1024]; | |
4379 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
|
4380 sprintf(pDefaultSkyTexture.data(), "%S", pDefaultSkyTextureW); |
0 | 4381 |
4382 wchar_t pDefaultGroundTextureW[1024]; | |
4383 GetPrivateProfileStringW(L"textures", L"default", L"dirt", pDefaultGroundTextureW, 0x10u, pIniFilename); | |
4384 sprintf(pDefaultGroundTexture, "%S", pDefaultGroundTextureW); | |
4385 | |
4386 wchar_t pFloat[1024]; | |
4387 GetPrivateProfileStringW(L"debug", L"recmod1", L"1.0", pFloat, 0x10u, pIniFilename); | |
4388 swscanf(pFloat, L"%f", &flt_6BE3A4_debug_recmod1); | |
4389 | |
4390 GetPrivateProfileStringW(L"debug", L"recmod2", L"1.0", pFloat, 0x10u, pIniFilename); | |
4391 swscanf(pFloat, L"%f", &flt_6BE3A8_debug_recmod2); | |
4392 | |
4393 flt_6BE3AC_debug_recmod1_x_1_6 = flt_6BE3A4_debug_recmod1 * 1.666666666666667; | |
4394 | |
4395 v3 = 0; | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1203
diff
changeset
|
4396 if ( strlen(pDefaultSkyTexture.data()) ) |
0 | 4397 { |
4398 do | |
4399 { | |
4400 if ( pDefaultSkyTexture[v3] == ' ' ) | |
4401 pDefaultSkyTexture[v3] = 0; | |
4402 ++v3; | |
4403 } | |
1205
8c02e6f74b29
arrays to std::arrays phase 2 - mm7_data.h converted
Grumpy7
parents:
1203
diff
changeset
|
4404 while ( v3 < strlen(pDefaultSkyTexture.data()) ); |
0 | 4405 } |
4406 v4 = 0; | |
4407 if ( strlen(pDefaultGroundTexture) ) | |
4408 { | |
4409 do | |
4410 { | |
4411 if ( pDefaultGroundTexture[v4] == ' ' ) | |
4412 pDefaultGroundTexture[v4] = 0; | |
4413 ++v4; | |
4414 } | |
4415 while ( v4 < strlen(pDefaultGroundTexture) ); | |
4416 } | |
4417 | |
4418 MM7Initialization(); | |
4419 } | |
4420 | |
4421 //----- (004666D5) -------------------------------------------------------- | |
2151 | 4422 void MM7Initialization() |
0 | 4423 { |
4424 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor ) | |
4425 { | |
2151 | 4426 /*if (byte_6BE388_graphicsmode == 0) |
0 | 4427 { |
4428 outdoor_grid_band_1 = 10; | |
4429 outdoor_grid_band_2 = 15; | |
4430 outdoor_grid_band_3 = 20; | |
1637 | 4431 pODMRenderParams->shading_dist_mist = 8192; |
4432 pODMRenderParams->bNoSky = false; | |
0 | 4433 LOBYTE(viewparams->field_20) = 0; |
2151 | 4434 }*/ |
1637 | 4435 pODMRenderParams->shading_dist_shade = 2048; |
4436 pODMRenderParams->terrain_gamma = 0; | |
4437 pODMRenderParams->building_gamme = 0; | |
4438 pODMRenderParams->shading_dist_shademist = 4096; | |
4439 pODMRenderParams->outdoor_no_wavy_water = 0; | |
1410
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1409
diff
changeset
|
4440 //_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
|
4441 { |
1637 | 4442 pODMRenderParams->outdoor_grid_band_3 = outdoor_grid_band_3; |
4443 pODMRenderParams->uPickDepth = outdoor_grid_band_3 * 512; | |
1410
38df78aba732
deleted stru220.h and stru220 (bezier terrain stuff)
Nomad
parents:
1409
diff
changeset
|
4444 } |
0 | 4445 } |
4446 else | |
4447 LOBYTE(viewparams->field_20) = 0; | |
2101 | 4448 pParty->uFlags |= 2; |
692 | 4449 viewparams->uSomeY = viewparams->uScreen_topL_Y; |
4450 viewparams->uSomeX = viewparams->uScreen_topL_X; | |
4451 viewparams->uSomeZ = viewparams->uScreen_BttmR_X; | |
4452 viewparams->uSomeW = viewparams->uScreen_BttmR_Y; | |
4453 | |
4454 pViewport->SetScreen(viewparams->uScreen_topL_X, viewparams->uScreen_topL_Y, viewparams->uScreen_BttmR_X, viewparams->uScreen_BttmR_Y); | |
0 | 4455 if ( uCurrentlyLoadedLevelType == LEVEL_Outdoor ) |
1637 | 4456 pODMRenderParams->Initialize(); |
0 | 4457 } |
4458 | |
4459 //----- (00466C40) -------------------------------------------------------- | |
4460 const wchar_t *MENU_STATE_to_string(MENU_STATE m) | |
4461 { | |
4462 switch (m) | |
4463 { | |
982 | 4464 case -1: return L"-1"; |
4465 case MENU_MAIN: return L"MENU_MAIN"; | |
4466 case MENU_NEWGAME: return L"MENU_NEWGAME"; | |
4467 case MENU_CREDITS: return L"MENU_CREDITS"; | |
4468 case MENU_SAVELOAD: return L"MENU_SAVELOAD"; | |
4469 case MENU_EXIT_GAME: return L"MENU_EXIT_GAME"; | |
4470 case MENU_5: return L"MENU_5"; | |
4471 case MENU_CREATEPARTY: return L"MENU_CREATEPARTY"; | |
165 | 4472 case MENU_NAMEPANELESC: return L"MENU_NAMEPANELESC"; |
982 | 4473 case MENU_CREDITSPROC: return L"MENU_CREDITSPROC"; |
961 | 4474 case MENU_LoadingProcInMainMenu: return L"MENU_LoadingProcInMainMenu"; |
1458 | 4475 case MENU_DebugBLVLevel: return L"MENU_DebugBLVLevel"; |
165 | 4476 case MENU_CREDITSCLOSE: return L"MENU_CREDITSCLOSE"; |
982 | 4477 default: return L"unk"; |
0 | 4478 }; |
4479 }; | |
4480 void SetCurrentMenuID(MENU_STATE uMenu) | |
4481 { | |
2006 | 4482 sCurrentMenuID = uMenu; |
0 | 4483 |
4484 Log::Warning(L"CurrentMenu = %s", MENU_STATE_to_string(uMenu)); | |
4485 } | |
4486 | |
4487 //----- (00466CA0) -------------------------------------------------------- | |
4488 MENU_STATE GetCurrentMenuID() | |
4489 { | |
2006 | 4490 return sCurrentMenuID; |
0 | 4491 } |
4492 | |
4493 | |
4494 //----- (0046BDA8) -------------------------------------------------------- | |
1458 | 4495 unsigned int GetGravityStrength() |
0 | 4496 { |
4497 int v0; // eax@1 | |
4498 | |
4499 v0 = ~LOBYTE(pGame->uFlags2) & 8; | |
4500 LOBYTE(v0) = v0 | 2; | |
4501 return (unsigned int)v0 >> 1; | |
4502 } | |
4503 | |
4504 //----- (0046BDC0) -------------------------------------------------------- | |
1458 | 4505 void UpdateUserInput_and_MapSpecificStuff() |
0 | 4506 { |
2061 | 4507 if (dword_6BE364_game_settings_1 & GAME_SETTINGS_0080_SKIP_USER_INPUT_THIS_FRAME) |
0 | 4508 { |
2061 | 4509 dword_6BE364_game_settings_1 &= ~GAME_SETTINGS_0080_SKIP_USER_INPUT_THIS_FRAME; |
4510 return; | |
0 | 4511 } |
2061 | 4512 |
630 | 4513 if (uCurrentlyLoadedLevelType == LEVEL_Indoor) |
0 | 4514 BLV_UpdateUserInputAndOther(); |
630 | 4515 else if (uCurrentlyLoadedLevelType == LEVEL_Outdoor) |
0 | 4516 ODM_UpdateUserInputAndOther(); |
630 | 4517 |
783 | 4518 area_of_effect__damage_evaluate(); |
0 | 4519 } |
4520 | |
4521 //----- (0046BFFA) -------------------------------------------------------- | |
4522 bool __fastcall _46BFFA_check_object_intercept(unsigned int uLayingItemID, signed int a2) | |
4523 { | |
2101 | 4524 ObjectDesc *object; // ebx@1 |
0 | 4525 unsigned int v8; // eax@19 |
4526 signed int v10; // ebx@19 | |
4527 char *v11; // edx@20 | |
4528 unsigned __int16 v12; // ax@23 | |
4529 int v13; // eax@27 | |
4530 unsigned int v14; // ebx@33 | |
4531 int v16; // eax@36 | |
4532 unsigned int v17; // eax@37 | |
4533 __int16 v18; // di@37 | |
4534 signed int v19; // edx@37 | |
4535 unsigned __int8 v20; // sf@37 | |
4536 char *v21; // ecx@38 | |
4537 unsigned __int16 v22; // ax@41 | |
4538 unsigned int v23; // eax@46 | |
4539 signed int v24; // ebx@46 | |
4540 char *v25; // edx@47 | |
4541 int v26; // edx@54 | |
4542 int v27; // edx@55 | |
4543 int v28; // edx@56 | |
4544 int v29; // edx@57 | |
4545 unsigned __int16 v30; // ax@60 | |
4546 unsigned int v31; // ecx@60 | |
4547 int v32; // edi@60 | |
4548 unsigned int v33; // eax@65 | |
4549 signed int v34; // edx@65 | |
4550 char *v35; // ecx@66 | |
4551 unsigned __int16 v36; // ax@69 | |
4552 int v37; // ST14_4@72 | |
4553 int v38; // eax@72 | |
4554 int v39; // ST10_4@72 | |
4555 int v40; // ST0C_4@72 | |
4556 int v41; // edx@76 | |
4557 int v42; // edx@77 | |
4558 int v43; // edx@78 | |
4559 unsigned __int8 v44; // zf@79 | |
4560 int v45; // edx@79 | |
4561 unsigned __int16 v46; // ax@80 | |
4562 int v47; // eax@81 | |
4563 int v48; // edx@87 | |
4564 int v49; // edx@88 | |
4565 int v50; // edx@89 | |
4566 signed int v52; // ebx@93 | |
4567 char *v53; // edx@94 | |
4568 unsigned __int16 v54; // ax@98 | |
4569 unsigned int v55; // ecx@98 | |
4570 signed int v56; // ebx@98 | |
4571 char *v57; // edx@99 | |
4572 unsigned __int16 v58; // ax@102 | |
4573 unsigned __int16 v59; // ax@107 | |
4574 unsigned int v60; // ecx@107 | |
4575 signed int v61; // ebx@107 | |
4576 char *v62; // edx@108 | |
4577 unsigned __int16 v63; // ax@111 | |
4578 int v64; // ebx@114 | |
4579 signed int v65; // eax@114 | |
4580 unsigned int v66; // edi@123 | |
4581 unsigned __int16 v67; // ax@124 | |
4582 unsigned int v68; // ecx@124 | |
4583 signed int v69; // ebx@124 | |
4584 char *v70; // edx@125 | |
4585 unsigned __int16 v71; // ax@128 | |
4586 unsigned int v72; // ebx@131 | |
4587 int v78; // eax@133 | |
4588 char v79; // zf@139 | |
4589 unsigned int v80; // eax@140 | |
4590 signed int v81; // edx@140 | |
4591 char *v82; // ecx@141 | |
4592 unsigned __int16 v83; // ax@144 | |
4593 unsigned __int16 v84; // ax@151 | |
4594 unsigned int v85; // ecx@151 | |
4595 signed int v86; // ebx@151 | |
4596 char *v87; // edx@152 | |
4597 unsigned __int16 v88; // ax@155 | |
4598 unsigned int v89; // eax@158 | |
4599 int v90; // ST34_4@159 | |
4600 int v91; // eax@159 | |
4601 unsigned int v92; // eax@163 | |
4602 unsigned int v93; // eax@177 | |
4603 char *v94; // ecx@178 | |
4604 unsigned __int16 v95; // ax@181 | |
4605 unsigned __int16 v96; // ax@184 | |
4606 int v97; // eax@185 | |
4607 unsigned __int16 v98; // ax@191 | |
4608 char v100; // ST18_1@198 | |
4609 int v102; // eax@198 | |
4610 signed int v106; // eax@208 | |
4611 unsigned int v107; // edx@220 | |
4612 signed int v108; // ebx@225 | |
4613 unsigned int v109; // eax@234 | |
4614 signed int v110; // ebx@234 | |
4615 char *v111; // ecx@235 | |
4616 unsigned __int16 v112; // ax@238 | |
4617 unsigned __int16 v113; // si@241 | |
4618 int v114; // eax@242 | |
4619 int v115; // eax@245 | |
4620 unsigned __int16 v117; // ax@251 | |
4621 unsigned int v118; // ecx@251 | |
4622 signed int v119; // ebx@251 | |
4623 char *v120; // edx@252 | |
4624 unsigned __int16 v121; // ax@255 | |
4625 unsigned int v122; // eax@260 | |
4626 char *v123; // edx@261 | |
4627 int v124; // eax@267 | |
4628 int v125; // [sp-20h] [bp-4Ch]@28 | |
4629 char v132; // [sp-8h] [bp-34h]@131 | |
4630 char v134; // [sp-4h] [bp-30h]@131 | |
4631 signed int v135; // [sp-4h] [bp-30h]@217 | |
4632 int v136; // [sp+Ch] [bp-20h]@208 | |
4633 int v137; // [sp+10h] [bp-1Ch]@208 | |
4634 signed int v138; // [sp+14h] [bp-18h]@207 | |
4635 signed int v139; // [sp+18h] [bp-14h]@208 | |
4636 char *v140; // [sp+1Ch] [bp-10h]@61 | |
4637 signed int v141; // [sp+1Ch] [bp-10h]@117 | |
4638 unsigned int v142; // [sp+1Ch] [bp-10h]@158 | |
4639 signed int v143; // [sp+1Ch] [bp-10h]@172 | |
4640 char *v144; // [sp+1Ch] [bp-10h]@192 | |
4641 signed int v146; // [sp+20h] [bp-Ch]@60 | |
4642 int v147; // [sp+20h] [bp-Ch]@72 | |
4643 signed int v148; // [sp+20h] [bp-Ch]@158 | |
4644 unsigned __int16 v150; // [sp+20h] [bp-Ch]@208 | |
4645 signed int v152; // [sp+24h] [bp-8h]@208 | |
2101 | 4646 |
4647 //ïðèìåíåíèå: ôàåðáîëò â õðàìå ëóíû | |
4648 object = &pObjectList->pObjects[pSpriteObjects[uLayingItemID].uObjectDescID]; | |
4649 //v151 = PID_TYPE(a2); | |
848 | 4650 if ( PID_TYPE(a2) == OBJECT_Actor) |
4651 { | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4652 if ( PID_TYPE(pSpriteObjects[uLayingItemID].spell_caster_pid) == OBJECT_Actor |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4653 && !pActors[PID_ID(pSpriteObjects[uLayingItemID].spell_caster_pid)].GetActorsRelation(&pActors[PID_ID(a2)]) ) |
0 | 4654 return 1; |
4655 } | |
4656 else | |
4657 { | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4658 if ( PID_TYPE(a2) == OBJECT_Player && PID_TYPE(pSpriteObjects[uLayingItemID].spell_caster_pid) == OBJECT_Player) |
0 | 4659 return 1; |
4660 } | |
4661 if ( pParty->bTurnBasedModeOn == 1 ) | |
4662 { | |
2101 | 4663 if ( pSpriteObjects[uLayingItemID].uAttributes & 4 ) |
0 | 4664 { |
1450 | 4665 --pTurnEngine->pending_actions; |
2101 | 4666 pSpriteObjects[uLayingItemID].uAttributes &= 0xFFFB; |
0 | 4667 } |
4668 } | |
2101 | 4669 if ( PID_TYPE(a2) == OBJECT_BModel && PID_TYPE(pSpriteObjects[uLayingItemID].spell_caster_pid) != OBJECT_Player) |
1280 | 4670 { |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4671 if (PID_ID(pSpriteObjects[uLayingItemID].spell_caster_pid) < 500) //bugfix PID_ID(v2->spell_caster_pid)==1000 |
2166 | 4672 pActors[PID_ID(pSpriteObjects[uLayingItemID].spell_caster_pid)].uAttributes |= 0x40000; |
1280 | 4673 } |
4674 | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4675 //v6 = v2->uType; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4676 //v7 = v2->uType; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4677 if ( pSpriteObjects[uLayingItemID].uType > 3060 ) |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4678 { |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4679 if ( pSpriteObjects[uLayingItemID].uType > 6090 ) |
0 | 4680 { |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4681 if ( pSpriteObjects[uLayingItemID].uType > 8090 ) |
0 | 4682 { |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4683 if ( pSpriteObjects[uLayingItemID].uType == 9010 ) |
0 | 4684 goto LABEL_247; |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4685 if ( pSpriteObjects[uLayingItemID].uType != 9030 ) |
0 | 4686 { |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4687 if ( pSpriteObjects[uLayingItemID].uType != 9040 ) |
0 | 4688 { |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4689 if ( pSpriteObjects[uLayingItemID].uType != 9080 ) |
0 | 4690 return 0; |
2101 | 4691 v95 = 0; |
4692 pSpriteObjects[uLayingItemID].uType = pSpriteObjects[uLayingItemID].uType + 1; | |
4693 for ( v146 = 0; v146 < (signed int)pObjectList->uNumObjects; ++v146 ) | |
0 | 4694 { |
2101 | 4695 if ( pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v146].uObjectID ) |
4696 v95 = v146; | |
0 | 4697 } |
2101 | 4698 pSpriteObjects[uLayingItemID].uObjectDescID = v95; |
4699 if ( !v95 ) | |
4700 SpriteObject::OnInteraction(uLayingItemID); | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4701 v100 = pSpriteObjects[uLayingItemID].field_61; |
2101 | 4702 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; |
4703 v102 = 8 * uLayingItemID; | |
4704 LOBYTE(v102) = PID(OBJECT_Item, uLayingItemID); | |
4705 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
4706 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
4707 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
4708 AttackerInfo.Add(v102, 512, pSpriteObjects[uLayingItemID].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y, pSpriteObjects[uLayingItemID].vPosition.z, v100, 0); | |
4709 if (object->uFlags & OBJECT_DESC_TRIAL_PARTICLE) | |
4710 trail_particle_generator.GenerateTrailParticles(pSpriteObjects[uLayingItemID].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y, pSpriteObjects[uLayingItemID].vPosition.z, object->uParticleTrailColor); | |
4711 if ( !pSpriteObjects[uLayingItemID].uSoundID ) | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4712 v47 = 0; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4713 else |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4714 v47 = (signed __int16)pSpriteObjects[uLayingItemID].uSoundID + 4; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4715 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; |
2101 | 4716 pAudioPlayer->PlaySound((SoundID)v125, v102, 0, -1, 0, v47, 0, 0); |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4717 return 0; |
0 | 4718 } |
2101 | 4719 sub_43A97E(uLayingItemID, a2); |
4720 ++pSpriteObjects[uLayingItemID].uType; | |
4721 v95 = 0; | |
4722 for ( v52 = 0; v52 < (signed int)pObjectList->uNumObjects; ++v52 ) | |
4723 { | |
4724 if ( pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v52].uObjectID ) | |
4725 v95 = v52; | |
4726 } | |
4727 pSpriteObjects[uLayingItemID].uObjectDescID = v95; | |
4728 if ( !v95 ) | |
4729 SpriteObject::OnInteraction(uLayingItemID); | |
4730 v96 = pSpriteObjects[uLayingItemID].uSoundID; | |
4731 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
4732 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
4733 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
4734 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
4735 if ( !v96 ) | |
4736 v97 = 0; | |
4737 else | |
4738 v97 = (signed __int16)v96 + 4; | |
4739 v124 = 8 * uLayingItemID; | |
4740 LOBYTE(v124) = v124 | 2; | |
4741 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
4742 pAudioPlayer->PlaySound((SoundID)v125, v124, 0, -1, 0, v97, 0, 0); | |
4743 return 0; | |
0 | 4744 } |
4745 LABEL_172: | |
4746 v143 = 17030; | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4747 switch ( pSpriteObjects[uLayingItemID].uType ) |
0 | 4748 { |
4749 case 0x1798u: | |
4750 v143 = 15040; | |
4751 break; | |
4752 case 0xFAAu: | |
4753 v143 = 13010; | |
4754 break; | |
4755 case 0x2346u: | |
4756 v143 = 18030; | |
4757 break; | |
4758 } | |
4759 v138 = 1; | |
2101 | 4760 if ( PID_TYPE(a2) != OBJECT_Actor) |
0 | 4761 { |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4762 if ( pSpriteObjects[uLayingItemID].uType != 9030 || pSpriteObjects[uLayingItemID].spell_skill != 4 ) |
2101 | 4763 { |
4764 SpriteObject::OnInteraction(uLayingItemID); | |
4765 return 0; | |
4766 } | |
4767 pSpriteObjects[uLayingItemID]._46BEF1_apply_spells_aoe(); | |
0 | 4768 LABEL_233: |
4769 if ( !v138 ) | |
4770 { | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4771 ++pSpriteObjects[uLayingItemID].uType; |
2101 | 4772 v112 = 0; |
4773 for ( v110 = 0; v110 < (signed int)pObjectList->uNumObjects; ++v110 ) | |
0 | 4774 { |
2101 | 4775 if ( pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v110].uObjectID ) |
4776 v112 = v110; | |
0 | 4777 } |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4778 pSpriteObjects[uLayingItemID].uObjectDescID = v112; |
0 | 4779 if ( !v112 ) |
2101 | 4780 SpriteObject::OnInteraction(uLayingItemID); |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4781 pSpriteObjects[uLayingItemID].vVelocity.z = 0; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4782 pSpriteObjects[uLayingItemID].vVelocity.y = 0; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4783 pSpriteObjects[uLayingItemID].vVelocity.x = 0; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4784 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4785 v113 = pSpriteObjects[uLayingItemID].uSoundID; |
0 | 4786 if ( v113 ) |
4787 v114 = (signed __int16)v113 + 4; | |
4788 else | |
4789 v114 = 0; | |
2101 | 4790 v115 = 8 * uLayingItemID; |
4791 LOBYTE(v115) = PID(OBJECT_Item, uLayingItemID); | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4792 v125 = v143 + 1; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4793 pAudioPlayer->PlaySound((SoundID)v125, v115, 0, -1, 0, v114, 0, 0); |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4794 return 0; |
0 | 4795 } |
2101 | 4796 SpriteObject::OnInteraction(uLayingItemID); |
0 | 4797 return 0; |
4798 } | |
2101 | 4799 v106 = a2; |
0 | 4800 v150 = 0; |
848 | 4801 v139 = PID_ID(v106); |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4802 v137 = pSpriteObjects[uLayingItemID].spell_level; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4803 v152 = pSpriteObjects[uLayingItemID].spell_skill; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4804 v136 = pSpriteObjects[uLayingItemID].spell_id; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4805 if ( pSpriteObjects[uLayingItemID].uType == 9030 ) |
0 | 4806 { |
4807 v150 = 2; | |
4808 if ( v152 == 2 ) | |
4809 { | |
4810 v150 = 3; | |
4811 } | |
4812 else | |
4813 { | |
4814 if ( v152 >= 3 ) | |
4815 v150 = 4; | |
4816 } | |
2166 | 4817 pActors[v139].uAttributes |= 0x80000; |
0 | 4818 } |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4819 if ( pSpriteObjects[uLayingItemID].uType == 6040 ) |
0 | 4820 { |
4821 v135 = 7; | |
4822 } | |
4823 else | |
4824 { | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4825 if ( pSpriteObjects[uLayingItemID].uType == 8030 ) |
0 | 4826 { |
4827 v135 = 9; | |
4828 } | |
4829 else | |
4830 { | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4831 if ( pSpriteObjects[uLayingItemID].uType != 9030 ) |
0 | 4832 { |
4833 v107 = v136; | |
4834 LABEL_222: | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4835 if ( pSpriteObjects[uLayingItemID].uType != 9030 || v152 != 4 ) |
0 | 4836 { |
4837 v108 = v139; | |
4838 if ( stru_50C198.GetMagicalResistance(&pActors[v139], v107) ) | |
4839 { | |
4840 v138 = 0; | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4841 if ( pSpriteObjects[uLayingItemID].uType == 8030 ) |
0 | 4842 { |
4843 pActors[v108].uAIState = Standing; | |
4844 pActors[v108].UpdateAnimation(); | |
4845 } | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4846 pActors[v108].pActorBuffs[v136].Apply(pParty->uTimePlayed + (signed int)(signed __int64)((double)(v137 << 7) * 0.033333335), |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4847 v152, v150, 0, 0); |
0 | 4848 } |
4849 } | |
4850 else | |
4851 { | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4852 pSpriteObjects[uLayingItemID]._46BEF1_apply_spells_aoe(); |
0 | 4853 } |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4854 pSpriteObjects[uLayingItemID].spell_level = 0; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4855 pSpriteObjects[uLayingItemID].spell_skill = 0; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4856 pSpriteObjects[uLayingItemID].spell_id = 0; |
0 | 4857 goto LABEL_233; |
4858 } | |
4859 v135 = 10; | |
4860 } | |
4861 } | |
4862 v107 = v135; | |
4863 goto LABEL_222; | |
4864 } | |
2101 | 4865 if ( pSpriteObjects[uLayingItemID].uType == 8090 |
4866 || pSpriteObjects[uLayingItemID].uType == 7030 | |
4867 || pSpriteObjects[uLayingItemID].uType == 7090 || pSpriteObjects[uLayingItemID].uType == 8000 ) | |
4868 { | |
4869 sub_43A97E(uLayingItemID, a2); | |
4870 ++pSpriteObjects[uLayingItemID].uType; | |
4871 v95 = 0; | |
4872 for ( v52 = 0; v52 < (signed int)pObjectList->uNumObjects; ++v52 ) | |
4873 { | |
4874 if ( pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v52].uObjectID ) | |
4875 v95 = v52; | |
4876 } | |
4877 pSpriteObjects[uLayingItemID].uObjectDescID = v95; | |
4878 if ( !v95 ) | |
4879 SpriteObject::OnInteraction(uLayingItemID); | |
4880 v96 = pSpriteObjects[uLayingItemID].uSoundID; | |
4881 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
4882 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
4883 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
4884 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
4885 if ( !v96 ) | |
4886 v97 = 0; | |
4887 else | |
4888 v97 = (signed __int16)v96 + 4; | |
4889 v124 = 8 * uLayingItemID; | |
4890 LOBYTE(v124) = v124 | 2; | |
4891 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
4892 pAudioPlayer->PlaySound((SoundID)v125, v124, 0, -1, 0, v97, 0, 0); | |
4893 return 0; | |
4894 } | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4895 if ( pSpriteObjects[uLayingItemID].uType == 8010 ) |
0 | 4896 { |
2101 | 4897 if ( PID_TYPE(a2) == 3 |
4898 && MonsterStats::BelongsToSupertype(pActors[PID_ID(a2)].pMonsterInfo.uID, MONSTER_SUPERTYPE_UNDEAD) ) | |
4899 sub_43A97E(uLayingItemID, a2); | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4900 ++pSpriteObjects[uLayingItemID].uType; |
2101 | 4901 //v9 = 0; |
4902 v95 = 0; | |
4903 for ( v52 = 0; v52 < (signed int)pObjectList->uNumObjects; ++v52 ) | |
0 | 4904 { |
2101 | 4905 if ( pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v52].uObjectID ) |
4906 v95 = v52; | |
0 | 4907 } |
2101 | 4908 pSpriteObjects[uLayingItemID].uObjectDescID = v95; |
4909 if ( !v95 ) | |
4910 SpriteObject::OnInteraction(uLayingItemID); | |
4911 v96 = pSpriteObjects[uLayingItemID].uSoundID; | |
4912 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
4913 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
4914 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
4915 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
4916 if ( !v96 ) | |
4917 v97 = 0; | |
4918 else | |
4919 v97 = (signed __int16)v96 + 4; | |
4920 v92 = uLayingItemID; | |
4921 v124 = 8 * v92; | |
4922 LOBYTE(v124) = v124 | 2; | |
4923 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
4924 pAudioPlayer->PlaySound((SoundID)v125, v124, 0, -1, 0, v97, 0, 0); | |
4925 return 0; | |
0 | 4926 } |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4927 v79 = pSpriteObjects[uLayingItemID].uType == 8030; |
0 | 4928 } |
4929 else | |
4930 { | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4931 if ( pSpriteObjects[uLayingItemID].uType == 6090 ) |
2101 | 4932 { |
4933 sub_43A97E(uLayingItemID, a2); | |
4934 ++pSpriteObjects[uLayingItemID].uType; | |
4935 v95 = 0; | |
4936 for ( v52 = 0; v52 < (signed int)pObjectList->uNumObjects; ++v52 ) | |
4937 { | |
4938 if ( pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v52].uObjectID ) | |
4939 v95 = v52; | |
4940 } | |
4941 pSpriteObjects[uLayingItemID].uObjectDescID = v95; | |
4942 if ( !v95 ) | |
4943 SpriteObject::OnInteraction(uLayingItemID); | |
4944 v96 = pSpriteObjects[uLayingItemID].uSoundID; | |
4945 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
4946 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
4947 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
4948 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
4949 if ( !v96 ) | |
4950 v97 = 0; | |
4951 else | |
4952 v97 = (signed __int16)v96 + 4; | |
4953 v124 = 8 * uLayingItemID; | |
4954 LOBYTE(v124) = v124 | 2; | |
4955 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
4956 pAudioPlayer->PlaySound((SoundID)v125, v124, 0, -1, 0, v97, 0, 0); | |
4957 return 0; | |
4958 } | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4959 if ( pSpriteObjects[uLayingItemID].uType <= 4070 ) |
0 | 4960 { |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4961 if ( pSpriteObjects[uLayingItemID].uType != 4070 ) |
0 | 4962 { |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
4963 v48 = pSpriteObjects[uLayingItemID].uType - 3090; |
0 | 4964 if ( v48 ) |
4965 { | |
4966 v49 = v48 - 2; | |
4967 if ( v49 ) | |
4968 { | |
4969 v50 = v49 - 908; | |
2101 | 4970 if ( v49 == 908 ) |
4971 { | |
4972 sub_43A97E(uLayingItemID, a2); | |
4973 ++pSpriteObjects[uLayingItemID].uType; | |
4974 v95 = 0; | |
4975 for ( v52 = 0; v52 < (signed int)pObjectList->uNumObjects; ++v52 ) | |
4976 { | |
4977 if ( pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v52].uObjectID ) | |
4978 v95 = v52; | |
4979 } | |
4980 pSpriteObjects[uLayingItemID].uObjectDescID = v95; | |
4981 if ( !v95 ) | |
4982 SpriteObject::OnInteraction(uLayingItemID); | |
4983 v96 = pSpriteObjects[uLayingItemID].uSoundID; | |
4984 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
4985 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
4986 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
4987 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
4988 if ( !v96 ) | |
4989 v97 = 0; | |
4990 else | |
4991 v97 = (signed __int16)v96 + 4; | |
4992 v124 = 8 * uLayingItemID; | |
4993 LOBYTE(v124) = v124 | 2; | |
4994 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
4995 pAudioPlayer->PlaySound((SoundID)v125, v124, 0, -1, 0, v97, 0, 0); | |
4996 return 0; | |
4997 } | |
0 | 4998 v45 = v50 - 30; |
4999 v44 = v45 == 0; | |
5000 goto LABEL_91; | |
5001 } | |
2101 | 5002 //v9 = 0; |
5003 pSpriteObjects[uLayingItemID].uType = pSpriteObjects[uLayingItemID].uType - 1; | |
5004 v58 = 0; | |
5005 for ( v56 = 0; v56 < (signed int)pObjectList->uNumObjects; ++v56 ) | |
0 | 5006 { |
2101 | 5007 if ( pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v56].uObjectID ) |
5008 v58 = v56; | |
0 | 5009 } |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5010 pSpriteObjects[uLayingItemID].uObjectDescID = v58; |
0 | 5011 if ( !v58 ) |
2101 | 5012 SpriteObject::OnInteraction(uLayingItemID); |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5013 pSpriteObjects[uLayingItemID].vVelocity.z = 0; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5014 pSpriteObjects[uLayingItemID].vVelocity.y = 0; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5015 pSpriteObjects[uLayingItemID].vVelocity.x = 0; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5016 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; |
2101 | 5017 sub_43A97E(uLayingItemID, a2); |
5018 if ( !pSpriteObjects[uLayingItemID].uSoundID ) | |
0 | 5019 v16 = 0; |
5020 else | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5021 v16 = (signed __int16)pSpriteObjects[uLayingItemID].uSoundID + 4; |
2101 | 5022 v124 = 8 * uLayingItemID; |
0 | 5023 LOBYTE(v124) = v124 | 2; |
1456 | 5024 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; |
2101 | 5025 pAudioPlayer->PlaySound((SoundID)v125, v124, 0, -1, 0, v16, 0, 0); |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5026 return 0; |
0 | 5027 } |
2101 | 5028 //v9 = 0; |
5029 pSpriteObjects[uLayingItemID].uType = pSpriteObjects[uLayingItemID].uType + 2; | |
5030 v63 = 0; | |
5031 for ( v61 = 0; v61 < (signed int)pObjectList->uNumObjects; ++v61 ) | |
0 | 5032 { |
2101 | 5033 if ( v59 == pObjectList->pObjects[v61].uObjectID ) |
5034 v63 = v61; | |
0 | 5035 } |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5036 pSpriteObjects[uLayingItemID].uObjectDescID = v63; |
0 | 5037 if ( !v63 ) |
2101 | 5038 SpriteObject::OnInteraction(uLayingItemID); |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5039 v64 = pSpriteObjects[uLayingItemID].uFacing - stru_5C6E00->uIntegerDoublePi; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5040 v44 = pSpriteObjects[uLayingItemID].spell_skill == 4; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5041 pSpriteObjects[uLayingItemID].vVelocity.z = 0; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5042 pSpriteObjects[uLayingItemID].vVelocity.y = 0; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5043 pSpriteObjects[uLayingItemID].vVelocity.x = 0; |
0 | 5044 v65 = 7; |
5045 if ( v44 ) | |
5046 v65 = 9; | |
5047 if ( v65 > 0 ) | |
5048 { | |
5049 v141 = v65; | |
5050 do | |
5051 { | |
2101 | 5052 v64 += (signed int)stru_5C6E00->uIntegerHalfPi / 2; |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5053 pSpriteObjects[uLayingItemID].Create(v64, 0, 1000, 0); |
0 | 5054 --v141; |
5055 } | |
5056 while ( v141 ); | |
5057 } | |
2101 | 5058 SpriteObject::OnInteraction(uLayingItemID); |
5059 if ( !pSpriteObjects[uLayingItemID].uSoundID ) | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5060 v16 = 0; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5061 else |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5062 v16 = (signed __int16)pSpriteObjects[uLayingItemID].uSoundID + 4; |
2101 | 5063 v124 = 8 * uLayingItemID; |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5064 LOBYTE(v124) = v124 | 2; |
1456 | 5065 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; |
2101 | 5066 pAudioPlayer->PlaySound((SoundID)v125, v124, 0, -1, 0, v16, 0, 0); |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5067 return 0; |
0 | 5068 } |
2101 | 5069 //v66 = 0; |
5070 if ( PID_TYPE(a2) == 6 || PID_TYPE(a2) == 5 || !PID_TYPE(a2) ) | |
0 | 5071 return 1; |
2101 | 5072 pSpriteObjects[uLayingItemID].uType = pSpriteObjects[uLayingItemID].uType + 1; |
5073 v71 = 0; | |
5074 for ( v69 = 0; v69 < (signed int)pObjectList->uNumObjects; ++v69 ) | |
0 | 5075 { |
2101 | 5076 if ( pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v69].uObjectID ) |
5077 v71 = v69; | |
0 | 5078 } |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5079 pSpriteObjects[uLayingItemID].uObjectDescID = v71; |
0 | 5080 if ( !v71 ) |
2101 | 5081 SpriteObject::OnInteraction(uLayingItemID); |
0 | 5082 v134 = 0; |
2101 | 5083 v72 = uLayingItemID; |
0 | 5084 v132 = 0; |
2101 | 5085 pSpriteObjects[uLayingItemID].vVelocity.z = 0; |
5086 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
5087 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
5088 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
2059 | 5089 AttackerInfo.Add(PID(OBJECT_Item,v72), 512, pSpriteObjects[uLayingItemID].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y, pSpriteObjects[uLayingItemID].vPosition.z, v132, v134); |
2101 | 5090 if ( !pSpriteObjects[uLayingItemID].uSoundID ) |
0 | 5091 v78 = 0; |
5092 else | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5093 v78 = (signed __int16)pSpriteObjects[uLayingItemID].uSoundID + 4; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5094 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; |
2185 | 5095 pAudioPlayer->PlaySound((SoundID)v125, pSpriteObjects[uLayingItemID].vPosition.x, 0, -1, 0, v78, 0, 0); |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5096 return 0; |
0 | 5097 } |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5098 if ( pSpriteObjects[uLayingItemID].uType == 4090 ) |
0 | 5099 { |
2101 | 5100 //v9 = 0; |
5101 pSpriteObjects[uLayingItemID].uType = pSpriteObjects[uLayingItemID].uType + 2; | |
5102 v88 = 0; | |
5103 for ( v86 = 0; v86 < (signed int)pObjectList->uNumObjects; ++v86 ) | |
0 | 5104 { |
2101 | 5105 if ( pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v86].uObjectID ) |
5106 v88 = v86; | |
0 | 5107 } |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5108 pSpriteObjects[uLayingItemID].uObjectDescID = v88; |
0 | 5109 if ( !v88 ) |
2101 | 5110 SpriteObject::OnInteraction(uLayingItemID); |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5111 v89 = pSpriteObjects[uLayingItemID].uFacing - stru_5C6E00->uIntegerDoublePi; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5112 pSpriteObjects[uLayingItemID].vVelocity.z = 0; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5113 pSpriteObjects[uLayingItemID].vVelocity.y = 0; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5114 pSpriteObjects[uLayingItemID].vVelocity.x = 0; |
0 | 5115 v142 = v89; |
5116 v148 = 7; | |
5117 do | |
5118 { | |
5119 pRnd->SetRange(-128, 128); | |
5120 v90 = pRnd->GetInRange(); | |
5121 pRnd->SetRange(5, 500); | |
5122 v91 = pRnd->GetInRange(); | |
5123 v142 += (signed int)stru_5C6E00->uIntegerHalfPi >> 1; | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5124 pSpriteObjects[uLayingItemID].Create(v90 + v142, 0, v91, 0); |
0 | 5125 --v148; |
5126 } | |
5127 while ( v148 ); | |
2101 | 5128 SpriteObject::OnInteraction(uLayingItemID); |
5129 if ( !pSpriteObjects[uLayingItemID].uSoundID ) | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5130 v16 = 0; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5131 else |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5132 v16 = (signed __int16)pSpriteObjects[uLayingItemID].uSoundID + 4; |
2101 | 5133 v124 = 8 * uLayingItemID; |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5134 LOBYTE(v124) = v124 | 2; |
1456 | 5135 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id-1] + 1; |
2101 | 5136 pAudioPlayer->PlaySound((SoundID)v125, v124, 0, -1, 0, v16, 0, 0); |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5137 return 0; |
0 | 5138 } |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5139 if ( pSpriteObjects[uLayingItemID].uType == 4092 ) |
0 | 5140 { |
2101 | 5141 //v66 = 0; |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5142 pSpriteObjects[uLayingItemID].uType = 4091; |
2101 | 5143 v83 = 0; |
5144 for ( v81 = 0; v81 < (signed int)pObjectList->uNumObjects; ++v81 ) | |
0 | 5145 { |
2101 | 5146 if ( pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v81].uObjectID ) |
5147 v83 = v81; | |
0 | 5148 } |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5149 pSpriteObjects[uLayingItemID].uObjectDescID = v83; |
0 | 5150 if ( !v83 ) |
2101 | 5151 SpriteObject::OnInteraction(uLayingItemID); |
0 | 5152 v134 = 0; |
2102 | 5153 //v72 = uLayingItemID; |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5154 v132 = pSpriteObjects[uLayingItemID].field_61; |
2101 | 5155 pSpriteObjects[uLayingItemID].vVelocity.z = 0; |
5156 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
5157 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
5158 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
2102 | 5159 AttackerInfo.Add(PID(OBJECT_Item, uLayingItemID), 512, pSpriteObjects[uLayingItemID].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y, pSpriteObjects[uLayingItemID].vPosition.z, v132, v134); |
2101 | 5160 if ( !pSpriteObjects[uLayingItemID].uSoundID ) |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5161 v78 = 0; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5162 else |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5163 v78 = (signed __int16)pSpriteObjects[uLayingItemID].uSoundID + 4; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5164 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; |
2102 | 5165 pAudioPlayer->PlaySound((SoundID)v125, pSpriteObjects[uLayingItemID].vPosition.x, 0, -1, 0, v78, 0, 0); |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5166 return 0; |
0 | 5167 } |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5168 if ( pSpriteObjects[uLayingItemID].uType == 4100 || pSpriteObjects[uLayingItemID].uType == 6010 ) |
2101 | 5169 { |
5170 sub_43A97E(uLayingItemID, a2); | |
5171 ++pSpriteObjects[uLayingItemID].uType; | |
5172 v95 = 0; | |
5173 for ( v52 = 0; v52 < (signed int)pObjectList->uNumObjects; ++v52 ) | |
5174 { | |
5175 if ( pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v52].uObjectID ) | |
5176 v95 = v52; | |
5177 } | |
5178 pSpriteObjects[uLayingItemID].uObjectDescID = v95; | |
5179 if ( !v95 ) | |
5180 SpriteObject::OnInteraction(uLayingItemID); | |
5181 v96 = pSpriteObjects[uLayingItemID].uSoundID; | |
5182 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
5183 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
5184 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
5185 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
5186 if ( !v96 ) | |
5187 v97 = 0; | |
5188 else | |
5189 v97 = (signed __int16)v96 + 4; | |
5190 v124 = 8 * uLayingItemID; | |
5191 LOBYTE(v124) = v124 | 2; | |
5192 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
5193 pAudioPlayer->PlaySound((SoundID)v125, v124, 0, -1, 0, v97, 0, 0); | |
5194 return 0; | |
5195 } | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5196 v79 = pSpriteObjects[uLayingItemID].uType == 6040; |
0 | 5197 } |
5198 if ( !v79 ) | |
5199 return 0; | |
5200 goto LABEL_172; | |
5201 } | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5202 if ( pSpriteObjects[uLayingItemID].uType == 3060 ) |
2101 | 5203 { |
5204 sub_43A97E(uLayingItemID, a2); | |
5205 ++pSpriteObjects[uLayingItemID].uType; | |
5206 v95 = 0; | |
5207 for ( v52 = 0; v52 < (signed int)pObjectList->uNumObjects; ++v52 ) | |
5208 { | |
5209 if ( pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v52].uObjectID ) | |
5210 v95 = v52; | |
5211 } | |
5212 pSpriteObjects[uLayingItemID].uObjectDescID = v95; | |
5213 if ( !v95 ) | |
5214 SpriteObject::OnInteraction(uLayingItemID); | |
5215 v96 = pSpriteObjects[uLayingItemID].uSoundID; | |
5216 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
5217 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
5218 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
5219 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
5220 if ( !v96 ) | |
5221 v97 = 0; | |
5222 else | |
5223 v97 = (signed __int16)v96 + 4; | |
5224 v124 = 8 * uLayingItemID; | |
5225 LOBYTE(v124) = v124 | 2; | |
5226 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
5227 pAudioPlayer->PlaySound((SoundID)v125, v124, 0, -1, 0, v97, 0, 0); | |
5228 return 0; | |
5229 } | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5230 if ( pSpriteObjects[uLayingItemID].uType <= 555 ) |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5231 { |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5232 if ( pSpriteObjects[uLayingItemID].uType == 555 ) |
0 | 5233 { |
2101 | 5234 sub_43A97E(uLayingItemID, a2); |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5235 ++pSpriteObjects[uLayingItemID].uType; |
0 | 5236 v18 = 0; |
2101 | 5237 v22 = 0; |
5238 v25 = (char *)&pObjectList->pObjects->uObjectID; | |
5239 for ( v24 = 0; v24 < (signed int)pObjectList->uNumObjects; ++v24 ) | |
0 | 5240 { |
2101 | 5241 if ( pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v24].uObjectID ) |
5242 v22 = v24; | |
0 | 5243 } |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5244 pSpriteObjects[uLayingItemID].uObjectDescID = v22; |
0 | 5245 if ( v22 == v18 ) |
2101 | 5246 SpriteObject::OnInteraction(uLayingItemID); |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5247 pSpriteObjects[uLayingItemID].vVelocity.z = v18; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5248 pSpriteObjects[uLayingItemID].vVelocity.y = v18; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5249 pSpriteObjects[uLayingItemID].vVelocity.x = v18; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5250 pSpriteObjects[uLayingItemID].uSpriteFrameID = v18; |
0 | 5251 } |
5252 else | |
5253 { | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5254 switch ( pSpriteObjects[uLayingItemID].uType ) |
0 | 5255 { |
5256 case 500: | |
5257 case 505: | |
5258 case 510: | |
5259 case 515: | |
5260 case 520: | |
5261 case 525: | |
5262 case 530: | |
5263 case 535: | |
5264 case 540: | |
2101 | 5265 sub_43A97E(uLayingItemID, a2); |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5266 ++pSpriteObjects[uLayingItemID].uType; |
2101 | 5267 v12 = 0; |
5268 for ( v10 = 0; v10 < (signed int)pObjectList->uNumObjects; ++v10 ) | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5269 { |
2101 | 5270 if ( pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v10].uObjectID ) |
5271 v12 = v10; | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5272 } |
2101 | 5273 pSpriteObjects[uLayingItemID].uObjectDescID = v12; |
5274 if ( !v12 ) | |
5275 SpriteObject::OnInteraction(uLayingItemID); | |
5276 v44 = pSpriteObjects[uLayingItemID].uType == 555; | |
5277 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
5278 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
5279 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
5280 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
5281 if ( !v44 ) | |
5282 { | |
5283 v13 = 8 * uLayingItemID; | |
5284 LOBYTE(v13) = PID(OBJECT_Item, uLayingItemID); | |
5285 pAudioPlayer->PlaySound(SOUND_8, v13, 0, -1, 0, 0, 0, 0); | |
5286 } | |
5287 return 0; | |
0 | 5288 case 545: |
5289 case 550: | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5290 if ( pSpriteObjects[uLayingItemID].stru_24.uItemID != 405 && pSpriteObjects[uLayingItemID].stru_24.uSpecEnchantmentType != 3 ) |
0 | 5291 { |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5292 pSpriteObjects[uLayingItemID].vVelocity.z = 0; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5293 pSpriteObjects[uLayingItemID].vVelocity.y = 0; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5294 pSpriteObjects[uLayingItemID].vVelocity.x = 0; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5295 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; |
2101 | 5296 sub_43A97E(uLayingItemID, a2); |
5297 SpriteObject::OnInteraction(uLayingItemID); | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5298 if ( pSpriteObjects[uLayingItemID].uSoundID == 0 ) |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5299 v16 = 0; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5300 else |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5301 v16 = (signed __int16)pSpriteObjects[uLayingItemID].uSoundID + 4; |
2101 | 5302 v124 = 8 * uLayingItemID; |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5303 LOBYTE(v124) = v124 | 2; |
1996 | 5304 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id] + 1; |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5305 pAudioPlayer->PlaySound((SoundID)v125, v124, 0, -1, 0, v16, 0, 0); |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5306 return 0; |
0 | 5307 } |
5308 v18 = 0; | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5309 pSpriteObjects[uLayingItemID].uType = 600; |
2101 | 5310 v22 = 0; |
5311 for ( v19 = 0; v19 < (signed int)pObjectList->uNumObjects; ++v19 ) | |
0 | 5312 { |
2101 | 5313 if ( pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v19].uObjectID ) |
5314 v22 = v19; | |
0 | 5315 } |
2101 | 5316 pSpriteObjects[uLayingItemID].uObjectDescID = v22; |
5317 if ( !v22 ) | |
5318 SpriteObject::OnInteraction(uLayingItemID); | |
5319 pSpriteObjects[uLayingItemID].vVelocity.z = v18; | |
5320 pSpriteObjects[uLayingItemID].vVelocity.y = v18; | |
5321 pSpriteObjects[uLayingItemID].vVelocity.x = v18; | |
5322 pSpriteObjects[uLayingItemID].uSpriteFrameID = v18; | |
0 | 5323 default: |
5324 return 0; | |
5325 } | |
2101 | 5326 v12 = 0; |
5327 for ( v10; v10 < (signed int)v8; ++v10 ) | |
0 | 5328 { |
5329 v11 += 56; | |
2101 | 5330 if ( pSpriteObjects[uLayingItemID].uType != *(short *)v11 ) |
5331 v12 = v10; | |
0 | 5332 } |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5333 pSpriteObjects[uLayingItemID].uObjectDescID = v12; |
0 | 5334 if ( !v12 ) |
2101 | 5335 SpriteObject::OnInteraction(uLayingItemID); |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5336 v44 = pSpriteObjects[uLayingItemID].uType == 555; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5337 pSpriteObjects[uLayingItemID].vVelocity.z = 0; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5338 pSpriteObjects[uLayingItemID].vVelocity.y = 0; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5339 pSpriteObjects[uLayingItemID].vVelocity.x = 0; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5340 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; |
0 | 5341 if ( !v44 ) |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5342 { |
2101 | 5343 v13 = 8 * uLayingItemID; |
5344 LOBYTE(v13) = PID(OBJECT_Item, uLayingItemID); | |
5345 pAudioPlayer->PlaySound(SOUND_8, v13, 0, -1, 0, 0, 0, 0); | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5346 return 0; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5347 } |
0 | 5348 } |
5349 return 0; | |
5350 } | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5351 if ( pSpriteObjects[uLayingItemID].uType > 1100 ) |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5352 { |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5353 v41 = pSpriteObjects[uLayingItemID].uType - 2030; |
0 | 5354 if ( !v41 ) |
5355 goto LABEL_247; | |
5356 v42 = v41 - 30; | |
5357 if ( v42 ) | |
5358 { | |
5359 v43 = v42 - 40; | |
2101 | 5360 if ( v42 == 40 ) |
5361 { | |
5362 if ( PID_TYPE(a2) != 3 ) | |
5363 { | |
5364 //v32 = 0; | |
5365 pSpriteObjects[uLayingItemID].uType = pSpriteObjects[uLayingItemID].uType + 1; | |
5366 v46 = 0; | |
5367 for ( v146 = 0; v146 < (signed int)pObjectList->uNumObjects; ++v146 ) | |
5368 { | |
5369 if ( pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v146].uObjectID ) | |
5370 v46 = v146; | |
5371 } | |
5372 pSpriteObjects[uLayingItemID].uObjectDescID = v46; | |
5373 if ( !v46 ) | |
5374 SpriteObject::OnInteraction(uLayingItemID); | |
5375 v100 = pSpriteObjects[uLayingItemID].field_61; | |
5376 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
5377 v102 = 8 * uLayingItemID; | |
5378 LOBYTE(v102) = PID(OBJECT_Item, uLayingItemID); | |
5379 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
5380 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
5381 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
5382 AttackerInfo.Add(v102, 512, pSpriteObjects[uLayingItemID].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y, pSpriteObjects[uLayingItemID].vPosition.z, v100, 0); | |
5383 if (object->uFlags & OBJECT_DESC_TRIAL_PARTICLE) | |
5384 trail_particle_generator.GenerateTrailParticles(pSpriteObjects[uLayingItemID].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y, pSpriteObjects[uLayingItemID].vPosition.z, object->uParticleTrailColor); | |
5385 if ( !pSpriteObjects[uLayingItemID].uSoundID ) | |
5386 v47 = 0; | |
5387 else | |
5388 v47 = (signed __int16)pSpriteObjects[uLayingItemID].uSoundID + 4; | |
5389 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
5390 pAudioPlayer->PlaySound((SoundID)v125, v102, 0, -1, 0, v47, 0, 0); | |
5391 return 0; | |
5392 } | |
5393 return 1; | |
5394 } | |
0 | 5395 v45 = v43 - 910; |
5396 v44 = v45 == 0; | |
5397 LABEL_91: | |
5398 if ( !v44 && v45 != 20 ) | |
5399 return 0; | |
5400 } | |
2101 | 5401 sub_43A97E(uLayingItemID, a2); |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5402 ++pSpriteObjects[uLayingItemID].uType; |
2101 | 5403 v95 = 0; |
5404 for ( v52 = 0; v52 < (signed int)pObjectList->uNumObjects; ++v52 ) | |
0 | 5405 { |
2101 | 5406 if ( pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v52].uObjectID ) |
5407 v95 = v52; | |
0 | 5408 } |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5409 pSpriteObjects[uLayingItemID].uObjectDescID = v95; |
2101 | 5410 if ( !v95 ) |
5411 SpriteObject::OnInteraction(uLayingItemID); | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5412 v96 = pSpriteObjects[uLayingItemID].uSoundID; |
2101 | 5413 pSpriteObjects[uLayingItemID].vVelocity.z = 0; |
5414 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
5415 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
5416 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
5417 if ( !v96 ) | |
0 | 5418 v97 = 0; |
5419 else | |
5420 v97 = (signed __int16)v96 + 4; | |
2101 | 5421 v124 = 8 * uLayingItemID; |
5422 LOBYTE(v124) = v124 | 2; | |
5423 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
5424 pAudioPlayer->PlaySound((SoundID)v125, v124, 0, -1, 0, v97, 0, 0); | |
5425 return 0; | |
5426 } | |
5427 if ( pSpriteObjects[uLayingItemID].uType == 1100 ) | |
5428 { | |
5429 sub_43A97E(uLayingItemID, a2); | |
5430 ++pSpriteObjects[uLayingItemID].uType; | |
5431 v95 = 0; | |
5432 for ( v52 = 0; v52 < (signed int)pObjectList->uNumObjects; ++v52 ) | |
5433 { | |
5434 if ( pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v52].uObjectID ) | |
5435 v95 = v52; | |
5436 } | |
5437 pSpriteObjects[uLayingItemID].uObjectDescID = v95; | |
5438 if ( !v95 ) | |
5439 SpriteObject::OnInteraction(uLayingItemID); | |
5440 v96 = pSpriteObjects[uLayingItemID].uSoundID; | |
5441 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
5442 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
5443 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
5444 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
5445 if ( !v96 ) | |
5446 v97 = 0; | |
5447 else | |
5448 v97 = (signed __int16)v96 + 4; | |
5449 v92 = uLayingItemID; | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5450 v124 = 8 * v92; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5451 LOBYTE(v124) = v124 | 2; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5452 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; |
2101 | 5453 pAudioPlayer->PlaySound((SoundID)v125, v124, 0, -1, 0, v97, 0, 0); |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5454 return 0; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5455 } |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5456 v26 = pSpriteObjects[uLayingItemID].uType - 600; |
2101 | 5457 if ( pSpriteObjects[uLayingItemID].uType == 600 ) |
0 | 5458 { |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5459 pSpriteObjects[uLayingItemID].uType = 601; |
2101 | 5460 v36 = 0; |
5461 for ( v34 = 0; v34 < (signed int)pObjectList->uNumObjects; ++v34 ) | |
0 | 5462 { |
2101 | 5463 if ( pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v34].uObjectID ) |
5464 v36 = v34; | |
0 | 5465 } |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5466 pSpriteObjects[uLayingItemID].uObjectDescID = v36; |
0 | 5467 if ( !v36 ) |
2101 | 5468 SpriteObject::OnInteraction(uLayingItemID); |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5469 v37 = pSpriteObjects[uLayingItemID].vPosition.z; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5470 pSpriteObjects[uLayingItemID].vVelocity.z = 0; |
2101 | 5471 v38 = 8 * uLayingItemID; |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5472 v39 = pSpriteObjects[uLayingItemID].vPosition.y; |
2101 | 5473 LOBYTE(v38) = PID(OBJECT_Item, uLayingItemID); |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5474 pSpriteObjects[uLayingItemID].vVelocity.y = 0; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5475 pSpriteObjects[uLayingItemID].vVelocity.x = 0; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5476 v40 = pSpriteObjects[uLayingItemID].vPosition.x; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5477 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; |
0 | 5478 v147 = v38; |
2059 | 5479 AttackerInfo.Add(v38, 512, v40, v39, v37, 0, 0); |
2101 | 5480 if (object->uFlags & OBJECT_DESC_TRIAL_PARTICLE) |
5481 trail_particle_generator.GenerateTrailParticles(pSpriteObjects[uLayingItemID].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y, pSpriteObjects[uLayingItemID].vPosition.z, object->uParticleTrailColor); | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5482 pAudioPlayer->PlaySound(SOUND_8, v147, 0, -1, 0, 0, 0, 0); |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5483 return 0; |
0 | 5484 } |
5485 v27 = v26 - 410; | |
2101 | 5486 if ( v26 == 410 ) |
5487 { | |
5488 sub_43A97E(uLayingItemID, a2); | |
5489 ++pSpriteObjects[uLayingItemID].uType; | |
5490 v95 = 0; | |
5491 for ( v52 = 0; v52 < (signed int)pObjectList->uNumObjects; ++v52 ) | |
5492 { | |
5493 if ( pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v52].uObjectID ) | |
5494 v95 = v52; | |
5495 } | |
5496 pSpriteObjects[uLayingItemID].uObjectDescID = v95; | |
5497 if ( !v95 ) | |
5498 SpriteObject::OnInteraction(uLayingItemID); | |
5499 v96 = pSpriteObjects[uLayingItemID].uSoundID; | |
5500 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
5501 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
5502 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
5503 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
5504 if ( !v96 ) | |
5505 v97 = 0; | |
5506 else | |
5507 v97 = (signed __int16)v96 + 4; | |
5508 v124 = 8 * uLayingItemID; | |
5509 LOBYTE(v124) = v124 | 2; | |
5510 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
5511 pAudioPlayer->PlaySound((SoundID)v125, v124, 0, -1, 0, v97, 0, 0); | |
5512 return 0; | |
5513 } | |
0 | 5514 v28 = v27 - 40; |
5515 if ( !v28 ) | |
2101 | 5516 { |
5517 v95 = 0; | |
5518 pSpriteObjects[uLayingItemID].uType = pSpriteObjects[uLayingItemID].uType + 1; | |
5519 for ( v146 = 0; v146 < (signed int)pObjectList->uNumObjects; ++v146 ) | |
5520 { | |
5521 if ( pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v146].uObjectID ) | |
5522 v95 = v146; | |
5523 } | |
5524 pSpriteObjects[uLayingItemID].uObjectDescID = v95; | |
5525 if ( !v95 ) | |
5526 SpriteObject::OnInteraction(uLayingItemID); | |
5527 v100 = pSpriteObjects[uLayingItemID].field_61; | |
5528 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
5529 v102 = 8 * uLayingItemID; | |
5530 LOBYTE(v102) = PID(OBJECT_Item, uLayingItemID); | |
5531 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
5532 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
5533 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
5534 AttackerInfo.Add(v102, 512, pSpriteObjects[uLayingItemID].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y, pSpriteObjects[uLayingItemID].vPosition.z, v100, 0); | |
5535 if (object->uFlags & OBJECT_DESC_TRIAL_PARTICLE) | |
5536 trail_particle_generator.GenerateTrailParticles(pSpriteObjects[uLayingItemID].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y, pSpriteObjects[uLayingItemID].vPosition.z, object->uParticleTrailColor); | |
5537 if ( !pSpriteObjects[uLayingItemID].uSoundID ) | |
5538 v47 = 0; | |
5539 else | |
5540 v47 = (signed __int16)pSpriteObjects[uLayingItemID].uSoundID + 4; | |
5541 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
5542 pAudioPlayer->PlaySound((SoundID)v125, v102, 0, -1, 0, v47, 0, 0); | |
5543 return 0; | |
5544 } | |
0 | 5545 v29 = v28 - 10; |
5546 if ( v29 ) | |
5547 { | |
5548 if ( v29 != 20 ) | |
5549 return 0; | |
2101 | 5550 if ( PID_TYPE(a2) != 3 ) |
0 | 5551 { |
2101 | 5552 //v32 = 0; |
5553 pSpriteObjects[uLayingItemID].uType = pSpriteObjects[uLayingItemID].uType + 1; | |
5554 v46 = 0; | |
5555 for ( v146 = 0; v146 < (signed int)pObjectList->uNumObjects; ++v146 ) | |
0 | 5556 { |
2101 | 5557 if ( pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v146].uObjectID ) |
5558 v46 = v146; | |
0 | 5559 } |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5560 pSpriteObjects[uLayingItemID].uObjectDescID = v46; |
2101 | 5561 if ( !v46 ) |
5562 SpriteObject::OnInteraction(uLayingItemID); | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5563 v100 = pSpriteObjects[uLayingItemID].field_61; |
2101 | 5564 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; |
5565 v102 = 8 * uLayingItemID; | |
5566 LOBYTE(v102) = PID(OBJECT_Item, uLayingItemID); | |
5567 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
5568 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
5569 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
5570 AttackerInfo.Add(v102, 512, pSpriteObjects[uLayingItemID].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y, pSpriteObjects[uLayingItemID].vPosition.z, v100, 0); | |
5571 if (object->uFlags & OBJECT_DESC_TRIAL_PARTICLE) | |
5572 trail_particle_generator.GenerateTrailParticles(pSpriteObjects[uLayingItemID].vPosition.x, pSpriteObjects[uLayingItemID].vPosition.y, pSpriteObjects[uLayingItemID].vPosition.z, object->uParticleTrailColor); | |
5573 if ( !pSpriteObjects[uLayingItemID].uSoundID ) | |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5574 v47 = 0; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5575 else |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5576 v47 = (signed __int16)pSpriteObjects[uLayingItemID].uSoundID + 4; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5577 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; |
2101 | 5578 pAudioPlayer->PlaySound((SoundID)v125, v102, 0, -1, 0, v47, 0, 0); |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5579 return 0; |
0 | 5580 } |
5581 return 1; | |
5582 } | |
5583 LABEL_247: | |
2101 | 5584 //v9 = 0; |
5585 if ( PID_TYPE(a2) == 6 || PID_TYPE(a2) == 5 || !PID_TYPE(a2) ) | |
0 | 5586 return 1; |
2101 | 5587 if ( PID_TYPE(a2) != 2 ) |
0 | 5588 { |
2101 | 5589 sub_43A97E(uLayingItemID, a2); |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5590 ++pSpriteObjects[uLayingItemID].uType; |
2101 | 5591 v95 = 0; |
5592 for ( v52 = 0; v52 < (signed int)pObjectList->uNumObjects; ++v52 ) | |
0 | 5593 { |
2101 | 5594 if ( pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v52].uObjectID ) |
5595 v95 = v52; | |
0 | 5596 } |
2101 | 5597 pSpriteObjects[uLayingItemID].uObjectDescID = v95; |
5598 if ( !v95 ) | |
5599 SpriteObject::OnInteraction(uLayingItemID); | |
5600 pSpriteObjects[uLayingItemID].vVelocity.z = 0; | |
5601 pSpriteObjects[uLayingItemID].vVelocity.y = 0; | |
5602 pSpriteObjects[uLayingItemID].vVelocity.x = 0; | |
5603 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; | |
5604 if ( !pSpriteObjects[uLayingItemID].uSoundID ) | |
5605 v97 = 0; | |
5606 else | |
5607 v97 = (signed __int16)pSpriteObjects[uLayingItemID].uSoundID + 4; | |
5608 v124 = 8 * uLayingItemID; | |
5609 LOBYTE(v124) = v124 | 2; | |
5610 v125 = word_4EE088_sound_ids[pSpriteObjects[uLayingItemID].spell_id - 1] + 1; | |
5611 pAudioPlayer->PlaySound((SoundID)v125, v124, 0, -1, 0, v97, 0, 0); | |
5612 return 0; | |
0 | 5613 } |
2101 | 5614 pSpriteObjects[uLayingItemID].uType = pSpriteObjects[uLayingItemID].uType + 1; |
5615 v121 = 0; | |
5616 for ( v119 = 0; v119 < (signed int)pObjectList->uNumObjects; ++v119 ) | |
0 | 5617 { |
2101 | 5618 if ( pSpriteObjects[uLayingItemID].uType == pObjectList->pObjects[v119].uObjectID ) |
5619 v121 = v119; | |
0 | 5620 } |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5621 pSpriteObjects[uLayingItemID].uObjectDescID = v121; |
0 | 5622 if ( !v121 ) |
2101 | 5623 SpriteObject::OnInteraction(uLayingItemID); |
1429
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5624 pSpriteObjects[uLayingItemID].vVelocity.z = 0; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5625 pSpriteObjects[uLayingItemID].vVelocity.y = 0; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5626 pSpriteObjects[uLayingItemID].vVelocity.x = 0; |
c7489dd19f88
BuildingType_Tavern and CastSpellInfo_PushCastSpellInfo fix
Ritor1
parents:
1417
diff
changeset
|
5627 pSpriteObjects[uLayingItemID].uSpriteFrameID = 0; |
2101 | 5628 v13 = 8 * uLayingItemID; |
5629 LOBYTE(v13) = PID(OBJECT_Item,uLayingItemID); | |
5630 pAudioPlayer->PlaySound(SOUND_8, v13, 0, -1, 0, 0, 0, 0); | |
0 | 5631 return 0; |
5632 } |