Cleanup and add MxParam.

This commit is contained in:
Brendan Dougherty 2023-07-09 13:23:14 -05:00
parent 7da2d6a4e8
commit 8aad19de35
5 changed files with 66 additions and 8 deletions

View File

@ -133,6 +133,7 @@ add_library(lego1 SHARED
LEGO1/mxomnicreateparam.cpp
LEGO1/mxomnicreateparambase.cpp
LEGO1/mxpalette.cpp
LEGO1/mxparam.cpp
LEGO1/mxpresenter.cpp
LEGO1/mxscheduler.cpp
LEGO1/mxsmkpresenter.cpp

View File

@ -5,10 +5,13 @@
#include "mxparam.h"
#include "mxtypes.h"
DECOMP_SIZE_ASSERT(MxNotification, 0x8);
DECOMP_SIZE_ASSERT(MxNotificationManager, 0x40);
// OFFSET: LEGO1 0x100ac220
MxNotification::MxNotification(MxCore *p_destination, MxParam *p_param)
MxNotification::MxNotification(MxCore *p_target, MxParam *p_param)
{
m_destination = p_destination;
m_target = p_target;
m_param = p_param->Clone();
}
@ -54,7 +57,7 @@ long MxNotificationManager::Tickle()
while (m_sendList->size() != 0) {
MxNotification *notif = m_sendList->front();
m_sendList->pop_front();
notif->m_destination->Notify(*notif->m_param);
notif->GetTarget()->Notify(*notif->GetParam());
delete notif;
}

View File

@ -10,11 +10,22 @@
class MxNotification
{
public:
MxCore *m_destination;
MxParam *m_param;
MxNotification(MxCore *p_destination, MxParam *p_param);
MxNotification(MxCore *p_target, MxParam *p_param);
~MxNotification();
inline MxCore *GetTarget()
{
return m_target;
}
inline MxParam *GetParam()
{
return m_param;
}
private:
MxCore *m_target; // 0x0
MxParam *m_param; // 0x4
};
// VTABLE 0x100dc078
@ -30,7 +41,7 @@ class MxNotificationManager : public MxCore
public:
MxNotificationManager();
virtual ~MxNotificationManager(); // vtable+0x0
virtual ~MxNotificationManager(); // vtable+0x0 (scalar deleting destructor)
virtual long Tickle(); // vtable+0x8
// TODO: Where does this method come from?

11
LEGO1/mxparam.cpp Normal file
View File

@ -0,0 +1,11 @@
#include "mxparam.h"
#include "decomp.h"
DECOMP_SIZE_ASSERT(MxParam, 0xc);
// OFFSET: LEGO1 0x10010390
MxParam* MxParam::Clone()
{
return new MxParam(m_type, m_sender);
}

32
LEGO1/mxparam.h Normal file
View File

@ -0,0 +1,32 @@
#ifndef MXPARAM_H
#define MXPARAM_H
#include "mxomnicreateparambase.h"
class MxCore;
// VTABLE 0x100d56e0
class MxParam : public MxOmniCreateParamBase
{
public:
inline MxParam(int p_type, MxCore *p_sender) : MxOmniCreateParamBase(), m_type(p_type), m_sender(p_sender){}
virtual ~MxParam(){}; // vtable+0x0 (scalar deleting destructor)
virtual MxParam *Clone(); // vtable+0x4
inline int GetType() const
{
return m_type;
}
inline MxCore *GetSender() const
{
return m_sender;
}
private:
int m_type; // 0x4
MxCore *m_sender; // 0x8
};
#endif // MXPARAM_H