Implement MxObjectFactory::{MxObjectFactory,Create}

Matching of MxObjectFactory::Create is not good, because none of the other objects have been implemented.
This commit is contained in:
Anonymous Maarten 2023-06-29 14:33:51 +02:00
parent 4d31ca4d1d
commit fe64453c34
3 changed files with 69 additions and 1 deletions

View File

@ -127,6 +127,7 @@ add_library(lego1 SHARED
LEGO1/mxmidipresenter.cpp LEGO1/mxmidipresenter.cpp
LEGO1/mxmusicpresenter.cpp LEGO1/mxmusicpresenter.cpp
LEGO1/mxnotificationmanager.cpp LEGO1/mxnotificationmanager.cpp
LEGO1/mxobjectfactory.cpp
LEGO1/mxomni.cpp LEGO1/mxomni.cpp
LEGO1/mxomnicreateflags.cpp LEGO1/mxomnicreateflags.cpp
LEGO1/mxomnicreateparam.cpp LEGO1/mxomnicreateparam.cpp

45
LEGO1/mxobjectfactory.cpp Normal file
View File

@ -0,0 +1,45 @@
#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_STATIC_ASSERT(sizeof(MxObjectFactory) == 56); // 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 *name)
{
MxAtomId atom(name, LookupMode_Exact);
if (0) {
#define X(V) } else if (this->m_id##V == atom) { return new V;
FOR_MXOBJECTFACTORY_OBJECTS(X)
#undef X
} else {
return NULL;
}
}
// OFFSET: LEGO1 0x100b1a30 STUB
void MxObjectFactory::vtable18(void *) {
// FIXME
}

View File

@ -2,11 +2,33 @@
#define MXOBJECTFACTORY_H #define MXOBJECTFACTORY_H
#include "mxcore.h" #include "mxcore.h"
#include "mxatomid.h"
#define FOR_MXOBJECTFACTORY_OBJECTS(X) \
X(MxPresenter) \
X(MxCompositePresenter) \
X(MxVideoPresenter) \
X(MxFlcPresenter) \
X(MxSmkPresenter) \
X(MxStillPresenter) \
X(MxWavePresenter) \
X(MxMIDIPresenter) \
X(MxEventPresenter) \
X(MxLoopingFlcPresenter) \
X(MxLoopingSmkPresenter) \
X(MxLoopingMIDIPresenter)
// VTABLE 0x100dc220 // VTABLE 0x100dc220
class MxObjectFactory : public MxCore class MxObjectFactory : public MxCore
{ {
public:
MxObjectFactor();
virtual MxCore *Create(const char *name); // vtable 0x14
virtual void vtable18(void *); // vtable 0x18
private:
#define X(V) MxAtomId m_id##V;
FOR_MXOBJECTFACTORY_OBJECTS(X)
#undef X
}; };
#endif // MXOBJECTFACTORY_H #endif // MXOBJECTFACTORY_H