Refactor JukeBox, add enum for music (#988)

* Refactor JukeBox, add enum for music

* add BETA annotation

* Fix BETA annotation

* Fix BETA annotation

* Fix
This commit is contained in:
Christian Semmler 2024-06-03 07:00:38 -04:00 committed by GitHub
parent 828b35e9d2
commit 73bb37596e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 102 additions and 105 deletions

View File

@ -79,6 +79,8 @@ public:
void FUN_10034b60(); void FUN_10034b60();
void FUN_10034d00(); void FUN_10034d00();
// TODO: Most likely getters/setters are not used according to BETA.
inline MxU32 GetUnknown18() { return m_unk0x018; } inline MxU32 GetUnknown18() { return m_unk0x018; }
inline ElevatorFloor GetElevatorFloor() { return (ElevatorFloor) m_elevFloor; } inline ElevatorFloor GetElevatorFloor() { return (ElevatorFloor) m_elevFloor; }
inline MxU8 GetUnknown21() { return m_unk0x021; } inline MxU8 GetUnknown21() { return m_unk0x021; }
@ -90,10 +92,6 @@ public:
// SYNTHETIC: LEGO1 0x10033960 // SYNTHETIC: LEGO1 0x10033960
// Act1State::`scalar deleting destructor' // Act1State::`scalar deleting destructor'
friend class Isle;
friend class SkateBoard;
protected:
MxS32* m_unk0x008; // 0x008 FIXME: count for m_unk0x008 MxS32* m_unk0x008; // 0x008 FIXME: count for m_unk0x008
MxS16 m_unk0x00c; // 0x00c MxS16 m_unk0x00c; // 0x00c
undefined2 m_unk0x00e; // 0x00e undefined2 m_unk0x00e; // 0x00e

View File

@ -7,6 +7,15 @@
// SIZE 0x10 // SIZE 0x10
class JukeBoxState : public LegoState { class JukeBoxState : public LegoState {
public: public:
enum Music {
e_pasquell = 0,
e_right,
e_decal,
e_wallis,
e_nelson,
e_torpedos
};
// FUNCTION: LEGO1 0x1000f310 // FUNCTION: LEGO1 0x1000f310
inline const char* ClassName() const override // vtable+0x0c inline const char* ClassName() const override // vtable+0x0c
{ {
@ -22,16 +31,10 @@ public:
MxBool IsSerializable() override; // vtable+0x14 MxBool IsSerializable() override; // vtable+0x14
inline MxU32 IsActive() { return m_active; }
inline void SetActive(MxU32 p_active) { m_active = p_active; }
inline MxU32 GetState() { return m_state; }
inline void SetState(MxU32 p_state) { m_state = p_state; }
// SYNTHETIC: LEGO1 0x1000f3d0 // SYNTHETIC: LEGO1 0x1000f3d0
// JukeBoxState::`scalar deleting destructor' // JukeBoxState::`scalar deleting destructor'
// protected: Music m_music; // 0x08
MxU32 m_state; // 0x08
MxU32 m_active; // 0x0c MxU32 m_active; // 0x0c
}; };

View File

@ -18,6 +18,8 @@ public:
m_clickedAtom = NULL; m_clickedAtom = NULL;
} }
// TODO: Most likely getters/setters are not used according to BETA.
inline MxS32 GetClickedObjectId() const { return m_clickedObjectId; } inline MxS32 GetClickedObjectId() const { return m_clickedObjectId; }
inline const char* GetClickedAtom() const { return m_clickedAtom; } inline const char* GetClickedAtom() const { return m_clickedAtom; }
inline MxS16 GetUnknown0x28() const { return m_unk0x28; } inline MxS16 GetUnknown0x28() const { return m_unk0x28; }
@ -26,7 +28,6 @@ public:
inline void SetClickedAtom(const char* p_clickedAtom) { m_clickedAtom = p_clickedAtom; } inline void SetClickedAtom(const char* p_clickedAtom) { m_clickedAtom = p_clickedAtom; }
inline void SetUnknown0x28(MxS16 p_unk0x28) { m_unk0x28 = p_unk0x28; } inline void SetUnknown0x28(MxS16 p_unk0x28) { m_unk0x28 = p_unk0x28; }
private:
MxS32 m_clickedObjectId; // 0x20 MxS32 m_clickedObjectId; // 0x20
const char* m_clickedAtom; // 0x24 const char* m_clickedAtom; // 0x24
MxS16 m_unk0x28; // 0x28 MxS16 m_unk0x28; // 0x28

View File

@ -90,7 +90,7 @@ public:
e_unk51, e_unk51,
e_unk52, e_unk52,
e_jukeboxw, e_jukeboxw,
e_unk54, e_jukeboxExterior,
e_unk55, e_unk55,
e_histbook, e_histbook,
e_bike, e_bike,
@ -174,7 +174,6 @@ public:
inline Act GetLoadedAct() { return m_loadedAct; } inline Act GetLoadedAct() { return m_loadedAct; }
inline Area GetCurrentArea() { return m_currentArea; } inline Area GetCurrentArea() { return m_currentArea; }
inline Area GetPreviousArea() { return m_previousArea; } inline Area GetPreviousArea() { return m_previousArea; }
inline JukeboxScript::Script GetUnknown0x41c() { return m_unk0x41c; }
inline Area GetUnknown0x42c() { return m_unk0x42c; } inline Area GetUnknown0x42c() { return m_unk0x42c; }
inline History* GetHistory() { return &m_history; } inline History* GetHistory() { return &m_history; }
@ -182,7 +181,6 @@ public:
inline void SetCurrentArea(Area p_currentArea) { m_currentArea = p_currentArea; } inline void SetCurrentArea(Area p_currentArea) { m_currentArea = p_currentArea; }
inline void SetPreviousArea(Area p_previousArea) { m_previousArea = p_previousArea; } inline void SetPreviousArea(Area p_previousArea) { m_previousArea = p_previousArea; }
inline void SetActorId(MxU8 p_actorId) { m_actorId = p_actorId; } inline void SetActorId(MxU8 p_actorId) { m_actorId = p_actorId; }
inline void SetUnknown0x41c(JukeboxScript::Script p_unk0x41c) { m_unk0x41c = p_unk0x41c; }
inline void SetUnknown0x42c(Area p_unk0x42c) { m_unk0x42c = p_unk0x42c; } inline void SetUnknown0x42c(Area p_unk0x42c) { m_unk0x42c = p_unk0x42c; }
inline Username* GetPlayersIndex(MxS32 p_index) { return &m_players[p_index]; } inline Username* GetPlayersIndex(MxS32 p_index) { return &m_players[p_index]; }
inline MxS16 GetPlayerCount() { return m_playerCount; } inline MxS16 GetPlayerCount() { return m_playerCount; }
@ -210,23 +208,17 @@ private:
LegoFullScreenMovie* m_fullScreenMovie; // 0x20 LegoFullScreenMovie* m_fullScreenMovie; // 0x20
MxU16 m_unk0x24; // 0x24 MxU16 m_unk0x24; // 0x24
// Member visibility needs to be refactored, since most members are accessed directly. // TODO: Most likely getters/setters are not used according to BETA for the following members:
public: public:
MxS16 m_playerCount; // 0x26 MxS16 m_playerCount; // 0x26
Username m_players[9]; // 0x28 Username m_players[9]; // 0x28
private:
History m_history; // 0xa6 History m_history; // 0xa6
undefined2 m_unk0x41a; // 0x41a undefined2 m_unk0x41a; // 0x41a
JukeboxScript::Script m_unk0x41c; // 0x41c JukeboxScript::Script m_jukeboxMusic; // 0x41c
MxBool m_isDirty; // 0x420 MxBool m_isDirty; // 0x420
public:
Area m_currentArea; // 0x424 Area m_currentArea; // 0x424
Area m_previousArea; // 0x428 Area m_previousArea; // 0x428
private:
Area m_unk0x42c; // 0x42c Area m_unk0x42c; // 0x42c
}; };

