isle-portable/LEGO1/lego/legoomni/src/common/legoobjectfactory.cpp
Nathan M Gilbert fca8f74bd8
Fix Annotations and LegoAnimActor class structure. (#710)
* Fix size annotations for legoomni
Fix structure and add placeholder annotations for LegoAnimActor and subclasses

* Fix LegoCarRaceActor constructor
Fix function name in LegoRaceCar

* Add size assertions for legoomni and fix sizes

* Various style fixes

* Use other marker so vtable.py doesn't compare

* Revert "Use other marker so vtable.py doesn't compare"

This reverts commit 608985cd73856598b95c15aed9f8f022645e9e7a.

* Fix copy/paste error

* Remove stale comment.

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2024-03-22 21:30:58 -04:00

135 lines
3.7 KiB
C++

#include "legoobjectfactory.h"
#include "act2actor.h"
#include "act2brick.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 "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 "motocycle.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 "animstate.h"
#include "beachhouseentity.h"
#include "bumpbouy.h"
#include "carracestate.h"
#include "caveentity.h"
#include "gasstationentity.h"
#include "hospitalentity.h"
#include "infocenterentity.h"
#include "jailentity.h"
#include "jetskiracestate.h"
#include "jukebox.h"
#include "jukeboxentity.h"
#include "jukeboxstate.h"
#include "mxcompositemediapresenter.h"
#include "pizzeria.h"
#include "pizzeriastate.h"
#include "policeentity.h"
#include "raceskel.h"
#include "racestandsentity.h"
#include "radiostate.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);
// FUNCTION: LEGO1 0x10006e40
LegoObjectFactory::LegoObjectFactory()
{
#define X(V) this->m_id##V = MxAtomId(#V, e_exact);
FOR_LEGOOBJECTFACTORY_OBJECTS(X)
#undef X
}
// FUNCTION: LEGO1 0x10009a90
MxCore* LegoObjectFactory::Create(const char* p_name)
{
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);
}
}
// FUNCTION: LEGO1 0x1000fb30
void LegoObjectFactory::Destroy(MxCore* p_object)
{
delete p_object;
}