Switch to Mx types

This commit is contained in:
Brendan Dougherty 2023-07-11 14:09:21 -05:00
parent 6d533f3977
commit a8f7530162
4 changed files with 16 additions and 15 deletions

View File

@ -30,13 +30,13 @@ class MxCore
return !strcmp(name, MxCore::ClassName());
}
inline int GetId()
inline MxU32 GetId()
{
return m_id;
}
private:
unsigned int m_id;
MxU32 m_id;
};

View File

@ -47,7 +47,7 @@ MxNotificationManager::~MxNotificationManager()
}
// OFFSET: LEGO1 0x100ac800
long MxNotificationManager::Tickle()
MxResult MxNotificationManager::Tickle()
{
m_sendList = new MxList<MxNotification *>();
if (m_sendList == NULL) {
@ -73,7 +73,7 @@ long MxNotificationManager::Tickle()
}
// OFFSET: LEGO1 0x100ac600
MxResult MxNotificationManager::Create(int p_unk1, int p_unk2)
MxResult MxNotificationManager::Create(MxS32 p_unk1, MxS32 p_unk2)
{
MxResult result = SUCCESS;
m_queue = new MxList<MxNotification *>();
@ -93,8 +93,8 @@ void MxNotificationManager::Register(MxCore *p_listener)
{
MxAutoLocker lock(&m_lock);
unsigned int listenerId = p_listener->GetId();
MxList<unsigned int>::iterator it = find(m_listenerIds.begin(), m_listenerIds.end(), listenerId);
MxU32 listenerId = p_listener->GetId();
MxList<MxU32>::iterator it = find(m_listenerIds.begin(), m_listenerIds.end(), listenerId);
if (it != m_listenerIds.end())
return;
@ -106,7 +106,7 @@ void MxNotificationManager::Unregister(MxCore *p_listener)
{
MxAutoLocker lock(&m_lock);
MxList<unsigned int>::iterator it = find(m_listenerIds.begin(), m_listenerIds.end(), p_listener->GetId());
MxList<MxU32>::iterator it = find(m_listenerIds.begin(), m_listenerIds.end(), p_listener->GetId());
if (it != m_listenerIds.end()) {
m_listenerIds.erase(it);
@ -129,7 +129,7 @@ MxResult MxNotificationManager::Send(MxCore *p_listener, MxParam *p_param)
return FAILURE;
}
else {
MxList<unsigned int>::iterator it = find(m_listenerIds.begin(), m_listenerIds.end(), p_listener->GetId());
MxList<MxU32>::iterator it = find(m_listenerIds.begin(), m_listenerIds.end(), p_listener->GetId());
if (it == m_listenerIds.end()) {
return FAILURE;
}

View File

@ -34,17 +34,17 @@ class MxNotificationManager : public MxCore
MxList<MxNotification *> *m_queue; // 0x8
MxList<MxNotification *> *m_sendList; // 0xc
MxCriticalSection m_lock; // 0x10
int m_unk2c; // 0x2c
MxList<unsigned int> m_listenerIds; // 0x30
MxS32 m_unk2c; // 0x2c
MxList<MxU32> m_listenerIds; // 0x30
MxBool m_active; // 0x3c
public:
MxNotificationManager();
virtual ~MxNotificationManager(); // vtable+0x0 (scalar deleting destructor)
virtual long Tickle(); // vtable+0x8
virtual MxResult Tickle(); // vtable+0x8
// TODO: Where does this method come from?
virtual MxResult Create(int p_unk1, int p_unk2); // vtable+0x14
virtual MxResult Create(MxS32 p_unk1, MxS32 p_unk2); // vtable+0x14
void Register(MxCore *p_listener);
void Unregister(MxCore *p_listener);
MxResult Send(MxCore *p_listener, MxParam *p_param);

View File

@ -2,6 +2,7 @@
#define MXPARAM_H
#include "mxomnicreateparambase.h"
#include "mxtypes.h"
class MxCore;
@ -9,12 +10,12 @@ class MxCore;
class MxParam : public MxOmniCreateParamBase
{
public:
inline MxParam(int p_type, MxCore *p_sender) : MxOmniCreateParamBase(), m_type(p_type), m_sender(p_sender){}
inline MxParam(MxS32 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
inline MxS32 GetType() const
{
return m_type;
}
@ -25,7 +26,7 @@ class MxParam : public MxOmniCreateParamBase
}
private:
int m_type; // 0x4
MxS32 m_type; // 0x4
MxCore *m_sender; // 0x8
};