2023-06-29 04:10:08 -04:00
|
|
|
#include "gasstation.h"
|
|
|
|
|
2024-02-13 18:40:04 -05:00
|
|
|
#include "legocontrolmanager.h"
|
|
|
|
#include "legogamestate.h"
|
|
|
|
#include "legoinputmanager.h"
|
|
|
|
#include "legoomni.h"
|
2024-01-17 12:24:42 -05:00
|
|
|
#include "mxnotificationmanager.h"
|
2024-02-13 18:40:04 -05:00
|
|
|
#include "mxticklemanager.h"
|
|
|
|
|
|
|
|
// GLOBAL: LEGO1 0x100f0160
|
|
|
|
undefined4 g_unk0x100f0160;
|
2024-01-17 12:24:42 -05:00
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x100046a0
|
2023-06-29 04:10:08 -04:00
|
|
|
GasStation::GasStation()
|
|
|
|
{
|
2024-02-04 10:36:47 -05:00
|
|
|
m_unk0xf8 = 0;
|
2024-02-13 18:40:04 -05:00
|
|
|
m_state = NULL;
|
2024-02-04 10:36:47 -05:00
|
|
|
m_unk0xfc = 0;
|
|
|
|
m_unk0x108 = 0;
|
|
|
|
m_unk0x104 = 0;
|
|
|
|
m_unk0x114 = 0;
|
|
|
|
m_unk0x106 = 0;
|
|
|
|
m_unk0x10c = 0;
|
|
|
|
m_unk0x115 = 0;
|
|
|
|
m_unk0x110 = 0;
|
2024-01-17 12:24:42 -05:00
|
|
|
|
|
|
|
NotificationManager()->Register(this);
|
2023-06-29 04:10:08 -04:00
|
|
|
}
|
|
|
|
|
2024-02-07 06:13:20 -05:00
|
|
|
// FUNCTION: LEGO1 0x10004770
|
2024-01-20 18:04:46 -05:00
|
|
|
MxBool GasStation::VTable0x5c()
|
|
|
|
{
|
2024-02-07 06:13:20 -05:00
|
|
|
return TRUE;
|
2024-01-20 18:04:46 -05:00
|
|
|
}
|
|
|
|
|
2024-02-13 18:40:04 -05:00
|
|
|
// FUNCTION: LEGO1 0x100048c0
|
2023-06-29 04:10:08 -04:00
|
|
|
GasStation::~GasStation()
|
|
|
|
{
|
2024-02-13 18:40:04 -05:00
|
|
|
InputManager()->UnRegister(this);
|
|
|
|
if (InputManager()->GetWorld() == this) {
|
|
|
|
InputManager()->ClearWorld();
|
|
|
|
}
|
|
|
|
|
|
|
|
ControlManager()->Unregister(this);
|
|
|
|
TickleManager()->UnregisterClient(this);
|
|
|
|
NotificationManager()->Unregister(this);
|
|
|
|
g_unk0x100f0160 = 3;
|
2023-06-29 04:10:08 -04:00
|
|
|
}
|
|
|
|
|
2024-02-13 18:40:04 -05:00
|
|
|
// FUNCTION: LEGO1 0x10004990
|
2024-01-20 18:04:46 -05:00
|
|
|
MxResult GasStation::Create(MxDSAction& p_dsAction)
|
|
|
|
{
|
2024-02-13 18:40:04 -05:00
|
|
|
MxResult result = LegoWorld::Create(p_dsAction);
|
|
|
|
if (result == SUCCESS) {
|
|
|
|
InputManager()->SetWorld(this);
|
|
|
|
ControlManager()->Register(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
InputManager()->SetCamera(NULL);
|
|
|
|
|
|
|
|
m_state = (GasStationState*) GameState()->GetState("GasStationState");
|
|
|
|
if (!m_state) {
|
|
|
|
m_state = (GasStationState*) GameState()->CreateState("GasStationState");
|
|
|
|
m_state->GetUnknown0x14().SetUnknown0x00(1);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
GasStationState::Unknown0x14& unk0x14 = m_state->GetUnknown0x14();
|
|
|
|
if (unk0x14.GetUnknown0x00() == 4) {
|
|
|
|
unk0x14.SetUnknown0x00(4);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
unk0x14.SetUnknown0x00(3);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GameState()->SetCurrentArea(LegoGameState::e_garage);
|
|
|
|
GameState()->StopArea(LegoGameState::e_previousArea);
|
|
|
|
|
|
|
|
InputManager()->Register(this);
|
|
|
|
SetIsWorldActive(FALSE);
|
|
|
|
return result;
|
2024-01-20 18:04:46 -05:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// STUB: LEGO1 0x10004a60
|
2023-12-13 05:48:14 -05:00
|
|
|
MxLong GasStation::Notify(MxParam& p_param)
|
2023-06-29 04:10:08 -04:00
|
|
|
{
|
2023-10-24 19:38:27 -04:00
|
|
|
// TODO
|
2023-06-29 04:10:08 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
return 0;
|
2023-06-29 04:10:08 -04:00
|
|
|
}
|
|
|
|
|
2024-01-20 18:04:46 -05:00
|
|
|
// STUB: LEGO1 0x10004b30
|
2024-01-27 15:18:35 -05:00
|
|
|
void GasStation::ReadyWorld()
|
2024-01-20 18:04:46 -05:00
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
|
2024-02-13 18:40:04 -05:00
|
|
|
// FUNCTION: LEGO1 0x10005c40
|
2024-02-02 12:18:46 -05:00
|
|
|
void GasStation::Enable(MxBool p_enable)
|
2024-01-20 18:04:46 -05:00
|
|
|
{
|
2024-02-13 18:40:04 -05:00
|
|
|
LegoWorld::Enable(p_enable);
|
|
|
|
|
|
|
|
if (p_enable) {
|
|
|
|
InputManager()->SetWorld(this);
|
|
|
|
InputManager()->SetCamera(NULL);
|
|
|
|
}
|
|
|
|
else {
|
|
|
|
if (InputManager()->GetWorld() == this) {
|
|
|
|
InputManager()->ClearWorld();
|
|
|
|
}
|
|
|
|
}
|
2024-01-20 18:04:46 -05:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// STUB: LEGO1 0x10005c90
|
2023-09-21 14:51:24 -04:00
|
|
|
MxResult GasStation::Tickle()
|
2023-06-29 04:10:08 -04:00
|
|
|
{
|
2023-10-24 19:38:27 -04:00
|
|
|
// TODO
|
2023-06-29 04:10:08 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
return 0;
|
2023-06-29 04:10:08 -04:00
|
|
|
}
|
2024-01-20 18:04:46 -05:00
|
|
|
|
|
|
|
// STUB: LEGO1 0x10005e70
|
|
|
|
MxBool GasStation::VTable0x64()
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
return FALSE;
|
|
|
|
}
|