Rename stuff, add default arg

This commit is contained in:
Christian Semmler 2024-01-31 07:29:03 -05:00
parent 62fd080e7e
commit 5da883f0f0
9 changed files with 30 additions and 26 deletions

View File

@ -32,15 +32,15 @@ class LegoGameState {
LegoState* CreateState(const char* p_stateName);
void GetFileSavePath(MxString* p_outPath, MxULong p_slotn);
void StopPreviousAction(MxU32);
void HandleAction(MxU32);
void StopArea(MxU32 p_area = 0);
void SwitchArea(MxU32 p_area);
inline MxU8 GetUnknownC() { return m_unk0x0c; }
inline MxU32 GetUnknown10() { return m_unk0x10; }
inline MxS32 GetCurrentAct() { return m_currentAct; }
inline undefined4 GetUnknown424() { return m_unk0x424; }
inline undefined4 GetUnknown424() { return m_currentArea; }
inline void SetDirty(MxBool p_dirty) { m_isDirty = p_dirty; }
inline void SetUnknown424(undefined4 p_unk0x424) { m_unk0x424 = p_unk0x424; }
inline void SetUnknown424(undefined4 p_unk0x424) { m_currentArea = p_unk0x424; }
void SetSomeEnumState(undefined4 p_state);
void FUN_1003ceb0();
@ -75,8 +75,8 @@ class LegoGameState {
ScoreStruct m_unk0xa6; // 0xa6
undefined m_unk0x41a[8]; // 0x41a - might be part of the structure at 0xa6
MxBool m_isDirty; // 0x420
undefined4 m_unk0x424; // 0x424
undefined4 m_prevArea; // 0x428
undefined4 m_currentArea; // 0x424
undefined4 m_previousArea; // 0x428
undefined4 m_unk0x42c; // 0x42c
};

View File

@ -69,8 +69,8 @@ LegoGameState::LegoGameState()
this->m_stateCount = 0;
this->m_unk0x0c = 0;
this->m_savePath = NULL;
this->m_unk0x424 = 0;
this->m_prevArea = 0;
this->m_currentArea = 0;
this->m_previousArea = 0;
this->m_unk0x42c = 0;
this->m_isDirty = FALSE;
this->m_currentAct = -1;
@ -257,10 +257,10 @@ void LegoGameState::SerializePlayersInfo(MxS16)
}
// FUNCTION: LEGO1 0x1003a720
void LegoGameState::StopPreviousAction(MxU32 p_area)
void LegoGameState::StopArea(MxU32 p_area)
{
if (p_area == 0) {
p_area = m_prevArea;
p_area = m_previousArea;
}
switch (p_area) {
@ -397,13 +397,13 @@ void LegoGameState::StopPreviousAction(MxU32 p_area)
InvokeAction(Extra::e_close, *g_racecarScript, 0, NULL);
break;
case 0x2e:
if (m_unk0x424 != 2) {
if (m_currentArea != 2) {
InvokeAction(Extra::e_stop, *g_act2mainScript, 0, NULL);
InvokeAction(Extra::e_close, *g_act2mainScript, 0, NULL);
}
break;
case 0x2f:
if (m_unk0x424 != 2) {
if (m_currentArea != 2) {
InvokeAction(Extra::e_stop, *g_act3Script, 0, NULL);
InvokeAction(Extra::e_close, *g_act3Script, 0, NULL);
}
@ -421,10 +421,11 @@ void LegoGameState::StopPreviousAction(MxU32 p_area)
}
// STUB: LEGO1 0x1003b060
void LegoGameState::HandleAction(MxU32 p_area)
void LegoGameState::SwitchArea(MxU32 p_area)
{
m_prevArea = m_unk0x424;
m_unk0x424 = p_area;
m_previousArea = m_currentArea;
m_currentArea = p_area;
BackgroundAudioManager()->Stop();
AnimationManager()->FUN_1005ef10();
VideoManager()->SetUnk0x554(0);

View File

@ -199,8 +199,10 @@ MxBool FUN_1003ee00(MxAtomId& p_atomId, MxS32 p_id)
MxBool RemoveFromWorld(MxAtomId& p_entityAtom, MxS32 p_entityId, MxAtomId& p_worldAtom, MxS32 p_worldEntityId)
{
LegoWorld* world = FindWorld(p_worldAtom, p_worldEntityId);
if (world) {
MxCore* object = world->Find(p_entityAtom, p_entityId);
if (object) {
world->Remove(object);
@ -218,6 +220,7 @@ MxBool RemoveFromWorld(MxAtomId& p_entityAtom, MxS32 p_entityId, MxAtomId& p_wor
return TRUE;
}
}
return FALSE;
}

View File

@ -39,7 +39,7 @@ MxResult ElevatorBottom::Create(MxDSAction& p_dsAction)
SetIsWorldActive(FALSE);
GameState()->SetUnknown424(5);
GameState()->StopPreviousAction(0);
GameState()->StopArea();
return result;
}
@ -56,7 +56,7 @@ MxLong ElevatorBottom::Notify(MxParam& p_param)
ret = HandleNotification17(p_param);
break;
case c_notificationTransitioned:
GameState()->HandleAction(m_unk0xf8);
GameState()->SwitchArea(m_unk0xf8);
break;
}
}

View File

@ -139,7 +139,7 @@ MxLong Infocenter::Notify(MxParam& p_param)
}
else if (m_unk0x104 != 0) {
BackgroundAudioManager()->RaiseVolume();
GameState()->HandleAction(m_unk0x104);
GameState()->SwitchArea(m_unk0x104);
m_unk0x104 = 0;
}
break;

View File

@ -40,7 +40,7 @@ MxResult InfocenterDoor::Create(MxDSAction& p_dsAction)
SetIsWorldActive(FALSE);
GameState()->SetUnknown424(3);
GameState()->StopPreviousAction(0);
GameState()->StopArea();
return result;
}