View File

@ -44,7 +44,7 @@ void ConvertHSVToRGB(float p_h, float p_s, float p_v, float* p_rOut, float* p_bO
void PlayCamAnim(LegoPathActor* p_actor, MxBool p_unused, MxU32 p_location, MxBool p_bool); void PlayCamAnim(LegoPathActor* p_actor, MxBool p_unused, MxU32 p_location, MxBool p_bool);
void FUN_1003eda0(); void FUN_1003eda0();
MxBool RemoveFromCurrentWorld(const MxAtomId& p_atomId, MxS32 p_id); MxBool RemoveFromCurrentWorld(const MxAtomId& p_atomId, MxS32 p_id);
void FUN_1003ef00(MxBool p_enable); void EnableAnimations(MxBool p_enable);
void SetAppCursor(Cursor p_cursor); void SetAppCursor(Cursor p_cursor);
MxBool FUN_1003ef60(); MxBool FUN_1003ef60();
MxBool RemoveFromWorld(MxAtomId& p_entityAtom, MxS32 p_entityId, MxAtomId& p_worldAtom, MxS32 p_worldEntityId); MxBool RemoveFromWorld(MxAtomId& p_entityAtom, MxS32 p_entityId, MxAtomId& p_worldAtom, MxS32 p_worldEntityId);

View File

@ -430,7 +430,7 @@ void IslePathActor::RegisterSpawnLocations()
JukeboxScript::c_noneJukebox JukeboxScript::c_noneJukebox
); );
g_spawnLocations[27] = SpawnLocation( g_spawnLocations[27] = SpawnLocation(
LegoGameState::e_unk54, LegoGameState::e_jukeboxExterior,
g_isleScript, g_isleScript,
0, 0,
"int36", "int36",

View File

@ -55,37 +55,37 @@ void JukeBoxEntity::StartAction()
MxDSAction action; MxDSAction action;
BackgroundAudioManager()->Stop(); BackgroundAudioManager()->Stop();
JukeBoxState* state = (JukeBoxState*) GameState()->GetState("JukeBoxState"); JukeBoxState* state = (JukeBoxState*) GameState()->GetState("JukeBoxState");
state->SetActive(TRUE); state->m_active = TRUE;
switch (state->GetState()) { switch (state->m_music) {
case 0: case JukeBoxState::e_pasquell:
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_npz001bd_RunAnim, NULL); InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_npz001bd_RunAnim, NULL);
GameState()->SetUnknown0x41c(JukeboxScript::c_JBMusic1); GameState()->m_jukeboxMusic = JukeboxScript::c_JBMusic1;
break; break;
case 1: case JukeBoxState::e_right:
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_npz006bd_RunAnim, NULL); InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_npz006bd_RunAnim, NULL);
GameState()->SetUnknown0x41c(JukeboxScript::c_JBMusic2); GameState()->m_jukeboxMusic = JukeboxScript::c_JBMusic2;
break; break;
case 2: case JukeBoxState::e_decal:
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_npz003bd_RunAnim, NULL); InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_npz003bd_RunAnim, NULL);
GameState()->SetUnknown0x41c(JukeboxScript::c_JBMusic3); GameState()->m_jukeboxMusic = JukeboxScript::c_JBMusic3;
break; break;
case 3: case JukeBoxState::e_wallis:
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_npz002bd_RunAnim, NULL); InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_npz002bd_RunAnim, NULL);
GameState()->SetUnknown0x41c(JukeboxScript::c_JBMusic4); GameState()->m_jukeboxMusic = JukeboxScript::c_JBMusic4;
break; break;
case 4: case JukeBoxState::e_nelson:
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_npz007bd_RunAnim, NULL); InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_npz007bd_RunAnim, NULL);
GameState()->SetUnknown0x41c(JukeboxScript::c_JBMusic5); GameState()->m_jukeboxMusic = JukeboxScript::c_JBMusic5;
break; break;
case 5: case JukeBoxState::e_torpedos:
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_npz004bd_RunAnim, NULL); InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_npz004bd_RunAnim, NULL);
GameState()->SetUnknown0x41c(JukeboxScript::c_JBMusic6); GameState()->m_jukeboxMusic = JukeboxScript::c_JBMusic6;
break; break;
} }
action.SetAtomId(*g_jukeboxScript); action.SetAtomId(*g_jukeboxScript);
action.SetObjectId(GameState()->GetUnknown0x41c()); action.SetObjectId(GameState()->m_jukeboxMusic);
m_audioEnabled = BackgroundAudioManager()->GetEnabled(); m_audioEnabled = BackgroundAudioManager()->GetEnabled();
if (!m_audioEnabled) { if (!m_audioEnabled) {
@ -100,30 +100,30 @@ void JukeBoxEntity::StopAction(JukeboxScript::Script p_script)
{ {
JukeBoxState* state = (JukeBoxState*) GameState()->GetState("JukeBoxState"); JukeBoxState* state = (JukeBoxState*) GameState()->GetState("JukeBoxState");
if (state && state->IsActive()) { if (state && state->m_active) {
switch (p_script) { switch (p_script) {
case JukeboxScript::c_JBMusic1: case JukeboxScript::c_JBMusic1:
state->SetActive(FALSE); state->m_active = FALSE;
InvokeAction(Extra::e_stop, *g_isleScript, IsleScript::c_npz001bd_RunAnim, NULL); InvokeAction(Extra::e_stop, *g_isleScript, IsleScript::c_npz001bd_RunAnim, NULL);
break; break;
case JukeboxScript::c_JBMusic2: case JukeboxScript::c_JBMusic2:
state->SetActive(FALSE); state->m_active = FALSE;
InvokeAction(Extra::e_stop, *g_isleScript, IsleScript::c_npz006bd_RunAnim, NULL); InvokeAction(Extra::e_stop, *g_isleScript, IsleScript::c_npz006bd_RunAnim, NULL);
break; break;
case JukeboxScript::c_JBMusic3: case JukeboxScript::c_JBMusic3:
state->SetActive(FALSE); state->m_active = FALSE;
InvokeAction(Extra::e_stop, *g_isleScript, IsleScript::c_npz003bd_RunAnim, NULL); InvokeAction(Extra::e_stop, *g_isleScript, IsleScript::c_npz003bd_RunAnim, NULL);
break; break;
case JukeboxScript::c_JBMusic4: case JukeboxScript::c_JBMusic4:
state->SetActive(FALSE); state->m_active = FALSE;
InvokeAction(Extra::e_stop, *g_isleScript, IsleScript::c_npz002bd_RunAnim, NULL); InvokeAction(Extra::e_stop, *g_isleScript, IsleScript::c_npz002bd_RunAnim, NULL);
break; break;
case JukeboxScript::c_JBMusic5: case JukeboxScript::c_JBMusic5:
state->SetActive(FALSE); state->m_active = FALSE;
InvokeAction(Extra::e_stop, *g_isleScript, IsleScript::c_npz007bd_RunAnim, NULL); InvokeAction(Extra::e_stop, *g_isleScript, IsleScript::c_npz007bd_RunAnim, NULL);
break; break;
case JukeboxScript::c_JBMusic6: case JukeboxScript::c_JBMusic6:
state->SetActive(FALSE); state->m_active = FALSE;
InvokeAction(Extra::e_stop, *g_isleScript, IsleScript::c_npz004bd_RunAnim, NULL); InvokeAction(Extra::e_stop, *g_isleScript, IsleScript::c_npz004bd_RunAnim, NULL);
break; break;
} }

View File

@ -124,7 +124,7 @@ LegoGameState::LegoGameState()
m_actorId = 0; m_actorId = 0;
m_savePath = NULL; m_savePath = NULL;
m_stateArray = NULL; m_stateArray = NULL;
m_unk0x41c = JukeboxScript::c_noneJukebox; m_jukeboxMusic = JukeboxScript::c_noneJukebox;
m_currentArea = e_undefined; m_currentArea = e_undefined;
m_previousArea = e_undefined; m_previousArea = e_undefined;
m_unk0x42c = e_undefined; m_unk0x42c = e_undefined;
@ -982,7 +982,7 @@ void LegoGameState::SwitchArea(Area p_area)
VideoManager()->SetUnk0x554(TRUE); VideoManager()->SetUnk0x554(TRUE);
InvokeAction(Extra::ActionType::e_opendisk, *g_jukeboxwScript, JukeboxwScript::c__StartUp, NULL); InvokeAction(Extra::ActionType::e_opendisk, *g_jukeboxwScript, JukeboxwScript::c__StartUp, NULL);
break; break;
case e_unk54: case e_jukeboxExterior:
LoadIsle(); LoadIsle();
break; break;
case e_histbook: case e_histbook:

View File

@ -437,7 +437,7 @@ MxBool RemoveFromWorld(MxAtomId& p_entityAtom, MxS32 p_entityId, MxAtomId& p_wor
} }
// FUNCTION: LEGO1 0x1003ef00 // FUNCTION: LEGO1 0x1003ef00
void FUN_1003ef00(MxBool p_enable) void EnableAnimations(MxBool p_enable)
{ {
if (p_enable) { if (p_enable) {
AnimationManager()->Resume(); AnimationManager()->Resume();

View File

@ -100,7 +100,7 @@ MxResult Hospital::Create(MxDSAction& p_dsAction)
GameState()->StopArea(LegoGameState::e_previousArea); GameState()->StopArea(LegoGameState::e_previousArea);
InputManager()->Register(this); InputManager()->Register(this);
FUN_1003ef00(FALSE); EnableAnimations(FALSE);
return result; return result;
} }

View File

@ -113,7 +113,7 @@ MxResult Isle::Create(MxDSAction& p_dsAction)
} }
m_act1state = act1state; m_act1state = act1state;
FUN_1003ef00(TRUE); EnableAnimations(TRUE);
GameState()->SetDirty(TRUE); GameState()->SetDirty(TRUE);
} }
@ -270,7 +270,7 @@ void Isle::ReadyWorld()
m_act1state->SetUnknown21(0); m_act1state->SetUnknown21(0);
} }
else if (GameState()->GetLoadedAct() != LegoGameState::e_act1) { else if (GameState()->GetLoadedAct() != LegoGameState::e_act1) {
FUN_1003ef00(TRUE); EnableAnimations(TRUE);
FUN_10032620(); FUN_10032620();
m_act1state->FUN_10034d00(); m_act1state->FUN_10034d00();
FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen); FUN_10015820(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
@ -548,7 +548,7 @@ void Isle::Enable(MxBool p_enable)
GameState()->StopArea(LegoGameState::e_previousArea); GameState()->StopArea(LegoGameState::e_previousArea);
GameState()->m_previousArea = GameState()->m_currentArea; GameState()->m_previousArea = GameState()->m_currentArea;
FUN_1003ef00(TRUE); EnableAnimations(TRUE);
if (m_act1state->m_unk0x018 == 0) { if (m_act1state->m_unk0x018 == 0) {
MxS32 locations[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10}; MxS32 locations[] = {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
@ -748,7 +748,7 @@ void Isle::Enable(MxBool p_enable)
} }
m_act1state->m_unk0x018 = 0; m_act1state->m_unk0x018 = 0;
FUN_1003ef00(FALSE); EnableAnimations(FALSE);
AnimationManager()->FUN_10064670(NULL); AnimationManager()->FUN_10064670(NULL);
break; break;
} }
@ -781,7 +781,7 @@ void Isle::Enable(MxBool p_enable)
} }
m_act1state->m_unk0x018 = 0; m_act1state->m_unk0x018 = 0;
FUN_1003ef00(TRUE); EnableAnimations(TRUE);
break; break;
} }
case 7: case 7:
@ -806,12 +806,12 @@ void Isle::Enable(MxBool p_enable)
m_act1state->m_unk0x018 = 0; m_act1state->m_unk0x018 = 0;
((IslePathActor*) CurrentActor()) ((IslePathActor*) CurrentActor())
->SpawnPlayer( ->SpawnPlayer(
LegoGameState::e_unk54, LegoGameState::e_jukeboxExterior,
TRUE, TRUE,
IslePathActor::c_spawnBit1 | IslePathActor::c_playMusic | IslePathActor::c_spawnBit3 IslePathActor::c_spawnBit1 | IslePathActor::c_playMusic | IslePathActor::c_spawnBit3
); );
GameState()->m_currentArea = LegoGameState::e_unk66; GameState()->m_currentArea = LegoGameState::e_unk66;
FUN_1003ef00(TRUE); EnableAnimations(TRUE);
m_jukebox->StartAction(); m_jukebox->StartAction();
break; break;
} }

