2023-10-12 12:18:24 -04:00
|
|
|
#include "legoobjectfactory.h"
|
|
|
|
|
2024-03-22 21:30:58 -04:00
|
|
|
#include "act2actor.h"
|
|
|
|
#include "act2brick.h"
|
2023-12-26 18:10:28 -05:00
|
|
|
#include "carrace.h"
|
2023-10-12 12:18:24 -04:00
|
|
|
#include "decomp.h"
|
2023-12-26 18:10:28 -05:00
|
|
|
#include "dunebuggy.h"
|
|
|
|
#include "elevatorbottom.h"
|
|
|
|
#include "gasstation.h"
|
|
|
|
#include "helicopter.h"
|
|
|
|
#include "historybook.h"
|
|
|
|
#include "hospital.h"
|
|
|
|
#include "infocenter.h"
|
|
|
|
#include "infocenterdoor.h"
|
|
|
|
#include "isle.h"
|
|
|
|
#include "jetskirace.h"
|
|
|
|
#include "lego3dwavepresenter.h"
|
|
|
|
#include "legoact2.h"
|
|
|
|
#include "legoactioncontrolpresenter.h"
|
|
|
|
#include "legoactor.h"
|
|
|
|
#include "legoactorpresenter.h"
|
|
|
|
#include "legoanimactor.h"
|
|
|
|
#include "legoanimpresenter.h"
|
|
|
|
#include "legocarbuild.h"
|
2024-06-03 12:53:25 -04:00
|
|
|
#include "legocarbuildpresenter.h"
|
2023-12-26 18:10:28 -05:00
|
|
|
#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 "police.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"
|
2024-06-03 12:53:25 -04:00
|
|
|
#include "legoanimationmanager.h"
|
2023-12-26 18:10:28 -05:00
|
|
|
#include "legoanimmmpresenter.h"
|
2024-01-14 17:00:03 -05:00
|
|
|
#include "motocycle.h"
|
2023-12-26 18:10:28 -05:00
|
|
|
#include "racecar.h"
|
|
|
|
#include "towtrack.h"
|
|
|
|
// #include "act3cop.h"
|
|
|
|
// #include "act3brickster.h"
|
|
|
|
#include "act3actor.h"
|
|
|
|
#include "act3shark.h"
|
2024-06-03 12:53:25 -04:00
|
|
|
#include "buildings.h"
|
2023-12-26 18:10:28 -05:00
|
|
|
#include "bumpbouy.h"
|
2024-02-10 18:44:00 -05:00
|
|
|
#include "caveentity.h"
|
2024-03-05 16:05:38 -05:00
|
|
|
#include "jukebox.h"
|
2023-12-26 18:10:28 -05:00
|
|
|
#include "jukeboxentity.h"
|
2024-03-05 16:05:38 -05:00
|
|
|
#include "mxcompositemediapresenter.h"
|
2023-12-26 18:10:28 -05:00
|
|
|
#include "pizzeria.h"
|
2024-03-22 21:30:58 -04:00
|
|
|
#include "raceskel.h"
|
2023-12-26 18:10:28 -05:00
|
|
|
|
|
|
|
// TODO: Before HospitalState, add all of the different LegoVehicleBuildState's
|
2023-10-12 12:18:24 -04:00
|
|
|
|
|
|
|
// TODO: Uncomment once we have all the relevant types ready
|
|
|
|
// DECOMP_SIZE_ASSERT(LegoObjectFactory, 0x1c8);
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x10006e40
|
2023-10-12 12:18:24 -04:00
|
|
|
LegoObjectFactory::LegoObjectFactory()
|
|
|
|
{
|
2024-01-17 11:53:53 -05:00
|
|
|
#define X(V) this->m_id##V = MxAtomId(#V, e_exact);
|
2023-10-24 19:38:27 -04:00
|
|
|
FOR_LEGOOBJECTFACTORY_OBJECTS(X)
|
2023-10-12 12:18:24 -04:00
|
|
|
#undef X
|
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x10009a90
|
2023-10-24 19:38:27 -04:00
|
|
|
MxCore* LegoObjectFactory::Create(const char* p_name)
|
2023-10-12 12:18:24 -04:00
|
|
|
{
|
2024-01-17 11:53:53 -05:00
|
|
|
MxAtomId atom(p_name, e_exact);
|
2023-10-12 12:18:24 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
#define X(V) \
|
|
|
|
if (this->m_id##V == atom) { \
|
|
|
|
return new V; \
|
|
|
|
} \
|
|
|
|
else
|
|
|
|
FOR_LEGOOBJECTFACTORY_OBJECTS(X)
|
2023-10-12 12:18:24 -04:00
|
|
|
#undef X
|
2023-10-24 19:38:27 -04:00
|
|
|
{
|
|
|
|
return MxObjectFactory::Create(p_name);
|
|
|
|
}
|
2023-10-12 12:18:24 -04:00
|
|
|
}
|
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x1000fb30
|
2023-10-24 19:38:27 -04:00
|
|
|
void LegoObjectFactory::Destroy(MxCore* p_object)
|
2023-10-12 12:18:24 -04:00
|
|
|
{
|
2023-11-05 17:41:35 -05:00
|
|
|
delete p_object;
|
2023-10-12 12:18:24 -04:00
|
|
|
}
|