Clear unknowns in Act3State (#1665)

This commit is contained in:
Fabian Neundorf
2025-08-04 04:17:17 +02:00
committed by GitHub
parent 1e9c0a95df
commit 67695b5233
4 changed files with 22 additions and 15 deletions

View File

@@ -58,7 +58,14 @@ private:
// SIZE 0x0c // SIZE 0x0c
class Act3State : public LegoState { class Act3State : public LegoState {
public: public:
Act3State() { m_unk0x08 = 0; } enum {
e_initial = 0,
e_ready = 1,
e_goodEnding = 2,
e_badEnding = 3,
};
Act3State() { m_state = Act3State::e_initial; }
// FUNCTION: LEGO1 0x1000e2f0 // FUNCTION: LEGO1 0x1000e2f0
MxBool IsSerializable() override { return FALSE; } MxBool IsSerializable() override { return FALSE; }
@@ -80,11 +87,11 @@ public:
// SYNTHETIC: LEGO1 0x1000e3c0 // SYNTHETIC: LEGO1 0x1000e3c0
// Act3State::`scalar deleting destructor' // Act3State::`scalar deleting destructor'
undefined4 GetUnknown0x08() { return m_unk0x08; } MxU32 GetState() { return m_state; }
// TODO: Most likely getters/setters are not used according to BETA. // TODO: Most likely getters/setters are not used according to BETA.
undefined4 m_unk0x08; // 0x08 MxU32 m_state; // 0x08
}; };
// VTABLE: LEGO1 0x100d9628 // VTABLE: LEGO1 0x100d9628

View File

@@ -864,7 +864,7 @@ MxLong LegoNavController::Notify(MxParam& p_param)
} }
GameState()->SetCurrentAct(LegoGameState::e_act3); GameState()->SetCurrentAct(LegoGameState::e_act3);
act3State->m_unk0x08 = 2; act3State->m_state = Act3State::e_goodEnding;
GameState()->m_currentArea = LegoGameState::e_act3script; GameState()->m_currentArea = LegoGameState::e_act3script;
GameState()->SwitchArea(LegoGameState::e_infomain); GameState()->SwitchArea(LegoGameState::e_infomain);
break; break;
@@ -878,7 +878,7 @@ MxLong LegoNavController::Notify(MxParam& p_param)
} }
GameState()->SetCurrentAct(LegoGameState::e_act3); GameState()->SetCurrentAct(LegoGameState::e_act3);
act3State->m_unk0x08 = 3; act3State->m_state = Act3State::e_badEnding;
GameState()->m_currentArea = LegoGameState::e_act3script; GameState()->m_currentArea = LegoGameState::e_act3script;
GameState()->SwitchArea(LegoGameState::e_infomain); GameState()->SwitchArea(LegoGameState::e_infomain);
break; break;

View File

