2023-06-29 04:10:08 -04:00
|
|
|
#include "towtrack.h"
|
|
|
|
|
2024-05-24 14:07:36 -04:00
|
|
|
#include "legogamestate.h"
|
2024-05-24 14:44:09 -04:00
|
|
|
#include "legovariables.h"
|
|
|
|
#include "legoworld.h"
|
2024-05-24 14:07:36 -04:00
|
|
|
#include "misc.h"
|
2024-05-24 14:44:09 -04:00
|
|
|
#include "mxmisc.h"
|
|
|
|
#include "mxtimer.h"
|
|
|
|
#include "mxvariabletable.h"
|
2024-05-24 14:07:36 -04:00
|
|
|
|
2024-03-22 21:30:58 -04:00
|
|
|
DECOMP_SIZE_ASSERT(TowTrack, 0x180)
|
2024-06-03 12:53:25 -04:00
|
|
|
DECOMP_SIZE_ASSERT(TowTrackMissionState, 0x28)
|
2023-09-10 08:01:39 -04:00
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x1004c720
|
2023-06-29 04:10:08 -04:00
|
|
|
TowTrack::TowTrack()
|
|
|
|
{
|
2024-05-24 14:07:36 -04:00
|
|
|
m_unk0x168 = 0;
|
|
|
|
m_unk0x16a = -1;
|
|
|
|
m_state = NULL;
|
|
|
|
m_unk0x16c = 0;
|
|
|
|
m_unk0x170 = -1;
|
|
|
|
m_unk0x16e = 0;
|
|
|
|
m_unk0x174 = -1;
|
2024-06-06 11:45:37 -04:00
|
|
|
m_maxLinearVel = 40.0;
|
2024-05-24 14:07:36 -04:00
|
|
|
m_unk0x178 = 1.0;
|
2023-06-29 04:10:08 -04:00
|
|
|
}
|
2024-01-20 18:04:46 -05:00
|
|
|
|
2024-05-24 14:44:09 -04:00
|
|
|
// FUNCTION: LEGO1 0x1004c9e0
|
|
|
|
// FUNCTION: BETA10 0x100f6bf1
|
2024-01-20 18:04:46 -05:00
|
|
|
MxResult TowTrack::Create(MxDSAction& p_dsAction)
|
|
|
|
{
|
2024-05-24 14:44:09 -04:00
|
|
|
MxResult result = IslePathActor::Create(p_dsAction);
|
|
|
|
|
|
|
|
if (result == SUCCESS) {
|
|
|
|
m_world = CurrentWorld();
|
|
|
|
|
|
|
|
if (m_world) {
|
|
|
|
m_world->Add(this);
|
|
|
|
}
|
|
|
|
|
|
|
|
m_state = (TowTrackMissionState*) GameState()->GetState("TowTrackMissionState");
|
|
|
|
if (!m_state) {
|
|
|
|
m_state = new TowTrackMissionState();
|
|
|
|
m_state->m_unk0x08 = 0;
|
|
|
|
GameState()->RegisterState(m_state);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
VariableTable()->SetVariable(g_varTOWFUEL, "1.0");
|
|
|
|
m_unk0x178 = 1.0;
|
|
|
|
m_time = Timer()->GetTime();
|
|
|
|
return result;
|
2024-01-20 18:04:46 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
// STUB: LEGO1 0x1004cb10
|
|
|
|
void TowTrack::VTable0x70(float p_float)
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
|
2024-05-24 14:07:36 -04:00
|
|
|
// FUNCTION: LEGO1 0x1004cc40
|
|
|
|
void TowTrack::CreateState()
|
|
|
|
{
|
|
|
|
m_state = (TowTrackMissionState*) GameState()->GetState("TowTrackMissionState");
|
|
|
|
if (m_state == NULL) {
|
|
|
|
m_state = (TowTrackMissionState*) GameState()->CreateState("TowTrackMissionState");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2024-01-20 18:04:46 -05:00
|
|
|
// STUB: LEGO1 0x1004cc80
|
|
|
|
MxLong TowTrack::Notify(MxParam& p_param)
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// STUB: LEGO1 0x1004cd30
|
2024-05-01 09:00:42 -04:00
|
|
|
MxU32 TowTrack::VTable0xd8(LegoEndAnimNotificationParam& p_param)
|
2024-01-20 18:04:46 -05:00
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// STUB: LEGO1 0x1004d330
|
|
|
|
MxU32 TowTrack::VTable0xdc(MxType19NotificationParam& p_param)
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// STUB: LEGO1 0x1004d690
|
2024-05-30 09:54:24 -04:00
|
|
|
MxU32 TowTrack::HandleClick()
|
2024-01-20 18:04:46 -05:00
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
return 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// STUB: LEGO1 0x1004d8f0
|
2024-06-06 11:45:37 -04:00
|
|
|
void TowTrack::Exit()
|
2024-01-20 18:04:46 -05:00
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
|
|
|
|
// STUB: LEGO1 0x1004d9e0
|
2024-05-30 09:54:24 -04:00
|
|
|
MxU32 TowTrack::HandleControl(LegoControlManagerEvent& p_param)
|
2024-01-20 18:04:46 -05:00
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
return 0;
|
|
|
|
}
|
2024-03-16 14:20:44 -04:00
|
|
|
|
|
|
|
// STUB: LEGO1 0x1004dab0
|
|
|
|
void TowTrack::FUN_1004dab0()
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
}
|
2024-03-17 13:01:47 -04:00
|
|
|
|
|
|
|
// STUB: LEGO1 0x1004dad0
|
|
|
|
void TowTrack::FUN_1004dad0()
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
}
|
2024-05-24 20:41:57 -04:00
|
|
|
|
|
|
|
// STUB: LEGO1 0x1004db10
|
|
|
|
void TowTrack::FUN_1004db10()
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
}
|
|
|
|
|
|
|
|
// STUB: LEGO1 0x1004dbe0
|
|
|
|
void TowTrack::FUN_1004dbe0()
|
|
|
|
{
|
|
|
|
// TODO
|
|
|
|
}
|
2024-06-03 12:53:25 -04:00
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x1004dd30
|
|
|
|
TowTrackMissionState::TowTrackMissionState()
|
|
|
|
{
|
|
|
|
m_unk0x12 = 0;
|
|
|
|
m_unk0x14 = 0;
|
|
|
|
m_unk0x16 = 0;
|
|
|
|
m_unk0x08 = 0;
|
|
|
|
m_unk0x18 = 0;
|
|
|
|
m_unk0x0c = 0;
|
|
|
|
m_unk0x1a = 0;
|
|
|
|
m_unk0x10 = 0;
|
|
|
|
m_score1 = 0;
|
|
|
|
m_score2 = 0;
|
|
|
|
m_score3 = 0;
|
|
|
|
m_score4 = 0;
|
|
|
|
m_score5 = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
// FUNCTION: LEGO1 0x1004dde0
|
|
|
|
MxResult TowTrackMissionState::Serialize(LegoFile* p_legoFile)
|
|
|
|
{
|
|
|
|
LegoState::Serialize(p_legoFile);
|
|
|
|
|
|
|
|
if (p_legoFile->IsReadMode()) {
|
|
|
|
p_legoFile->Read(&m_unk0x12, sizeof(m_unk0x12));
|
|
|
|
p_legoFile->Read(&m_unk0x14, sizeof(m_unk0x14));
|
|
|
|
p_legoFile->Read(&m_unk0x16, sizeof(m_unk0x16));
|
|
|
|
p_legoFile->Read(&m_unk0x18, sizeof(m_unk0x18));
|
|
|
|
p_legoFile->Read(&m_unk0x1a, sizeof(m_unk0x1a));
|
|
|
|
p_legoFile->Read(&m_score1, sizeof(m_score1));
|
|
|
|
p_legoFile->Read(&m_score2, sizeof(m_score2));
|
|
|
|
p_legoFile->Read(&m_score3, sizeof(m_score3));
|
|
|
|
p_legoFile->Read(&m_score4, sizeof(m_score4));
|
|
|
|
p_legoFile->Read(&m_score5, sizeof(m_score5));
|
|
|
|
}
|
|
|
|
else if (p_legoFile->IsWriteMode()) {
|
|
|
|
MxU16 write = m_unk0x12;
|
|
|
|
p_legoFile->Write(&write, sizeof(m_unk0x12));
|
|
|
|
|
|
|
|
write = m_unk0x14;
|
|
|
|
p_legoFile->Write(&write, sizeof(m_unk0x12));
|
|
|
|
|
|
|
|
write = m_unk0x16;
|
|
|
|
p_legoFile->Write(&write, sizeof(m_unk0x12));
|
|
|
|
|
|
|
|
write = m_unk0x18;
|
|
|
|
p_legoFile->Write(&write, sizeof(m_unk0x12));
|
|
|
|
|
|
|
|
write = m_unk0x1a;
|
|
|
|
p_legoFile->Write(&write, sizeof(m_unk0x12));
|
|
|
|
|
|
|
|
write = m_score1;
|
|
|
|
p_legoFile->Write(&write, sizeof(m_unk0x12));
|
|
|
|
|
|
|
|
write = m_score2;
|
|
|
|
p_legoFile->Write(&write, sizeof(m_unk0x12));
|
|
|
|
|
|
|
|
write = m_score3;
|
|
|
|
p_legoFile->Write(&write, sizeof(m_unk0x12));
|
|
|
|
|
|
|
|
write = m_score4;
|
|
|
|
p_legoFile->Write(&write, sizeof(m_unk0x12));
|
|
|
|
|
|
|
|
write = m_score5;
|
|
|
|
p_legoFile->Write(&write, sizeof(m_unk0x12));
|
|
|
|
}
|
|
|
|
|
|
|
|
return SUCCESS;
|
|
|
|
}
|