From 77c6f6799b0e51579a82d4abdfb212d0c4832152 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Sun, 17 Mar 2024 12:21:45 -0400 Subject: [PATCH] Implement/match Isle::HandleTransitionEnd --- .../legoomni/include/actions/isle_actions.h | 4 +- LEGO1/lego/legoomni/include/ambulance.h | 1 + LEGO1/lego/legoomni/include/bike.h | 2 + LEGO1/lego/legoomni/include/dunebuggy.h | 2 + LEGO1/lego/legoomni/include/hospital.h | 5 + LEGO1/lego/legoomni/include/hospitalstate.h | 1 - LEGO1/lego/legoomni/include/infocenter.h | 8 +- LEGO1/lego/legoomni/include/isle.h | 48 +++-- LEGO1/lego/legoomni/include/jetski.h | 7 +- LEGO1/lego/legoomni/include/jukebox.h | 2 - LEGO1/lego/legoomni/include/legogamestate.h | 5 +- LEGO1/lego/legoomni/include/misc.h | 7 +- LEGO1/lego/legoomni/include/motocycle.h | 2 + LEGO1/lego/legoomni/include/police.h | 1 - LEGO1/lego/legoomni/include/policestate.h | 5 + LEGO1/lego/legoomni/include/skateboard.h | 2 + LEGO1/lego/legoomni/include/towtrack.h | 1 + LEGO1/lego/legoomni/src/actors/ambulance.cpp | 6 + LEGO1/lego/legoomni/src/actors/bike.cpp | 6 + LEGO1/lego/legoomni/src/actors/dunebuggy.cpp | 6 + LEGO1/lego/legoomni/src/actors/helicopter.cpp | 5 +- LEGO1/lego/legoomni/src/actors/jetski.cpp | 6 + .../legoomni/src/actors/jukeboxentity.cpp | 2 +- LEGO1/lego/legoomni/src/actors/motorcycle.cpp | 6 + LEGO1/lego/legoomni/src/actors/skateboard.cpp | 6 + LEGO1/lego/legoomni/src/actors/towtrack.cpp | 6 + LEGO1/lego/legoomni/src/common/misc.cpp | 5 +- .../src/infocenter/infocenterstate.cpp | 1 + LEGO1/lego/legoomni/src/isle/radiostate.cpp | 1 + .../lego/legoomni/src/police/policestate.cpp | 1 + .../legoomni/src/worlds/elevatorbottom.cpp | 1 + .../lego/legoomni/src/worlds/historybook.cpp | 1 + LEGO1/lego/legoomni/src/worlds/hospital.cpp | 2 + LEGO1/lego/legoomni/src/worlds/infocenter.cpp | 8 +- .../legoomni/src/worlds/infocenterdoor.cpp | 1 + LEGO1/lego/legoomni/src/worlds/isle.cpp | 187 +++++++++++++++++- LEGO1/lego/legoomni/src/worlds/jukebox.cpp | 2 + LEGO1/lego/legoomni/src/worlds/police.cpp | 2 + .../legoomni/src/worlds/registrationbook.cpp | 1 + LEGO1/lego/legoomni/src/worlds/score.cpp | 1 + 40 files changed, 323 insertions(+), 43 deletions(-) diff --git a/LEGO1/lego/legoomni/include/actions/isle_actions.h b/LEGO1/lego/legoomni/include/actions/isle_actions.h index d9518c7b..7a54bc30 100644 --- a/LEGO1/lego/legoomni/include/actions/isle_actions.h +++ b/LEGO1/lego/legoomni/include/actions/isle_actions.h @@ -2435,6 +2435,8 @@ enum Script { c_hho141cl_Pho_684 = 2427, c_hho142cl_0_sfx = 2428, c_hho142cl_1_sfx = 2429, +}; +enum Script2 { c_hho142cl_2_sfx = 2430, c_hho142cl_3_sfx = 2431, c_hho142cl_4_sfx = 2432, @@ -3671,7 +3673,7 @@ enum Script { c_srt004in_Anim = 3663, c_IRTX08RA_Wav_868 = 3664, c_nrtflag0_Anim = 3665, - c_WNS050P1_Wav = 3666, + c_WNS050P1_Wav_X = 3666, c_wns050p1_0_sfx = 3667, c_wns050p1_1_sfx = 3668, c_wns050p1_Anim = 3669, diff --git a/LEGO1/lego/legoomni/include/ambulance.h b/LEGO1/lego/legoomni/include/ambulance.h index 4c1ea373..ae9bee04 100644 --- a/LEGO1/lego/legoomni/include/ambulance.h +++ b/LEGO1/lego/legoomni/include/ambulance.h @@ -34,6 +34,7 @@ class Ambulance : public IslePathActor { void VTable0xe4() override; // vtable+0xe4 void FUN_10036e60(); + void FUN_10037060(); // SYNTHETIC: LEGO1 0x10036130 // Ambulance::`scalar deleting destructor' diff --git a/LEGO1/lego/legoomni/include/bike.h b/LEGO1/lego/legoomni/include/bike.h index bfc634b4..7355d1a7 100644 --- a/LEGO1/lego/legoomni/include/bike.h +++ b/LEGO1/lego/legoomni/include/bike.h @@ -28,6 +28,8 @@ class Bike : public IslePathActor { MxU32 VTable0xd4(LegoControlManagerEvent& p_param) override; // vtable+0xd4 void VTable0xe4() override; // vtable+0xe4 + void FUN_10076b60(); + // SYNTHETIC: LEGO1 0x10076880 // Bike::`scalar deleting destructor' diff --git a/LEGO1/lego/legoomni/include/dunebuggy.h b/LEGO1/lego/legoomni/include/dunebuggy.h index 27c0cdb5..c10ea949 100644 --- a/LEGO1/lego/legoomni/include/dunebuggy.h +++ b/LEGO1/lego/legoomni/include/dunebuggy.h @@ -30,6 +30,8 @@ class DuneBuggy : public IslePathActor { MxU32 VTable0xdc(MxType19NotificationParam& p_param) override; // vtable+0xdc void VTable0xe4() override; // vtable+0xe4 + void FUN_10068350(); + // SYNTHETIC: LEGO1 0x10067dc0 // DuneBuggy::`scalar deleting destructor' diff --git a/LEGO1/lego/legoomni/include/hospital.h b/LEGO1/lego/legoomni/include/hospital.h index 78f8c233..50fb8a8f 100644 --- a/LEGO1/lego/legoomni/include/hospital.h +++ b/LEGO1/lego/legoomni/include/hospital.h @@ -8,6 +8,11 @@ #include "mxstillpresenter.h" #include "radio.h" +namespace HospitalScript +{ +enum Script; +} + // VTABLE: LEGO1 0x100d9730 // SIZE 0x12c class Hospital : public LegoWorld { diff --git a/LEGO1/lego/legoomni/include/hospitalstate.h b/LEGO1/lego/legoomni/include/hospitalstate.h index 1752f7fe..d7e0f7b3 100644 --- a/LEGO1/lego/legoomni/include/hospitalstate.h +++ b/LEGO1/lego/legoomni/include/hospitalstate.h @@ -2,7 +2,6 @@ #define HOSPITALSTATE_H #include "decomp.h" -#include "hospital_actions.h" #include "legostate.h" // VTABLE: LEGO1 0x100d97a0 diff --git a/LEGO1/lego/legoomni/include/infocenter.h b/LEGO1/lego/legoomni/include/infocenter.h index 5fd2fc93..40048919 100644 --- a/LEGO1/lego/legoomni/include/infocenter.h +++ b/LEGO1/lego/legoomni/include/infocenter.h @@ -1,7 +1,6 @@ #ifndef INFOCENTER_H #define INFOCENTER_H -#include "infomain_actions.h" #include "legogamestate.h" #include "legoworld.h" #include "mxrect32.h" @@ -11,6 +10,11 @@ class InfocenterState; class MxStillPresenter; class LegoControlManagerEvent; +namespace InfomainScript +{ +enum Script; +} + // SIZE 0x18 struct InfocenterMapEntry { // FUNCTION: LEGO1 0x1006ec80 @@ -93,7 +97,7 @@ class Infocenter : public LegoWorld { void StartCredits(); void StopCredits(); - void PlayAction(InfomainScript::Script p_objectId); + void PlayAction(InfomainScript::Script p_script); void StopCurrentAction(); void PlayBookAnimation(); diff --git a/LEGO1/lego/legoomni/include/isle.h b/LEGO1/lego/legoomni/include/isle.h index 91a02430..8a39144a 100644 --- a/LEGO1/lego/legoomni/include/isle.h +++ b/LEGO1/lego/legoomni/include/isle.h @@ -19,6 +19,16 @@ class RaceCar; class Jetski; class Act1State; +namespace IsleScript +{ +enum Script; +} + +namespace JukeboxScript +{ +enum Script; +} + // VTABLE: LEGO1 0x100d6fb8 // SIZE 0x140 class Isle : public LegoWorld { @@ -66,28 +76,34 @@ class Isle : public LegoWorld { MxLong HandleTransitionEnd(); void FUN_10032620(); void FUN_100330e0(); + void FUN_10032d30( + IsleScript::Script p_script, + JukeboxScript::Script p_music, + const char* p_cameraLocation, + MxBool p_und + ); - inline void SetUnknown13c(LegoGameState::Area p_unk0x13c) { m_unk0x13c = p_unk0x13c; } + inline void SetDestLocation(LegoGameState::Area p_destLocation) { m_destLocation = p_destLocation; } // SYNTHETIC: LEGO1 0x10030a30 // Isle::`scalar deleting destructor' protected: - Act1State* m_act1state; // 0xf8 - Pizza* m_pizza; // 0xfc - Pizzeria* m_pizzeria; // 0x100 - TowTrack* m_towtrack; // 0x104 - Ambulance* m_ambulance; // 0x108 - JukeBoxEntity* m_jukebox; // 0x10c - Helicopter* m_helicopter; // 0x110 - Bike* m_bike; // 0x114 - DuneBuggy* m_dunebuggy; // 0x118 - Motocycle* m_motocycle; // 0x11c - SkateBoard* m_skateboard; // 0x120 - RaceCar* m_racecar; // 0x124 - Jetski* m_jetski; // 0x128 - Radio m_radio; // 0x12c - LegoGameState::Area m_unk0x13c; // 0x13c + Act1State* m_act1state; // 0xf8 + Pizza* m_pizza; // 0xfc + Pizzeria* m_pizzeria; // 0x100 + TowTrack* m_towtrack; // 0x104 + Ambulance* m_ambulance; // 0x108 + JukeBoxEntity* m_jukebox; // 0x10c + Helicopter* m_helicopter; // 0x110 + Bike* m_bike; // 0x114 + DuneBuggy* m_dunebuggy; // 0x118 + Motocycle* m_motocycle; // 0x11c + SkateBoard* m_skateboard; // 0x120 + RaceCar* m_racecar; // 0x124 + Jetski* m_jetski; // 0x128 + Radio m_radio; // 0x12c + LegoGameState::Area m_destLocation; // 0x13c }; #endif // ISLE_H diff --git a/LEGO1/lego/legoomni/include/jetski.h b/LEGO1/lego/legoomni/include/jetski.h index b71e43cf..92147be9 100644 --- a/LEGO1/lego/legoomni/include/jetski.h +++ b/LEGO1/lego/legoomni/include/jetski.h @@ -30,12 +30,17 @@ class Jetski : public IslePathActor { MxU32 VTable0xd4(LegoControlManagerEvent&) override; // vtable+0xd4 void VTable0xe4() override; // vtable+0xe4 + void FUN_1007e990(); + + inline MxS16 GetUnknown0x160() { return m_unk0x160; } + // SYNTHETIC: LEGO1 0x1007e5c0 // Jetski::`scalar deleting destructor' private: // TODO: Jetski fields - undefined m_unk0x160[4]; + MxS16 m_unk0x160; // 0x160 + undefined m_unk0x162[2]; // 0x162 }; #endif // JETSKI_H diff --git a/LEGO1/lego/legoomni/include/jukebox.h b/LEGO1/lego/legoomni/include/jukebox.h index 0fde6a3b..f5778dda 100644 --- a/LEGO1/lego/legoomni/include/jukebox.h +++ b/LEGO1/lego/legoomni/include/jukebox.h @@ -2,9 +2,7 @@ #define JUKEBOX_H #include "decomp.h" -#include "jukebox_actions.h" #include "jukeboxstate.h" -#include "jukeboxw_actions.h" #include "legocontrolmanager.h" #include "legogamestate.h" #include "legoworld.h" diff --git a/LEGO1/lego/legoomni/include/legogamestate.h b/LEGO1/lego/legoomni/include/legogamestate.h index 32fb2a4b..dd294958 100644 --- a/LEGO1/lego/legoomni/include/legogamestate.h +++ b/LEGO1/lego/legoomni/include/legogamestate.h @@ -81,8 +81,9 @@ class LegoGameState { e_unk59, e_unk60, e_unk61, - - e_unk64 = 64, + e_unk62, + e_unk63, + e_unk64, e_unk66 = 66 }; diff --git a/LEGO1/lego/legoomni/include/misc.h b/LEGO1/lego/legoomni/include/misc.h index c026b5e1..0ff0af1a 100644 --- a/LEGO1/lego/legoomni/include/misc.h +++ b/LEGO1/lego/legoomni/include/misc.h @@ -26,6 +26,11 @@ class MxTransitionManager; class ViewLODListManager; class ViewManager; +namespace JukeboxScript +{ +enum Script; +} + extern MxBool g_isWorldActive; LegoOmni* Lego(); @@ -49,7 +54,7 @@ ViewLODListManager* GetViewLODListManager(); LegoWorld* FindWorld(const MxAtomId& p_atom, MxS32 p_entityid); LegoROI* FindROI(const char* p_name); MxDSAction& GetCurrentAction(); -void PlayMusic(MxU32 p_index); +void PlayMusic(JukeboxScript::Script p_script); void SetIsWorldActive(MxBool p_isWorldActive); void DeleteObjects(MxAtomId* p_id, MxS32 p_first, MxS32 p_last); void SetCurrentWorld(LegoWorld* p_world); diff --git a/LEGO1/lego/legoomni/include/motocycle.h b/LEGO1/lego/legoomni/include/motocycle.h index cf3f376f..638018f0 100644 --- a/LEGO1/lego/legoomni/include/motocycle.h +++ b/LEGO1/lego/legoomni/include/motocycle.h @@ -30,6 +30,8 @@ class Motocycle : public IslePathActor { MxU32 VTable0xdc(MxType19NotificationParam&) override; // vtable+0xdc void VTable0xe4() override; // vtable+0xe4 + void FUN_10035e10(); + // SYNTHETIC: LEGO1 0x100359d0 // Motocycle::`scalar deleting destructor' diff --git a/LEGO1/lego/legoomni/include/police.h b/LEGO1/lego/legoomni/include/police.h index 01908d41..721ec7cb 100644 --- a/LEGO1/lego/legoomni/include/police.h +++ b/LEGO1/lego/legoomni/include/police.h @@ -6,7 +6,6 @@ #include "legogamestate.h" #include "legoworld.h" #include "mxdsaction.h" -#include "police_actions.h" #include "radio.h" class PoliceState; diff --git a/LEGO1/lego/legoomni/include/policestate.h b/LEGO1/lego/legoomni/include/policestate.h index 1a01fd04..60f3507e 100644 --- a/LEGO1/lego/legoomni/include/policestate.h +++ b/LEGO1/lego/legoomni/include/policestate.h @@ -5,6 +5,11 @@ #include "legostate.h" #include "police.h" +namespace PoliceScript +{ +enum Script; +} + // VTABLE: LEGO1 0x100d8af0 // SIZE 0x10 class PoliceState : public LegoState { diff --git a/LEGO1/lego/legoomni/include/skateboard.h b/LEGO1/lego/legoomni/include/skateboard.h index 628e26f5..b5d4fbf1 100644 --- a/LEGO1/lego/legoomni/include/skateboard.h +++ b/LEGO1/lego/legoomni/include/skateboard.h @@ -29,6 +29,8 @@ class SkateBoard : public IslePathActor { MxU32 VTable0xd4(LegoControlManagerEvent& p_param) override; // vtable+0xd4 void VTable0xe4() override; // vtable+0xe4 + void FUN_10010510(); + // SYNTHETIC: LEGO1 0x1000ff60 // SkateBoard::`scalar deleting destructor' diff --git a/LEGO1/lego/legoomni/include/towtrack.h b/LEGO1/lego/legoomni/include/towtrack.h index 8ae7a1e6..2d1146ef 100644 --- a/LEGO1/lego/legoomni/include/towtrack.h +++ b/LEGO1/lego/legoomni/include/towtrack.h @@ -33,6 +33,7 @@ class TowTrack : public IslePathActor { void VTable0xe4() override; // vtable+0xe4 void FUN_1004dab0(); + void FUN_1004dad0(); // SYNTHETIC: LEGO1 0x1004c950 // TowTrack::`scalar deleting destructor' diff --git a/LEGO1/lego/legoomni/src/actors/ambulance.cpp b/LEGO1/lego/legoomni/src/actors/ambulance.cpp index 17a1d82f..298b1fb4 100644 --- a/LEGO1/lego/legoomni/src/actors/ambulance.cpp +++ b/LEGO1/lego/legoomni/src/actors/ambulance.cpp @@ -79,6 +79,12 @@ MxU32 Ambulance::VTable0xd4(LegoControlManagerEvent& p_param) return 0; } +// STUB: LEGO1 0x10037060 +void Ambulance::FUN_10037060() +{ + // TODO +} + // STUB: LEGO1 0x10037160 MxResult Ambulance::Tickle() { diff --git a/LEGO1/lego/legoomni/src/actors/bike.cpp b/LEGO1/lego/legoomni/src/actors/bike.cpp index f9921309..e556667f 100644 --- a/LEGO1/lego/legoomni/src/actors/bike.cpp +++ b/LEGO1/lego/legoomni/src/actors/bike.cpp @@ -56,3 +56,9 @@ MxU32 Bike::VTable0xd4(LegoControlManagerEvent& p_param) // TODO return 0; } + +// STUB: LEGO1 0x10076b60 +void Bike::FUN_10076b60() +{ + // TODO +} diff --git a/LEGO1/lego/legoomni/src/actors/dunebuggy.cpp b/LEGO1/lego/legoomni/src/actors/dunebuggy.cpp index 66fa23d2..70a19138 100644 --- a/LEGO1/lego/legoomni/src/actors/dunebuggy.cpp +++ b/LEGO1/lego/legoomni/src/actors/dunebuggy.cpp @@ -50,3 +50,9 @@ MxU32 DuneBuggy::VTable0xdc(MxType19NotificationParam& p_param) // TODO return 0; } + +// STUB: LEGO1 0x10068350 +void DuneBuggy::FUN_10068350() +{ + // TODO +} diff --git a/LEGO1/lego/legoomni/src/actors/helicopter.cpp b/LEGO1/lego/legoomni/src/actors/helicopter.cpp index a05bf431..81c6fc0e 100644 --- a/LEGO1/lego/legoomni/src/actors/helicopter.cpp +++ b/LEGO1/lego/legoomni/src/actors/helicopter.cpp @@ -4,6 +4,7 @@ #include "act3.h" #include "isle.h" #include "jukebox.h" +#include "jukebox_actions.h" #include "legoanimationmanager.h" #include "legocontrolmanager.h" #include "legogamestate.h" @@ -114,7 +115,7 @@ MxU32 Helicopter::VTable0xcc() m_script = *g_isleScript; AnimationManager()->FUN_10064670(FALSE); VTable0xe8(0x29, TRUE, 7); - ((Isle*) CurrentWorld())->SetUnknown13c(LegoGameState::e_unk60); + ((Isle*) CurrentWorld())->SetDestLocation(LegoGameState::e_unk60); FUN_10015820(TRUE, 0); TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, TRUE); SetUnknownDC(4); @@ -229,7 +230,7 @@ MxU32 Helicopter::VTable0xd4(LegoControlManagerEvent& p_param) break; case 0x1c: if (GameState()->GetCurrentAct() == LegoGameState::e_act1) { - ((Isle*) CurrentWorld())->SetUnknown13c(LegoGameState::e_infomain); + ((Isle*) CurrentWorld())->SetDestLocation(LegoGameState::e_infomain); TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE); VTable0xe4(); } diff --git a/LEGO1/lego/legoomni/src/actors/jetski.cpp b/LEGO1/lego/legoomni/src/actors/jetski.cpp index 7a5a3dcd..b68e6b5e 100644 --- a/LEGO1/lego/legoomni/src/actors/jetski.cpp +++ b/LEGO1/lego/legoomni/src/actors/jetski.cpp @@ -42,3 +42,9 @@ MxU32 Jetski::VTable0xd4(LegoControlManagerEvent& p_param) // TODO return 0; } + +// STUB: LEGO1 0x1007e990 +void Jetski::FUN_1007e990() +{ + // TODO +} diff --git a/LEGO1/lego/legoomni/src/actors/jukeboxentity.cpp b/LEGO1/lego/legoomni/src/actors/jukeboxentity.cpp index 32ce7429..7104b6f4 100644 --- a/LEGO1/lego/legoomni/src/actors/jukeboxentity.cpp +++ b/LEGO1/lego/legoomni/src/actors/jukeboxentity.cpp @@ -36,7 +36,7 @@ MxLong JukeBoxEntity::Notify(MxParam& p_param) CurrentActor()->VTable0xe4(); } - ((Isle*) FindWorld(*g_isleScript, 0))->SetUnknown13c(LegoGameState::e_jukeboxw); + ((Isle*) FindWorld(*g_isleScript, 0))->SetDestLocation(LegoGameState::e_jukeboxw); TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE); return 1; } diff --git a/LEGO1/lego/legoomni/src/actors/motorcycle.cpp b/LEGO1/lego/legoomni/src/actors/motorcycle.cpp index 0f4424f9..61e8eb3c 100644 --- a/LEGO1/lego/legoomni/src/actors/motorcycle.cpp +++ b/LEGO1/lego/legoomni/src/actors/motorcycle.cpp @@ -50,3 +50,9 @@ MxU32 Motocycle::VTable0xdc(MxType19NotificationParam& p_param) // TODO return 0; } + +// STUB: LEGO1 0x10035e10 +void Motocycle::FUN_10035e10() +{ + // TODO +} diff --git a/LEGO1/lego/legoomni/src/actors/skateboard.cpp b/LEGO1/lego/legoomni/src/actors/skateboard.cpp index 759ce4b6..5024c51d 100644 --- a/LEGO1/lego/legoomni/src/actors/skateboard.cpp +++ b/LEGO1/lego/legoomni/src/actors/skateboard.cpp @@ -50,3 +50,9 @@ MxU32 SkateBoard::VTable0xd0() // TODO return 0; } + +// STUB: LEGO1 0x10010510 +void SkateBoard::FUN_10010510() +{ + // TODO +} diff --git a/LEGO1/lego/legoomni/src/actors/towtrack.cpp b/LEGO1/lego/legoomni/src/actors/towtrack.cpp index 2f09b6ae..673efddc 100644 --- a/LEGO1/lego/legoomni/src/actors/towtrack.cpp +++ b/LEGO1/lego/legoomni/src/actors/towtrack.cpp @@ -75,3 +75,9 @@ void TowTrack::FUN_1004dab0() { // TODO } + +// STUB: LEGO1 0x1004dad0 +void TowTrack::FUN_1004dad0() +{ + // TODO +} diff --git a/LEGO1/lego/legoomni/src/common/misc.cpp b/LEGO1/lego/legoomni/src/common/misc.cpp index 0ac953b1..cf917a62 100644 --- a/LEGO1/lego/legoomni/src/common/misc.cpp +++ b/LEGO1/lego/legoomni/src/common/misc.cpp @@ -164,12 +164,11 @@ MxTransitionManager* TransitionManager() } // FUNCTION: LEGO1 0x10015910 -void PlayMusic(MxU32 p_index) +void PlayMusic(JukeboxScript::Script p_script) { - // index is the entityid of the music in jukebox.si MxDSAction action; action.SetAtomId(*g_jukeboxScript); - action.SetObjectId(p_index); + action.SetObjectId(p_script); LegoOmni::GetInstance()->GetBackgroundAudioManager()->PlayMusic(action, 5, 4); } diff --git a/LEGO1/lego/legoomni/src/infocenter/infocenterstate.cpp b/LEGO1/lego/legoomni/src/infocenter/infocenterstate.cpp index 0eedf9c5..8efa9807 100644 --- a/LEGO1/lego/legoomni/src/infocenter/infocenterstate.cpp +++ b/LEGO1/lego/legoomni/src/infocenter/infocenterstate.cpp @@ -1,6 +1,7 @@ #include "infocenterstate.h" #include "infocenter.h" +#include "infomain_actions.h" DECOMP_SIZE_ASSERT(InfocenterState, 0x94); diff --git a/LEGO1/lego/legoomni/src/isle/radiostate.cpp b/LEGO1/lego/legoomni/src/isle/radiostate.cpp index 2fff7e41..03334f2d 100644 --- a/LEGO1/lego/legoomni/src/isle/radiostate.cpp +++ b/LEGO1/lego/legoomni/src/isle/radiostate.cpp @@ -1,6 +1,7 @@ #include "radiostate.h" #include "jukebox.h" +#include "jukebox_actions.h" #include "legoomni.h" #include "mxmisc.h" #include "mxtimer.h" diff --git a/LEGO1/lego/legoomni/src/police/policestate.cpp b/LEGO1/lego/legoomni/src/police/policestate.cpp index 752ead10..994445c6 100644 --- a/LEGO1/lego/legoomni/src/police/policestate.cpp +++ b/LEGO1/lego/legoomni/src/police/policestate.cpp @@ -6,6 +6,7 @@ #include "mxdsaction.h" #include "mxmisc.h" #include "police.h" +#include "police_actions.h" #include diff --git a/LEGO1/lego/legoomni/src/worlds/elevatorbottom.cpp b/LEGO1/lego/legoomni/src/worlds/elevatorbottom.cpp index 31fd5b37..2f04a784 100644 --- a/LEGO1/lego/legoomni/src/worlds/elevatorbottom.cpp +++ b/LEGO1/lego/legoomni/src/worlds/elevatorbottom.cpp @@ -2,6 +2,7 @@ #include "act1state.h" #include "jukebox.h" +#include "jukebox_actions.h" #include "legocontrolmanager.h" #include "legogamestate.h" #include "legoinputmanager.h" diff --git a/LEGO1/lego/legoomni/src/worlds/historybook.cpp b/LEGO1/lego/legoomni/src/worlds/historybook.cpp index 91fb4ee9..9f99002b 100644 --- a/LEGO1/lego/legoomni/src/worlds/historybook.cpp +++ b/LEGO1/lego/legoomni/src/worlds/historybook.cpp @@ -1,6 +1,7 @@ #include "historybook.h" #include "jukebox.h" +#include "jukebox_actions.h" #include "legocontrolmanager.h" #include "legoinputmanager.h" #include "misc.h" diff --git a/LEGO1/lego/legoomni/src/worlds/hospital.cpp b/LEGO1/lego/legoomni/src/worlds/hospital.cpp index b5f73af6..4646718a 100644 --- a/LEGO1/lego/legoomni/src/worlds/hospital.cpp +++ b/LEGO1/lego/legoomni/src/worlds/hospital.cpp @@ -1,7 +1,9 @@ #include "hospital.h" +#include "hospital_actions.h" #include "islepathactor.h" #include "jukebox.h" +#include "jukebox_actions.h" #include "legocontrolmanager.h" #include "legoinputmanager.h" #include "legoomni.h" diff --git a/LEGO1/lego/legoomni/src/worlds/infocenter.cpp b/LEGO1/lego/legoomni/src/worlds/infocenter.cpp index d470fe2c..bdea2fd2 100644 --- a/LEGO1/lego/legoomni/src/worlds/infocenter.cpp +++ b/LEGO1/lego/legoomni/src/worlds/infocenter.cpp @@ -4,7 +4,9 @@ #include "credits_actions.h" #include "helicopterstate.h" #include "infocenterstate.h" +#include "infomain_actions.h" #include "jukebox.h" +#include "jukebox_actions.h" #include "legoact2state.h" #include "legoanimationmanager.h" #include "legobuildingmanager.h" @@ -1412,14 +1414,14 @@ void Infocenter::StopCredits() } // FUNCTION: LEGO1 0x10071300 -void Infocenter::PlayAction(InfomainScript::Script p_objectId) +void Infocenter::PlayAction(InfomainScript::Script p_script) { MxDSAction action; - action.SetObjectId(p_objectId); + action.SetObjectId(p_script); action.SetAtomId(*g_infomainScript); StopCurrentAction(); - m_currentInfomainScript = p_objectId; + m_currentInfomainScript = p_script; BackgroundAudioManager()->LowerVolume(); Start(&action); } diff --git a/LEGO1/lego/legoomni/src/worlds/infocenterdoor.cpp b/LEGO1/lego/legoomni/src/worlds/infocenterdoor.cpp index c9e65a14..049da564 100644 --- a/LEGO1/lego/legoomni/src/worlds/infocenterdoor.cpp +++ b/LEGO1/lego/legoomni/src/worlds/infocenterdoor.cpp @@ -2,6 +2,7 @@ #include "infocenterstate.h" #include "jukebox.h" +#include "jukebox_actions.h" #include "legocontrolmanager.h" #include "legogamestate.h" #include "legoinputmanager.h" diff --git a/LEGO1/lego/legoomni/src/worlds/isle.cpp b/LEGO1/lego/legoomni/src/worlds/isle.cpp index 8c8e2720..35321ab0 100644 --- a/LEGO1/lego/legoomni/src/worlds/isle.cpp +++ b/LEGO1/lego/legoomni/src/worlds/isle.cpp @@ -6,9 +6,11 @@ #include "carracestate.h" #include "dunebuggy.h" #include "helicopter.h" +#include "isle_actions.h" #include "islepathactor.h" #include "jetski.h" #include "jetskiracestate.h" +#include "jukebox_actions.h" #include "jukeboxentity.h" #include "legoanimationmanager.h" #include "legocontrolmanager.h" @@ -20,6 +22,7 @@ #include "motocycle.h" #include "mxmisc.h" #include "mxnotificationmanager.h" +#include "mxstillpresenter.h" #include "mxtransitionmanager.h" #include "pizza.h" #include "skateboard.h" @@ -48,7 +51,7 @@ Isle::Isle() m_racecar = NULL; m_jetski = NULL; m_act1state = 0; - m_unk0x13c = LegoGameState::e_undefined; + m_destLocation = LegoGameState::e_undefined; NotificationManager()->Register(this); } @@ -89,7 +92,7 @@ MxResult Isle::Create(MxDSAction& p_dsAction) GameState()->StopArea(LegoGameState::e_act2main); // Looks like a bug break; case LegoGameState::e_actNotFound: - m_unk0x13c = LegoGameState::e_infomain; + m_destLocation = LegoGameState::e_infomain; } if (GameState()->GetCurrentArea() == LegoGameState::e_isle) { @@ -257,7 +260,7 @@ void Isle::Enable(MxBool p_enable) switch (GameState()->m_currentArea) { case LegoGameState::e_elevride: - m_unk0x13c = LegoGameState::e_elevride; + m_destLocation = LegoGameState::e_elevride; #ifdef COMPAT_MODE { @@ -288,7 +291,7 @@ void Isle::Enable(MxBool p_enable) #endif break; case LegoGameState::e_garadoor: - m_unk0x13c = LegoGameState::e_garadoor; + m_destLocation = LegoGameState::e_garadoor; #ifdef COMPAT_MODE { @@ -302,7 +305,7 @@ void Isle::Enable(MxBool p_enable) SetIsWorldActive(FALSE); break; case LegoGameState::e_polidoor: - m_unk0x13c = LegoGameState::e_polidoor; + m_destLocation = LegoGameState::e_polidoor; #ifdef COMPAT_MODE { @@ -542,10 +545,180 @@ void Isle::FUN_10032620() // TODO } -// STUB: LEGO1 0x100327a0 +// FUNCTION: LEGO1 0x100327a0 MxLong Isle::HandleTransitionEnd() { - return 0; + InvokeAction(Extra::e_stop, *g_isleScript, IsleScript::c_Avo917In_PlayWav, NULL); + DeleteObjects(&m_atom, IsleScript::c_Avo900Ps_PlayWav, IsleScript::c_Avo907Ps_PlayWav); + + if (m_destLocation != LegoGameState::e_unk61) { + m_act1state->m_unk0x018 = 0; + } + + switch (m_destLocation) { + case LegoGameState::e_infomain: + ((LegoEntity*) Find(*g_isleScript, IsleScript::c_InfoCenter_Entity))->GetROI()->SetUnknown0x0c(1); + GameState()->SwitchArea(m_destLocation); + m_destLocation = LegoGameState::e_undefined; + break; + case LegoGameState::e_elevride: + m_act1state->m_unk0x01f = 1; + VariableTable()->SetVariable("VISIBILITY", "Hide infocen"); + FUN_10032d30(IsleScript::c_ElevRide_Background_Bitmap, JukeboxScript::c_Elevator_Music, "LCAMZI1,90", FALSE); + break; + case LegoGameState::e_elevride2: + FUN_10032d30(IsleScript::c_ElevRide_Background_Bitmap, JukeboxScript::c_Elevator_Music, "LCAMZI2,90", FALSE); + + if (m_destLocation == LegoGameState::e_undefined) { + ((MxStillPresenter*) Find(m_atom, IsleScript::c_Meter3_Bitmap))->Enable(TRUE); + } + break; + case LegoGameState::e_elevopen: + FUN_10032d30( + IsleScript::c_ElevOpen_Background_Bitmap, + JukeboxScript::c_InfoCenter_3rd_Floor_Music, + "LCAMZIS,90", + FALSE + ); + break; + case LegoGameState::e_seaview: + FUN_10032d30( + IsleScript::c_SeaView_Background_Bitmap, + JukeboxScript::c_InfoCenter_3rd_Floor_Music, + "LCAMZIE,90", + FALSE + ); + break; + case LegoGameState::e_observe: + FUN_10032d30( + IsleScript::c_Observe_Background_Bitmap, + JukeboxScript::c_InfoCenter_3rd_Floor_Music, + "LCAMZIW,90", + FALSE + ); + break; + case LegoGameState::e_elevdown: + FUN_10032d30( + IsleScript::c_ElevDown_Background_Bitmap, + JukeboxScript::c_InfoCenter_3rd_Floor_Music, + "LCAMZIN,90", + FALSE + ); + break; + case LegoGameState::e_garadoor: + m_act1state->m_unk0x01f = 1; + VariableTable()->SetVariable("VISIBILITY", "Hide Gas"); + FUN_10032d30(IsleScript::c_GaraDoor_Background_Bitmap, JukeboxScript::c_JBMusic2, "LCAMZG1,90", FALSE); + break; + case LegoGameState::e_unk28: + GameState()->SwitchArea(m_destLocation); + GameState()->StopArea(LegoGameState::e_previousArea); + m_destLocation = LegoGameState::e_undefined; + VariableTable()->SetVariable("VISIBILITY", "Show Gas"); + AnimationManager()->FUN_1005f0b0(); + FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen); + SetAppCursor(0); + SetIsWorldActive(TRUE); + break; + case LegoGameState::e_unk33: + GameState()->SwitchArea(m_destLocation); + GameState()->StopArea(LegoGameState::e_previousArea); + m_destLocation = LegoGameState::e_undefined; + VariableTable()->SetVariable("VISIBILITY", "Show Policsta"); + AnimationManager()->FUN_1005f0b0(); + FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen); + SetAppCursor(0); + SetIsWorldActive(TRUE); + break; + case LegoGameState::e_polidoor: + m_act1state->m_unk0x01f = 1; + VariableTable()->SetVariable("VISIBILITY", "Hide Policsta"); + FUN_10032d30( + IsleScript::c_PoliDoor_Background_Bitmap, + JukeboxScript::c_PoliceStation_Music, + "LCAMZP1,90", + FALSE + ); + break; + case LegoGameState::e_unk57: + m_act1state->m_unk0x01f = 1; + FUN_10032d30(IsleScript::c_BikeDashboard_Bitmap, JukeboxScript::c_MusicTheme1, NULL, TRUE); + + if (m_act1state->m_unk0x01f == 0) { + m_bike->FUN_10076b60(); + } + break; + case LegoGameState::e_unk58: + m_act1state->m_unk0x01f = 1; + FUN_10032d30(IsleScript::c_DuneCarFuelMeter, JukeboxScript::c_MusicTheme1, NULL, TRUE); + + if (m_act1state->m_unk0x01f == 0) { + m_dunebuggy->FUN_10068350(); + } + break; + case LegoGameState::e_unk59: + m_act1state->m_unk0x01f = 1; + FUN_10032d30(IsleScript::c_MotoBikeDashboard_Bitmap, JukeboxScript::c_MusicTheme1, NULL, TRUE); + + if (m_act1state->m_unk0x01f == 0) { + m_motocycle->FUN_10035e10(); + } + break; + case LegoGameState::e_unk60: + m_act1state->m_unk0x01f = 1; + FUN_10032d30(IsleScript::c_HelicopterDashboard_Bitmap, JukeboxScript::c_MusicTheme1, NULL, TRUE); + break; + case LegoGameState::e_unk61: + m_act1state->m_unk0x01f = 1; + FUN_10032d30(IsleScript::c_SkatePizza_Bitmap, JukeboxScript::c_MusicTheme1, NULL, TRUE); + + if (m_act1state->m_unk0x01f == 0) { + m_skateboard->FUN_10010510(); + } + break; + case LegoGameState::e_unk62: + m_act1state->m_unk0x01f = 1; + m_act1state->m_unk0x018 = 10; + FUN_10032d30(IsleScript::c_AmbulanceFuelMeter, JukeboxScript::c_MusicTheme1, NULL, TRUE); + + if (m_act1state->m_unk0x01f == 0) { + m_ambulance->FUN_10037060(); + } + break; + case LegoGameState::e_unk63: + m_act1state->m_unk0x01f = 1; + m_act1state->m_unk0x018 = 8; + FUN_10032d30(IsleScript::c_TowFuelMeter, JukeboxScript::c_MusicTheme1, NULL, TRUE); + + if (m_act1state->m_unk0x01f == 0) { + m_towtrack->FUN_1004dad0(); + } + break; + case LegoGameState::e_unk64: + m_act1state->m_unk0x01f = 1; + FUN_10032d30((IsleScript::Script) m_jetski->GetUnknown0x160(), JukeboxScript::c_MusicTheme1, NULL, TRUE); + + if (m_act1state->m_unk0x01f == 0) { + m_jetski->FUN_1007e990(); + } + break; + default: + GameState()->SwitchArea(m_destLocation); + m_destLocation = LegoGameState::e_undefined; + } + + return 1; +} + +// STUB: LEGO1 0x10032d30 +void Isle::FUN_10032d30( + IsleScript::Script p_script, + JukeboxScript::Script p_music, + const char* p_cameraLocation, + MxBool p_und +) +{ + // TODO } // FUNCTION: LEGO1 0x10032f10 diff --git a/LEGO1/lego/legoomni/src/worlds/jukebox.cpp b/LEGO1/lego/legoomni/src/worlds/jukebox.cpp index 62e810d5..84483153 100644 --- a/LEGO1/lego/legoomni/src/worlds/jukebox.cpp +++ b/LEGO1/lego/legoomni/src/worlds/jukebox.cpp @@ -1,7 +1,9 @@ #include "jukebox.h" #include "act1state.h" +#include "jukebox_actions.h" #include "jukeboxstate.h" +#include "jukeboxw_actions.h" #include "legocontrolmanager.h" #include "legogamestate.h" #include "legoinputmanager.h" diff --git a/LEGO1/lego/legoomni/src/worlds/police.cpp b/LEGO1/lego/legoomni/src/worlds/police.cpp index e9129dcd..b88594dc 100644 --- a/LEGO1/lego/legoomni/src/worlds/police.cpp +++ b/LEGO1/lego/legoomni/src/worlds/police.cpp @@ -1,6 +1,7 @@ #include "police.h" #include "jukebox.h" +#include "jukebox_actions.h" #include "legocontrolmanager.h" #include "legogamestate.h" #include "legoinputmanager.h" @@ -10,6 +11,7 @@ #include "mxmisc.h" #include "mxnotificationmanager.h" #include "mxtransitionmanager.h" +#include "police_actions.h" #include "policestate.h" DECOMP_SIZE_ASSERT(Police, 0x110) diff --git a/LEGO1/lego/legoomni/src/worlds/registrationbook.cpp b/LEGO1/lego/legoomni/src/worlds/registrationbook.cpp index 6d168637..3775b1bc 100644 --- a/LEGO1/lego/legoomni/src/worlds/registrationbook.cpp +++ b/LEGO1/lego/legoomni/src/worlds/registrationbook.cpp @@ -1,6 +1,7 @@ #include "registrationbook.h" #include "infocenterstate.h" +#include "jukebox_actions.h" #include "legocontrolmanager.h" #include "legogamestate.h" #include "legoinputmanager.h" diff --git a/LEGO1/lego/legoomni/src/worlds/score.cpp b/LEGO1/lego/legoomni/src/worlds/score.cpp index 32482f31..354079b7 100644 --- a/LEGO1/lego/legoomni/src/worlds/score.cpp +++ b/LEGO1/lego/legoomni/src/worlds/score.cpp @@ -2,6 +2,7 @@ #include "ambulancemissionstate.h" #include "jukebox.h" +#include "jukebox_actions.h" #include "legocontrolmanager.h" #include "legogamestate.h" #include "legoinputmanager.h"