Implement/match Isle::CreateState and related (#948)

This commit is contained in:
Christian Semmler
2024-05-24 14:07:36 -04:00
committed by GitHub
parent 1633118f68
commit 63719ef689
14 changed files with 123 additions and 61 deletions

View File

@@ -18,17 +18,17 @@ DECOMP_SIZE_ASSERT(Ambulance, 0x184)
// FUNCTION: LEGO1 0x10035ee0
Ambulance::Ambulance()
{
this->m_unk0x168 = 0;
this->m_unk0x16a = -1;
this->m_state = NULL;
this->m_unk0x16c = 0;
this->m_unk0x174 = -1;
this->m_unk0x16e = 0;
this->m_unk0x178 = -1;
this->m_unk0x170 = 0;
this->m_unk0x172 = 0;
this->m_unk0x13c = 40.0;
this->m_unk0x17c = 1.0;
m_unk0x168 = 0;
m_unk0x16a = -1;
m_state = NULL;
m_unk0x16c = 0;
m_unk0x174 = -1;
m_unk0x16e = 0;
m_unk0x178 = -1;
m_unk0x170 = 0;
m_unk0x172 = 0;
m_unk0x13c = 40.0;
m_unk0x17c = 1.0;
}
// FUNCTION: LEGO1 0x10035f90
@@ -66,7 +66,6 @@ MxResult Ambulance::Create(MxDSAction& p_dsAction)
VariableTable()->SetVariable(g_varAMBULFUEL, "1.0");
m_unk0x17c = 1.0;
m_time = Timer()->GetTime();
return result;
}
@@ -76,6 +75,19 @@ void Ambulance::VTable0x70(float p_float)
// TODO
}
// FUNCTION: LEGO1 0x100363f0
void Ambulance::CreateState()
{
LegoGameState* gameState = GameState();
AmbulanceMissionState* state = (AmbulanceMissionState*) gameState->GetState("AmbulanceMissionState");
if (state == NULL) {
state = (AmbulanceMissionState*) gameState->CreateState("AmbulanceMissionState");
}
m_state = state;
}
// STUB: LEGO1 0x10036420
MxLong Ambulance::Notify(MxParam& p_param)
{

View File

@@ -49,12 +49,12 @@ MxResult Helicopter::Create(MxDSAction& p_dsAction)
if (world) {
world->Add(this);
}
GetState();
CreateState();
return result;
}
// FUNCTION: LEGO1 0x10003320
void Helicopter::GetState()
void Helicopter::CreateState()
{
m_state = (HelicopterState*) GameState()->GetState("HelicopterState");
if (!m_state) {

View File

@@ -1,17 +1,21 @@
#include "pizza.h"
#include "act1state.h"
#include "legogamestate.h"
#include "misc.h"
#include "mxmisc.h"
#include "mxticklemanager.h"
#include "pizzamissionstate.h"
DECOMP_SIZE_ASSERT(Pizza, 0x9c)
// FUNCTION: LEGO1 0x10037ef0
Pizza::Pizza()
{
m_unk0x7c = 0;
m_state = NULL;
m_unk0x80 = 0;
m_skateboard = NULL;
m_unk0x88 = 0;
m_act1state = NULL;
m_unk0x8c = -1;
m_unk0x98 = 0;
m_unk0x90 = 0x80000000;
@@ -30,6 +34,20 @@ MxResult Pizza::Create(MxDSAction& p_dsAction)
return SUCCESS;
}
// FUNCTION: LEGO1 0x100381b0
void Pizza::CreateState()
{
m_state = (PizzaMissionState*) GameState()->GetState("PizzaMissionState");
if (m_state == NULL) {
m_state = (PizzaMissionState*) GameState()->CreateState("PizzaMissionState");
}
m_act1state = (Act1State*) GameState()->GetState("Act1State");
if (m_act1state == NULL) {
m_act1state = (Act1State*) GameState()->CreateState("Act1State");
}
}
// STUB: LEGO1 0x100382b0
void Pizza::FUN_100382b0()
{

View File

@@ -11,14 +11,14 @@ MxResult Pizzeria::Create(MxDSAction& p_dsAction)
MxResult result = IsleActor::Create(p_dsAction);
if (result == SUCCESS) {
Init();
CreateState();
}
return result;
}
// FUNCTION: LEGO1 0x100179f0
void Pizzeria::Init()
void Pizzeria::CreateState()
{
LegoGameState* gameState = GameState();
PizzeriaState* pizzeriaState = (PizzeriaState*) gameState->GetState("PizzeriaState");

View File

@@ -22,7 +22,7 @@ Radio::Radio()
ControlManager()->Register(this);
m_unk0x0c = TRUE;
CreateRadioState();
CreateState();
}
// FUNCTION: LEGO1 0x1002c990
@@ -147,12 +147,12 @@ void Radio::Initialize(MxBool p_und)
{
if (m_unk0x0c != p_und) {
m_unk0x0c = p_und;
CreateRadioState();
CreateState();
}
}
// FUNCTION: LEGO1 0x1002cde0
void Radio::CreateRadioState()
void Radio::CreateState()
{
LegoGameState* gameState = GameState();
RadioState* state = (RadioState*) gameState->GetState("RadioState");

View File

@@ -1,19 +1,23 @@
#include "towtrack.h"
#include "legogamestate.h"
#include "misc.h"
#include "towtrackmissionstate.h"
DECOMP_SIZE_ASSERT(TowTrack, 0x180)
// FUNCTION: LEGO1 0x1004c720
TowTrack::TowTrack()
{
this->m_unk0x168 = 0;
this->m_unk0x16a = -1;
this->m_unk0x164 = 0;
this->m_unk0x16c = 0;
this->m_unk0x170 = -1;
this->m_unk0x16e = 0;
this->m_unk0x174 = -1;
this->m_unk0x13c = 40.0;
this->m_unk0x178 = 1.0;
m_unk0x168 = 0;
m_unk0x16a = -1;
m_state = NULL;
m_unk0x16c = 0;
m_unk0x170 = -1;
m_unk0x16e = 0;
m_unk0x174 = -1;
m_unk0x13c = 40.0;
m_unk0x178 = 1.0;
}
// STUB: LEGO1 0x1004c9e0
@@ -29,6 +33,15 @@ void TowTrack::VTable0x70(float p_float)
// TODO
}
// FUNCTION: LEGO1 0x1004cc40
void TowTrack::CreateState()
{
m_state = (TowTrackMissionState*) GameState()->GetState("TowTrackMissionState");
if (m_state == NULL) {
m_state = (TowTrackMissionState*) GameState()->CreateState("TowTrackMissionState");
}
}
// STUB: LEGO1 0x1004cc80
MxLong TowTrack::Notify(MxParam& p_param)
{

View File

@@ -31,6 +31,7 @@
#include "mxtransitionmanager.h"
#include "mxvariabletable.h"
#include "pizza.h"
#include "pizzeria.h"
#include "scripts.h"
#include "skateboard.h"
#include "towtrack.h"
@@ -474,7 +475,7 @@ void Isle::Enable(MxBool p_enable)
m_radio.Initialize(p_enable);
if (p_enable) {
FUN_100330e0();
CreateState();
VideoManager()->ResetPalette(FALSE);
m_act1state->FUN_10034d00();
@@ -1095,10 +1096,24 @@ void Isle::VTable0x6c(LegoPathActor* p_actor)
}
}
// STUB: LEGO1 0x100330e0
void Isle::FUN_100330e0()
// FUNCTION: LEGO1 0x100330e0
void Isle::CreateState()
{
// TODO
m_act1state = (Act1State*) GameState()->GetState("Act1State");
if (!m_act1state) {
m_act1state = (Act1State*) GameState()->CreateState("Act1State");
m_act1state->m_unk0x018 = 0;
}
m_radio.CreateState();
m_pizzeria->CreateState();
m_pizza->CreateState();
m_towtrack->CreateState();
m_ambulance->CreateState();
if (m_helicopter != NULL) {
m_helicopter->CreateState();
}
}
// STUB: LEGO1 0x10033180