Implement a few functions in LegoEntity (#201)

This commit is contained in:
Misha 2023-10-11 18:15:36 -04:00 committed by GitHub
parent 19ee8cdc30
commit b7b0ac6ae7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 20 additions and 5 deletions

View file

@ -36,10 +36,13 @@ void LegoEntity::Reset()
m_unk59 = 4; m_unk59 = 4;
} }
// OFFSET: LEGO1 0x100107e0 STUB // OFFSET: LEGO1 0x100107e0
void LegoEntity::vtable18() MxResult LegoEntity::InitFromMxDSObject(MxDSObject& p_object)
{ {
m_mxEntityId = p_object.GetObjectId();
m_atom = p_object.GetAtomId();
AddToCurrentWorld();
return SUCCESS;
} }
// OFFSET: LEGO1 0x10010810 STUB // OFFSET: LEGO1 0x10010810 STUB
@ -53,6 +56,16 @@ void LegoEntity::Destroy(MxBool)
Reset(); Reset();
} }
// OFFSET: LEGO1 0x10010880 STUB
void LegoEntity::AddToCurrentWorld()
{
LegoWorld* world = GetCurrentWorld();
if (world != NULL && world != (LegoWorld*)this)
{
// TODO: world->vtable58(this);
}
}
// OFFSET: LEGO1 0x10010e10 // OFFSET: LEGO1 0x10010e10
void LegoEntity::ParseAction(char *p_extra) void LegoEntity::ParseAction(char *p_extra)
{ {

View file

@ -5,6 +5,7 @@
#include "mxvector.h" #include "mxvector.h"
#include "extra.h" #include "extra.h"
#include "decomp.h" #include "decomp.h"
#include "mxdsobject.h"
// VTABLE 0x100d4858 // VTABLE 0x100d4858
// SIZE 0x68 (probably) // SIZE 0x68 (probably)
@ -34,12 +35,13 @@ class LegoEntity : public MxEntity
return !strcmp(name, LegoEntity::ClassName()) || MxEntity::IsA(name); return !strcmp(name, LegoEntity::ClassName()) || MxEntity::IsA(name);
} }
virtual void vtable18(); // vtable+0x18 virtual MxResult InitFromMxDSObject(MxDSObject& p_object); // vtable+0x18
virtual void Destroy(MxBool); // vtable+0x1c virtual void Destroy(MxBool); // vtable+0x1c
virtual void ParseAction(char *); // vtable+0x20 virtual void ParseAction(char *); // vtable+0x20
protected: protected:
void Reset(); void Reset();
void AddToCurrentWorld();
undefined m_unk10; undefined m_unk10;
undefined m_unk11; undefined m_unk11;

View file

@ -28,7 +28,7 @@ class MxEntity : public MxCore
} }
virtual MxResult SetEntityId(MxS32 p_id, const MxAtomId &p_atom); // vtable+0x14 virtual MxResult SetEntityId(MxS32 p_id, const MxAtomId &p_atom); // vtable+0x14
private: protected:
MxS32 m_mxEntityId; // 0x8 MxS32 m_mxEntityId; // 0x8
MxAtomId m_atom; // 0xc MxAtomId m_atom; // 0xc
}; };