@@ -632,22 +632,22 @@ MxLong Act3::Notify(MxParam& p_param)
break; break;
} }
case c_notificationKeyPress: case c_notificationKeyPress:
if (m_state->m_unk0x08 == 1 && ((LegoEventNotificationParam&) p_param).GetKey() == ' ') { if (m_state->m_state == Act3State::e_ready && ((LegoEventNotificationParam&) p_param).GetKey() == ' ') {
AnimationManager()->FUN_10061010(FALSE); AnimationManager()->FUN_10061010(FALSE);
return 1; return 1;
} }
break; break;
case c_notificationButtonUp: case c_notificationButtonUp:
case c_notificationButtonDown: case c_notificationButtonDown:
if (m_state->m_unk0x08 == 1) { if (m_state->m_state == Act3State::e_ready) {
return 1; return 1;
} }
break; break;
case c_notificationEndAnim: case c_notificationEndAnim:
if (m_state->m_unk0x08 == 1) { if (m_state->m_state == Act3State::e_ready) {
assert(m_copter && m_brickster && m_cop1 && m_cop2); assert(m_copter && m_brickster && m_cop1 && m_cop2);
m_unk0x4220.RemoveByObjectIdOrFirst(0); m_unk0x4220.RemoveByObjectIdOrFirst(0);
m_state->m_unk0x08 = 0; m_state->m_state = Act3State::e_initial;
Disable(TRUE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen); Disable(TRUE, LegoOmni::c_disableInput | LegoOmni::c_disable3d | LegoOmni::c_clearScreen);
m_copter->HandleClick(); m_copter->HandleClick();
m_copter->m_state->m_unk0x08 = 1; m_copter->m_state->m_unk0x08 = 1;
@@ -686,7 +686,7 @@ void Act3::ReadyWorld()
AnimationManager() AnimationManager()
->FUN_10060dc0(m_unk0x426c, NULL, TRUE, LegoAnimationManager::e_unk0, NULL, TRUE, FALSE, FALSE, FALSE); ->FUN_10060dc0(m_unk0x426c, NULL, TRUE, LegoAnimationManager::e_unk0, NULL, TRUE, FALSE, FALSE, FALSE);
m_state->m_unk0x08 = 1; m_state->m_state = Act3State::e_ready;
} }
// FUNCTION: LEGO1 0x10073300 // FUNCTION: LEGO1 0x10073300
@@ -758,7 +758,7 @@ void Act3::SetBrickster(Act3Brickster* p_brickster)
// FUNCTION: LEGO1 0x10073400 // FUNCTION: LEGO1 0x10073400
void Act3::FUN_10073400() void Act3::FUN_10073400()
{ {
m_state->m_unk0x08 = 2; m_state->m_state = Act3State::e_goodEnding;
m_destLocation = LegoGameState::e_infomain; m_destLocation = LegoGameState::e_infomain;
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE); TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
} }
@@ -766,7 +766,7 @@ void Act3::FUN_10073400()
// FUNCTION: LEGO1 0x10073430 // FUNCTION: LEGO1 0x10073430
void Act3::FUN_10073430() void Act3::FUN_10073430()
{ {
m_state->m_unk0x08 = 3; m_state->m_state = Act3State::e_badEnding;
m_destLocation = LegoGameState::e_infomain; m_destLocation = LegoGameState::e_infomain;
TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE); TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE);
} }
@@ -794,7 +794,7 @@ void Act3::GoodEnding(const Matrix4& p_destination)
m_copter->m_unk0x1f4 m_copter->m_unk0x1f4
); );
#else #else
m_state->m_unk0x08 = 2; m_state->m_state = Act3State::e_goodEnding;
GameState()->SwitchArea(LegoGameState::Area::e_infomain); GameState()->SwitchArea(LegoGameState::Area::e_infomain);
#endif #endif
} }

View File

@@ -561,14 +561,14 @@ void Infocenter::ReadyWorld()
Act3State* state = (Act3State*) GameState()->GetState("Act3State"); Act3State* state = (Act3State*) GameState()->GetState("Act3State");
GameState()->FindLoadedAct(); GameState()->FindLoadedAct();
if (state && state->GetUnknown0x08() == 3) { if (state && state->GetState() == Act3State::e_badEnding) {
bg->Enable(TRUE); bg->Enable(TRUE);
PlayCutscene(e_badEndMovie, TRUE); PlayCutscene(e_badEndMovie, TRUE);
m_infocenterState->m_state = InfocenterState::e_playCutscene; m_infocenterState->m_state = InfocenterState::e_playCutscene;
return; return;
} }
if (state && state->GetUnknown0x08() == 2) { if (state && state->GetState() == Act3State::e_goodEnding) {
bg->Enable(TRUE); bg->Enable(TRUE);
PlayCutscene(e_goodEndMovie, TRUE); PlayCutscene(e_goodEndMovie, TRUE);
m_infocenterState->m_state = InfocenterState::e_playCutscene; m_infocenterState->m_state = InfocenterState::e_playCutscene;