View File

@ -53,7 +53,7 @@ MxResult Score::Create(MxDSAction& p_dsAction)
ScoreState* state = (ScoreState*) gs->GetState("ScoreState");
m_state = state ? state : (ScoreState*) gs->CreateState("ScoreState");
GameState()->SetUnknown424(0xd);
GameState()->StopPreviousAction(0);
GameState()->StopArea();
}
return result;
@ -97,7 +97,7 @@ MxLong Score::Notify(MxParam& p_param)
case c_notificationTransitioned:
DeleteObjects(g_infoscorScript, 7, 9);
if (m_unk0xf8)
GameState()->HandleAction(m_unk0xf8);
GameState()->SwitchArea(m_unk0xf8);
ret = 1;
break;
default:

View File

@ -62,14 +62,14 @@ MxResult Isle::Create(MxDSAction& p_dsAction)
if (result == SUCCESS) {
ControlManager()->Register(this);
InputManager()->SetWorld(this);
GameState()->StopPreviousAction(0);
GameState()->StopArea();
switch (GameState()->GetCurrentAct()) {
case 1:
GameState()->StopPreviousAction(0x2e);
GameState()->StopArea(0x2e);
break;
case 2:
GameState()->StopPreviousAction(0x2e);
GameState()->StopArea(0x2e);
break;
case -1:
m_unk0x13c = 2;
@ -158,7 +158,7 @@ void Isle::ReadyWorld()
LegoWorld::ReadyWorld();
if (m_act1state->GetUnknown21()) {
GameState()->HandleAction(2);
GameState()->SwitchArea(2);
m_act1state->SetUnknown18(0);
m_act1state->SetUnknown21(0);
}

View File

@ -56,7 +56,7 @@ MxResult Police::Create(MxDSAction& p_dsAction)
m_policeState = policeState;
GameState()->SetUnknown424(0x22);
GameState()->StopPreviousAction(0);
GameState()->StopArea();
return ret;
}