Clear unknowns in Act1State (#1664)

This commit is contained in:
Fabian Neundorf
2025-08-02 17:20:37 +02:00
committed by GitHub
parent 3ed6c58701
commit 1e9c0a95df
7 changed files with 52 additions and 52 deletions

View File

@@ -75,11 +75,11 @@ public:
MxU32 GetState() { return m_state; } MxU32 GetState() { return m_state; }
ElevatorFloor GetElevatorFloor() { return (ElevatorFloor) m_elevFloor; } ElevatorFloor GetElevatorFloor() { return (ElevatorFloor) m_elevFloor; }
MxU8 GetUnknown21() { return m_unk0x021; } MxBool IsSpawnInInfocenter() { return m_spawnInInfocenter; }
void SetState(MxU32 p_state) { m_state = p_state; } void SetState(MxU32 p_state) { m_state = p_state; }
void SetElevatorFloor(ElevatorFloor p_elevFloor) { m_elevFloor = p_elevFloor; } void SetElevatorFloor(ElevatorFloor p_elevFloor) { m_elevFloor = p_elevFloor; }
void SetUnknown21(MxU8 p_unk0x21) { m_unk0x021 = p_unk0x21; } void SetSpawnInInfocenter(MxBool p_spawnInInfocenter) { m_spawnInInfocenter = p_spawnInInfocenter; }
// SYNTHETIC: LEGO1 0x10033960 // SYNTHETIC: LEGO1 0x10033960
// Act1State::`scalar deleting destructor' // Act1State::`scalar deleting destructor'
@@ -90,11 +90,11 @@ public:
IsleScript::Script m_currentCptClickDialogue; // 0x014 IsleScript::Script m_currentCptClickDialogue; // 0x014
MxU32 m_state; // 0x018 MxU32 m_state; // 0x018
MxS16 m_elevFloor; // 0x01c MxS16 m_elevFloor; // 0x01c
MxBool m_unk0x01e; // 0x01e MxBool m_playingFloor2Animation; // 0x01e
MxBool m_unk0x01f; // 0x01f MxBool m_switchedToArea; // 0x01f
MxBool m_planeActive; // 0x020 MxBool m_planeActive; // 0x020
undefined m_unk0x021; // 0x021 MxBool m_spawnInInfocenter; // 0x021
MxBool m_unk0x022; // 0x022 MxBool m_playedExitExplanation; // 0x022
undefined m_unk0x023; // 0x023 undefined m_unk0x023; // 0x023
LegoNamedPlane m_motocyclePlane; // 0x024 LegoNamedPlane m_motocyclePlane; // 0x024
LegoNamedPlane m_bikePlane; // 0x070 LegoNamedPlane m_bikePlane; // 0x070

View File

@@ -111,8 +111,8 @@ void Bike::ActivateSceneActions()
PlayMusic(JukeboxScript::c_InformationCenter_Music); PlayMusic(JukeboxScript::c_InformationCenter_Music);
Act1State* act1state = (Act1State*) GameState()->GetState("Act1State"); Act1State* act1state = (Act1State*) GameState()->GetState("Act1State");
if (!act1state->m_unk0x022) { if (!act1state->m_playedExitExplanation) {
act1state->m_unk0x022 = TRUE; act1state->m_playedExitExplanation = TRUE;
MxMatrix mat(UserActor()->GetROI()->GetLocal2World()); MxMatrix mat(UserActor()->GetROI()->GetLocal2World());
mat.TranslateBy(mat[2][0] * 2.5, mat[2][1] + 0.7, mat[2][2] * 2.5); mat.TranslateBy(mat[2][0] * 2.5, mat[2][1] + 0.7, mat[2][2] * 2.5);

View File

@@ -192,8 +192,8 @@ void DuneBuggy::ActivateSceneActions()
PlayMusic(JukeboxScript::c_GarageArea_Music); PlayMusic(JukeboxScript::c_GarageArea_Music);
Act1State* act1state = (Act1State*) GameState()->GetState("Act1State"); Act1State* act1state = (Act1State*) GameState()->GetState("Act1State");
if (!act1state->m_unk0x022) { if (!act1state->m_playedExitExplanation) {
act1state->m_unk0x022 = TRUE; act1state->m_playedExitExplanation = TRUE;
MxMatrix mat(UserActor()->GetROI()->GetLocal2World()); MxMatrix mat(UserActor()->GetROI()->GetLocal2World());
mat.TranslateBy(mat[2][0] * 2.5, mat[2][1] + 0.7, mat[2][2] * 2.5); mat.TranslateBy(mat[2][0] * 2.5, mat[2][1] + 0.7, mat[2][2] * 2.5);

View File

@@ -163,11 +163,11 @@ void Jetski::ActivateSceneActions()
Act1State* act1state = (Act1State*) GameState()->GetState("Act1State"); Act1State* act1state = (Act1State*) GameState()->GetState("Act1State");
if (!act1state->m_state) { if (!act1state->m_state) {
if (act1state->m_unk0x022) { if (act1state->m_playedExitExplanation) {
PlayCamAnim(this, FALSE, 68, TRUE); PlayCamAnim(this, FALSE, 68, TRUE);
} }
else { else {
act1state->m_unk0x022 = TRUE; act1state->m_playedExitExplanation = TRUE;
LegoPathActor* user = UserActor(); LegoPathActor* user = UserActor();
if (user != NULL) { if (user != NULL) {

View File

@@ -151,8 +151,8 @@ void Motocycle::ActivateSceneActions()
PlayMusic(JukeboxScript::c_PoliceStation_Music); PlayMusic(JukeboxScript::c_PoliceStation_Music);
Act1State* act1state = (Act1State*) GameState()->GetState("Act1State"); Act1State* act1state = (Act1State*) GameState()->GetState("Act1State");
if (!act1state->m_unk0x022) { if (!act1state->m_playedExitExplanation) {
act1state->m_unk0x022 = TRUE; act1state->m_playedExitExplanation = TRUE;
MxMatrix mat(UserActor()->GetROI()->GetLocal2World()); MxMatrix mat(UserActor()->GetROI()->GetLocal2World());
mat.TranslateBy(mat[2][0] * 2.5, mat[2][1] + 0.7, mat[2][2] * 2.5); mat.TranslateBy(mat[2][0] * 2.5, mat[2][1] + 0.7, mat[2][2] * 2.5);

View File

@@ -151,8 +151,8 @@ void SkateBoard::ActivateSceneActions()
if (m_act1state->m_state != Act1State::e_pizza) { if (m_act1state->m_state != Act1State::e_pizza) {
PlayMusic(JukeboxScript::c_BeachBlvd_Music); PlayMusic(JukeboxScript::c_BeachBlvd_Music);
if (!m_act1state->m_unk0x022) { if (!m_act1state->m_playedExitExplanation) {
m_act1state->m_unk0x022 = TRUE; m_act1state->m_playedExitExplanation = TRUE;
MxMatrix mat(UserActor()->GetROI()->GetLocal2World()); MxMatrix mat(UserActor()->GetROI()->GetLocal2World());
mat.TranslateBy(mat[2][0] * 2.5, mat[2][1] + 0.2, mat[2][2] * 2.5); mat.TranslateBy(mat[2][0] * 2.5, mat[2][1] + 0.2, mat[2][2] * 2.5);

View File

@@ -244,15 +244,15 @@ void Isle::HandleElevatorEndAction()
m_act1state->m_state = Act1State::e_none; m_act1state->m_state = Act1State::e_none;
break; break;
case Act1State::c_floor2: case Act1State::c_floor2:
if (m_act1state->m_unk0x01e) { if (m_act1state->m_playingFloor2Animation) {
m_act1state->m_unk0x01e = FALSE; m_act1state->m_playingFloor2Animation = FALSE;
m_act1state->m_state = Act1State::e_none; m_act1state->m_state = Act1State::e_none;
InputManager()->EnableInputProcessing(); InputManager()->EnableInputProcessing();
} }
else { else {
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_Floor2, NULL); InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_Floor2, NULL);
InputManager()->EnableInputProcessing(); InputManager()->EnableInputProcessing();
m_act1state->m_unk0x01e = TRUE; m_act1state->m_playingFloor2Animation = TRUE;
} }
break; break;
case Act1State::c_floor3: case Act1State::c_floor3:
@@ -268,10 +268,10 @@ void Isle::ReadyWorld()
{ {
LegoWorld::ReadyWorld(); LegoWorld::ReadyWorld();
if (m_act1state->GetUnknown21()) { if (m_act1state->IsSpawnInInfocenter()) {
GameState()->SwitchArea(LegoGameState::e_infomain); GameState()->SwitchArea(LegoGameState::e_infomain);
m_act1state->SetState(Act1State::e_none); m_act1state->SetState(Act1State::e_none);
m_act1state->SetUnknown21(0); m_act1state->SetSpawnInInfocenter(FALSE);
} }
else if (GameState()->GetLoadedAct() != LegoGameState::e_act1) { else if (GameState()->GetLoadedAct() != LegoGameState::e_act1) {
EnableAnimations(TRUE); EnableAnimations(TRUE);
@@ -318,7 +318,7 @@ MxLong Isle::HandleControl(LegoControlManagerNotificationParam& p_param)
break; break;
case Act1State::c_floor2: case Act1State::c_floor2:
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_Floor2, NULL); InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_Floor2, NULL);
m_act1state->m_unk0x01e = TRUE; m_act1state->m_playingFloor2Animation = TRUE;
break; break;
case Act1State::c_floor3: case Act1State::c_floor3:
InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_Elev3_2_Ride, NULL); InvokeAction(Extra::e_start, *g_isleScript, IsleScript::c_Elev3_2_Ride, NULL);
@@ -907,7 +907,7 @@ MxLong Isle::HandleTransitionEnd()
m_destLocation = LegoGameState::e_undefined; m_destLocation = LegoGameState::e_undefined;
break; break;
case LegoGameState::e_elevride: case LegoGameState::e_elevride:
m_act1state->m_unk0x01f = TRUE; m_act1state->m_switchedToArea = TRUE;
VariableTable()->SetVariable("VISIBILITY", "Hide infocen"); VariableTable()->SetVariable("VISIBILITY", "Hide infocen");
TransitionToOverlay( TransitionToOverlay(
IsleScript::c_ElevRide_Background_Bitmap, IsleScript::c_ElevRide_Background_Bitmap,
@@ -961,7 +961,7 @@ MxLong Isle::HandleTransitionEnd()
); );
break; break;
case LegoGameState::e_garadoor: case LegoGameState::e_garadoor:
m_act1state->m_unk0x01f = TRUE; m_act1state->m_switchedToArea = TRUE;
VariableTable()->SetVariable("VISIBILITY", "Hide Gas"); VariableTable()->SetVariable("VISIBILITY", "Hide Gas");
TransitionToOverlay(IsleScript::c_GaraDoor_Background_Bitmap, JukeboxScript::c_JBMusic2, "LCAMZG1,90", FALSE); TransitionToOverlay(IsleScript::c_GaraDoor_Background_Bitmap, JukeboxScript::c_JBMusic2, "LCAMZG1,90", FALSE);
break; break;
@@ -986,7 +986,7 @@ MxLong Isle::HandleTransitionEnd()
SetIsWorldActive(TRUE); SetIsWorldActive(TRUE);
break; break;
case LegoGameState::e_polidoor: case LegoGameState::e_polidoor:
m_act1state->m_unk0x01f = TRUE; m_act1state->m_switchedToArea = TRUE;
VariableTable()->SetVariable("VISIBILITY", "Hide Policsta"); VariableTable()->SetVariable("VISIBILITY", "Hide Policsta");
TransitionToOverlay( TransitionToOverlay(
IsleScript::c_PoliDoor_Background_Bitmap, IsleScript::c_PoliDoor_Background_Bitmap,
@@ -996,61 +996,61 @@ MxLong Isle::HandleTransitionEnd()
); );
break; break;
case LegoGameState::e_bike: case LegoGameState::e_bike:
m_act1state->m_unk0x01f = TRUE; m_act1state->m_switchedToArea = TRUE;
TransitionToOverlay(IsleScript::c_BikeDashboard_Bitmap, JukeboxScript::c_MusicTheme1, NULL, TRUE); TransitionToOverlay(IsleScript::c_BikeDashboard_Bitmap, JukeboxScript::c_MusicTheme1, NULL, TRUE);
if (!m_act1state->m_unk0x01f) { if (!m_act1state->m_switchedToArea) {
m_bike->ActivateSceneActions(); m_bike->ActivateSceneActions();
} }
break; break;
case LegoGameState::e_dunecar: case LegoGameState::e_dunecar:
m_act1state->m_unk0x01f = TRUE; m_act1state->m_switchedToArea = TRUE;
TransitionToOverlay(IsleScript::c_DuneCarFuelMeter, JukeboxScript::c_MusicTheme1, NULL, TRUE); TransitionToOverlay(IsleScript::c_DuneCarFuelMeter, JukeboxScript::c_MusicTheme1, NULL, TRUE);
if (!m_act1state->m_unk0x01f) { if (!m_act1state->m_switchedToArea) {
m_dunebuggy->ActivateSceneActions(); m_dunebuggy->ActivateSceneActions();
} }
break; break;
case LegoGameState::e_motocycle: case LegoGameState::e_motocycle:
m_act1state->m_unk0x01f = TRUE; m_act1state->m_switchedToArea = TRUE;
TransitionToOverlay(IsleScript::c_MotoBikeDashboard_Bitmap, JukeboxScript::c_MusicTheme1, NULL, TRUE); TransitionToOverlay(IsleScript::c_MotoBikeDashboard_Bitmap, JukeboxScript::c_MusicTheme1, NULL, TRUE);
if (!m_act1state->m_unk0x01f) { if (!m_act1state->m_switchedToArea) {
m_motocycle->ActivateSceneActions(); m_motocycle->ActivateSceneActions();
} }
break; break;
case LegoGameState::e_copter: case LegoGameState::e_copter:
m_act1state->m_unk0x01f = TRUE; m_act1state->m_switchedToArea = TRUE;
TransitionToOverlay(IsleScript::c_HelicopterDashboard_Bitmap, JukeboxScript::c_MusicTheme1, NULL, TRUE); TransitionToOverlay(IsleScript::c_HelicopterDashboard_Bitmap, JukeboxScript::c_MusicTheme1, NULL, TRUE);
break; break;
case LegoGameState::e_skateboard: case LegoGameState::e_skateboard:
m_act1state->m_unk0x01f = TRUE; m_act1state->m_switchedToArea = TRUE;
TransitionToOverlay(IsleScript::c_SkatePizza_Bitmap, JukeboxScript::c_MusicTheme1, NULL, TRUE); TransitionToOverlay(IsleScript::c_SkatePizza_Bitmap, JukeboxScript::c_MusicTheme1, NULL, TRUE);
if (!m_act1state->m_unk0x01f) { if (!m_act1state->m_switchedToArea) {
m_skateboard->ActivateSceneActions(); m_skateboard->ActivateSceneActions();
} }
break; break;
case LegoGameState::e_ambulance: case LegoGameState::e_ambulance:
m_act1state->m_unk0x01f = TRUE; m_act1state->m_switchedToArea = TRUE;
m_act1state->m_state = Act1State::e_ambulance; m_act1state->m_state = Act1State::e_ambulance;
TransitionToOverlay(IsleScript::c_AmbulanceFuelMeter, JukeboxScript::c_MusicTheme1, NULL, TRUE); TransitionToOverlay(IsleScript::c_AmbulanceFuelMeter, JukeboxScript::c_MusicTheme1, NULL, TRUE);
if (!m_act1state->m_unk0x01f) { if (!m_act1state->m_switchedToArea) {
m_ambulance->ActivateSceneActions(); m_ambulance->ActivateSceneActions();
} }
break; break;
case LegoGameState::e_towtrack: case LegoGameState::e_towtrack:
m_act1state->m_unk0x01f = TRUE; m_act1state->m_switchedToArea = TRUE;
m_act1state->m_state = Act1State::e_towtrack; m_act1state->m_state = Act1State::e_towtrack;
TransitionToOverlay(IsleScript::c_TowFuelMeter, JukeboxScript::c_MusicTheme1, NULL, TRUE); TransitionToOverlay(IsleScript::c_TowFuelMeter, JukeboxScript::c_MusicTheme1, NULL, TRUE);
if (!m_act1state->m_unk0x01f) { if (!m_act1state->m_switchedToArea) {
m_towtrack->ActivateSceneActions(); m_towtrack->ActivateSceneActions();
} }
break; break;
case LegoGameState::e_jetski: case LegoGameState::e_jetski:
m_act1state->m_unk0x01f = TRUE; m_act1state->m_switchedToArea = TRUE;
TransitionToOverlay( TransitionToOverlay(
(IsleScript::Script) m_jetski->GetJetskiDashboardStreamId(), (IsleScript::Script) m_jetski->GetJetskiDashboardStreamId(),
JukeboxScript::c_MusicTheme1, JukeboxScript::c_MusicTheme1,
@@ -1058,7 +1058,7 @@ MxLong Isle::HandleTransitionEnd()
TRUE TRUE
); );
if (!m_act1state->m_unk0x01f) { if (!m_act1state->m_switchedToArea) {
m_jetski->ActivateSceneActions(); m_jetski->ActivateSceneActions();
} }
break; break;
@@ -1078,7 +1078,7 @@ void Isle::TransitionToOverlay(
MxBool p_setCamera MxBool p_setCamera
) )
{ {
if (m_act1state->m_unk0x01f) { if (m_act1state->m_switchedToArea) {
MxPresenter* presenter = (MxPresenter*) Find(m_atomId, p_script); MxPresenter* presenter = (MxPresenter*) Find(m_atomId, p_script);
if (presenter != NULL && presenter->GetCurrentTickleState() == MxPresenter::e_repeating) { if (presenter != NULL && presenter->GetCurrentTickleState() == MxPresenter::e_repeating) {
@@ -1100,7 +1100,7 @@ void Isle::TransitionToOverlay(
Disable(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen); Disable(FALSE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
SetAppCursor(e_cursorArrow); SetAppCursor(e_cursorArrow);
m_destLocation = LegoGameState::e_undefined; m_destLocation = LegoGameState::e_undefined;
m_act1state->m_unk0x01f = FALSE; m_act1state->m_switchedToArea = FALSE;
} }
else { else {
NotificationManager()->Send(this, MxNotificationParam(c_notificationTransitioned, NULL)); NotificationManager()->Send(this, MxNotificationParam(c_notificationTransitioned, NULL));
@@ -1110,7 +1110,7 @@ void Isle::TransitionToOverlay(
GameState()->SwitchArea(m_destLocation); GameState()->SwitchArea(m_destLocation);
GameState()->StopArea(LegoGameState::e_previousArea); GameState()->StopArea(LegoGameState::e_previousArea);
NotificationManager()->Send(this, MxNotificationParam(c_notificationTransitioned, NULL)); NotificationManager()->Send(this, MxNotificationParam(c_notificationTransitioned, NULL));
m_act1state->m_unk0x01f = TRUE; m_act1state->m_switchedToArea = TRUE;
} }
} }
@@ -1229,9 +1229,9 @@ MxBool Isle::Escape()
break; break;
} }
if (m_act1state->m_unk0x01e == TRUE) { if (m_act1state->m_playingFloor2Animation == TRUE) {
InvokeAction(Extra::e_stop, *g_isleScript, IsleScript::c_Floor2, NULL); InvokeAction(Extra::e_stop, *g_isleScript, IsleScript::c_Floor2, NULL);
m_act1state->m_unk0x01e = FALSE; m_act1state->m_playingFloor2Animation = FALSE;
} }
m_act1state->m_elevFloor = Act1State::c_floor1; m_act1state->m_elevFloor = Act1State::c_floor1;
@@ -1309,18 +1309,18 @@ Act1State::Act1State()
{ {
m_elevFloor = Act1State::c_floor1; m_elevFloor = Act1State::c_floor1;
m_state = Act1State::e_initial; m_state = Act1State::e_initial;
m_unk0x01e = FALSE; m_playingFloor2Animation = FALSE;
m_cptClickDialogue = Playlist((MxU32*) g_cptClickDialogue, sizeOfArray(g_cptClickDialogue), Playlist::e_loop); m_cptClickDialogue = Playlist((MxU32*) g_cptClickDialogue, sizeOfArray(g_cptClickDialogue), Playlist::e_loop);
m_unk0x01f = FALSE; m_switchedToArea = FALSE;
m_planeActive = FALSE; m_planeActive = FALSE;
m_currentCptClickDialogue = IsleScript::c_noneIsle; m_currentCptClickDialogue = IsleScript::c_noneIsle;
m_unk0x022 = FALSE; m_playedExitExplanation = FALSE;
m_helicopterWindshield = NULL; m_helicopterWindshield = NULL;
m_helicopterJetLeft = NULL; m_helicopterJetLeft = NULL;
m_helicopterJetRight = NULL; m_helicopterJetRight = NULL;
m_helicopter = NULL; m_helicopter = NULL;
m_jetskiFront = NULL; m_jetskiFront = NULL;
m_unk0x021 = 1; m_spawnInInfocenter = 1;
m_jetskiWindshield = NULL; m_jetskiWindshield = NULL;
m_jetski = NULL; m_jetski = NULL;
m_dunebuggyFront = NULL; m_dunebuggyFront = NULL;
@@ -1419,7 +1419,7 @@ MxResult Act1State::Serialize(LegoStorage* p_storage)
} }
p_storage->WriteS16(m_cptClickDialogue.m_nextIndex); p_storage->WriteS16(m_cptClickDialogue.m_nextIndex);
p_storage->WriteU8(m_unk0x022); p_storage->WriteU8(m_playedExitExplanation);
} }
else if (p_storage->IsReadMode()) { else if (p_storage->IsReadMode()) {
if (strcmp(m_helicopterPlane.m_name.GetData(), "")) { if (strcmp(m_helicopterPlane.m_name.GetData(), "")) {
@@ -1467,7 +1467,7 @@ MxResult Act1State::Serialize(LegoStorage* p_storage)
} }
p_storage->ReadS16(m_cptClickDialogue.m_nextIndex); p_storage->ReadS16(m_cptClickDialogue.m_nextIndex);
p_storage->ReadU8(m_unk0x022); p_storage->ReadU8(m_playedExitExplanation);
} }
return SUCCESS; return SUCCESS;
@@ -1500,7 +1500,7 @@ MxBool Act1State::Reset()
m_motocyclePlane.m_name = ""; m_motocyclePlane.m_name = "";
m_bikePlane.m_name = ""; m_bikePlane.m_name = "";
m_skateboardPlane.m_name = ""; m_skateboardPlane.m_name = "";
m_unk0x022 = FALSE; m_playedExitExplanation = FALSE;
m_helicopterPlane.m_name = ""; m_helicopterPlane.m_name = "";
if (m_helicopterWindshield) { if (m_helicopterWindshield) {