isle-portable/LEGO1/mxobjectfactory.cpp
Andrew Gutekanst c66b6aa123
Refine MxObjectFactory (#205)
* Refine MxObjectFactory

* Change interface of Destroy

---------

Co-authored-by: Christian Semmler <mail@csemmler.com>
2023-10-14 14:59:06 +02:00

47 lines
1 KiB
C++

#include "mxobjectfactory.h"
#include "mxpresenter.h"
#include "mxcompositepresenter.h"
#include "mxvideopresenter.h"
#include "mxflcpresenter.h"
#include "mxsmkpresenter.h"
#include "mxstillpresenter.h"
#include "mxwavepresenter.h"
#include "mxmidipresenter.h"
#include "mxeventpresenter.h"
#include "mxloopingflcpresenter.h"
#include "mxloopingsmkpresenter.h"
#include "mxloopingmidipresenter.h"
#include "decomp.h"
DECOMP_SIZE_ASSERT(MxObjectFactory, 0x38); // 100af1db
// OFFSET: LEGO1 0x100b0d80
MxObjectFactory::MxObjectFactory()
{
#define X(V) this->m_id##V = MxAtomId(#V, LookupMode_Exact);
FOR_MXOBJECTFACTORY_OBJECTS(X)
#undef X
}
// OFFSET: LEGO1 0x100b12c0
MxCore *MxObjectFactory::Create(const char *p_name)
{
MxAtomId atom(p_name, LookupMode_Exact);
MxCore* object = NULL;
if (0) {}
#define X(V) else if (this->m_id##V == atom) { object = new V; }
FOR_MXOBJECTFACTORY_OBJECTS(X)
#undef X
else {}
return object;
}
// OFFSET: LEGO1 0x100b1a30
void MxObjectFactory::Destroy(MxCore *p_object)
{
delete p_object;
}