Match LegoObjectFactory

This commit is contained in:
Christian Semmler 2024-06-12 19:47:20 -04:00
parent 00cabfb813
commit de4be3cd4e
15 changed files with 459 additions and 25 deletions

View File

@ -7,6 +7,8 @@
// SIZE 0x1f8 // SIZE 0x1f8
class Doors : public LegoPathActor { class Doors : public LegoPathActor {
public: public:
Doors() : m_unk0x154(0), m_unk0x15c(0), m_unk0x160(0), m_unk0x1f4(0) {}
// FUNCTION: LEGO1 0x1000e430 // FUNCTION: LEGO1 0x1000e430
inline const char* ClassName() const override // vtable+0x0c inline const char* ClassName() const override // vtable+0x0c
{ {

View File

@ -9,6 +9,8 @@
// SIZE 0x0c // SIZE 0x0c
class HelicopterState : public LegoState { class HelicopterState : public LegoState {
public: public:
HelicopterState() : m_unk0x08(0) {}
// FUNCTION: LEGO1 0x1000e0d0 // FUNCTION: LEGO1 0x1000e0d0
inline const char* ClassName() const override // vtable+0x0c inline const char* ClassName() const override // vtable+0x0c
{ {

View File

@ -21,6 +21,8 @@ class JukeBoxState : public LegoState {
e_torpedos e_torpedos
}; };
JukeBoxState() : m_music(e_pasquell), m_active(FALSE) {}
// FUNCTION: LEGO1 0x1000f310 // FUNCTION: LEGO1 0x1000f310
inline const char* ClassName() const override // vtable+0x0c inline const char* ClassName() const override // vtable+0x0c
{ {

View File

@ -5,10 +5,17 @@
#include "legostate.h" #include "legostate.h"
#include "legoworld.h" #include "legoworld.h"
class Act2Actor;
// VTABLE: LEGO1 0x100d4a70 // VTABLE: LEGO1 0x100d4a70
// SIZE 0x10 // SIZE 0x10
class LegoAct2State : public LegoState { class LegoAct2State : public LegoState {
public: public:
LegoAct2State()
{
m_unk0x08 = 0;
m_unk0x0c = 0;
}
~LegoAct2State() override {} ~LegoAct2State() override {}
// FUNCTION: LEGO1 0x1000df80 // FUNCTION: LEGO1 0x1000df80
@ -43,6 +50,7 @@ class LegoAct2State : public LegoState {
// SIZE 0x1154 // SIZE 0x1154
class LegoAct2 : public LegoWorld { class LegoAct2 : public LegoWorld {
public: public:
LegoAct2();
~LegoAct2() override; ~LegoAct2() override;
MxLong Notify(MxParam& p_param) override; // vtable+0x04 MxLong Notify(MxParam& p_param) override; // vtable+0x04
@ -54,6 +62,7 @@ class LegoAct2 : public LegoWorld {
MxBool Escape() override; // vtable+0x64 MxBool Escape() override; // vtable+0x64
void Enable(MxBool p_enable) override; // vtable+0x68 void Enable(MxBool p_enable) override; // vtable+0x68
inline void SetUnknown0x1138(Act2Actor* p_unk0x1138) { m_unk0x1138 = p_unk0x1138; }
inline void SetUnknown0x1150(undefined4 p_unk0x1150) { m_unk0x1150 = p_unk0x1150; } inline void SetUnknown0x1150(undefined4 p_unk0x1150) { m_unk0x1150 = p_unk0x1150; }
// SYNTHETIC: LEGO1 0x1004fe20 // SYNTHETIC: LEGO1 0x1004fe20
@ -78,7 +87,7 @@ class LegoAct2 : public LegoWorld {
undefined4 m_unk0x112c; // 0x112c undefined4 m_unk0x112c; // 0x112c
undefined4 m_unk0x1130; // 0x1130 undefined4 m_unk0x1130; // 0x1130
undefined4 m_unk0x1134; // 0x1134 undefined4 m_unk0x1134; // 0x1134
undefined4 m_unk0x1138; // 0x1138 Act2Actor* m_unk0x1138; // 0x1138
undefined m_unk0x113c; // 0x113c undefined m_unk0x113c; // 0x113c
undefined4 m_unk0x1140; // 0x1140 undefined4 m_unk0x1140; // 0x1140
undefined4 m_unk0x1144; // 0x1144 undefined4 m_unk0x1144; // 0x1144

View File

@ -10,7 +10,7 @@
// SIZE 0x68 // SIZE 0x68
class LegoActionControlPresenter : public MxMediaPresenter { class LegoActionControlPresenter : public MxMediaPresenter {
public: public:
LegoActionControlPresenter() { m_unk0x50 = Extra::ActionType::e_none; } LegoActionControlPresenter() : m_unk0x50(Extra::ActionType::e_none) {}
~LegoActionControlPresenter() override { Destroy(TRUE); } // vtable+0x00 ~LegoActionControlPresenter() override { Destroy(TRUE); } // vtable+0x00
// FUNCTION: BETA10 0x100a7840 // FUNCTION: BETA10 0x100a7840

View File

@ -8,7 +8,7 @@
// SIZE 0x50 // SIZE 0x50
class LegoVehicleBuildState : public LegoState { class LegoVehicleBuildState : public LegoState {
public: public:
LegoVehicleBuildState(char* p_classType); LegoVehicleBuildState(const char* p_classType);
// FUNCTION: LEGO1 0x10025ff0 // FUNCTION: LEGO1 0x10025ff0
inline const char* ClassName() const override // vtable+0x0c inline const char* ClassName() const override // vtable+0x0c
@ -49,6 +49,11 @@ class LegoVehicleBuildState : public LegoState {
MxU8 m_placedPartCount; // 0x4f MxU8 m_placedPartCount; // 0x4f
}; };
typedef LegoVehicleBuildState LegoRaceCarBuildState;
typedef LegoVehicleBuildState LegoCopterBuildState;
typedef LegoVehicleBuildState LegoDuneCarBuildState;
typedef LegoVehicleBuildState LegoJetskiBuildState;
// VTABLE: LEGO1 0x100d6658 // VTABLE: LEGO1 0x100d6658
// SIZE 0x34c // SIZE 0x34c
class LegoCarBuild : public LegoWorld { class LegoCarBuild : public LegoWorld {

View File

@ -8,13 +8,13 @@
X(LegoActorPresenter) \ X(LegoActorPresenter) \
X(LegoWorldPresenter) \ X(LegoWorldPresenter) \
X(LegoWorld) \ X(LegoWorld) \
X(LegoAnimPresenter) \
X(LegoModelPresenter) \ X(LegoModelPresenter) \
X(LegoTexturePresenter) \ X(LegoTexturePresenter) \
X(LegoPhonemePresenter) \ X(LegoPhonemePresenter) \
X(LegoFlcTexturePresenter) \ X(LegoFlcTexturePresenter) \
X(LegoPalettePresenter) \ X(LegoPalettePresenter) \
X(LegoPathPresenter) \ X(LegoPathPresenter) \
X(LegoAnimPresenter) \
X(LegoLoopingAnimPresenter) \ X(LegoLoopingAnimPresenter) \
X(LegoLocomotionAnimPresenter) \ X(LegoLocomotionAnimPresenter) \
X(LegoHideAnimPresenter) \ X(LegoHideAnimPresenter) \
@ -49,6 +49,10 @@
X(LegoAct2) \ X(LegoAct2) \
X(LegoAct2State) \ X(LegoAct2State) \
X(CarRace) \ X(CarRace) \
X(LegoRaceCarBuildState) \
X(LegoCopterBuildState) \
X(LegoDuneCarBuildState) \
X(LegoJetskiBuildState) \
X(HospitalState) \ X(HospitalState) \
X(InfocenterState) \ X(InfocenterState) \
X(PoliceState) \ X(PoliceState) \

View File

@ -9,7 +9,7 @@ class Act1State;
class SkateBoard; class SkateBoard;
// VTABLE: LEGO1 0x100d7408 // VTABLE: LEGO1 0x100d7408
// SIZE 0xb0 // SIZE 0xb4
class PizzaMissionState : public LegoState { class PizzaMissionState : public LegoState {
public: public:
// SIZE 0x20 // SIZE 0x20
@ -22,6 +22,8 @@ class PizzaMissionState : public LegoState {
undefined m_unk0x18[6]; // 0x1a undefined m_unk0x18[6]; // 0x1a
}; };
PizzaMissionState();
// FUNCTION: LEGO1 0x10039290 // FUNCTION: LEGO1 0x10039290
inline const char* ClassName() const override // vtable+0x0c inline const char* ClassName() const override // vtable+0x0c
{ {
@ -47,6 +49,7 @@ class PizzaMissionState : public LegoState {
undefined4 m_unk0x08; // 0x08 undefined4 m_unk0x08; // 0x08
undefined4 m_unk0x0c; // 0x0c undefined4 m_unk0x0c; // 0x0c
Entry m_state[5]; // 0x10 Entry m_state[5]; // 0x10
undefined4 m_unk0xb0; // 0xb0
}; };
// VTABLE: LEGO1 0x100d7380 // VTABLE: LEGO1 0x100d7380

View File

@ -12,6 +12,8 @@ class MxEndActionNotificationParam;
// SIZE 0x0c // SIZE 0x0c
class ScoreState : public LegoState { class ScoreState : public LegoState {
public: public:
ScoreState() : m_playCubeTutorial(TRUE) {}
// FUNCTION: LEGO1 0x1000de40 // FUNCTION: LEGO1 0x1000de40
inline const char* ClassName() const override // vtable+0x0c inline const char* ClassName() const override // vtable+0x0c
{ {

View File

@ -8,7 +8,7 @@
#include "mxticklemanager.h" #include "mxticklemanager.h"
DECOMP_SIZE_ASSERT(Pizza, 0x9c) DECOMP_SIZE_ASSERT(Pizza, 0x9c)
DECOMP_SIZE_ASSERT(PizzaMissionState, 0xb0) DECOMP_SIZE_ASSERT(PizzaMissionState, 0xb4)
DECOMP_SIZE_ASSERT(PizzaMissionState::Entry, 0x20) DECOMP_SIZE_ASSERT(PizzaMissionState::Entry, 0x20)
// FUNCTION: LEGO1 0x10037ef0 // FUNCTION: LEGO1 0x10037ef0
@ -99,6 +99,12 @@ undefined4 Pizza::HandleEndAction(MxEndActionNotificationParam&)
return 0; return 0;
} }
// STUB: LEGO1 0x10039030
PizzaMissionState::PizzaMissionState()
{
// TODO
}
// STUB: LEGO1 0x100393c0 // STUB: LEGO1 0x100393c0
MxResult PizzaMissionState::Serialize(LegoFile* p_legoFile) MxResult PizzaMissionState::Serialize(LegoFile* p_legoFile)
{ {

View File

@ -64,7 +64,7 @@ MxBool LegoCarBuild::Escape()
} }
// FUNCTION: LEGO1 0x10025f30 // FUNCTION: LEGO1 0x10025f30
LegoVehicleBuildState::LegoVehicleBuildState(char* p_classType) LegoVehicleBuildState::LegoVehicleBuildState(const char* p_classType)
{ {
m_className = p_classType; m_className = p_classType;
m_unk0x4c = 0; m_unk0x4c = 0;

View File

@ -61,6 +61,7 @@
#include "legotexturepresenter.h" #include "legotexturepresenter.h"
#include "legoworld.h" #include "legoworld.h"
#include "legoworldpresenter.h" #include "legoworldpresenter.h"
#include "misc.h"
#include "motocycle.h" #include "motocycle.h"
#include "mxcompositemediapresenter.h" #include "mxcompositemediapresenter.h"
#include "mxcontrolpresenter.h" #include "mxcontrolpresenter.h"
@ -74,34 +75,423 @@
#include "skateboard.h" #include "skateboard.h"
#include "towtrack.h" #include "towtrack.h"
// TODO: Before HospitalState, add all of the different LegoVehicleBuildState's DECOMP_SIZE_ASSERT(LegoObjectFactory, 0x1c8);
// TODO: Uncomment once we have all the relevant types ready
// DECOMP_SIZE_ASSERT(LegoObjectFactory, 0x1c8);
// FUNCTION: LEGO1 0x10006e40 // FUNCTION: LEGO1 0x10006e40
LegoObjectFactory::LegoObjectFactory() LegoObjectFactory::LegoObjectFactory()
{ {
#define X(V) this->m_id##V = MxAtomId(#V, e_exact); m_idLegoEntityPresenter = MxAtomId("LegoEntityPresenter", e_exact);
FOR_LEGOOBJECTFACTORY_OBJECTS(X) m_idLegoActorPresenter = MxAtomId("LegoActorPresenter", e_exact);
#undef X m_idLegoWorldPresenter = MxAtomId("LegoWorldPresenter", e_exact);
m_idLegoWorld = MxAtomId("LegoWorld", e_exact);
m_idLegoAnimPresenter = MxAtomId("LegoAnimPresenter", e_exact); // duplicate
m_idLegoModelPresenter = MxAtomId("LegoModelPresenter", e_exact);
m_idLegoTexturePresenter = MxAtomId("LegoTexturePresenter", e_exact);
m_idLegoPhonemePresenter = MxAtomId("LegoPhonemePresenter", e_exact);
m_idLegoFlcTexturePresenter = MxAtomId("LegoFlcTexturePresenter", e_exact);
m_idLegoPalettePresenter = MxAtomId("LegoPalettePresenter", e_exact);
m_idLegoPathPresenter = MxAtomId("LegoPathPresenter", e_exact);
m_idLegoAnimPresenter = MxAtomId("LegoAnimPresenter", e_exact);
m_idLegoLoopingAnimPresenter = MxAtomId("LegoLoopingAnimPresenter", e_exact);
m_idLegoLocomotionAnimPresenter = MxAtomId("LegoLocomotionAnimPresenter", e_exact);
m_idLegoHideAnimPresenter = MxAtomId("LegoHideAnimPresenter", e_exact);
m_idLegoPartPresenter = MxAtomId("LegoPartPresenter", e_exact);
m_idLegoCarBuildAnimPresenter = MxAtomId("LegoCarBuildAnimPresenter", e_exact);
m_idLegoActionControlPresenter = MxAtomId("LegoActionControlPresenter", e_exact);
m_idLegoMeterPresenter = MxAtomId("LegoMeterPresenter", e_exact);
m_idLegoLoadCacheSoundPresenter = MxAtomId("LegoLoadCacheSoundPresenter", e_exact);
m_idLego3DWavePresenter = MxAtomId("Lego3DWavePresenter", e_exact);
m_idLegoActor = MxAtomId("LegoActor", e_exact);
m_idLegoPathActor = MxAtomId("LegoPathActor", e_exact);
m_idLegoRaceCar = MxAtomId("LegoRaceCar", e_exact);
m_idLegoJetski = MxAtomId("LegoJetski", e_exact);
m_idJetskiRace = MxAtomId("JetskiRace", e_exact);
m_idLegoEntity = MxAtomId("LegoEntity", e_exact);
m_idLegoCarRaceActor = MxAtomId("LegoCarRaceActor", e_exact);
m_idLegoJetskiRaceActor = MxAtomId("LegoJetskiRaceActor", e_exact);
m_idLegoCarBuild = MxAtomId("LegoCarBuild", e_exact);
m_idInfocenter = MxAtomId("Infocenter", e_exact);
m_idLegoAnimActor = MxAtomId("LegoAnimActor", e_exact);
m_idMxControlPresenter = MxAtomId("MxControlPresenter", e_exact);
m_idRegistrationBook = MxAtomId("RegistrationBook", e_exact);
m_idHistoryBook = MxAtomId("HistoryBook", e_exact);
m_idElevatorBottom = MxAtomId("ElevatorBottom", e_exact);
m_idInfocenterDoor = MxAtomId("InfocenterDoor", e_exact);
m_idScore = MxAtomId("Score", e_exact);
m_idScoreState = MxAtomId("ScoreState", e_exact);
m_idHospital = MxAtomId("Hospital", e_exact);
m_idIsle = MxAtomId("Isle", e_exact);
m_idPolice = MxAtomId("Police", e_exact);
m_idGasStation = MxAtomId("GasStation", e_exact);
m_idLegoAct2 = MxAtomId("LegoAct2", e_exact);
m_idLegoAct2State = MxAtomId("LegoAct2State", e_exact);
m_idCarRace = MxAtomId("CarRace", e_exact);
m_idLegoRaceCarBuildState = MxAtomId("LegoRaceCarBuildState", e_exact);
m_idLegoCopterBuildState = MxAtomId("LegoCopterBuildState", e_exact);
m_idLegoDuneCarBuildState = MxAtomId("LegoDuneCarBuildState", e_exact);
m_idLegoJetskiBuildState = MxAtomId("LegoJetskiBuildState", e_exact);
m_idHospitalState = MxAtomId("HospitalState", e_exact);
m_idInfocenterState = MxAtomId("InfocenterState", e_exact);
m_idPoliceState = MxAtomId("PoliceState", e_exact);
m_idGasStationState = MxAtomId("GasStationState", e_exact);
m_idSkateBoard = MxAtomId("SkateBoard", e_exact);
m_idHelicopter = MxAtomId("Helicopter", e_exact);
m_idHelicopterState = MxAtomId("HelicopterState", e_exact);
m_idDuneBuggy = MxAtomId("DuneBuggy", e_exact);
m_idPizza = MxAtomId("Pizza", e_exact);
m_idPizzaMissionState = MxAtomId("PizzaMissionState", e_exact);
m_idAct2Actor = MxAtomId("Act2Actor", e_exact);
m_idAct2Brick = MxAtomId("Act2Brick", e_exact);
m_idAct2GenActor = MxAtomId("Act2GenActor", e_exact);
m_idAct2PoliceStation = MxAtomId("Act2PoliceStation", e_exact);
m_idAct3 = MxAtomId("Act3", e_exact);
m_idAct3State = MxAtomId("Act3State", e_exact);
m_idDoors = MxAtomId("Doors", e_exact);
m_idLegoAnimMMPresenter = MxAtomId("LegoAnimMMPresenter", e_exact);
m_idRaceCar = MxAtomId("RaceCar", e_exact);
m_idJetski = MxAtomId("Jetski", e_exact);
m_idBike = MxAtomId("Bike", e_exact);
m_idMotocycle = MxAtomId("Motocycle", e_exact);
m_idAmbulance = MxAtomId("Ambulance", e_exact);
m_idAmbulanceMissionState = MxAtomId("AmbulanceMissionState", e_exact);
m_idTowTrack = MxAtomId("TowTrack", e_exact);
m_idTowTrackMissionState = MxAtomId("TowTrackMissionState", e_exact);
m_idAct3Cop = MxAtomId("Act3Cop", e_exact);
m_idAct3Brickster = MxAtomId("Act3Brickster", e_exact);
m_idAct3Shark = MxAtomId("Act3Shark", e_exact);
m_idBumpBouy = MxAtomId("BumpBouy", e_exact);
m_idAct3Actor = MxAtomId("Act3Actor", e_exact);
m_idJetskiRaceState = MxAtomId("JetskiRaceState", e_exact);
m_idCarRaceState = MxAtomId("CarRaceState", e_exact);
m_idAct1State = MxAtomId("Act1State", e_exact);
m_idPizzeria = MxAtomId("Pizzeria", e_exact);
m_idPizzeriaState = MxAtomId("PizzeriaState", e_exact);
m_idInfoCenterEntity = MxAtomId("InfoCenterEntity", e_exact);
m_idHospitalEntity = MxAtomId("HospitalEntity", e_exact);
m_idGasStationEntity = MxAtomId("GasStationEntity", e_exact);
m_idPoliceEntity = MxAtomId("PoliceEntity", e_exact);
m_idBeachHouseEntity = MxAtomId("BeachHouseEntity", e_exact);
m_idRaceStandsEntity = MxAtomId("RaceStandsEntity", e_exact);
m_idJukeBoxEntity = MxAtomId("JukeBoxEntity", e_exact);
m_idRadioState = MxAtomId("RadioState", e_exact);
m_idCaveEntity = MxAtomId("CaveEntity", e_exact);
m_idJailEntity = MxAtomId("JailEntity", e_exact);
m_idMxCompositeMediaPresenter = MxAtomId("MxCompositeMediaPresenter", e_exact);
m_idJukeBox = MxAtomId("JukeBox", e_exact);
m_idJukeBoxState = MxAtomId("JukeBoxState", e_exact);
m_idRaceSkel = MxAtomId("RaceSkel", e_exact);
m_idAnimState = MxAtomId("AnimState", e_exact);
} }
// FUNCTION: LEGO1 0x10009a90 // FUNCTION: LEGO1 0x10009a90
MxCore* LegoObjectFactory::Create(const char* p_name) MxCore* LegoObjectFactory::Create(const char* p_name)
{ {
MxCore* object = NULL;
MxAtomId atom(p_name, e_exact); MxAtomId atom(p_name, e_exact);
#define X(V) \ if (m_idLegoModelPresenter == atom) {
if (this->m_id##V == atom) { \ object = new LegoModelPresenter();
return new V; \
} \
else
FOR_LEGOOBJECTFACTORY_OBJECTS(X)
#undef X
{
return MxObjectFactory::Create(p_name);
} }
else if (m_idLegoTexturePresenter == atom) {
object = new LegoTexturePresenter();
}
else if (m_idLegoPhonemePresenter == atom) {
object = new LegoPhonemePresenter();
}
else if (m_idLegoFlcTexturePresenter == atom) {
object = new LegoFlcTexturePresenter();
}
else if (m_idLegoEntityPresenter == atom) {
object = new LegoEntityPresenter();
}
else if (m_idLegoActorPresenter == atom) {
object = new LegoActorPresenter();
}
else if (m_idLegoWorldPresenter == atom) {
object = new LegoWorldPresenter();
}
else if (m_idLegoWorld == atom) {
object = new LegoWorld();
}
else if (m_idLegoPalettePresenter == atom) {
object = new LegoPalettePresenter();
}
else if (m_idLegoPathPresenter == atom) {
object = new LegoPathPresenter();
}
else if (m_idLegoAnimPresenter == atom) {
object = new LegoAnimPresenter();
}
else if (m_idLegoLoopingAnimPresenter == atom) {
object = new LegoLoopingAnimPresenter();
}
else if (m_idLegoLocomotionAnimPresenter == atom) {
object = new LegoLocomotionAnimPresenter();
}
else if (m_idLegoHideAnimPresenter == atom) {
object = new LegoHideAnimPresenter();
}
else if (m_idLegoPartPresenter == atom) {
object = new LegoPartPresenter();
}
else if (m_idLegoCarBuildAnimPresenter == atom) {
object = new LegoCarBuildAnimPresenter();
}
else if (m_idLegoActionControlPresenter == atom) {
object = new LegoActionControlPresenter();
}
else if (m_idLegoMeterPresenter == atom) {
object = new LegoMeterPresenter();
}
else if (m_idLegoLoadCacheSoundPresenter == atom) {
object = new LegoLoadCacheSoundPresenter();
}
else if (m_idLego3DWavePresenter == atom) {
object = new Lego3DWavePresenter();
}
else if (m_idLegoActor == atom) {
object = new LegoActor();
}
else if (m_idLegoPathActor == atom) {
object = new LegoPathActor();
}
else if (m_idJetskiRace == atom) {
object = new JetskiRace();
}
else if (m_idLegoEntity == atom) {
object = new LegoEntity();
}
else if (m_idLegoRaceCar == atom) {
object = new LegoRaceCar();
}
else if (m_idLegoJetski == atom) {
object = new LegoJetski();
}
else if (m_idLegoCarRaceActor == atom) {
object = new LegoCarRaceActor();
}
else if (m_idLegoJetskiRaceActor == atom) {
object = new LegoJetskiRaceActor();
}
else if (m_idLegoCarBuild == atom) {
object = new LegoCarBuild();
}
else if (m_idInfocenter == atom) {
object = new Infocenter();
}
else if (m_idLegoAnimActor == atom) {
object = new LegoAnimActor();
}
else if (m_idMxControlPresenter == atom) {
object = new MxControlPresenter();
}
else if (m_idRegistrationBook == atom) {
object = new RegistrationBook();
}
else if (m_idHistoryBook == atom) {
object = new HistoryBook();
}
else if (m_idElevatorBottom == atom) {
object = new ElevatorBottom();
}
else if (m_idInfocenterDoor == atom) {
object = new InfocenterDoor();
}
else if (m_idScore == atom) {
object = new Score();
}
else if (m_idScoreState == atom) {
object = new ScoreState();
}
else if (m_idHospital == atom) {
object = new Hospital();
}
else if (m_idIsle == atom) {
object = new Isle();
}
else if (m_idPolice == atom) {
object = new Police();
}
else if (m_idGasStation == atom) {
object = new GasStation();
}
else if (m_idLegoAct2 == atom) {
object = new LegoAct2();
}
else if (m_idLegoAct2State == atom) {
object = new LegoAct2State();
}
else if (m_idCarRace == atom) {
object = new CarRace();
}
else if (m_idLegoRaceCarBuildState == atom || m_idLegoCopterBuildState == atom || m_idLegoDuneCarBuildState == atom || m_idLegoJetskiBuildState == atom) {
object = new LegoVehicleBuildState(p_name);
}
else if (m_idHospitalState == atom) {
object = new HospitalState();
}
else if (m_idInfocenterState == atom) {
object = new InfocenterState();
}
else if (m_idPoliceState == atom) {
object = new PoliceState();
}
if (object != NULL) {
return object;
}
if (m_idGasStationState == atom) {
object = new GasStationState();
}
else if (m_idSkateBoard == atom) {
object = new SkateBoard();
}
else if (m_idHelicopter == atom) {
object = new Helicopter();
}
else if (m_idHelicopterState == atom) {
object = new HelicopterState();
}
else if (m_idDuneBuggy == atom) {
object = new DuneBuggy();
}
else if (m_idPizza == atom) {
object = new Pizza();
}
else if (m_idPizzaMissionState == atom) {
object = new PizzaMissionState();
}
else if (m_idAct2Actor == atom) {
Act2Actor* actor = new Act2Actor();
((LegoAct2*) CurrentWorld())->SetUnknown0x1138(actor);
object = actor;
}
else if (m_idAct2Brick == atom) {
object = new Act2Brick();
}
else if (m_idAct2GenActor == atom) {
object = new Act2GenActor();
}
else if (m_idAct2PoliceStation == atom) {
object = new Act2PoliceStation();
}
else if (m_idAct3 == atom) {
object = new Act3();
}
else if (m_idAct3State == atom) {
object = new Act3State();
}
else if (m_idDoors == atom) {
object = new Doors();
}
else if (m_idLegoAnimMMPresenter == atom) {
object = new LegoAnimMMPresenter();
}
else if (m_idRaceCar == atom) {
object = new RaceCar();
}
else if (m_idJetski == atom) {
object = new Jetski();
}
else if (m_idBike == atom) {
object = new Bike();
}
else if (m_idMotocycle == atom) {
object = new Motocycle();
}
else if (m_idAmbulance == atom) {
object = new Ambulance();
}
else if (m_idAmbulanceMissionState == atom) {
object = new AmbulanceMissionState();
}
else if (m_idTowTrack == atom) {
object = new TowTrack();
}
else if (m_idTowTrackMissionState == atom) {
object = new TowTrackMissionState();
}
else if (m_idAct3Cop == atom) {
object = new Act3Cop();
}
else if (m_idAct3Brickster == atom) {
object = new Act3Brickster();
}
else if (m_idAct3Shark == atom) {
object = new Act3Shark();
}
else if (m_idAct3Actor == atom) {
object = new Act3Actor();
}
else if (m_idBumpBouy == atom) {
object = new BumpBouy();
}
else if (m_idJetskiRaceState == atom) {
object = new JetskiRaceState();
}
else if (m_idCarRaceState == atom) {
object = new CarRaceState();
}
else if (m_idAct1State == atom) {
object = new Act1State();
}
else if (m_idPizzeria == atom) {
object = new Pizzeria();
}
else if (m_idPizzeriaState == atom) {
object = new PizzeriaState();
}
else if (m_idInfoCenterEntity == atom) {
object = new InfoCenterEntity();
}
else if (m_idHospitalEntity == atom) {
object = new HospitalEntity();
}
else if (m_idGasStationEntity == atom) {
object = new GasStationEntity();
}
else if (m_idPoliceEntity == atom) {
object = new PoliceEntity();
}
else if (m_idBeachHouseEntity == atom) {
object = new BeachHouseEntity();
}
else if (m_idJukeBoxEntity == atom) {
object = new JukeBoxEntity();
}
else if (m_idRaceStandsEntity == atom) {
object = new RaceStandsEntity();
}
else if (m_idRadioState == atom) {
object = new RadioState();
}
else if (m_idCaveEntity == atom) {
object = new CaveEntity();
}
else if (m_idJailEntity == atom) {
object = new JailEntity();
}
else if (m_idMxCompositeMediaPresenter == atom) {
object = new MxCompositeMediaPresenter();
}
else if (m_idJukeBox == atom) {
object = new JukeBox();
}
else if (m_idJukeBoxState == atom) {
object = new JukeBoxState();
}
else if (m_idRaceSkel == atom) {
object = new RaceSkel();
}
else if (m_idAnimState == atom) {
object = new AnimState();
}
else {
object = MxObjectFactory::Create(p_name);
}
return object;
} }
// FUNCTION: LEGO1 0x1000fb30 // FUNCTION: LEGO1 0x1000fb30

View File

@ -10,6 +10,12 @@
DECOMP_SIZE_ASSERT(LegoAct2, 0x1154) DECOMP_SIZE_ASSERT(LegoAct2, 0x1154)
DECOMP_SIZE_ASSERT(LegoAct2State, 0x10) DECOMP_SIZE_ASSERT(LegoAct2State, 0x10)
// STUB: LEGO1 0x1004fce0
LegoAct2::LegoAct2()
{
// TODO
}
// FUNCTION: LEGO1 0x1004fe10 // FUNCTION: LEGO1 0x1004fe10
MxBool LegoAct2::VTable0x5c() MxBool LegoAct2::VTable0x5c()
{ {

View File

@ -42,6 +42,9 @@ class MxObjectFactory : public MxCore {
// SYNTHETIC: LEGO1 0x100b1160 // SYNTHETIC: LEGO1 0x100b1160
// MxObjectFactory::`scalar deleting destructor' // MxObjectFactory::`scalar deleting destructor'
// SYNTHETIC: LEGO1 0x10009020
// MxObjectFactory::~MxObjectFactory
private: private:
#define X(V) MxAtomId m_id##V; #define X(V) MxAtomId m_id##V;
FOR_MXOBJECTFACTORY_OBJECTS(X) FOR_MXOBJECTFACTORY_OBJECTS(X)

View File

@ -19,7 +19,7 @@ DECOMP_SIZE_ASSERT(MxObjectFactory, 0x38); // 100af1db
// FUNCTION: LEGO1 0x100b0d80 // FUNCTION: LEGO1 0x100b0d80
MxObjectFactory::MxObjectFactory() MxObjectFactory::MxObjectFactory()
{ {
#define X(V) this->m_id##V = MxAtomId(#V, e_exact); #define X(V) m_id##V = MxAtomId(#V, e_exact);
FOR_MXOBJECTFACTORY_OBJECTS(X) FOR_MXOBJECTFACTORY_OBJECTS(X)
#undef X #undef X
} }
@ -33,7 +33,7 @@ MxCore* MxObjectFactory::Create(const char* p_name)
if (0) { if (0) {
} }
#define X(V) \ #define X(V) \
else if (this->m_id##V == atom) \ else if (m_id##V == atom) \
{ \ { \
object = new V; \ object = new V; \
} }