isle/LEGO1/legoobjectfactory.cpp

136 lines
3.8 KiB
C++
Raw Normal View History

#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"
2023-10-24 19:38:27 -04:00
#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);
(Proposal) Adjustments to "decomp" language (#308) * Adjustments to "decomp" language * Fix a comment * Fix accidental clang-formatting * Fix order * Fix order * Remove junk * Fix OFFSET * Adjustments based on new suggestions * Annotate globals * Globals in ISLE * More globals * Merge from parser2 branch * Allow prepending space for exact marker match * To eliminate noise, require the 0x prefix on offset for marker match * fix test from previous * Count tab stops for indented functions to reduce MISSED_END_OF_FUNCTION noise * FUNCTION to SYNTHETIC where needed * Missed marker conversion on SetAtomId * pylint cleanup, remove unused code * Fix unexpected function end, add more unit tests * Be more strict about synthetic name syntax * Revert "Missed marker conversion on SetAtomId" This reverts commit d87d665127fae7dd6e5bd48d9af14a0a829bf9e2. * Revert "FUNCTION to SYNTHETIC where needed" This reverts commit 8c815418d261ba8c5f67a9a2cae349fe4ac92db8. * Implicit lookup by name for functions * Fix VTABLE SYNTHETIC and other decomp markers * Get vtable class name * Vtable marker should identify struct * No colon for SIZE comment * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update CONTRIBUTING.md * Fix destructor/annotation * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md --------- Co-authored-by: disinvite <disinvite@users.noreply.github.com>
2023-12-06 07:10:45 -05:00
// FUNCTION: LEGO1 0x10006e40
LegoObjectFactory::LegoObjectFactory()
{
#define X(V) this->m_id##V = MxAtomId(#V, LookupMode_Exact);
2023-10-24 19:38:27 -04:00
FOR_LEGOOBJECTFACTORY_OBJECTS(X)
#undef X
}
(Proposal) Adjustments to "decomp" language (#308) * Adjustments to "decomp" language * Fix a comment * Fix accidental clang-formatting * Fix order * Fix order * Remove junk * Fix OFFSET * Adjustments based on new suggestions * Annotate globals * Globals in ISLE * More globals * Merge from parser2 branch * Allow prepending space for exact marker match * To eliminate noise, require the 0x prefix on offset for marker match * fix test from previous * Count tab stops for indented functions to reduce MISSED_END_OF_FUNCTION noise * FUNCTION to SYNTHETIC where needed * Missed marker conversion on SetAtomId * pylint cleanup, remove unused code * Fix unexpected function end, add more unit tests * Be more strict about synthetic name syntax * Revert "Missed marker conversion on SetAtomId" This reverts commit d87d665127fae7dd6e5bd48d9af14a0a829bf9e2. * Revert "FUNCTION to SYNTHETIC where needed" This reverts commit 8c815418d261ba8c5f67a9a2cae349fe4ac92db8. * Implicit lookup by name for functions * Fix VTABLE SYNTHETIC and other decomp markers * Get vtable class name * Vtable marker should identify struct * No colon for SIZE comment * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update CONTRIBUTING.md * Fix destructor/annotation * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md --------- Co-authored-by: disinvite <disinvite@users.noreply.github.com>
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-24 19:38:27 -04:00
MxAtomId atom(p_name, LookupMode_Exact);
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)
#undef X
2023-10-24 19:38:27 -04:00
{
return MxObjectFactory::Create(p_name);
}
}
(Proposal) Adjustments to "decomp" language (#308) * Adjustments to "decomp" language * Fix a comment * Fix accidental clang-formatting * Fix order * Fix order * Remove junk * Fix OFFSET * Adjustments based on new suggestions * Annotate globals * Globals in ISLE * More globals * Merge from parser2 branch * Allow prepending space for exact marker match * To eliminate noise, require the 0x prefix on offset for marker match * fix test from previous * Count tab stops for indented functions to reduce MISSED_END_OF_FUNCTION noise * FUNCTION to SYNTHETIC where needed * Missed marker conversion on SetAtomId * pylint cleanup, remove unused code * Fix unexpected function end, add more unit tests * Be more strict about synthetic name syntax * Revert "Missed marker conversion on SetAtomId" This reverts commit d87d665127fae7dd6e5bd48d9af14a0a829bf9e2. * Revert "FUNCTION to SYNTHETIC where needed" This reverts commit 8c815418d261ba8c5f67a9a2cae349fe4ac92db8. * Implicit lookup by name for functions * Fix VTABLE SYNTHETIC and other decomp markers * Get vtable class name * Vtable marker should identify struct * No colon for SIZE comment * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update README.md * Update CONTRIBUTING.md * Update README.md * Update CONTRIBUTING.md * Fix destructor/annotation * Update README.md * Update README.md * Update README.md * Update README.md * Update README.md --------- Co-authored-by: disinvite <disinvite@users.noreply.github.com>
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)
{
delete p_object;
}