mirror of
https://github.com/isledecomp/isle.git
synced 2024-11-22 23:57:54 -05:00
Refine MxObjectFactory (#205)
* Refine MxObjectFactory * Change interface of Destroy --------- Co-authored-by: Christian Semmler <mail@csemmler.com>
This commit is contained in:
parent
a24a798c82
commit
c66b6aa123
4 changed files with 13 additions and 11 deletions
|
@ -29,7 +29,7 @@ MxCore *LegoObjectFactory::Create(const char *p_name)
|
||||||
}
|
}
|
||||||
|
|
||||||
// OFFSET: LEGO1 0x1000fb30 STUB
|
// OFFSET: LEGO1 0x1000fb30 STUB
|
||||||
void LegoObjectFactory::Destroy(void *p_object)
|
void LegoObjectFactory::Destroy(MxCore *p_object)
|
||||||
{
|
{
|
||||||
// TODO
|
// TODO
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,7 +12,7 @@ class LegoObjectFactory : public MxObjectFactory
|
||||||
public:
|
public:
|
||||||
LegoObjectFactory();
|
LegoObjectFactory();
|
||||||
virtual MxCore *Create(const char *p_name) override; // vtable 0x14
|
virtual MxCore *Create(const char *p_name) override; // vtable 0x14
|
||||||
virtual void Destroy(void *p_object) override; // vtable 0x18
|
virtual void Destroy(MxCore *p_object) override; // vtable 0x18
|
||||||
private:
|
private:
|
||||||
#define X(V) MxAtomId m_id##V;
|
#define X(V) MxAtomId m_id##V;
|
||||||
FOR_LEGOOBJECTFACTORY_OBJECTS(X)
|
FOR_LEGOOBJECTFACTORY_OBJECTS(X)
|
||||||
|
|
|
@ -29,17 +29,19 @@ MxObjectFactory::MxObjectFactory()
|
||||||
MxCore *MxObjectFactory::Create(const char *p_name)
|
MxCore *MxObjectFactory::Create(const char *p_name)
|
||||||
{
|
{
|
||||||
MxAtomId atom(p_name, LookupMode_Exact);
|
MxAtomId atom(p_name, LookupMode_Exact);
|
||||||
|
MxCore* object = NULL;
|
||||||
|
|
||||||
if (0) {
|
if (0) {}
|
||||||
#define X(V) } else if (this->m_id##V == atom) { return new V;
|
#define X(V) else if (this->m_id##V == atom) { object = new V; }
|
||||||
FOR_MXOBJECTFACTORY_OBJECTS(X)
|
FOR_MXOBJECTFACTORY_OBJECTS(X)
|
||||||
#undef X
|
#undef X
|
||||||
} else {
|
else {}
|
||||||
return NULL;
|
|
||||||
}
|
return object;
|
||||||
}
|
}
|
||||||
|
|
||||||
// OFFSET: LEGO1 0x100b1a30 STUB
|
// OFFSET: LEGO1 0x100b1a30
|
||||||
void MxObjectFactory::Destroy(void *p_object) {
|
void MxObjectFactory::Destroy(MxCore *p_object)
|
||||||
// FIXME
|
{
|
||||||
|
delete p_object;
|
||||||
}
|
}
|
||||||
|
|
|
@ -38,7 +38,7 @@ class MxObjectFactory : public MxCore
|
||||||
}
|
}
|
||||||
|
|
||||||
virtual MxCore *Create(const char *p_name); // vtable 0x14
|
virtual MxCore *Create(const char *p_name); // vtable 0x14
|
||||||
virtual void Destroy(void *p_object); // vtable 0x18
|
virtual void Destroy(MxCore *p_object); // vtable 0x18
|
||||||
private:
|
private:
|
||||||
#define X(V) MxAtomId m_id##V;
|
#define X(V) MxAtomId m_id##V;
|
||||||
FOR_MXOBJECTFACTORY_OBJECTS(X)
|
FOR_MXOBJECTFACTORY_OBJECTS(X)
|
||||||
|
|
Loading…
Reference in a new issue