From a8f75301623a05ae0f0828b8dc53957f09faa466 Mon Sep 17 00:00:00 2001 From: Brendan Dougherty Date: Tue, 11 Jul 2023 14:09:21 -0500 Subject: [PATCH] Switch to Mx types --- LEGO1/mxcore.h | 4 ++-- LEGO1/mxnotificationmanager.cpp | 12 ++++++------ LEGO1/mxnotificationmanager.h | 8 ++++---- LEGO1/mxparam.h | 7 ++++--- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/LEGO1/mxcore.h b/LEGO1/mxcore.h index caf8b17b..63004a63 100644 --- a/LEGO1/mxcore.h +++ b/LEGO1/mxcore.h @@ -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; }; diff --git a/LEGO1/mxnotificationmanager.cpp b/LEGO1/mxnotificationmanager.cpp index 5eae8d27..53c837c7 100644 --- a/LEGO1/mxnotificationmanager.cpp +++ b/LEGO1/mxnotificationmanager.cpp @@ -47,7 +47,7 @@ MxNotificationManager::~MxNotificationManager() } // OFFSET: LEGO1 0x100ac800 -long MxNotificationManager::Tickle() +MxResult MxNotificationManager::Tickle() { m_sendList = new MxList(); 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(); @@ -93,8 +93,8 @@ void MxNotificationManager::Register(MxCore *p_listener) { MxAutoLocker lock(&m_lock); - unsigned int listenerId = p_listener->GetId(); - MxList::iterator it = find(m_listenerIds.begin(), m_listenerIds.end(), listenerId); + MxU32 listenerId = p_listener->GetId(); + MxList::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::iterator it = find(m_listenerIds.begin(), m_listenerIds.end(), p_listener->GetId()); + MxList::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::iterator it = find(m_listenerIds.begin(), m_listenerIds.end(), p_listener->GetId()); + MxList::iterator it = find(m_listenerIds.begin(), m_listenerIds.end(), p_listener->GetId()); if (it == m_listenerIds.end()) { return FAILURE; } diff --git a/LEGO1/mxnotificationmanager.h b/LEGO1/mxnotificationmanager.h index e63a17bb..191b7ffd 100644 --- a/LEGO1/mxnotificationmanager.h +++ b/LEGO1/mxnotificationmanager.h @@ -34,17 +34,17 @@ class MxNotificationManager : public MxCore MxList *m_queue; // 0x8 MxList *m_sendList; // 0xc MxCriticalSection m_lock; // 0x10 - int m_unk2c; // 0x2c - MxList m_listenerIds; // 0x30 + MxS32 m_unk2c; // 0x2c + MxList 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); diff --git a/LEGO1/mxparam.h b/LEGO1/mxparam.h index c8948397..c4150ff7 100644 --- a/LEGO1/mxparam.h +++ b/LEGO1/mxparam.h @@ -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 };