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"
|
2024-03-09 15:07:52 -05:00
|
|
|
#include "misc.h"
|
|
|
|
#include "mxmisc.h"
|
2024-01-17 12:24:42 -05:00
|
|
|
#include "mxnotificationmanager.h"
|
2024-02-13 18:40:04 -05:00
|
|
|
#include "mxticklemanager.h"
|
|
|
|
|
2024-03-22 21:30:58 -04:00
|
|
|
DECOMP_SIZE_ASSERT(GasStation, 0x128)
|
|
|
|
|
2024-02-13 18:40:04 -05:00
|
|
|
// GLOBAL: LEGO1 0x100f0160
|
2024-03-05 03:45:09 -05:00
|
|
|
undefined4 g_unk0x100f0160 = 3;
|
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-03-13 13:17:20 -04:00
|
|
|
m_destLocation = LegoGameState::e_undefined;
|
2024-02-04 10:36:47 -05:00
|
|
|
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");
|
2024-03-13 11:38:38 -04:00
|
|
|
m_state->m_unk0x14.m_unk0x00 = 1;
|
|
|
|
}
|
|
|
|
else if (m_state->m_unk0x14.m_unk0x00 == 4) {
|
|
|
|
m_state->m_unk0x14.m_unk0x00 = 4;
|
2024-02-13 18:40:04 -05:00
|
|
|
}
|
|
|
|
else {
|
2024-03-13 11:38:38 -04:00
|
|
|
m_state->m_unk0x14.m_unk0x00 = 3;
|
2024-02-13 18:40:04 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
2024-02-17 12:23:09 -05:00
|
|
|
// FUNCTION: LEGO1 0x10004a60
|
2023-12-13 05:48:14 -05:00
|
|
|
MxLong GasStation::Notify(MxParam& p_param)
|
2023-06-29 04:10:08 -04:00
|
|
|
{
|
2024-02-17 12:23:09 -05:00
|
|
|
MxResult result = 0;
|
|
|
|
LegoWorld::Notify(p_param);
|
|
|
|
|
|
|
|
if (m_worldStarted) {
|
|
|
|
switch (((MxNotificationParam&) p_param).GetNotification()) {
|
|
|
|
case c_notificationEndAction:
|
|
|
|
result = HandleEndAction((MxEndActionNotificationParam&) p_param);
|
|
|
|
break;
|
|
|
|
case c_notificationKeyPress:
|
|
|
|
result = HandleKeyPress((((LegoEventNotificationParam&) p_param)).GetKey());
|
|
|
|
break;
|
|
|
|
case c_notificationButtonDown:
|
|
|
|
result = HandleButtonDown(((LegoControlManagerEvent&) p_param));
|
|
|
|
break;
|
|
|
|
case c_notificationClick:
|
|
|
|
result = HandleClick((LegoControlManagerEvent&) p_param);
|
|
|
|
break;
|
|
|
|
case c_notificationTransitioned:
|
2024-03-13 13:17:20 -04:00
|
|
|
GameState()->SwitchArea(m_destLocation);
|
2024-02-17 12:23:09 -05:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2023-06-29 04:10:08 -04:00
|
|
|
|
2024-02-17 12:23:09 -05:00
|
|
|
return result;
|
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-17 12:23:09 -05:00
|
|
|
// STUB: LEGO1 0x10005660
|
|
|
|
MxLong GasStation::HandleEndAction(MxEndActionNotificationParam& p_param)
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// STUB: LEGO1 0x10005920
|
|
|
|
MxLong GasStation::HandleKeyPress(MxS8 p_key)
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// STUB: LEGO1 0x10005960
|
|
|
|
MxLong GasStation::HandleButtonDown(LegoControlManagerEvent& p_param)
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// STUB: LEGO1 0x10005b20
|
|
|
|
MxLong GasStation::HandleClick(LegoControlManagerEvent& p_param)
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
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
|
|
|
|
2024-02-17 12:23:09 -05:00
|
|
|
return SUCCESS;
|
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;
|
|
|
|
}
|