From 5b8f51596868bb6464b8befff68229908449953f Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Sun, 17 Mar 2024 13:01:47 -0400 Subject: [PATCH] Implement/match Isle::HandleTransitionEnd (#683) * Implement/match Isle::HandleTransitionEnd * Rename enums * Forward declare enum for C++11+ * Add underlying storage to action headers * Fix missing define --- .../include/actions/act2main_actions.h | 4 + .../legoomni/include/actions/act3_actions.h | 4 + .../include/actions/carrace_actions.h | 4 + .../include/actions/carracer_actions.h | 4 + .../legoomni/include/actions/copter_actions.h | 4 + .../include/actions/credits_actions.h | 4 + .../include/actions/dunecar_actions.h | 4 + .../include/actions/elevbott_actions.h | 4 + .../legoomni/include/actions/garage_actions.h | 4 + .../include/actions/histbook_actions.h | 4 + .../include/actions/hospital_actions.h | 4 + .../include/actions/infodoor_actions.h | 4 + .../include/actions/infomain_actions.h | 4 + .../include/actions/infoscor_actions.h | 4 + .../legoomni/include/actions/intro_actions.h | 4 + .../legoomni/include/actions/isle_actions.h | 12 +- .../include/actions/jetrace_actions.h | 4 + .../include/actions/jetracer_actions.h | 4 + .../legoomni/include/actions/jetski_actions.h | 4 + .../include/actions/jukebox_actions.h | 4 + .../include/actions/jukeboxw_actions.h | 4 + .../legoomni/include/actions/nocd_actions.h | 4 + .../legoomni/include/actions/police_actions.h | 4 + .../include/actions/racecar_actions.h | 4 + .../include/actions/regbook_actions.h | 4 + .../include/actions/sndanim_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 | 9 + LEGO1/lego/legoomni/include/hospitalstate.h | 1 - LEGO1/lego/legoomni/include/infocenter.h | 12 +- LEGO1/lego/legoomni/include/isle.h | 56 +++-- LEGO1/lego/legoomni/include/jetski.h | 7 +- LEGO1/lego/legoomni/include/jukebox.h | 2 - LEGO1/lego/legoomni/include/legogamestate.h | 23 +- LEGO1/lego/legoomni/include/misc.h | 12 +- LEGO1/lego/legoomni/include/motocycle.h | 2 + LEGO1/lego/legoomni/include/police.h | 1 - LEGO1/lego/legoomni/include/policestate.h | 9 + 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 | 8 +- LEGO1/lego/legoomni/src/actors/dunebuggy.cpp | 6 + LEGO1/lego/legoomni/src/actors/helicopter.cpp | 7 +- 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 + .../legoomni/src/common/legogamestate.cpp | 28 +-- 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 | 211 ++++++++++++++++-- LEGO1/lego/legoomni/src/worlds/jukebox.cpp | 2 + LEGO1/lego/legoomni/src/worlds/police.cpp | 4 +- .../legoomni/src/worlds/registrationbook.cpp | 1 + LEGO1/lego/legoomni/src/worlds/score.cpp | 1 + 66 files changed, 494 insertions(+), 81 deletions(-) diff --git a/LEGO1/lego/legoomni/include/actions/act2main_actions.h b/LEGO1/lego/legoomni/include/actions/act2main_actions.h index c86570bc..0dfeb72e 100644 --- a/LEGO1/lego/legoomni/include/actions/act2main_actions.h +++ b/LEGO1/lego/legoomni/include/actions/act2main_actions.h @@ -5,7 +5,11 @@ namespace Act2mainScript { +#ifdef COMPAT_MODE +enum Script : int { +#else enum Script { +#endif c_noneAct2main = -1, c__Act2Main = 0, diff --git a/LEGO1/lego/legoomni/include/actions/act3_actions.h b/LEGO1/lego/legoomni/include/actions/act3_actions.h index 24a5eff7..c10c229b 100644 --- a/LEGO1/lego/legoomni/include/actions/act3_actions.h +++ b/LEGO1/lego/legoomni/include/actions/act3_actions.h @@ -5,7 +5,11 @@ namespace Act3Script { +#ifdef COMPAT_MODE +enum Script : int { +#else enum Script { +#endif c_noneAct3 = -1, c__Act3 = 0, diff --git a/LEGO1/lego/legoomni/include/actions/carrace_actions.h b/LEGO1/lego/legoomni/include/actions/carrace_actions.h index 276611e5..5084f2bc 100644 --- a/LEGO1/lego/legoomni/include/actions/carrace_actions.h +++ b/LEGO1/lego/legoomni/include/actions/carrace_actions.h @@ -5,7 +5,11 @@ namespace CarraceScript { +#ifdef COMPAT_MODE +enum Script : int { +#else enum Script { +#endif c_noneCarrace = -1, c__CarRace_World = 0, diff --git a/LEGO1/lego/legoomni/include/actions/carracer_actions.h b/LEGO1/lego/legoomni/include/actions/carracer_actions.h index 610e0ebf..7bde84b3 100644 --- a/LEGO1/lego/legoomni/include/actions/carracer_actions.h +++ b/LEGO1/lego/legoomni/include/actions/carracer_actions.h @@ -5,7 +5,11 @@ namespace CarracerScript { +#ifdef COMPAT_MODE +enum Script : int { +#else enum Script { +#endif c_noneCarracer = -1, c_nrt002pz_Anim = 0, diff --git a/LEGO1/lego/legoomni/include/actions/copter_actions.h b/LEGO1/lego/legoomni/include/actions/copter_actions.h index 9cb606a9..749898b6 100644 --- a/LEGO1/lego/legoomni/include/actions/copter_actions.h +++ b/LEGO1/lego/legoomni/include/actions/copter_actions.h @@ -5,7 +5,11 @@ namespace CopterScript { +#ifdef COMPAT_MODE +enum Script : int { +#else enum Script { +#endif c_noneCopter = -1, c__StartUp = 0, diff --git a/LEGO1/lego/legoomni/include/actions/credits_actions.h b/LEGO1/lego/legoomni/include/actions/credits_actions.h index c20bc0f8..a754a15b 100644 --- a/LEGO1/lego/legoomni/include/actions/credits_actions.h +++ b/LEGO1/lego/legoomni/include/actions/credits_actions.h @@ -5,7 +5,11 @@ namespace CreditsScript { +#ifdef COMPAT_MODE +enum Script : int { +#else enum Script { +#endif c_noneCredits = -1, c_Credits_Wav = 0, diff --git a/LEGO1/lego/legoomni/include/actions/dunecar_actions.h b/LEGO1/lego/legoomni/include/actions/dunecar_actions.h index 52285fbb..bc1ea6fd 100644 --- a/LEGO1/lego/legoomni/include/actions/dunecar_actions.h +++ b/LEGO1/lego/legoomni/include/actions/dunecar_actions.h @@ -5,7 +5,11 @@ namespace DunecarScript { +#ifdef COMPAT_MODE +enum Script : int { +#else enum Script { +#endif c_noneDunecar = -1, c__StartUp = 0, diff --git a/LEGO1/lego/legoomni/include/actions/elevbott_actions.h b/LEGO1/lego/legoomni/include/actions/elevbott_actions.h index de2dde7b..45e63778 100644 --- a/LEGO1/lego/legoomni/include/actions/elevbott_actions.h +++ b/LEGO1/lego/legoomni/include/actions/elevbott_actions.h @@ -5,7 +5,11 @@ namespace ElevbottScript { +#ifdef COMPAT_MODE +enum Script : int { +#else enum Script { +#endif c_noneElevbott = -1, c__StartUp = 0, diff --git a/LEGO1/lego/legoomni/include/actions/garage_actions.h b/LEGO1/lego/legoomni/include/actions/garage_actions.h index f9ec834f..8d6988f5 100644 --- a/LEGO1/lego/legoomni/include/actions/garage_actions.h +++ b/LEGO1/lego/legoomni/include/actions/garage_actions.h @@ -5,7 +5,11 @@ namespace GarageScript { +#ifdef COMPAT_MODE +enum Script : int { +#else enum Script { +#endif c_noneGarage = -1, c__StartUp = 0, diff --git a/LEGO1/lego/legoomni/include/actions/histbook_actions.h b/LEGO1/lego/legoomni/include/actions/histbook_actions.h index 88855148..5ed2df76 100644 --- a/LEGO1/lego/legoomni/include/actions/histbook_actions.h +++ b/LEGO1/lego/legoomni/include/actions/histbook_actions.h @@ -5,7 +5,11 @@ namespace HistbookScript { +#ifdef COMPAT_MODE +enum Script : int { +#else enum Script { +#endif c_noneHistbook = -1, c__StartUp = 0, diff --git a/LEGO1/lego/legoomni/include/actions/hospital_actions.h b/LEGO1/lego/legoomni/include/actions/hospital_actions.h index 8c8d46bd..f8f52c51 100644 --- a/LEGO1/lego/legoomni/include/actions/hospital_actions.h +++ b/LEGO1/lego/legoomni/include/actions/hospital_actions.h @@ -5,7 +5,11 @@ namespace HospitalScript { +#ifdef COMPAT_MODE +enum Script : int { +#else enum Script { +#endif c_noneHospital = -1, c__StartUp = 0, diff --git a/LEGO1/lego/legoomni/include/actions/infodoor_actions.h b/LEGO1/lego/legoomni/include/actions/infodoor_actions.h index 64738b1c..d422e237 100644 --- a/LEGO1/lego/legoomni/include/actions/infodoor_actions.h +++ b/LEGO1/lego/legoomni/include/actions/infodoor_actions.h @@ -5,7 +5,11 @@ namespace InfodoorScript { +#ifdef COMPAT_MODE +enum Script : int { +#else enum Script { +#endif c_noneInfodoor = -1, c__StartUp = 0, diff --git a/LEGO1/lego/legoomni/include/actions/infomain_actions.h b/LEGO1/lego/legoomni/include/actions/infomain_actions.h index 6e8cf021..9f0afb9f 100644 --- a/LEGO1/lego/legoomni/include/actions/infomain_actions.h +++ b/LEGO1/lego/legoomni/include/actions/infomain_actions.h @@ -5,7 +5,11 @@ namespace InfomainScript { +#ifdef COMPAT_MODE +enum Script : int { +#else enum Script { +#endif c_noneInfomain = -1, c__InfoMain = 0, diff --git a/LEGO1/lego/legoomni/include/actions/infoscor_actions.h b/LEGO1/lego/legoomni/include/actions/infoscor_actions.h index 66b536b0..b1cecbc1 100644 --- a/LEGO1/lego/legoomni/include/actions/infoscor_actions.h +++ b/LEGO1/lego/legoomni/include/actions/infoscor_actions.h @@ -5,7 +5,11 @@ namespace InfoscorScript { +#ifdef COMPAT_MODE +enum Script : int { +#else enum Script { +#endif c_noneInfoscor = -1, c__StartUp = 0, diff --git a/LEGO1/lego/legoomni/include/actions/intro_actions.h b/LEGO1/lego/legoomni/include/actions/intro_actions.h index e1899937..4f882cff 100644 --- a/LEGO1/lego/legoomni/include/actions/intro_actions.h +++ b/LEGO1/lego/legoomni/include/actions/intro_actions.h @@ -5,7 +5,11 @@ namespace IntroScript { +#ifdef COMPAT_MODE +enum Script : int { +#else enum Script { +#endif c_noneIntro = -1, c_Lego_Movie = 0, diff --git a/LEGO1/lego/legoomni/include/actions/isle_actions.h b/LEGO1/lego/legoomni/include/actions/isle_actions.h index d9518c7b..bf774c00 100644 --- a/LEGO1/lego/legoomni/include/actions/isle_actions.h +++ b/LEGO1/lego/legoomni/include/actions/isle_actions.h @@ -5,7 +5,11 @@ namespace IsleScript { +#ifdef COMPAT_MODE +enum Script : int { +#else enum Script { +#endif c_noneIsle = -1, c__Isle = 0, @@ -2435,6 +2439,12 @@ enum Script { c_hho141cl_Pho_684 = 2427, c_hho142cl_0_sfx = 2428, c_hho142cl_1_sfx = 2429, +}; +#ifdef COMPAT_MODE +enum Script2 : int { +#else +enum Script2 { +#endif c_hho142cl_2_sfx = 2430, c_hho142cl_3_sfx = 2431, c_hho142cl_4_sfx = 2432, @@ -3671,7 +3681,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/actions/jetrace_actions.h b/LEGO1/lego/legoomni/include/actions/jetrace_actions.h index cb8e886e..82bd9013 100644 --- a/LEGO1/lego/legoomni/include/actions/jetrace_actions.h +++ b/LEGO1/lego/legoomni/include/actions/jetrace_actions.h @@ -5,7 +5,11 @@ namespace JetraceScript { +#ifdef COMPAT_MODE +enum Script : int { +#else enum Script { +#endif c_noneJetrace = -1, c__JetRace_World = 0, diff --git a/LEGO1/lego/legoomni/include/actions/jetracer_actions.h b/LEGO1/lego/legoomni/include/actions/jetracer_actions.h index a2562969..01220338 100644 --- a/LEGO1/lego/legoomni/include/actions/jetracer_actions.h +++ b/LEGO1/lego/legoomni/include/actions/jetracer_actions.h @@ -5,7 +5,11 @@ namespace JetracerScript { +#ifdef COMPAT_MODE +enum Script : int { +#else enum Script { +#endif c_noneJetracer = -1, c_Trigger200_Drown = 200, diff --git a/LEGO1/lego/legoomni/include/actions/jetski_actions.h b/LEGO1/lego/legoomni/include/actions/jetski_actions.h index d55a86d5..9984f7b9 100644 --- a/LEGO1/lego/legoomni/include/actions/jetski_actions.h +++ b/LEGO1/lego/legoomni/include/actions/jetski_actions.h @@ -5,7 +5,11 @@ namespace JetskiScript { +#ifdef COMPAT_MODE +enum Script : int { +#else enum Script { +#endif c_noneJetski = -1, c__StartUp = 0, diff --git a/LEGO1/lego/legoomni/include/actions/jukebox_actions.h b/LEGO1/lego/legoomni/include/actions/jukebox_actions.h index cf4e334f..483b5652 100644 --- a/LEGO1/lego/legoomni/include/actions/jukebox_actions.h +++ b/LEGO1/lego/legoomni/include/actions/jukebox_actions.h @@ -5,7 +5,11 @@ namespace JukeboxScript { +#ifdef COMPAT_MODE +enum Script : int { +#else enum Script { +#endif c_noneJukebox = -1, c_MusicTheme1 = 0, diff --git a/LEGO1/lego/legoomni/include/actions/jukeboxw_actions.h b/LEGO1/lego/legoomni/include/actions/jukeboxw_actions.h index 9647202e..54be7db8 100644 --- a/LEGO1/lego/legoomni/include/actions/jukeboxw_actions.h +++ b/LEGO1/lego/legoomni/include/actions/jukeboxw_actions.h @@ -5,7 +5,11 @@ namespace JukeboxwScript { +#ifdef COMPAT_MODE +enum Script : int { +#else enum Script { +#endif c_noneJukeboxw = -1, c__StartUp = 0, diff --git a/LEGO1/lego/legoomni/include/actions/nocd_actions.h b/LEGO1/lego/legoomni/include/actions/nocd_actions.h index 54e03dcd..b445e0d7 100644 --- a/LEGO1/lego/legoomni/include/actions/nocd_actions.h +++ b/LEGO1/lego/legoomni/include/actions/nocd_actions.h @@ -5,7 +5,11 @@ namespace NocdScript { +#ifdef COMPAT_MODE +enum Script : int { +#else enum Script { +#endif c_noneNocd = -1, c_NoCD_Movie = 0, diff --git a/LEGO1/lego/legoomni/include/actions/police_actions.h b/LEGO1/lego/legoomni/include/actions/police_actions.h index e151a7a0..a9f6cd99 100644 --- a/LEGO1/lego/legoomni/include/actions/police_actions.h +++ b/LEGO1/lego/legoomni/include/actions/police_actions.h @@ -5,7 +5,11 @@ namespace PoliceScript { +#ifdef COMPAT_MODE +enum Script : int { +#else enum Script { +#endif c_nonePolice = -1, c__StartUp = 0, diff --git a/LEGO1/lego/legoomni/include/actions/racecar_actions.h b/LEGO1/lego/legoomni/include/actions/racecar_actions.h index eb79f14a..765697aa 100644 --- a/LEGO1/lego/legoomni/include/actions/racecar_actions.h +++ b/LEGO1/lego/legoomni/include/actions/racecar_actions.h @@ -5,7 +5,11 @@ namespace RacecarScript { +#ifdef COMPAT_MODE +enum Script : int { +#else enum Script { +#endif c_noneRacecar = -1, c__StartUp = 0, diff --git a/LEGO1/lego/legoomni/include/actions/regbook_actions.h b/LEGO1/lego/legoomni/include/actions/regbook_actions.h index 42470c15..6f46e2cf 100644 --- a/LEGO1/lego/legoomni/include/actions/regbook_actions.h +++ b/LEGO1/lego/legoomni/include/actions/regbook_actions.h @@ -5,7 +5,11 @@ namespace RegbookScript { +#ifdef COMPAT_MODE +enum Script : int { +#else enum Script { +#endif c_noneRegbook = -1, c__StartUp = 0, diff --git a/LEGO1/lego/legoomni/include/actions/sndanim_actions.h b/LEGO1/lego/legoomni/include/actions/sndanim_actions.h index bc2a2b45..e52d8832 100644 --- a/LEGO1/lego/legoomni/include/actions/sndanim_actions.h +++ b/LEGO1/lego/legoomni/include/actions/sndanim_actions.h @@ -5,7 +5,11 @@ namespace SndanimScript { +#ifdef COMPAT_MODE +enum Script : int { +#else enum Script { +#endif c_noneSndanim = -1, c_SoundAndAnim_Action = 0, 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..73585c64 100644 --- a/LEGO1/lego/legoomni/include/hospital.h +++ b/LEGO1/lego/legoomni/include/hospital.h @@ -8,6 +8,15 @@ #include "mxstillpresenter.h" #include "radio.h" +namespace HospitalScript +{ +#ifdef COMPAT_MODE +enum Script : int; +#else +enum Script; +#endif +} // namespace HospitalScript + // 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..c2dd079c 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,15 @@ class InfocenterState; class MxStillPresenter; class LegoControlManagerEvent; +namespace InfomainScript +{ +#ifdef COMPAT_MODE +enum Script : int; +#else +enum Script; +#endif +} // namespace InfomainScript + // SIZE 0x18 struct InfocenterMapEntry { // FUNCTION: LEGO1 0x1006ec80 @@ -93,7 +101,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..ba219794 100644 --- a/LEGO1/lego/legoomni/include/isle.h +++ b/LEGO1/lego/legoomni/include/isle.h @@ -19,6 +19,24 @@ class RaceCar; class Jetski; class Act1State; +namespace IsleScript +{ +#ifdef COMPAT_MODE +enum Script : int; +#else +enum Script; +#endif +} // namespace IsleScript + +namespace JukeboxScript +{ +#ifdef COMPAT_MODE +enum Script : int; +#else +enum Script; +#endif +} // namespace JukeboxScript + // VTABLE: LEGO1 0x100d6fb8 // SIZE 0x140 class Isle : public LegoWorld { @@ -66,28 +84,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..f61467df 100644 --- a/LEGO1/lego/legoomni/include/legogamestate.h +++ b/LEGO1/lego/legoomni/include/legogamestate.h @@ -64,10 +64,10 @@ class LegoGameState { e_unk33, e_police, e_polidoor, - e_copter, - e_dunecar, - e_jetski, - e_racecar, + e_copterbuild, + e_dunecarbuild, + e_jetskibuild, + e_racecarbuild, e_act2main = 46, e_act3script, @@ -76,13 +76,14 @@ class LegoGameState { e_unk54, e_histbook = 56, - e_unk57, - e_unk58, - e_unk59, - e_unk60, - e_unk61, - - e_unk64 = 64, + e_bike, + e_dunecar, + e_motocycle, + e_copter, + e_skateboard, + e_ambulance, + e_towtrack, + e_jetski, e_unk66 = 66 }; diff --git a/LEGO1/lego/legoomni/include/misc.h b/LEGO1/lego/legoomni/include/misc.h index c026b5e1..7ff00f83 100644 --- a/LEGO1/lego/legoomni/include/misc.h +++ b/LEGO1/lego/legoomni/include/misc.h @@ -1,6 +1,7 @@ #ifndef MISC_H #define MISC_H +#include "compat.h" #include "decomp.h" #include "mxtypes.h" @@ -26,6 +27,15 @@ class MxTransitionManager; class ViewLODListManager; class ViewManager; +namespace JukeboxScript +{ +#ifdef COMPAT_MODE +enum Script : int; +#else +enum Script; +#endif +} // namespace JukeboxScript + extern MxBool g_isWorldActive; LegoOmni* Lego(); @@ -49,7 +59,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..3deaff35 100644 --- a/LEGO1/lego/legoomni/include/policestate.h +++ b/LEGO1/lego/legoomni/include/policestate.h @@ -5,6 +5,15 @@ #include "legostate.h" #include "police.h" +namespace PoliceScript +{ +#ifdef COMPAT_MODE +enum Script : int; +#else +enum Script; +#endif +} // namespace PoliceScript + // 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..b0dcab1f 100644 --- a/LEGO1/lego/legoomni/src/actors/bike.cpp +++ b/LEGO1/lego/legoomni/src/actors/bike.cpp @@ -34,7 +34,7 @@ MxResult Bike::Create(MxDSAction& p_dsAction) void Bike::VTable0xe4() { IslePathActor::VTable0xe4(); - GameState()->SetCurrentArea(LegoGameState::Area::e_unk57); + GameState()->SetCurrentArea(LegoGameState::Area::e_bike); FUN_1003ee00(*g_isleScript, 11); FUN_1003ee00(*g_isleScript, 12); FUN_1003ee00(*g_isleScript, 15); @@ -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..969f32c8 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" @@ -67,7 +68,7 @@ void Helicopter::VTable0xe4() IslePathActor::VTable0xe4(); if (GameState()->GetCurrentAct() == LegoGameState::e_act1) { - GameState()->SetCurrentArea(LegoGameState::e_unk60); + GameState()->SetCurrentArea(LegoGameState::e_copter); if (CurrentActor()) { if (CurrentActor()->IsA("IslePathActor")) { ((IslePathActor*) CurrentActor())->VTable0xe8(0x37, TRUE, 7); @@ -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_copter); 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/legogamestate.cpp b/LEGO1/lego/legoomni/src/common/legogamestate.cpp index 46da224c..5acfce1b 100644 --- a/LEGO1/lego/legoomni/src/common/legogamestate.cpp +++ b/LEGO1/lego/legoomni/src/common/legogamestate.cpp @@ -702,22 +702,22 @@ void LegoGameState::StopArea(Area p_area) RemoveFromWorld(*g_isleScript, 0x481, *g_isleScript, 0); RemoveFromWorld(*g_isleScript, 0x482, *g_isleScript, 0); break; - case e_copter: + case e_copterbuild: InvokeAction(Extra::e_stop, *g_jukeboxScript, 0x2f, NULL); InvokeAction(Extra::e_stop, *g_copterScript, 0, NULL); InvokeAction(Extra::e_close, *g_copterScript, 0, NULL); break; - case e_dunecar: + case e_dunecarbuild: InvokeAction(Extra::e_stop, *g_jukeboxScript, 0x31, NULL); InvokeAction(Extra::e_stop, *g_dunecarScript, 0, NULL); InvokeAction(Extra::e_close, *g_dunecarScript, 0, NULL); break; - case e_jetski: + case e_jetskibuild: InvokeAction(Extra::e_stop, *g_jukeboxScript, 0x33, NULL); InvokeAction(Extra::e_stop, *g_jetskiScript, 0, NULL); InvokeAction(Extra::e_close, *g_jetskiScript, 0, NULL); break; - case e_racecar: + case e_racecarbuild: InvokeAction(Extra::e_stop, *g_jukeboxScript, 0x35, NULL); InvokeAction(Extra::e_stop, *g_racecarScript, 0, NULL); InvokeAction(Extra::e_close, *g_racecarScript, 0, NULL); @@ -801,12 +801,12 @@ void LegoGameState::SwitchArea(Area p_area) case e_hospitalExterior: case e_unk31: case e_policeExterior: - case e_unk57: - case e_unk58: - case e_unk59: - case e_unk60: - case e_unk61: - case e_unk64: + case e_bike: + case e_dunecar: + case e_motocycle: + case e_copter: + case e_skateboard: + case e_jetski: case e_unk66: LoadIsle(); break; @@ -902,19 +902,19 @@ void LegoGameState::SwitchArea(Area p_area) LoadIsle(); InvokeAction(Extra::ActionType::e_start, *g_isleScript, 1150, NULL); break; - case e_copter: + case e_copterbuild: VideoManager()->SetUnk0x554(TRUE); InvokeAction(Extra::ActionType::e_opendisk, *g_copterScript, 0, NULL); break; - case e_dunecar: + case e_dunecarbuild: VideoManager()->SetUnk0x554(TRUE); InvokeAction(Extra::ActionType::e_opendisk, *g_dunecarScript, 0, NULL); break; - case e_jetski: + case e_jetskibuild: VideoManager()->SetUnk0x554(TRUE); InvokeAction(Extra::ActionType::e_opendisk, *g_jetskiScript, 0, NULL); break; - case e_racecar: + case e_racecarbuild: VideoManager()->SetUnk0x554(TRUE); InvokeAction(Extra::ActionType::e_opendisk, *g_racecarScript, 0, NULL); break; 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..68ae4580 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 { @@ -315,7 +318,7 @@ void Isle::Enable(MxBool p_enable) SetIsWorldActive(FALSE); break; - case LegoGameState::e_unk57: + case LegoGameState::e_bike: FUN_1001fa70(CurrentActor()); SetIsWorldActive(TRUE); @@ -328,7 +331,7 @@ void Isle::Enable(MxBool p_enable) m_bike->Notify(LegoEventNotificationParam(c_notificationType11, NULL, 0, 0, 0, 0)); #endif break; - case LegoGameState::e_unk58: + case LegoGameState::e_dunecar: FUN_1001fa70(CurrentActor()); SetIsWorldActive(TRUE); @@ -341,7 +344,7 @@ void Isle::Enable(MxBool p_enable) m_dunebuggy->Notify(LegoEventNotificationParam(c_notificationType11, NULL, 0, 0, 0, 0)); #endif break; - case LegoGameState::e_unk59: + case LegoGameState::e_motocycle: FUN_1001fa70(CurrentActor()); SetIsWorldActive(TRUE); @@ -354,7 +357,7 @@ void Isle::Enable(MxBool p_enable) m_motocycle->Notify(LegoEventNotificationParam(c_notificationType11, NULL, 0, 0, 0, 0)); #endif break; - case LegoGameState::e_unk60: + case LegoGameState::e_copter: FUN_1001fa70(CurrentActor()); SetIsWorldActive(TRUE); @@ -367,7 +370,7 @@ void Isle::Enable(MxBool p_enable) m_helicopter->Notify(LegoEventNotificationParam(c_notificationType11, NULL, 0, 0, 0, 0)); #endif break; - case LegoGameState::e_unk61: + case LegoGameState::e_skateboard: FUN_1001fa70(CurrentActor()); SetIsWorldActive(TRUE); @@ -380,7 +383,7 @@ void Isle::Enable(MxBool p_enable) m_skateboard->Notify(LegoEventNotificationParam(c_notificationType11, NULL, 0, 0, 0, 0)); #endif break; - case LegoGameState::e_unk64: + case LegoGameState::e_jetski: FUN_1001fa70(CurrentActor()); SetIsWorldActive(TRUE); @@ -511,12 +514,12 @@ void Isle::Enable(MxBool p_enable) (m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_elevride) && (m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_polidoor) && (m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_garadoor) && - (m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_unk57) && - (m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_unk58) && - (m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_unk59) && - (m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_unk60) && - (m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_unk64) && - (m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_unk61) && + (m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_bike) && + (m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_dunecar) && + (m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_motocycle) && + (m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_copter) && + (m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_jetski) && + (m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_skateboard) && (m_act1state->m_unk0x018 != 0 || GameState()->m_currentArea != LegoGameState::e_jetrace2)) { FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen); } @@ -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_skateboard) { + 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_bike: + 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_dunecar: + 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_motocycle: + 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_copter: + m_act1state->m_unk0x01f = 1; + FUN_10032d30(IsleScript::c_HelicopterDashboard_Bitmap, JukeboxScript::c_MusicTheme1, NULL, TRUE); + break; + case LegoGameState::e_skateboard: + 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_ambulance: + 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_towtrack: + 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_jetski: + 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..e73c1384 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) @@ -128,7 +130,7 @@ MxLong Police::HandleClick(LegoControlManagerEvent& p_param) } BackgroundAudioManager()->Stop(); - m_destLocation = LegoGameState::Area::e_copter; + m_destLocation = LegoGameState::Area::e_copterbuild; TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE); break; case PoliceScript::c_Donut_Ctl: 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"