View File

@ -58,7 +58,7 @@ MxResult JukeBox::Create(MxDSAction& p_dsAction)
m_state = (JukeBoxState*) GameState()->GetState("JukeBoxState"); m_state = (JukeBoxState*) GameState()->GetState("JukeBoxState");
if (!m_state) { if (!m_state) {
m_state = (JukeBoxState*) GameState()->CreateState("JukeBoxState"); m_state = (JukeBoxState*) GameState()->CreateState("JukeBoxState");
m_state->SetState(0); m_state->m_music = JukeBoxState::e_pasquell;
} }
GameState()->SetCurrentArea(LegoGameState::e_jukeboxw); GameState()->SetCurrentArea(LegoGameState::e_jukeboxw);
@ -89,24 +89,27 @@ MxLong JukeBox::Notify(MxParam& p_param)
} }
// FUNCTION: LEGO1 0x1005d9f0 // FUNCTION: LEGO1 0x1005d9f0
// FUNCTION: BETA10 0x10037e39
void JukeBox::ReadyWorld() void JukeBox::ReadyWorld()
{ {
MxStillPresenter* presenter = NULL; MxStillPresenter* presenter = NULL;
switch (m_state->GetState()) { switch (m_state->m_music) {
case 1: case JukeBoxState::e_pasquell:
break;
case JukeBoxState::e_right:
presenter = (MxStillPresenter*) Find("MxStillPresenter", "Right_Bitmap"); presenter = (MxStillPresenter*) Find("MxStillPresenter", "Right_Bitmap");
break; break;
case 2: case JukeBoxState::e_decal:
presenter = (MxStillPresenter*) Find("MxStillPresenter", "Decal_Bitmap"); presenter = (MxStillPresenter*) Find("MxStillPresenter", "Decal_Bitmap");
break; break;
case 3: case JukeBoxState::e_wallis:
presenter = (MxStillPresenter*) Find("MxStillPresenter", "Wallis_Bitmap"); presenter = (MxStillPresenter*) Find("MxStillPresenter", "Wallis_Bitmap");
break; break;
case 4: case JukeBoxState::e_nelson:
presenter = (MxStillPresenter*) Find("MxStillPresenter", "Nelson_Bitmap"); presenter = (MxStillPresenter*) Find("MxStillPresenter", "Nelson_Bitmap");
break; break;
case 5: case JukeBoxState::e_torpedos:
presenter = (MxStillPresenter*) Find("MxStillPresenter", "Torpedos_Bitmap"); presenter = (MxStillPresenter*) Find("MxStillPresenter", "Torpedos_Bitmap");
break; break;
} }
@ -119,47 +122,48 @@ void JukeBox::ReadyWorld()
} }
// FUNCTION: LEGO1 0x1005da70 // FUNCTION: LEGO1 0x1005da70
// FUNCTION: BETA10 0x10037f6d
MxBool JukeBox::HandleControl(LegoControlManagerEvent& p_param) MxBool JukeBox::HandleControl(LegoControlManagerEvent& p_param)
{ {
MxStillPresenter* presenter; MxStillPresenter* presenter;
if (p_param.GetUnknown0x28() == 1) { if (p_param.m_unk0x28 == 1) {
switch (p_param.GetClickedObjectId()) { switch (p_param.m_clickedObjectId) {
case JukeboxwScript::c_Dback_Ctl: case JukeboxwScript::c_Dback_Ctl:
switch (m_state->GetState()) { switch (m_state->m_music) {
case JukeboxScript::c_MusicTheme1: case JukeBoxState::e_pasquell:
m_state->SetState(JukeboxScript::c_ResidentalArea_Music); m_state->m_music = JukeBoxState::e_torpedos;
presenter = (MxStillPresenter*) Find("MxStillPresenter", "Torpedos_Bitmap"); presenter = (MxStillPresenter*) Find("MxStillPresenter", "Torpedos_Bitmap");
presenter->Enable(TRUE); presenter->Enable(TRUE);
break; break;
case JukeboxScript::c_MusicTheme3: case JukeBoxState::e_right:
m_state->SetState(JukeboxScript::c_MusicTheme1); m_state->m_music = JukeBoxState::e_pasquell;
presenter = (MxStillPresenter*) Find("MxStillPresenter", "Right_Bitmap"); presenter = (MxStillPresenter*) Find("MxStillPresenter", "Right_Bitmap");
presenter->Enable(FALSE); presenter->Enable(FALSE);
break; break;
case JukeboxScript::c_Act2Cave: case JukeBoxState::e_decal:
m_state->SetState(JukeboxScript::c_MusicTheme3); m_state->m_music = JukeBoxState::e_right;
presenter = (MxStillPresenter*) Find("MxStillPresenter", "Decal_Bitmap"); presenter = (MxStillPresenter*) Find("MxStillPresenter", "Decal_Bitmap");
presenter->Enable(FALSE); presenter->Enable(FALSE);
presenter = (MxStillPresenter*) Find("MxStillPresenter", "Right_Bitmap"); presenter = (MxStillPresenter*) Find("MxStillPresenter", "Right_Bitmap");
presenter->Enable(TRUE); presenter->Enable(TRUE);
break; break;
case JukeboxScript::c_BrickstrChase: case JukeBoxState::e_wallis:
m_state->SetState(JukeboxScript::c_Act2Cave); m_state->m_music = JukeBoxState::e_decal;
presenter = (MxStillPresenter*) Find("MxStillPresenter", "Wallis_Bitmap"); presenter = (MxStillPresenter*) Find("MxStillPresenter", "Wallis_Bitmap");
presenter->Enable(FALSE); presenter->Enable(FALSE);
presenter = (MxStillPresenter*) Find("MxStillPresenter", "Decal_Bitmap"); presenter = (MxStillPresenter*) Find("MxStillPresenter", "Decal_Bitmap");
presenter->Enable(TRUE); presenter->Enable(TRUE);
break; break;
case JukeboxScript::c_BrickHunt: case JukeBoxState::e_nelson:
m_state->SetState(JukeboxScript::c_BrickstrChase); m_state->m_music = JukeBoxState::e_wallis;
presenter = (MxStillPresenter*) Find("MxStillPresenter", "Nelson_Bitmap"); presenter = (MxStillPresenter*) Find("MxStillPresenter", "Nelson_Bitmap");
presenter->Enable(FALSE); presenter->Enable(FALSE);
presenter = (MxStillPresenter*) Find("MxStillPresenter", "Wallis_Bitmap"); presenter = (MxStillPresenter*) Find("MxStillPresenter", "Wallis_Bitmap");
presenter->Enable(TRUE); presenter->Enable(TRUE);
break; break;
case JukeboxScript::c_ResidentalArea_Music: case JukeBoxState::e_torpedos:
m_state->SetState(JukeboxScript::c_BrickHunt); m_state->m_music = JukeBoxState::e_nelson;
presenter = (MxStillPresenter*) Find("MxStillPresenter", "Torpedos_Bitmap"); presenter = (MxStillPresenter*) Find("MxStillPresenter", "Torpedos_Bitmap");
presenter->Enable(FALSE); presenter->Enable(FALSE);
presenter = (MxStillPresenter*) Find("MxStillPresenter", "Nelson_Bitmap"); presenter = (MxStillPresenter*) Find("MxStillPresenter", "Nelson_Bitmap");
@ -168,52 +172,51 @@ MxBool JukeBox::HandleControl(LegoControlManagerEvent& p_param)
} }
break; break;
case JukeboxwScript::c_Dfwd_Ctl: case JukeboxwScript::c_Dfwd_Ctl:
switch (m_state->GetState()) { switch (m_state->m_music) {
case JukeboxScript::c_MusicTheme1: case JukeBoxState::e_pasquell:
m_state->SetState(JukeboxScript::c_MusicTheme3); m_state->m_music = JukeBoxState::e_right;
presenter = (MxStillPresenter*) Find("MxStillPresenter", "Right_Bitmap"); presenter = (MxStillPresenter*) Find("MxStillPresenter", "Right_Bitmap");
presenter->Enable(TRUE); presenter->Enable(TRUE);
break; break;
case JukeboxScript::c_MusicTheme3: case JukeBoxState::e_right:
m_state->SetState(JukeboxScript::c_Act2Cave); m_state->m_music = JukeBoxState::e_decal;
presenter = (MxStillPresenter*) Find("MxStillPresenter", "Right_Bitmap"); presenter = (MxStillPresenter*) Find("MxStillPresenter", "Right_Bitmap");
presenter->Enable(FALSE); presenter->Enable(FALSE);
presenter = (MxStillPresenter*) Find("MxStillPresenter", "Decal_Bitmap"); presenter = (MxStillPresenter*) Find("MxStillPresenter", "Decal_Bitmap");
presenter->Enable(TRUE); presenter->Enable(TRUE);
break; break;
case JukeboxScript::c_Act2Cave: case JukeBoxState::e_decal:
m_state->SetState(JukeboxScript::c_BrickstrChase); m_state->m_music = JukeBoxState::e_wallis;
presenter = (MxStillPresenter*) Find("MxStillPresenter", "Decal_Bitmap"); presenter = (MxStillPresenter*) Find("MxStillPresenter", "Decal_Bitmap");
presenter->Enable(FALSE); presenter->Enable(FALSE);
presenter = (MxStillPresenter*) Find("MxStillPresenter", "Wallis_Bitmap"); presenter = (MxStillPresenter*) Find("MxStillPresenter", "Wallis_Bitmap");
presenter->Enable(TRUE); presenter->Enable(TRUE);
break; break;
case JukeboxScript::c_BrickstrChase: case JukeBoxState::e_wallis:
m_state->SetState(JukeboxScript::c_BrickHunt); m_state->m_music = JukeBoxState::e_nelson;
presenter = (MxStillPresenter*) Find("MxStillPresenter", "Wallis_Bitmap"); presenter = (MxStillPresenter*) Find("MxStillPresenter", "Wallis_Bitmap");
presenter->Enable(FALSE); presenter->Enable(FALSE);
presenter = (MxStillPresenter*) Find("MxStillPresenter", "Nelson_Bitmap"); presenter = (MxStillPresenter*) Find("MxStillPresenter", "Nelson_Bitmap");
presenter->Enable(TRUE); presenter->Enable(TRUE);
break; break;
case JukeboxScript::c_BrickHunt: case JukeBoxState::e_nelson:
m_state->SetState(JukeboxScript::c_ResidentalArea_Music); m_state->m_music = JukeBoxState::e_torpedos;
presenter = (MxStillPresenter*) Find("MxStillPresenter", "Nelson_Bitmap"); presenter = (MxStillPresenter*) Find("MxStillPresenter", "Nelson_Bitmap");
presenter->Enable(FALSE); presenter->Enable(FALSE);
presenter = (MxStillPresenter*) Find("MxStillPresenter", "Torpedos_Bitmap"); presenter = (MxStillPresenter*) Find("MxStillPresenter", "Torpedos_Bitmap");
presenter->Enable(TRUE); presenter->Enable(TRUE);
break; break;
case JukeboxScript::c_ResidentalArea_Music: case JukeBoxState::e_torpedos:
m_state->SetState(JukeboxScript::c_MusicTheme1); m_state->m_music = JukeBoxState::e_pasquell;
presenter = (MxStillPresenter*) Find("MxStillPresenter", "Torpedos_Bitmap"); presenter = (MxStillPresenter*) Find("MxStillPresenter", "Torpedos_Bitmap");
presenter->Enable(FALSE); presenter->Enable(FALSE);
break; break;
} }
break; break;
case JukeboxwScript::c_Note_Ctl: case JukeboxwScript::c_Note_Ctl:
LegoGameState* gameState = GameState(); Act1State* act1State = (Act1State*) GameState()->GetState("Act1State");
Act1State* act1State = (Act1State*) gameState->GetState("Act1State"); act1State->m_unk0x018 = 11;
act1State->SetUnknown18(11); m_destLocation = LegoGameState::Area::e_jukeboxExterior;
m_destLocation = LegoGameState::Area::e_unk54;
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, 0, FALSE); TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, 0, FALSE);
break; break;
} }