diff --git a/CMakeLists.txt b/CMakeLists.txt index 1bcb3535..ceba04d7 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -285,7 +285,10 @@ target_link_libraries(omni PRIVATE dsound winmm Smacker::Smacker) add_library(lego1 SHARED LEGO1/define.cpp LEGO1/lego/legoomni/src/actors/act2actor.cpp + LEGO1/lego/legoomni/src/actors/act2genactor.cpp LEGO1/lego/legoomni/src/actors/act3actor.cpp + LEGO1/lego/legoomni/src/actors/act3brickster.cpp + LEGO1/lego/legoomni/src/actors/act3cop.cpp LEGO1/lego/legoomni/src/actors/act3shark.cpp LEGO1/lego/legoomni/src/actors/ambulance.cpp LEGO1/lego/legoomni/src/actors/bike.cpp diff --git a/LEGO1/lego/legoomni/include/act2genactor.h b/LEGO1/lego/legoomni/include/act2genactor.h new file mode 100644 index 00000000..93cc05da --- /dev/null +++ b/LEGO1/lego/legoomni/include/act2genactor.h @@ -0,0 +1,15 @@ +#ifndef ACT2GENACTOR_H +#define ACT2GENACTOR_H + +#include "legopathactor.h" + +// VTABLE: LEGO1 0x100d4ed8 +// SIZE 0x154 +class Act2GenActor : public LegoPathActor { + MxResult VTable0x94(LegoPathActor*, MxBool) override; // vtable+0x94 + + // SYNTHETIC: LEGO1 0x1000f5a0 + // Act2GenActor::`scalar deleting destructor' +}; + +#endif // ACT2GENACTOR_H diff --git a/LEGO1/lego/legoomni/include/act3actor.h b/LEGO1/lego/legoomni/include/act3actor.h index 3e6b3150..1944c3b4 100644 --- a/LEGO1/lego/legoomni/include/act3actor.h +++ b/LEGO1/lego/legoomni/include/act3actor.h @@ -23,6 +23,9 @@ class Act3Actor : public LegoAnimActor { // SYNTHETIC: LEGO1 0x10043330 // Act3Actor::`scalar deleting destructor' + // SYNTHETIC: LEGO1 0x10040fa0 + // Act3Actor::~Act3Actor + private: undefined4 m_unk0x1c; // 0x1c }; diff --git a/LEGO1/lego/legoomni/include/act3brickster.h b/LEGO1/lego/legoomni/include/act3brickster.h new file mode 100644 index 00000000..f9066d3c --- /dev/null +++ b/LEGO1/lego/legoomni/include/act3brickster.h @@ -0,0 +1,31 @@ +#ifndef ACT3BRICKSTER_H +#define ACT3BRICKSTER_H + +#include "act3actor.h" + +// VTABLE: LEGO1 0x100d7838 LegoPathActor +// VTABLE: LEGO1 0x100d7908 LegoAnimActor +// SIZE 0x1b4 +class Act3Brickster : public Act3Actor { +public: + Act3Brickster(); + ~Act3Brickster() override; + + void ParseAction(char* p_extra) override; // vtable+0x20 + void VTable0x70(float p_und) override; // vtable+0x70 + MxResult VTable0x94(LegoPathActor*, MxBool) override; // vtable+0x94 + void SwitchBoundary( + LegoPathBoundary*& p_boundary, + LegoUnknown100db7f4*& p_edge, + float& p_unk0xe4 + ) override; // vtable+0x98 + MxResult VTable0x9c() override; // vtable+0x9c + + // SYNTHETIC: LEGO1 0x10043250 + // Act3Brickster::`scalar deleting destructor' + +private: + undefined4 m_unk0x20[15]; // 0x20 +}; + +#endif // ACT3BRICKSTER_H diff --git a/LEGO1/lego/legoomni/include/act3cop.h b/LEGO1/lego/legoomni/include/act3cop.h new file mode 100644 index 00000000..29ac65b6 --- /dev/null +++ b/LEGO1/lego/legoomni/include/act3cop.h @@ -0,0 +1,25 @@ +#ifndef ACT3COP_H +#define ACT3COP_H + +#include "act3actor.h" + +// VTABLE: LEGO1 0x100d7750 LegoPathActor +// VTABLE: LEGO1 0x100d7820 LegoAnimActor +// SIZE 0x188 +class Act3Cop : public Act3Actor { +public: + Act3Cop(); + + void ParseAction(char* p_extra) override; // vtable+0x20 + void VTable0x70(float p_und) override; // vtable+0x70 + MxResult VTable0x94(LegoPathActor*, MxBool) override; // vtable+0x94 + MxResult VTable0x9c() override; // vtable+0x9c + + // SYNTHETIC: LEGO1 0x10043120 + // Act3Cop::`scalar deleting destructor' + +private: + undefined4 m_unk0x20[4]; // 0x20 +}; + +#endif // ACT3COP_H diff --git a/LEGO1/lego/legoomni/include/doors.h b/LEGO1/lego/legoomni/include/doors.h index be61fd15..30bc1448 100644 --- a/LEGO1/lego/legoomni/include/doors.h +++ b/LEGO1/lego/legoomni/include/doors.h @@ -7,6 +7,8 @@ // SIZE 0x1f8 class Doors : public LegoPathActor { public: + Doors() : m_unk0x154(0), m_unk0x15c(0), m_unk0x160(0), m_unk0x1f4(0) {} + // FUNCTION: LEGO1 0x1000e430 inline const char* ClassName() const override // vtable+0x0c { diff --git a/LEGO1/lego/legoomni/include/helicopter.h b/LEGO1/lego/legoomni/include/helicopter.h index 2676aa52..7e63407d 100644 --- a/LEGO1/lego/legoomni/include/helicopter.h +++ b/LEGO1/lego/legoomni/include/helicopter.h @@ -9,6 +9,8 @@ // SIZE 0x0c class HelicopterState : public LegoState { public: + HelicopterState() : m_unk0x08(0) {} + // FUNCTION: LEGO1 0x1000e0d0 inline const char* ClassName() const override // vtable+0x0c { diff --git a/LEGO1/lego/legoomni/include/jukebox.h b/LEGO1/lego/legoomni/include/jukebox.h index 8b624191..5ae7ba34 100644 --- a/LEGO1/lego/legoomni/include/jukebox.h +++ b/LEGO1/lego/legoomni/include/jukebox.h @@ -21,6 +21,8 @@ class JukeBoxState : public LegoState { e_torpedos }; + JukeBoxState() : m_music(e_pasquell), m_active(FALSE) {} + // FUNCTION: LEGO1 0x1000f310 inline const char* ClassName() const override // vtable+0x0c { diff --git a/LEGO1/lego/legoomni/include/legoact2.h b/LEGO1/lego/legoomni/include/legoact2.h index 504f0598..93e43a69 100644 --- a/LEGO1/lego/legoomni/include/legoact2.h +++ b/LEGO1/lego/legoomni/include/legoact2.h @@ -5,10 +5,17 @@ #include "legostate.h" #include "legoworld.h" +class Act2Actor; + // VTABLE: LEGO1 0x100d4a70 // SIZE 0x10 class LegoAct2State : public LegoState { public: + LegoAct2State() + { + m_unk0x08 = 0; + m_unk0x0c = 0; + } ~LegoAct2State() override {} // FUNCTION: LEGO1 0x1000df80 @@ -43,6 +50,7 @@ class LegoAct2State : public LegoState { // SIZE 0x1154 class LegoAct2 : public LegoWorld { public: + LegoAct2(); ~LegoAct2() override; MxLong Notify(MxParam& p_param) override; // vtable+0x04 @@ -54,6 +62,7 @@ class LegoAct2 : public LegoWorld { MxBool Escape() override; // vtable+0x64 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; } // SYNTHETIC: LEGO1 0x1004fe20 @@ -78,7 +87,7 @@ class LegoAct2 : public LegoWorld { undefined4 m_unk0x112c; // 0x112c undefined4 m_unk0x1130; // 0x1130 undefined4 m_unk0x1134; // 0x1134 - undefined4 m_unk0x1138; // 0x1138 + Act2Actor* m_unk0x1138; // 0x1138 undefined m_unk0x113c; // 0x113c undefined4 m_unk0x1140; // 0x1140 undefined4 m_unk0x1144; // 0x1144 diff --git a/LEGO1/lego/legoomni/include/legoactioncontrolpresenter.h b/LEGO1/lego/legoomni/include/legoactioncontrolpresenter.h index c46aec5b..f75e00a6 100644 --- a/LEGO1/lego/legoomni/include/legoactioncontrolpresenter.h +++ b/LEGO1/lego/legoomni/include/legoactioncontrolpresenter.h @@ -10,7 +10,7 @@ // SIZE 0x68 class LegoActionControlPresenter : public MxMediaPresenter { public: - LegoActionControlPresenter() { m_unk0x50 = Extra::ActionType::e_none; } + LegoActionControlPresenter() : m_unk0x50(Extra::ActionType::e_none) {} ~LegoActionControlPresenter() override { Destroy(TRUE); } // vtable+0x00 // FUNCTION: BETA10 0x100a7840 diff --git a/LEGO1/lego/legoomni/include/legoanimactor.h b/LEGO1/lego/legoomni/include/legoanimactor.h index 296c48d0..695ce832 100644 --- a/LEGO1/lego/legoomni/include/legoanimactor.h +++ b/LEGO1/lego/legoomni/include/legoanimactor.h @@ -62,6 +62,9 @@ class LegoAnimActor : public virtual LegoPathActor { }; // clang-format off +// GLOBAL: LEGO1 0x100d5438 +// LegoAnimActor::`vbtable' + // TEMPLATE: LEGO1 0x1000da20 // vector >::~vector > diff --git a/LEGO1/lego/legoomni/include/legocarbuild.h b/LEGO1/lego/legoomni/include/legocarbuild.h index ed486c9f..30c064af 100644 --- a/LEGO1/lego/legoomni/include/legocarbuild.h +++ b/LEGO1/lego/legoomni/include/legocarbuild.h @@ -8,7 +8,7 @@ // SIZE 0x50 class LegoVehicleBuildState : public LegoState { public: - LegoVehicleBuildState(char* p_classType); + LegoVehicleBuildState(const char* p_classType); // FUNCTION: LEGO1 0x10025ff0 inline const char* ClassName() const override // vtable+0x0c @@ -49,6 +49,11 @@ class LegoVehicleBuildState : public LegoState { MxU8 m_placedPartCount; // 0x4f }; +typedef LegoVehicleBuildState LegoRaceCarBuildState; +typedef LegoVehicleBuildState LegoCopterBuildState; +typedef LegoVehicleBuildState LegoDuneCarBuildState; +typedef LegoVehicleBuildState LegoJetskiBuildState; + // VTABLE: LEGO1 0x100d6658 // SIZE 0x34c class LegoCarBuild : public LegoWorld { diff --git a/LEGO1/lego/legoomni/include/legoobjectfactory.h b/LEGO1/lego/legoomni/include/legoobjectfactory.h index 37d54fb3..e77cb802 100644 --- a/LEGO1/lego/legoomni/include/legoobjectfactory.h +++ b/LEGO1/lego/legoomni/include/legoobjectfactory.h @@ -8,13 +8,13 @@ X(LegoActorPresenter) \ X(LegoWorldPresenter) \ X(LegoWorld) \ - X(LegoAnimPresenter) \ X(LegoModelPresenter) \ X(LegoTexturePresenter) \ X(LegoPhonemePresenter) \ X(LegoFlcTexturePresenter) \ X(LegoPalettePresenter) \ X(LegoPathPresenter) \ + X(LegoAnimPresenter) \ X(LegoLoopingAnimPresenter) \ X(LegoLocomotionAnimPresenter) \ X(LegoHideAnimPresenter) \ @@ -49,6 +49,10 @@ X(LegoAct2) \ X(LegoAct2State) \ X(CarRace) \ + X(LegoRaceCarBuildState) \ + X(LegoCopterBuildState) \ + X(LegoDuneCarBuildState) \ + X(LegoJetskiBuildState) \ X(HospitalState) \ X(InfocenterState) \ X(PoliceState) \ @@ -61,7 +65,7 @@ X(PizzaMissionState) \ X(Act2Actor) \ X(Act2Brick) \ - /*X(Act2GenActor)*/ \ + X(Act2GenActor) \ X(Act2PoliceStation) \ X(Act3) \ X(Act3State) \ @@ -75,8 +79,8 @@ X(AmbulanceMissionState) \ X(TowTrack) \ X(TowTrackMissionState) \ - /*X(Act3Cop)*/ \ - /*X(Act3Brickster)*/ \ + X(Act3Cop) \ + X(Act3Brickster) \ X(Act3Shark) \ X(BumpBouy) \ X(Act3Actor) \ diff --git a/LEGO1/lego/legoomni/include/pizza.h b/LEGO1/lego/legoomni/include/pizza.h index 7f1356be..51680712 100644 --- a/LEGO1/lego/legoomni/include/pizza.h +++ b/LEGO1/lego/legoomni/include/pizza.h @@ -9,7 +9,7 @@ class Act1State; class SkateBoard; // VTABLE: LEGO1 0x100d7408 -// SIZE 0xb0 +// SIZE 0xb4 class PizzaMissionState : public LegoState { public: // SIZE 0x20 @@ -22,6 +22,8 @@ class PizzaMissionState : public LegoState { undefined m_unk0x18[6]; // 0x1a }; + PizzaMissionState(); + // FUNCTION: LEGO1 0x10039290 inline const char* ClassName() const override // vtable+0x0c { @@ -47,6 +49,7 @@ class PizzaMissionState : public LegoState { undefined4 m_unk0x08; // 0x08 undefined4 m_unk0x0c; // 0x0c Entry m_state[5]; // 0x10 + undefined4 m_unk0xb0; // 0xb0 }; // VTABLE: LEGO1 0x100d7380 diff --git a/LEGO1/lego/legoomni/include/score.h b/LEGO1/lego/legoomni/include/score.h index 76a4ac8e..a11492a0 100644 --- a/LEGO1/lego/legoomni/include/score.h +++ b/LEGO1/lego/legoomni/include/score.h @@ -12,6 +12,8 @@ class MxEndActionNotificationParam; // SIZE 0x0c class ScoreState : public LegoState { public: + ScoreState() : m_playCubeTutorial(TRUE) {} + // FUNCTION: LEGO1 0x1000de40 inline const char* ClassName() const override // vtable+0x0c { diff --git a/LEGO1/lego/legoomni/src/actors/act2genactor.cpp b/LEGO1/lego/legoomni/src/actors/act2genactor.cpp new file mode 100644 index 00000000..d7ade7b1 --- /dev/null +++ b/LEGO1/lego/legoomni/src/actors/act2genactor.cpp @@ -0,0 +1,10 @@ +#include "act2genactor.h" + +DECOMP_SIZE_ASSERT(Act2GenActor, 0x154) + +// STUB: LEGO1 0x10018740 +MxResult Act2GenActor::VTable0x94(LegoPathActor*, MxBool) +{ + // TODO + return SUCCESS; +} diff --git a/LEGO1/lego/legoomni/src/actors/act3brickster.cpp b/LEGO1/lego/legoomni/src/actors/act3brickster.cpp new file mode 100644 index 00000000..24340578 --- /dev/null +++ b/LEGO1/lego/legoomni/src/actors/act3brickster.cpp @@ -0,0 +1,47 @@ +#include "act3brickster.h" + +DECOMP_SIZE_ASSERT(Act3Brickster, 0x1b4) + +// STUB: LEGO1 0x10040e10 +Act3Brickster::Act3Brickster() +{ + // TODO +} + +// FUNCTION: LEGO1 0x10040f20 +Act3Brickster::~Act3Brickster() +{ + // TODO +} + +// STUB: LEGO1 0x10040ff0 +void Act3Brickster::ParseAction(char* p_extra) +{ + // TODO +} + +// STUB: LEGO1 0x10041050 +void Act3Brickster::VTable0x70(float p_und) +{ + // TODO +} + +// STUB: LEGO1 0x100416b0 +MxResult Act3Brickster::VTable0x94(LegoPathActor*, MxBool) +{ + // TODO + return SUCCESS; +} + +// STUB: LEGO1 0x10042990 +void Act3Brickster::SwitchBoundary(LegoPathBoundary*& p_boundary, LegoUnknown100db7f4*& p_edge, float& p_unk0xe4) +{ + // TODO +} + +// STUB: LEGO1 0x100429d0 +MxResult Act3Brickster::VTable0x9c() +{ + // TODO + return SUCCESS; +} diff --git a/LEGO1/lego/legoomni/src/actors/act3cop.cpp b/LEGO1/lego/legoomni/src/actors/act3cop.cpp new file mode 100644 index 00000000..557386ce --- /dev/null +++ b/LEGO1/lego/legoomni/src/actors/act3cop.cpp @@ -0,0 +1,35 @@ +#include "act3cop.h" + +DECOMP_SIZE_ASSERT(Act3Cop, 0x188) + +// STUB: LEGO1 0x1003fe30 +Act3Cop::Act3Cop() +{ + // TODO +} + +// STUB: LEGO1 0x1003ff70 +MxResult Act3Cop::VTable0x94(LegoPathActor*, MxBool) +{ + // TODO + return SUCCESS; +} + +// STUB: LEGO1 0x10040060 +void Act3Cop::ParseAction(char* p_extra) +{ + // TODO +} + +// STUB: LEGO1 0x100401f0 +void Act3Cop::VTable0x70(float p_und) +{ + // TODO +} + +// STUB: LEGO1 0x10040d20 +MxResult Act3Cop::VTable0x9c() +{ + // TODO + return SUCCESS; +} diff --git a/LEGO1/lego/legoomni/src/actors/pizza.cpp b/LEGO1/lego/legoomni/src/actors/pizza.cpp index 43ef2ddb..0b783995 100644 --- a/LEGO1/lego/legoomni/src/actors/pizza.cpp +++ b/LEGO1/lego/legoomni/src/actors/pizza.cpp @@ -8,7 +8,7 @@ #include "mxticklemanager.h" DECOMP_SIZE_ASSERT(Pizza, 0x9c) -DECOMP_SIZE_ASSERT(PizzaMissionState, 0xb0) +DECOMP_SIZE_ASSERT(PizzaMissionState, 0xb4) DECOMP_SIZE_ASSERT(PizzaMissionState::Entry, 0x20) // FUNCTION: LEGO1 0x10037ef0 @@ -99,6 +99,12 @@ undefined4 Pizza::HandleEndAction(MxEndActionNotificationParam&) return 0; } +// STUB: LEGO1 0x10039030 +PizzaMissionState::PizzaMissionState() +{ + // TODO +} + // STUB: LEGO1 0x100393c0 MxResult PizzaMissionState::Serialize(LegoFile* p_legoFile) { diff --git a/LEGO1/lego/legoomni/src/build/legocarbuild.cpp b/LEGO1/lego/legoomni/src/build/legocarbuild.cpp index ed32a3f2..68bdc755 100644 --- a/LEGO1/lego/legoomni/src/build/legocarbuild.cpp +++ b/LEGO1/lego/legoomni/src/build/legocarbuild.cpp @@ -64,7 +64,7 @@ MxBool LegoCarBuild::Escape() } // FUNCTION: LEGO1 0x10025f30 -LegoVehicleBuildState::LegoVehicleBuildState(char* p_classType) +LegoVehicleBuildState::LegoVehicleBuildState(const char* p_classType) { m_className = p_classType; m_unk0x4c = 0; diff --git a/LEGO1/lego/legoomni/src/common/legoobjectfactory.cpp b/LEGO1/lego/legoomni/src/common/legoobjectfactory.cpp index 66411554..265a69dc 100644 --- a/LEGO1/lego/legoomni/src/common/legoobjectfactory.cpp +++ b/LEGO1/lego/legoomni/src/common/legoobjectfactory.cpp @@ -2,8 +2,20 @@ #include "act2actor.h" #include "act2brick.h" +#include "act2genactor.h" +#include "act2policestation.h" +#include "act3.h" +#include "act3actor.h" +#include "act3brickster.h" +#include "act3cop.h" +#include "act3shark.h" +#include "ambulance.h" +#include "bike.h" +#include "buildings.h" +#include "bumpbouy.h" #include "carrace.h" #include "decomp.h" +#include "doors.h" #include "dunebuggy.h" #include "elevatorbottom.h" #include "gasstation.h" @@ -13,13 +25,18 @@ #include "infocenter.h" #include "infocenterdoor.h" #include "isle.h" +#include "jetski.h" #include "jetskirace.h" +#include "jukebox.h" +#include "jukeboxentity.h" #include "lego3dwavepresenter.h" #include "legoact2.h" #include "legoactioncontrolpresenter.h" #include "legoactor.h" #include "legoactorpresenter.h" #include "legoanimactor.h" +#include "legoanimationmanager.h" +#include "legoanimmmpresenter.h" #include "legoanimpresenter.h" #include "legocarbuild.h" #include "legocarbuildpresenter.h" @@ -33,6 +50,7 @@ #include "legoloadcachesoundpresenter.h" #include "legolocomotionanimpresenter.h" #include "legoloopinganimpresenter.h" +#include "legometerpresenter.h" #include "legomodelpresenter.h" #include "legopalettepresenter.h" #include "legopartpresenter.h" @@ -43,65 +61,437 @@ #include "legotexturepresenter.h" #include "legoworld.h" #include "legoworldpresenter.h" +#include "misc.h" +#include "motocycle.h" +#include "mxcompositemediapresenter.h" #include "mxcontrolpresenter.h" #include "pizza.h" +#include "pizzeria.h" #include "police.h" +#include "racecar.h" +#include "raceskel.h" #include "registrationbook.h" #include "score.h" #include "skateboard.h" -// #include "act2genactor.h" -#include "act2policestation.h" -#include "act3.h" -#include "ambulance.h" -#include "bike.h" -#include "doors.h" -#include "jetski.h" -#include "legoanimationmanager.h" -#include "legoanimmmpresenter.h" -#include "motocycle.h" -#include "racecar.h" #include "towtrack.h" -// #include "act3cop.h" -// #include "act3brickster.h" -#include "act3actor.h" -#include "act3shark.h" -#include "buildings.h" -#include "bumpbouy.h" -#include "jukebox.h" -#include "jukeboxentity.h" -#include "legometerpresenter.h" -#include "mxcompositemediapresenter.h" -#include "pizzeria.h" -#include "raceskel.h" -// TODO: Before HospitalState, add all of the different LegoVehicleBuildState's - -// TODO: Uncomment once we have all the relevant types ready -// DECOMP_SIZE_ASSERT(LegoObjectFactory, 0x1c8); +DECOMP_SIZE_ASSERT(LegoObjectFactory, 0x1c8) // FUNCTION: LEGO1 0x10006e40 LegoObjectFactory::LegoObjectFactory() { -#define X(V) this->m_id##V = MxAtomId(#V, e_exact); - FOR_LEGOOBJECTFACTORY_OBJECTS(X) -#undef X + m_idLegoEntityPresenter = MxAtomId("LegoEntityPresenter", e_exact); + m_idLegoActorPresenter = MxAtomId("LegoActorPresenter", e_exact); + 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 MxCore* LegoObjectFactory::Create(const char* p_name) { + MxCore* object = NULL; MxAtomId atom(p_name, e_exact); -#define X(V) \ - if (this->m_id##V == atom) { \ - return new V; \ - } \ - else - FOR_LEGOOBJECTFACTORY_OBJECTS(X) -#undef X - { - return MxObjectFactory::Create(p_name); + if (m_idLegoModelPresenter == atom) { + object = new LegoModelPresenter(); } + 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 diff --git a/LEGO1/lego/legoomni/src/worlds/legoact2.cpp b/LEGO1/lego/legoomni/src/worlds/legoact2.cpp index 9fde7a10..3e3a3149 100644 --- a/LEGO1/lego/legoomni/src/worlds/legoact2.cpp +++ b/LEGO1/lego/legoomni/src/worlds/legoact2.cpp @@ -10,6 +10,12 @@ DECOMP_SIZE_ASSERT(LegoAct2, 0x1154) DECOMP_SIZE_ASSERT(LegoAct2State, 0x10) +// STUB: LEGO1 0x1004fce0 +LegoAct2::LegoAct2() +{ + // TODO +} + // FUNCTION: LEGO1 0x1004fe10 MxBool LegoAct2::VTable0x5c() { diff --git a/LEGO1/omni/include/mxobjectfactory.h b/LEGO1/omni/include/mxobjectfactory.h index 882ddc55..b52e5e32 100644 --- a/LEGO1/omni/include/mxobjectfactory.h +++ b/LEGO1/omni/include/mxobjectfactory.h @@ -42,6 +42,9 @@ class MxObjectFactory : public MxCore { // SYNTHETIC: LEGO1 0x100b1160 // MxObjectFactory::`scalar deleting destructor' + // SYNTHETIC: LEGO1 0x10009020 + // MxObjectFactory::~MxObjectFactory + private: #define X(V) MxAtomId m_id##V; FOR_MXOBJECTFACTORY_OBJECTS(X) diff --git a/LEGO1/omni/src/common/mxobjectfactory.cpp b/LEGO1/omni/src/common/mxobjectfactory.cpp index 93f2e0a0..3722bb0e 100644 --- a/LEGO1/omni/src/common/mxobjectfactory.cpp +++ b/LEGO1/omni/src/common/mxobjectfactory.cpp @@ -19,7 +19,7 @@ DECOMP_SIZE_ASSERT(MxObjectFactory, 0x38); // 100af1db // FUNCTION: LEGO1 0x100b0d80 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) #undef X } @@ -33,7 +33,7 @@ MxCore* MxObjectFactory::Create(const char* p_name) if (0) { } #define X(V) \ - else if (this->m_id##V == atom) \ + else if (m_id##V == atom) \ { \ object = new V; \ }