Merge remote-tracking branch 'isle/master'

This commit is contained in:
Christian Semmler 2025-08-20 15:05:49 -07:00
commit 12cad70d94
No known key found for this signature in database
GPG Key ID: 086DAA1360BEEE5C
2 changed files with 53 additions and 71 deletions

View File

@ -119,25 +119,6 @@ struct InfocenterMapEntry {
// SIZE 0x1d8
class Infocenter : public LegoWorld {
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() override;
@ -180,7 +161,7 @@ class Infocenter : public LegoWorld {
void UpdateFrameHot(MxBool p_display);
void Reset();
void PlayCutscene(Cutscene p_entityId, MxBool p_scale);
void PlayCutscene(IntroScript::Script p_entityId, MxBool p_scale);
void StopCutscene();
void UpdateEnabledGlowControl(MxS32 p_x, MxS32 p_y);
@ -198,7 +179,7 @@ class Infocenter : public LegoWorld {
MxS16 m_selectedCharacter; // 0xfc
InfocenterState* m_infocenterState; // 0x100
LegoGameState::Area m_destLocation; // 0x104
Cutscene m_currentCutscene; // 0x108
IntroScript::Script m_currentCutscene; // 0x108
Radio m_radio; // 0x10c
MxStillPresenter* m_dragPresenter; // 0x11c
InfocenterMapEntry m_glowInfo[7]; // 0x120

View File

@ -4,6 +4,7 @@
#include "credits_actions.h"
#include "helicopter.h"
#include "infomain_actions.h"
#include "intro_actions.h"
#include "jukebox.h"
#include "jukebox_actions.h"
#include "legoact2.h"
@ -128,13 +129,13 @@ InfomainScript::Script g_bricksterDialogue[2] = {
// FUNCTION: LEGO1 0x1006ea20
Infocenter::Infocenter()
{
m_selectedCharacter = e_noCharacter;
m_selectedCharacter = LegoActor::c_none;
m_dragPresenter = NULL;
m_infocenterState = NULL;
m_frame = NULL;
m_destLocation = LegoGameState::e_undefined;
m_currentInfomainScript = InfomainScript::c_noneInfomain;
m_currentCutscene = e_noIntro;
m_currentCutscene = IntroScript::c_noneIntro;
memset(&m_glowInfo, 0, sizeof(m_glowInfo));
@ -312,19 +313,19 @@ MxLong Infocenter::HandleEndAction(MxEndActionNotificationParam& p_param)
GameState()->SetActor(m_selectedCharacter);
switch (m_selectedCharacter) {
case e_pepper:
case LegoActor::c_pepper:
PlayAction(InfomainScript::c_avo901in_RunAnim);
break;
case e_mama:
case LegoActor::c_mama:
PlayAction(InfomainScript::c_avo902in_RunAnim);
break;
case e_papa:
case LegoActor::c_papa:
PlayAction(InfomainScript::c_avo903in_RunAnim);
break;
case e_nick:
case LegoActor::c_nick:
PlayAction(InfomainScript::c_avo904in_RunAnim);
break;
case e_laura:
case LegoActor::c_laura:
PlayAction(InfomainScript::c_avo905in_RunAnim);
break;
default:
@ -350,23 +351,23 @@ MxLong Infocenter::HandleEndAction(MxEndActionNotificationParam& p_param)
switch (m_infocenterState->m_state) {
case InfocenterState::e_playCutscene:
switch (m_currentCutscene) {
case e_legoMovie:
PlayCutscene(e_mindscapeMovie, FALSE);
case IntroScript::c_Lego_Movie:
PlayCutscene(IntroScript::c_Mindscape_Movie, FALSE);
return 1;
case e_mindscapeMovie:
PlayCutscene(e_introMovie, TRUE);
case IntroScript::c_Mindscape_Movie:
PlayCutscene(IntroScript::c_Intro_Movie, TRUE);
return 1;
case e_badEndMovie:
case IntroScript::c_BadEnd_Movie:
StopCutscene();
m_infocenterState->m_state = InfocenterState::e_welcomeAnimation;
PlayAction(InfomainScript::c_tic092in_RunAnim);
m_currentCutscene = e_noIntro;
m_currentCutscene = IntroScript::c_noneIntro;
return 1;
case e_goodEndMovie:
case IntroScript::c_GoodEnd_Movie:
StopCutscene();
m_infocenterState->m_state = InfocenterState::e_welcomeAnimation;
PlayAction(InfomainScript::c_tic089in_RunAnim);
m_currentCutscene = e_noIntro;
m_currentCutscene = IntroScript::c_noneIntro;
return 1;
}
@ -374,7 +375,7 @@ MxLong Infocenter::HandleEndAction(MxEndActionNotificationParam& p_param)
StopCutscene();
m_infocenterState->m_state = InfocenterState::e_welcomeAnimation;
PlayAction(InfomainScript::c_iic001in_RunAnim);
m_currentCutscene = e_noIntro;
m_currentCutscene = IntroScript::c_noneIntro;
if (!m_infocenterState->HasRegistered()) {
m_bookAnimationTimer = 1;
@ -385,17 +386,17 @@ MxLong Infocenter::HandleEndAction(MxEndActionNotificationParam& p_param)
m_infocenterState->m_state = InfocenterState::e_welcomeAnimation;
switch (m_currentCutscene) {
case e_badEndMovie:
case IntroScript::c_BadEnd_Movie:
PlayAction(InfomainScript::c_tic092in_RunAnim);
break;
case e_goodEndMovie:
case IntroScript::c_GoodEnd_Movie:
PlayAction(InfomainScript::c_tic089in_RunAnim);
break;
default:
PlayAction(InfomainScript::c_iic001in_RunAnim);
}
m_currentCutscene = e_noIntro;
m_currentCutscene = IntroScript::c_noneIntro;
return 1;
case InfocenterState::e_notRegistered:
SetROIVisible(g_object2x4red, FALSE);
@ -412,7 +413,7 @@ MxLong Infocenter::HandleEndAction(MxEndActionNotificationParam& p_param)
break;
case InfocenterState::e_selectedCharacterAndDestination:
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);
}
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
@ -462,7 +463,7 @@ void Infocenter::ReadyWorld()
switch (m_infocenterState->m_state) {
case InfocenterState::e_newState:
PlayCutscene(e_legoMovie, TRUE);
PlayCutscene(IntroScript::c_Lego_Movie, TRUE);
m_infocenterState->m_state = InfocenterState::e_playCutscene;
return;
case InfocenterState::e_selectedSave:
@ -525,7 +526,7 @@ void Infocenter::ReadyWorld()
if (state && state->GetState() == LegoAct2State::c_badEnding) {
bg->Enable(TRUE);
PlayCutscene(e_badEndMovie, TRUE);
PlayCutscene(IntroScript::c_BadEnd_Movie, TRUE);
m_infocenterState->m_state = InfocenterState::e_playCutscene;
return;
}
@ -570,14 +571,14 @@ void Infocenter::ReadyWorld()
if (state && state->GetState() == Act3State::e_badEnding) {
bg->Enable(TRUE);
PlayCutscene(e_badEndMovie, TRUE);
PlayCutscene(IntroScript::c_BadEnd_Movie, TRUE);
m_infocenterState->m_state = InfocenterState::e_playCutscene;
return;
}
if (state && state->GetState() == Act3State::e_goodEnding) {
bg->Enable(TRUE);
PlayCutscene(e_goodEndMovie, TRUE);
PlayCutscene(IntroScript::c_GoodEnd_Movie, TRUE);
m_infocenterState->m_state = InfocenterState::e_playCutscene;
return;
}
@ -759,19 +760,19 @@ MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
switch (m_dragPresenter->GetAction()->GetObjectId()) {
case InfomainScript::c_PepperHot_Bitmap:
m_selectedCharacter = e_pepper;
m_selectedCharacter = LegoActor::c_pepper;
break;
case InfomainScript::c_MamaHot_Bitmap:
m_selectedCharacter = e_mama;
m_selectedCharacter = LegoActor::c_mama;
break;
case InfomainScript::c_PapaHot_Bitmap:
m_selectedCharacter = e_papa;
m_selectedCharacter = LegoActor::c_papa;
break;
case InfomainScript::c_NickHot_Bitmap:
m_selectedCharacter = e_nick;
m_selectedCharacter = LegoActor::c_nick;
break;
case InfomainScript::c_LauraHot_Bitmap:
m_selectedCharacter = e_laura;
m_selectedCharacter = LegoActor::c_laura;
break;
}
@ -780,7 +781,7 @@ MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
switch (control->GetAction()->GetObjectId()) {
case InfomainScript::c_Pepper_Ctl:
if (m_selectedCharacter == e_pepper) {
if (m_selectedCharacter == LegoActor::c_pepper) {
m_radio.Stop();
BackgroundAudioManager()->Stop();
PlayAction(InfomainScript::c_Pepper_All_Movie);
@ -788,7 +789,7 @@ MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
}
break;
case InfomainScript::c_Mama_Ctl:
if (m_selectedCharacter == e_mama) {
if (m_selectedCharacter == LegoActor::c_mama) {
m_radio.Stop();
BackgroundAudioManager()->Stop();
PlayAction(InfomainScript::c_Mama_All_Movie);
@ -796,7 +797,7 @@ MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
}
break;
case InfomainScript::c_Papa_Ctl:
if (m_selectedCharacter == e_papa) {
if (m_selectedCharacter == LegoActor::c_papa) {
m_radio.Stop();
BackgroundAudioManager()->Stop();
PlayAction(InfomainScript::c_Papa_All_Movie);
@ -804,7 +805,7 @@ MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
}
break;
case InfomainScript::c_Nick_Ctl:
if (m_selectedCharacter == e_nick) {
if (m_selectedCharacter == LegoActor::c_nick) {
m_radio.Stop();
BackgroundAudioManager()->Stop();
PlayAction(InfomainScript::c_Nick_All_Movie);
@ -812,7 +813,7 @@ MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
}
break;
case InfomainScript::c_Laura_Ctl:
if (m_selectedCharacter == e_laura) {
if (m_selectedCharacter == LegoActor::c_laura) {
m_radio.Stop();
BackgroundAudioManager()->Stop();
PlayAction(InfomainScript::c_Laura_All_Movie);
@ -830,19 +831,19 @@ MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
GameState()->SetActor(m_selectedCharacter);
switch (m_selectedCharacter) {
case e_pepper:
case LegoActor::c_pepper:
PlayAction(InfomainScript::c_avo901in_RunAnim);
break;
case e_mama:
case LegoActor::c_mama:
PlayAction(InfomainScript::c_avo902in_RunAnim);
break;
case e_papa:
case LegoActor::c_papa:
PlayAction(InfomainScript::c_avo903in_RunAnim);
break;
case e_nick:
case LegoActor::c_nick:
PlayAction(InfomainScript::c_avo904in_RunAnim);
break;
case e_laura:
case LegoActor::c_laura:
PlayAction(InfomainScript::c_avo905in_RunAnim);
break;
}
@ -901,23 +902,23 @@ MxU8 Infocenter::HandleButtonUp(MxS32 p_x, MxS32 p_y)
}
else {
switch (m_selectedCharacter) {
case e_pepper:
case LegoActor::c_pepper:
dialogueToPlay = InfomainScript::c_avo901in_RunAnim;
GameState()->SetActorId(m_selectedCharacter);
break;
case e_mama:
case LegoActor::c_mama:
dialogueToPlay = InfomainScript::c_avo902in_RunAnim;
GameState()->SetActorId(m_selectedCharacter);
break;
case e_papa:
case LegoActor::c_papa:
dialogueToPlay = InfomainScript::c_avo903in_RunAnim;
GameState()->SetActorId(m_selectedCharacter);
break;
case e_nick:
case LegoActor::c_nick:
dialogueToPlay = InfomainScript::c_avo904in_RunAnim;
GameState()->SetActorId(m_selectedCharacter);
break;
case e_laura:
case LegoActor::c_laura:
dialogueToPlay = InfomainScript::c_avo905in_RunAnim;
GameState()->SetActorId(m_selectedCharacter);
break;
@ -1262,7 +1263,7 @@ MxResult Infocenter::Tickle()
}
// 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;
@ -1272,9 +1273,9 @@ void Infocenter::PlayCutscene(Cutscene p_entityId, MxBool p_scale)
SetAppCursor(e_cursorNone);
VideoManager()->GetDisplaySurface()->ClearScreen();
if (m_currentCutscene != e_noIntro) {
if (m_currentCutscene != IntroScript::c_noneIntro) {
// 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();
}
@ -1285,7 +1286,7 @@ void Infocenter::PlayCutscene(Cutscene p_entityId, MxBool p_scale)
// FUNCTION: LEGO1 0x10070cb0
void Infocenter::StopCutscene()
{
if (m_currentCutscene != e_noIntro) {
if (m_currentCutscene != IntroScript::c_noneIntro) {
InvokeAction(Extra::ActionType::e_close, *g_introScript, m_currentCutscene, NULL);
}
@ -1402,9 +1403,9 @@ void Infocenter::Reset()
GameState()->m_savedPreviousArea = LegoGameState::e_undefined;
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");