From 40d51659d3a25d5a9f2e334bd6a3701e818f3d68 Mon Sep 17 00:00:00 2001 From: Misha <106913236+MishaProductions@users.noreply.github.com> Date: Tue, 26 Dec 2023 18:10:28 -0500 Subject: [PATCH] Add most of LegoObjectFactory (#365) * push changes * push changes * fix * Update legoracecar.h --- LEGO1/act3actor.h | 2 +- LEGO1/lego3dwavepresenter.h | 4 +- LEGO1/legoact2.h | 11 +++++ LEGO1/legoobjectfactory.cpp | 97 ++++++++++++++++++++++++++++++++++++ LEGO1/legoobjectfactory.h | 98 ++++++++++++++++++++++++++++++++++++- LEGO1/legoracecar.h | 25 ++++++++++ LEGO1/pizzeria.h | 6 +-- 7 files changed, 236 insertions(+), 7 deletions(-) create mode 100644 LEGO1/legoact2.h create mode 100644 LEGO1/legoracecar.h diff --git a/LEGO1/act3actor.h b/LEGO1/act3actor.h index ef756436..bfdf879a 100644 --- a/LEGO1/act3actor.h +++ b/LEGO1/act3actor.h @@ -3,7 +3,7 @@ // FIXME: Uncertain location. There are three vtables which eventually call this // class' ClassName() function, but none of them call it directly. -class Act3Actor { +class Act3Actor : public MxCore { public: // FUNCTION: LEGO1 0x100431b0 inline virtual const char* ClassName() override diff --git a/LEGO1/lego3dwavepresenter.h b/LEGO1/lego3dwavepresenter.h index a2363518..ca72f212 100644 --- a/LEGO1/lego3dwavepresenter.h +++ b/LEGO1/lego3dwavepresenter.h @@ -1,11 +1,11 @@ #ifndef LEGO3DWAVEPRESENTER_H #define LEGO3DWAVEPRESENTER_H -#include "legowavepresenter.h" +#include "mxwavepresenter.h" // VTABLE: LEGO1 0x100d52b0 // SIZE 0xa0 -class Lego3DWavePresenter : public LegoWavePresenter { +class Lego3DWavePresenter : public MxWavePresenter { public: // FUNCTION: LEGO1 0x1000d890 inline virtual const char* ClassName() const override // vtable+0x0c diff --git a/LEGO1/legoact2.h b/LEGO1/legoact2.h new file mode 100644 index 00000000..b504c11c --- /dev/null +++ b/LEGO1/legoact2.h @@ -0,0 +1,11 @@ +#ifndef LEGOACT2_H +#define LEGOACT2_H + +#include "legocarraceactor.h" +#include "legopathactor.h" + +// VTABLE: LEGO1 0x100d82e0 +// SIZE: 0x1154 +class LegoAct2 : public LegoWorld {}; + +#endif // LEGOACT2_H diff --git a/LEGO1/legoobjectfactory.cpp b/LEGO1/legoobjectfactory.cpp index 2c77c7a9..ff52bad1 100644 --- a/LEGO1/legoobjectfactory.cpp +++ b/LEGO1/legoobjectfactory.cpp @@ -1,7 +1,104 @@ #include "legoobjectfactory.h" +#include "carrace.h" #include "decomp.h" +#include "dunebuggy.h" +#include "elevatorbottom.h" +#include "gasstation.h" +#include "gasstationstate.h" +#include "helicopter.h" +#include "helicopterstate.h" +#include "historybook.h" +#include "hospital.h" +#include "hospitalstate.h" +#include "infocenter.h" +#include "infocenterdoor.h" #include "infocenterstate.h" +#include "isle.h" +#include "jetskirace.h" +#include "lego3dwavepresenter.h" +#include "legoact2.h" +#include "legoact2state.h" +#include "legoactioncontrolpresenter.h" +#include "legoactor.h" +#include "legoactorpresenter.h" +#include "legoanimactor.h" +#include "legoanimpresenter.h" +#include "legocarbuild.h" +#include "legocarbuildanimpresenter.h" +#include "legocarraceactor.h" +#include "legoentity.h" +#include "legoentitypresenter.h" +#include "legoflctexturepresenter.h" +#include "legohideanimpresenter.h" +#include "legojetski.h" +#include "legojetskiraceactor.h" +#include "legoloadcachesoundpresenter.h" +#include "legolocomotionanimpresenter.h" +#include "legoloopinganimpresenter.h" +#include "legomodelpresenter.h" +#include "legopalettepresenter.h" +#include "legopartpresenter.h" +#include "legopathactor.h" +#include "legopathpresenter.h" +#include "legophonemepresenter.h" +#include "legoracecar.h" +#include "legotexturepresenter.h" +#include "legoworld.h" +#include "legoworldpresenter.h" +#include "mxcontrolpresenter.h" +#include "mxvideopresenter.h" +#include "pizza.h" +#include "pizzamissionstate.h" +#include "police.h" +#include "policestate.h" +#include "registrationbook.h" +#include "score.h" +#include "scorestate.h" +#include "skateboard.h" +// #include "act2actor.h" +#include "act2brick.h" +// #include "act2genactor.h" +#include "act2policestation.h" +#include "act3.h" +#include "act3state.h" +#include "ambulance.h" +#include "ambulancemissionstate.h" +#include "bike.h" +#include "doors.h" +#include "jetski.h" +#include "legoanimmmpresenter.h" +#include "motorcycle.h" +#include "racecar.h" +#include "towtrack.h" +#include "towtrackmissionstate.h" +// #include "act3cop.h" +// #include "act3brickster.h" +#include "act1state.h" +#include "act3actor.h" +#include "act3shark.h" +#include "beachhouseentity.h" +#include "bumpbouy.h" +#include "carracestate.h" +#include "gasstationentity.h" +#include "hospitalentity.h" +#include "infocenterentity.h" +#include "jetskiracestate.h" +#include "jukeboxentity.h" +#include "pizzeria.h" +#include "pizzeriastate.h" +#include "policeentity.h" +#include "racestandsentity.h" +#include "radiostate.h" +// #include "caveentity.h" +// #include "jailentity.h" +#include "jukebox.h" +#include "jukeboxstate.h" +#include "mxcompositemediapresenter.h" +// #include "raceskel.h" +#include "animstate.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); diff --git a/LEGO1/legoobjectfactory.h b/LEGO1/legoobjectfactory.h index 82117d34..3a575c52 100644 --- a/LEGO1/legoobjectfactory.h +++ b/LEGO1/legoobjectfactory.h @@ -3,7 +3,103 @@ #include "mxobjectfactory.h" -#define FOR_LEGOOBJECTFACTORY_OBJECTS(X) X(InfocenterState) +#define FOR_LEGOOBJECTFACTORY_OBJECTS(X) \ + X(LegoModelPresenter) \ + X(LegoTexturePresenter) \ + X(LegoPhonemePresenter) \ + X(LegoFlcTexturePresenter) \ + X(LegoEntityPresenter) \ + X(LegoActorPresenter) \ + X(LegoWorldPresenter) \ + X(LegoWorld) \ + X(LegoPalettePresenter) \ + X(LegoPathPresenter) \ + X(LegoAnimPresenter) \ + X(LegoLoopingAnimPresenter) \ + X(LegoLocomotionAnimPresenter) \ + X(LegoHideAnimPresenter) \ + X(LegoPartPresenter) \ + X(LegoCarBuildAnimPresenter) \ + X(LegoActionControlPresenter) \ + X(MxVideoPresenter) \ + X(LegoLoadCacheSoundPresenter) \ + X(Lego3DWavePresenter) \ + X(LegoActor) \ + X(LegoPathActor) \ + X(LegoRaceCar) \ + X(LegoJetski) \ + /*X(JetskiRace) \*/ \ + X(LegoEntity) \ + X(LegoCarRaceActor) \ + X(LegoJetskiRaceActor) \ + X(LegoCarBuild) \ + X(Infocenter) \ + X(LegoAnimActor) \ + X(MxControlPresenter) \ + X(RegistrationBook) \ + X(HistoryBook) \ + X(ElevatorBottom) \ + X(InfocenterDoor) \ + X(Score) \ + X(ScoreState) \ + X(Hospital) \ + X(Isle) \ + X(Police) \ + X(GasStation) \ + X(LegoAct2) \ + X(LegoAct2State) \ + /*X(CarRace)*/ \ + X(HospitalState) \ + X(InfocenterState) \ + X(PoliceState) \ + X(GasStationState) \ + X(SkateBoard) \ + X(Helicopter) \ + X(HelicopterState) \ + X(DuneBuggy) \ + X(Pizza) \ + X(PizzaMissionState) \ + /*X(Act2Actor)*/ \ + /*X(Act2Brick)*/ \ + /*X(Act2GenActor)*/ \ + X(Act2PoliceStation) \ + X(Act3) \ + X(Act3State) \ + X(Doors) \ + X(LegoAnimMMPresenter) \ + X(RaceCar) \ + X(Jetski) \ + X(Bike) \ + X(Motorcycle) \ + X(Ambulance) \ + X(AmbulanceMissionState) \ + X(TowTrack) \ + X(TowTrackMissionState) \ + /*X(Act3Cop)*/ \ + /*X(Act3Brickster)*/ \ + X(Act3Shark) \ + X(BumpBouy) \ + X(Act3Actor) \ + X(JetskiRaceState) \ + X(CarRaceState) \ + X(Act1State) \ + X(Pizzeria) \ + X(PizzeriaState) \ + X(InfoCenterEntity) \ + X(HospitalEntity) \ + X(GasStationEntity) \ + X(PoliceEntity) \ + X(BeachHouseEntity) \ + X(RaceStandsEntity) \ + X(JukeBoxEntity) \ + X(RadioState) \ + /*X(CaveEntity)*/ \ + /*X(JailEntity)*/ \ + X(MxCompositeMediaPresenter) \ + X(JukeBox) \ + X(JukeBoxState) \ + /*X(RaceSkel)*/ \ + X(AnimState) // VTABLE: LEGO1 0x100d4768 class LegoObjectFactory : public MxObjectFactory { diff --git a/LEGO1/legoracecar.h b/LEGO1/legoracecar.h new file mode 100644 index 00000000..38099af2 --- /dev/null +++ b/LEGO1/legoracecar.h @@ -0,0 +1,25 @@ +#ifndef LEGOCARRACE_H +#define LEGOCARRACE_H + +#include "legocarraceactor.h" +#include "legopathactor.h" + +// VTABLE: LEGO1 0x100d58b8 +// SIZE: 0x200 +class LegoRaceCar : public LegoCarRaceActor { +public: + // FUNCTION: LEGO1 0x10014290 + inline const char* ClassName() const override // vtable+0xc + { + // GLOBAL: LEGO1 0x100f0548 + return "LegoRaceCar"; + } + + // FUNCTION: LEGO1 0x100142b0 + inline MxBool IsA(const char* p_name) const override // vtable+0x10 + { + return !strcmp(p_name, LegoCarRaceActor::ClassName()) || LegoCarRaceActor::IsA(p_name); + } +}; + +#endif // LEGOCARRACE_H diff --git a/LEGO1/pizzeria.h b/LEGO1/pizzeria.h index 65a3b195..b9fcadf3 100644 --- a/LEGO1/pizzeria.h +++ b/LEGO1/pizzeria.h @@ -1,5 +1,5 @@ -#ifndef PIZZERIASTATE_H -#define PIZZERIASTATE_H +#ifndef PIZZERIA_H +#define PIZZERIA_H #include "isleactor.h" @@ -21,4 +21,4 @@ class Pizzeria : public IsleActor { } }; -#endif // PIZZERIASTATE_H +#endif // PIZZERIA_H