diff --git a/LEGO1/lego/legoomni/include/act3.h b/LEGO1/lego/legoomni/include/act3.h index 28129b4b..c4e528fd 100644 --- a/LEGO1/lego/legoomni/include/act3.h +++ b/LEGO1/lego/legoomni/include/act3.h @@ -58,7 +58,14 @@ private: // SIZE 0x0c class Act3State : public LegoState { 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 MxBool IsSerializable() override { return FALSE; } @@ -80,11 +87,11 @@ public: // SYNTHETIC: LEGO1 0x1000e3c0 // 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. - undefined4 m_unk0x08; // 0x08 + MxU32 m_state; // 0x08 }; // VTABLE: LEGO1 0x100d9628 diff --git a/LEGO1/lego/legoomni/src/entity/legonavcontroller.cpp b/LEGO1/lego/legoomni/src/entity/legonavcontroller.cpp index b539e050..5a74d98d 100644 --- a/LEGO1/lego/legoomni/src/entity/legonavcontroller.cpp +++ b/LEGO1/lego/legoomni/src/entity/legonavcontroller.cpp @@ -864,7 +864,7 @@ MxLong LegoNavController::Notify(MxParam& p_param) } GameState()->SetCurrentAct(LegoGameState::e_act3); - act3State->m_unk0x08 = 2; + act3State->m_state = Act3State::e_goodEnding; GameState()->m_currentArea = LegoGameState::e_act3script; GameState()->SwitchArea(LegoGameState::e_infomain); break; @@ -878,7 +878,7 @@ MxLong LegoNavController::Notify(MxParam& p_param) } GameState()->SetCurrentAct(LegoGameState::e_act3); - act3State->m_unk0x08 = 3; + act3State->m_state = Act3State::e_badEnding; GameState()->m_currentArea = LegoGameState::e_act3script; GameState()->SwitchArea(LegoGameState::e_infomain); break; diff --git a/LEGO1/lego/legoomni/src/worlds/act3.cpp b/LEGO1/lego/legoomni/src/worlds/act3.cpp index 5c2d67e4..df2cccac 100644 --- a/LEGO1/lego/legoomni/src/worlds/act3.cpp +++ b/LEGO1/lego/legoomni/src/worlds/act3.cpp @@ -632,22 +632,22 @@ MxLong Act3::Notify(MxParam& p_param) break; } 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); return 1; } break; case c_notificationButtonUp: case c_notificationButtonDown: - if (m_state->m_unk0x08 == 1) { + if (m_state->m_state == Act3State::e_ready) { return 1; } break; 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); 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); m_copter->HandleClick(); m_copter->m_state->m_unk0x08 = 1; @@ -686,7 +686,7 @@ void Act3::ReadyWorld() AnimationManager() ->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 @@ -758,7 +758,7 @@ void Act3::SetBrickster(Act3Brickster* p_brickster) // FUNCTION: LEGO1 0x10073400 void Act3::FUN_10073400() { - m_state->m_unk0x08 = 2; + m_state->m_state = Act3State::e_goodEnding; m_destLocation = LegoGameState::e_infomain; TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE); } @@ -766,7 +766,7 @@ void Act3::FUN_10073400() // FUNCTION: LEGO1 0x10073430 void Act3::FUN_10073430() { - m_state->m_unk0x08 = 3; + m_state->m_state = Act3State::e_badEnding; m_destLocation = LegoGameState::e_infomain; TransitionManager()->StartTransition(MxTransitionManager::e_mosaic, 50, FALSE, FALSE); } @@ -794,7 +794,7 @@ void Act3::GoodEnding(const Matrix4& p_destination) m_copter->m_unk0x1f4 ); #else - m_state->m_unk0x08 = 2; + m_state->m_state = Act3State::e_goodEnding; GameState()->SwitchArea(LegoGameState::Area::e_infomain); #endif } diff --git a/LEGO1/lego/legoomni/src/worlds/infocenter.cpp b/LEGO1/lego/legoomni/src/worlds/infocenter.cpp index 957681d9..ad49877c 100644 --- a/LEGO1/lego/legoomni/src/worlds/infocenter.cpp +++ b/LEGO1/lego/legoomni/src/worlds/infocenter.cpp @@ -561,14 +561,14 @@ void Infocenter::ReadyWorld() Act3State* state = (Act3State*) GameState()->GetState("Act3State"); GameState()->FindLoadedAct(); - if (state && state->GetUnknown0x08() == 3) { + if (state && state->GetState() == Act3State::e_badEnding) { bg->Enable(TRUE); PlayCutscene(e_badEndMovie, TRUE); m_infocenterState->m_state = InfocenterState::e_playCutscene; return; } - if (state && state->GetUnknown0x08() == 2) { + if (state && state->GetState() == Act3State::e_goodEnding) { bg->Enable(TRUE); PlayCutscene(e_goodEndMovie, TRUE); m_infocenterState->m_state = InfocenterState::e_playCutscene;