Implement a few methods

This commit is contained in:
Misha 2023-06-29 15:29:51 +03:00
parent 5191b04e13
commit d5ac6b796f
3 changed files with 27 additions and 4 deletions

View File

@ -15,13 +15,20 @@ LegoOmni::~LegoOmni()
// OFFSET: LEGO1 0x1005ad10 // OFFSET: LEGO1 0x1005ad10
LegoOmni *LegoOmni::GetInstance() LegoOmni *LegoOmni::GetInstance()
{ {
return (LegoOmni*)MxOmni::GetInstance(); return (LegoOmni *)MxOmni::GetInstance();
}
// OFFSET: LEGO1 0x1005ac90
void LegoOmni::CreateInstance()
{
MxOmni::DestroyInstance();
MxOmni::SetInstance(new LegoOmni());
} }
// OFFSET: LEGO1 0x10015700 // OFFSET: LEGO1 0x10015700
LegoOmni *Lego() LegoOmni *Lego()
{ {
return (LegoOmni *) MxOmni::GetInstance(); return (LegoOmni *)MxOmni::GetInstance();
} }
// OFFSET: LEGO1 0x10015710 // OFFSET: LEGO1 0x10015710
@ -30,7 +37,6 @@ LegoSoundManager *SoundManager()
return LegoOmni::GetInstance()->GetSoundManager(); return LegoOmni::GetInstance()->GetSoundManager();
} }
// OFFSET: LEGO1 0x10015720 // OFFSET: LEGO1 0x10015720
LegoVideoManager *VideoManager() LegoVideoManager *VideoManager()
{ {

View File

@ -1,7 +1,7 @@
#include "mxomni.h" #include "mxomni.h"
// 0x101015b0 // 0x101015b0
MxOmni* MxOmni::m_instance = NULL; MxOmni *MxOmni::m_instance = NULL;
// OFFSET: LEGO1 0x100aef10 // OFFSET: LEGO1 0x100aef10
MxOmni::MxOmni() MxOmni::MxOmni()
@ -33,12 +33,28 @@ void MxOmni::Init()
m_unk64 = NULL; m_unk64 = NULL;
} }
// OFFSET: LEGO1 0x100b0690
void MxOmni::DestroyInstance()
{
if (m_instance != NULL)
{
delete m_instance;
m_instance = NULL;
}
}
// OFFSET: LEGO1 0x100b0680 // OFFSET: LEGO1 0x100b0680
MxOmni *MxOmni::GetInstance() MxOmni *MxOmni::GetInstance()
{ {
return m_instance; return m_instance;
} }
// OFFSET: LEGO1 0x100af0b0
void MxOmni::SetInstance(MxOmni *instance)
{
m_instance = instance;
}
// OFFSET: LEGO1 0x100af0c0 // OFFSET: LEGO1 0x100af0c0
MxResult MxOmni::Create(MxOmniCreateParam &p) MxResult MxOmni::Create(MxOmniCreateParam &p)
{ {

View File

@ -35,6 +35,7 @@ class MxOmni : public MxCore
virtual void Init(); // vtable+14 virtual void Init(); // vtable+14
virtual MxResult Create(MxOmniCreateParam &p); // vtable+18 virtual MxResult Create(MxOmniCreateParam &p); // vtable+18
virtual void Destroy(); // vtable+1c virtual void Destroy(); // vtable+1c
static void SetInstance(MxOmni* instance);
MxTimer* GetTimer() const { return this->m_timer; } MxTimer* GetTimer() const { return this->m_timer; }