Remove obsolete enums in Infocenter (#1677)

This commit is contained in:
Christian Semmler
2025-08-20 15:04:08 -07:00
committed by GitHub
parent 689b44d87c
commit 7c95890cad
2 changed files with 53 additions and 71 deletions

View File

@@ -119,25 +119,6 @@ struct InfocenterMapEntry {
// SIZE 0x1d8 // SIZE 0x1d8
class Infocenter : public LegoWorld { class Infocenter : public LegoWorld {
public: public:
enum Cutscene {
e_noIntro = -1,
e_legoMovie,
e_mindscapeMovie,
e_introMovie,
e_outroMovie,
e_badEndMovie,
e_goodEndMovie
};
enum Character {
e_noCharacter = 0,
e_pepper,
e_mama,
e_papa,
e_nick,
e_laura
};
Infocenter(); Infocenter();
~Infocenter() override; ~Infocenter() override;
@@ -180,7 +161,7 @@ private:
void UpdateFrameHot(MxBool p_display); void UpdateFrameHot(MxBool p_display);
void Reset(); void Reset();
void PlayCutscene(Cutscene p_entityId, MxBool p_scale); void PlayCutscene(IntroScript::Script p_entityId, MxBool p_scale);
void StopCutscene(); void StopCutscene();
void UpdateEnabledGlowControl(MxS32 p_x, MxS32 p_y); void UpdateEnabledGlowControl(MxS32 p_x, MxS32 p_y);
@@ -198,7 +179,7 @@ private:
MxS16 m_selectedCharacter; // 0xfc MxS16 m_selectedCharacter; // 0xfc
InfocenterState* m_infocenterState; // 0x100 InfocenterState* m_infocenterState; // 0x100
LegoGameState::Area m_destLocation; // 0x104 LegoGameState::Area m_destLocation; // 0x104
Cutscene m_currentCutscene; // 0x108 IntroScript::Script m_currentCutscene; // 0x108
Radio m_radio; // 0x10c Radio m_radio; // 0x10c
MxStillPresenter* m_dragPresenter; // 0x11c MxStillPresenter* m_dragPresenter; // 0x11c
InfocenterMapEntry m_glowInfo[7]; // 0x120 InfocenterMapEntry m_glowInfo[7]; // 0x120

View File

@@ -4,6 +4,7 @@
#include "credits_actions.h" #include "credits_actions.h"
#include "helicopter.h" #include "helicopter.h"
#include "infomain_actions.h" #include "infomain_actions.h"
#include "intro_actions.h"
#include "jukebox.h" #include "jukebox.h"
#include "jukebox_actions.h" #include "jukebox_actions.h"
#include "legoact2.h" #include "legoact2.h"
@@ -128,13 +129,13 @@ InfomainScript::Script g_bricksterDialogue[2] = {
// FUNCTION: LEGO1 0x1006ea20 // FUNCTION: LEGO1 0x1006ea20
Infocenter::Infocenter() Infocenter::Infocenter()
{ {
m_selectedCharacter = e_noCharacter; m_selectedCharacter = LegoActor::c_none;
m_dragPresenter = NULL; m_dragPresenter = NULL;
m_infocenterState = NULL; m_infocenterState = NULL;
m_frame = NULL; m_frame = NULL;
m_destLocation = LegoGameState::e_undefined; m_destLocation = LegoGameState::e_undefined;
m_currentInfomainScript = InfomainScript::c_noneInfomain; m_currentInfomainScript = InfomainScript::c_noneInfomain;
m_currentCutscene = e_noIntro; m_currentCutscene = IntroScript::c_noneIntro;
memset(&m_glowInfo, 0, sizeof(m_glowInfo)); memset(&m_glowInfo, 0, sizeof(m_glowInfo));
@@ -306,19 +307,19 @@ MxLong Infocenter::HandleEndAction(MxEndActionNotificationParam& p_param)
GameState()->SetActor(m_selectedCharacter); GameState()->SetActor(m_selectedCharacter);
switch (m_selectedCharacter) { switch (m_selectedCharacter) {
case e_pepper: case LegoActor::c_pepper:
PlayAction(InfomainScript::c_avo901in_RunAnim); PlayAction(InfomainScript::c_avo901in_RunAnim);
break; break;
case e_mama: case LegoActor::c_mama:
PlayAction(InfomainScript::c_avo902in_RunAnim); PlayAction(InfomainScript::c_avo902in_RunAnim);
break; break;
case e_papa: case LegoActor::c_papa:
PlayAction(InfomainScript::c_avo903in_RunAnim); PlayAction(InfomainScript::c_avo903in_RunAnim);
break; break;
case e_nick: case LegoActor::c_nick:
PlayAction(InfomainScript::c_avo904in_RunAnim); PlayAction(InfomainScript::c_avo904in_RunAnim);
break; break;
case e_laura: case LegoActor::c_laura:
PlayAction(InfomainScript::c_avo905in_RunAnim); PlayAction(InfomainScript::c_avo905in_RunAnim);
break; break;
default: default:
@@ -343,23 +344,23 @@ MxLong Infocenter::HandleEndAction(MxEndActionNotificationParam& p_param)
switch (m_infocenterState->m_state) { switch (m_infocenterState->m_state) {
case InfocenterState::e_playCutscene: case InfocenterState::e_playCutscene:
switch (m_currentCutscene) { switch (m_currentCutscene) {
case e_legoMovie: case IntroScript::c_Lego_Movie:
PlayCutscene(e_mindscapeMovie, FALSE); PlayCutscene(IntroScript::c_Mindscape_Movie, FALSE);
return 1; return 1;
case e_mindscapeMovie: case IntroScript::c_Mindscape_Movie:
PlayCutscene(e_introMovie, TRUE); PlayCutscene(IntroScript::c_Intro_Movie, TRUE);
return 1; return 1;
case e_badEndMovie: case IntroScript::c_BadEnd_Movie:
StopCutscene(); StopCutscene();
m_infocenterState->m_state = InfocenterState::e_welcomeAnimation; m_infocenterState->m_state = InfocenterState::e_welcomeAnimation;
PlayAction(InfomainScript::c_tic092in_RunAnim); PlayAction(InfomainScript::c_tic092in_RunAnim);
m_currentCutscene = e_noIntro; m_currentCutscene = IntroScript::c_noneIntro;
return 1; return 1;
case e_goodEndMovie: case IntroScript::c_GoodEnd_Movie:
StopCutscene(); StopCutscene();
m_infocenterState->m_state = InfocenterState::e_welcomeAnimation; m_infocenterState->m_state = InfocenterState::e_welcomeAnimation;
PlayAction(InfomainScript::c_tic089in_RunAnim); PlayAction(InfomainScript::c_tic089in_RunAnim);
m_currentCutscene = e_noIntro; m_currentCutscene = IntroScript::c_noneIntro;
return 1; return 1;
} }
@@ -367,7 +368,7 @@ MxLong Infocenter::HandleEndAction(MxEndActionNotificationParam& p_param)
StopCutscene(); StopCutscene();
m_infocenterState->m_state = InfocenterState::e_welcomeAnimation; m_infocenterState->m_state = InfocenterState::e_welcomeAnimation;
PlayAction(InfomainScript::c_iic001in_RunAnim); PlayAction(InfomainScript::c_iic001in_RunAnim);
m_currentCutscene = e_noIntro; m_currentCutscene = IntroScript::c_noneIntro;
if (!m_infocenterState->HasRegistered()) { if (!m_infocenterState->HasRegistered()) {
m_bookAnimationTimer = 1; m_bookAnimationTimer = 1;
@@ -378,17 +379,17 @@ MxLong Infocenter::HandleEndAction(MxEndActionNotificationParam& p_param)
m_infocenterState->m_state = InfocenterState::e_welcomeAnimation; m_infocenterState->m_state = InfocenterState::e_welcomeAnimation;
switch (m_currentCutscene) { switch (m_currentCutscene) {
case e_badEndMovie: case IntroScript::c_BadEnd_Movie:
PlayAction(InfomainScript::c_tic092in_RunAnim); PlayAction(InfomainScript::c_tic092in_RunAnim);
break; break;
case e_goodEndMovie: case IntroScript::c_GoodEnd_Movie:
PlayAction(InfomainScript::c_tic089in_RunAnim); PlayAction(InfomainScript::c_tic089in_RunAnim);
break; break;
default: default:
PlayAction(InfomainScript::c_iic001in_RunAnim); PlayAction(InfomainScript::c_iic001in_RunAnim);
} }
m_currentCutscene = e_noIntro; m_currentCutscene = IntroScript::c_noneIntro;
return 1; return 1;
case InfocenterState::e_notRegistered: case InfocenterState::e_notRegistered:
SetROIVisible(g_object2x4red, FALSE); SetROIVisible(g_object2x4red, FALSE);
@@ -405,7 +406,7 @@ MxLong Infocenter::HandleEndAction(MxEndActionNotificationParam& p_param)
break; break;
case InfocenterState::e_selectedCharacterAndDestination: case InfocenterState::e_selectedCharacterAndDestination:
if (action->GetObjectId() == m_currentInfomainScript) { if (action->GetObjectId() == m_currentInfomainScript) {
if (GameState()->GetCurrentAct() != LegoGameState::e_act3 && m_selectedCharacter != e_noCharacter) { if (GameState()->GetCurrentAct() != LegoGameState::e_act3 && m_selectedCharacter != LegoActor::c_none) {
GameState()->SetActor(m_selectedCharacter); GameState()->SetActor(m_selectedCharacter);
} }
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE); TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
@@ -455,7 +456,7 @@ void Infocenter::ReadyWorld()
switch (m_infocenterState->m_state) { switch (m_infocenterState->m_state) {
case InfocenterState::e_newState: case InfocenterState::e_newState:
PlayCutscene(e_legoMovie, TRUE); PlayCutscene(IntroScript::c_Lego_Movie, TRUE);
m_infocenterState->m_state = InfocenterState::e_playCutscene; m_infocenterState->m_state = InfocenterState::e_playCutscene;
return; return;
case InfocenterState::e_selectedSave: case InfocenterState::e_selectedSave:
@@ -518,7 +519,7 @@ void Infocenter::ReadyWorld()
if (state && state->GetState() == LegoAct2State::c_badEnding) { if (state && state->GetState() == LegoAct2State::c_badEnding) {
bg->Enable(TRUE); bg->Enable(TRUE);
PlayCutscene(e_badEndMovie, TRUE); PlayCutscene(IntroScript::c_BadEnd_Movie, TRUE);
m_infocenterState->m_state = InfocenterState::e_playCutscene; m_infocenterState->m_state = InfocenterState::e_playCutscene;
return; return;
} }
@@ -563,14 +564,14 @@ void Infocenter::ReadyWorld()
if (state && state->GetState() == Act3State::e_badEnding) { if (state && state->GetState() == Act3State::e_badEnding) {
bg->Enable(TRUE); bg->Enable(TRUE);
PlayCutscene(e_badEndMovie, TRUE); PlayCutscene(IntroScript::c_BadEnd_Movie, TRUE);
m_infocenterState->m_state = InfocenterState::e_playCutscene; m_infocenterState->m_state = InfocenterState::e_playCutscene;
return; return;
} }
if (state && state->GetState() == Act3State::e_goodEnding) { if (state && state->GetState() == Act3State::e_goodEnding) {
bg->Enable(TRUE); bg->Enable(TRUE);
PlayCutscene(e_goodEndMovie, TRUE); PlayCutscene(IntroScript::c_GoodEnd_Movie, TRUE);
m_infocenterState->m_state = InfocenterState::e_playCutscene; m_infocenterState->m_state = InfocenterState::e_playCutscene;
return; return;
} }
@@ -752,19 +753,19 @@ MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
switch (m_dragPresenter->GetAction()->GetObjectId()) { switch (m_dragPresenter->GetAction()->GetObjectId()) {
case InfomainScript::c_PepperHot_Bitmap: case InfomainScript::c_PepperHot_Bitmap:
m_selectedCharacter = e_pepper; m_selectedCharacter = LegoActor::c_pepper;
break; break;
case InfomainScript::c_MamaHot_Bitmap: case InfomainScript::c_MamaHot_Bitmap:
m_selectedCharacter = e_mama; m_selectedCharacter = LegoActor::c_mama;
break; break;
case InfomainScript::c_PapaHot_Bitmap: case InfomainScript::c_PapaHot_Bitmap:
m_selectedCharacter = e_papa; m_selectedCharacter = LegoActor::c_papa;
break; break;
case InfomainScript::c_NickHot_Bitmap: case InfomainScript::c_NickHot_Bitmap:
m_selectedCharacter = e_nick; m_selectedCharacter = LegoActor::c_nick;
break; break;
case InfomainScript::c_LauraHot_Bitmap: case InfomainScript::c_LauraHot_Bitmap:
m_selectedCharacter = e_laura; m_selectedCharacter = LegoActor::c_laura;
break; break;
} }
@@ -773,7 +774,7 @@ MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
switch (control->GetAction()->GetObjectId()) { switch (control->GetAction()->GetObjectId()) {
case InfomainScript::c_Pepper_Ctl: case InfomainScript::c_Pepper_Ctl:
if (m_selectedCharacter == e_pepper) { if (m_selectedCharacter == LegoActor::c_pepper) {
m_radio.Stop(); m_radio.Stop();
BackgroundAudioManager()->Stop(); BackgroundAudioManager()->Stop();
PlayAction(InfomainScript::c_Pepper_All_Movie); PlayAction(InfomainScript::c_Pepper_All_Movie);
@@ -781,7 +782,7 @@ MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
} }
break; break;
case InfomainScript::c_Mama_Ctl: case InfomainScript::c_Mama_Ctl:
if (m_selectedCharacter == e_mama) { if (m_selectedCharacter == LegoActor::c_mama) {
m_radio.Stop(); m_radio.Stop();
BackgroundAudioManager()->Stop(); BackgroundAudioManager()->Stop();
PlayAction(InfomainScript::c_Mama_All_Movie); PlayAction(InfomainScript::c_Mama_All_Movie);
@@ -789,7 +790,7 @@ MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
} }
break; break;
case InfomainScript::c_Papa_Ctl: case InfomainScript::c_Papa_Ctl:
if (m_selectedCharacter == e_papa) { if (m_selectedCharacter == LegoActor::c_papa) {
m_radio.Stop(); m_radio.Stop();
BackgroundAudioManager()->Stop(); BackgroundAudioManager()->Stop();
PlayAction(InfomainScript::c_Papa_All_Movie); PlayAction(InfomainScript::c_Papa_All_Movie);
@@ -797,7 +798,7 @@ MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
} }
break; break;
case InfomainScript::c_Nick_Ctl: case InfomainScript::c_Nick_Ctl:
if (m_selectedCharacter == e_nick) { if (m_selectedCharacter == LegoActor::c_nick) {
m_radio.Stop(); m_radio.Stop();
BackgroundAudioManager()->Stop(); BackgroundAudioManager()->Stop();
PlayAction(InfomainScript::c_Nick_All_Movie); PlayAction(InfomainScript::c_Nick_All_Movie);
@@ -805,7 +806,7 @@ MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
} }
break; break;
case InfomainScript::c_Laura_Ctl: case InfomainScript::c_Laura_Ctl:
if (m_selectedCharacter == e_laura) { if (m_selectedCharacter == LegoActor::c_laura) {
m_radio.Stop(); m_radio.Stop();
BackgroundAudioManager()->Stop(); BackgroundAudioManager()->Stop();
PlayAction(InfomainScript::c_Laura_All_Movie); PlayAction(InfomainScript::c_Laura_All_Movie);
@@ -823,19 +824,19 @@ MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
GameState()->SetActor(m_selectedCharacter); GameState()->SetActor(m_selectedCharacter);
switch (m_selectedCharacter) { switch (m_selectedCharacter) {
case e_pepper: case LegoActor::c_pepper:
PlayAction(InfomainScript::c_avo901in_RunAnim); PlayAction(InfomainScript::c_avo901in_RunAnim);
break; break;
case e_mama: case LegoActor::c_mama:
PlayAction(InfomainScript::c_avo902in_RunAnim); PlayAction(InfomainScript::c_avo902in_RunAnim);
break; break;
case e_papa: case LegoActor::c_papa:
PlayAction(InfomainScript::c_avo903in_RunAnim); PlayAction(InfomainScript::c_avo903in_RunAnim);
break; break;
case e_nick: case LegoActor::c_nick:
PlayAction(InfomainScript::c_avo904in_RunAnim); PlayAction(InfomainScript::c_avo904in_RunAnim);
break; break;
case e_laura: case LegoActor::c_laura:
PlayAction(InfomainScript::c_avo905in_RunAnim); PlayAction(InfomainScript::c_avo905in_RunAnim);
break; break;
} }
@@ -894,23 +895,23 @@ MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
} }
else { else {
switch (m_selectedCharacter) { switch (m_selectedCharacter) {
case e_pepper: case LegoActor::c_pepper:
dialogueToPlay = InfomainScript::c_avo901in_RunAnim; dialogueToPlay = InfomainScript::c_avo901in_RunAnim;
GameState()->SetActorId(m_selectedCharacter); GameState()->SetActorId(m_selectedCharacter);
break; break;
case e_mama: case LegoActor::c_mama:
dialogueToPlay = InfomainScript::c_avo902in_RunAnim; dialogueToPlay = InfomainScript::c_avo902in_RunAnim;
GameState()->SetActorId(m_selectedCharacter); GameState()->SetActorId(m_selectedCharacter);
break; break;
case e_papa: case LegoActor::c_papa:
dialogueToPlay = InfomainScript::c_avo903in_RunAnim; dialogueToPlay = InfomainScript::c_avo903in_RunAnim;
GameState()->SetActorId(m_selectedCharacter); GameState()->SetActorId(m_selectedCharacter);
break; break;
case e_nick: case LegoActor::c_nick:
dialogueToPlay = InfomainScript::c_avo904in_RunAnim; dialogueToPlay = InfomainScript::c_avo904in_RunAnim;
GameState()->SetActorId(m_selectedCharacter); GameState()->SetActorId(m_selectedCharacter);
break; break;
case e_laura: case LegoActor::c_laura:
dialogueToPlay = InfomainScript::c_avo905in_RunAnim; dialogueToPlay = InfomainScript::c_avo905in_RunAnim;
GameState()->SetActorId(m_selectedCharacter); GameState()->SetActorId(m_selectedCharacter);
break; break;
@@ -1255,7 +1256,7 @@ MxResult Infocenter::Tickle()
} }
// FUNCTION: LEGO1 0x10070c20 // FUNCTION: LEGO1 0x10070c20
void Infocenter::PlayCutscene(Cutscene p_entityId, MxBool p_scale) void Infocenter::PlayCutscene(IntroScript::Script p_entityId, MxBool p_scale)
{ {
m_currentCutscene = p_entityId; m_currentCutscene = p_entityId;
@@ -1265,9 +1266,9 @@ void Infocenter::PlayCutscene(Cutscene p_entityId, MxBool p_scale)
SetAppCursor(e_cursorNone); SetAppCursor(e_cursorNone);
VideoManager()->GetDisplaySurface()->ClearScreen(); VideoManager()->GetDisplaySurface()->ClearScreen();
if (m_currentCutscene != e_noIntro) { if (m_currentCutscene != IntroScript::c_noneIntro) {
// check if the cutscene is an ending // check if the cutscene is an ending
if (m_currentCutscene >= e_badEndMovie && m_currentCutscene <= e_goodEndMovie) { if (m_currentCutscene >= IntroScript::c_BadEnd_Movie && m_currentCutscene <= IntroScript::c_GoodEnd_Movie) {
Reset(); Reset();
} }
@@ -1278,7 +1279,7 @@ void Infocenter::PlayCutscene(Cutscene p_entityId, MxBool p_scale)
// FUNCTION: LEGO1 0x10070cb0 // FUNCTION: LEGO1 0x10070cb0
void Infocenter::StopCutscene() void Infocenter::StopCutscene()
{ {
if (m_currentCutscene != e_noIntro) { if (m_currentCutscene != IntroScript::c_noneIntro) {
InvokeAction(Extra::ActionType::e_close, *g_introScript, m_currentCutscene, NULL); InvokeAction(Extra::ActionType::e_close, *g_introScript, m_currentCutscene, NULL);
} }
@@ -1395,9 +1396,9 @@ void Infocenter::Reset()
GameState()->m_savedPreviousArea = LegoGameState::e_undefined; GameState()->m_savedPreviousArea = LegoGameState::e_undefined;
InitializeBitmaps(); InitializeBitmaps();
m_selectedCharacter = e_pepper; m_selectedCharacter = LegoActor::c_pepper;
GameState()->SetActor(e_pepper); GameState()->SetActor(LegoActor::c_pepper);
HelicopterState* state = (HelicopterState*) GameState()->GetState("HelicopterState"); HelicopterState* state = (HelicopterState*) GameState()->GetState("HelicopterState");