Beta matching MxAtom classes (#847)

* Beta matching MxAtom classes

* Remove unused getter

* Restore operator!= for modern compilers
This commit is contained in:
MS 2024-04-25 11:43:42 -04:00 committed by GitHub
parent 31f5143741
commit 612eec6889
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 180 additions and 69 deletions

View file

@ -15,10 +15,11 @@
// for the combined key_value_pair, which doesn't seem possible with <map>. // for the combined key_value_pair, which doesn't seem possible with <map>.
// SIZE 0x14 // SIZE 0x14
class MxAtomIdCounter { class MxAtom {
public: public:
// always inlined // always inlined
MxAtomIdCounter(const char* p_str) // FUNCTION: BETA10 0x10123720
MxAtom(const char* p_str)
{ {
m_key = p_str; m_key = p_str;
m_value = 0; m_value = 0;
@ -26,23 +27,28 @@ class MxAtomIdCounter {
void Inc(); void Inc();
void Dec(); void Dec();
inline MxString* GetKey() { return &m_key; }
inline MxU16 GetValue() { return m_value; } // FUNCTION: BETA10 0x101236d0
inline MxString& GetKey() { return m_key; }
// SYNTHETIC: BETA10 0x10124a50
// MxAtom::`scalar deleting destructor'
private: private:
MxString m_key; MxString m_key;
MxU16 m_value; MxU16 m_value;
}; };
struct MxAtomIdCounterCompare { struct MxAtomCompare {
// FUNCTION: LEGO1 0x100ad120 // FUNCTION: LEGO1 0x100ad120
int operator()(MxAtomIdCounter* const& p_val0, MxAtomIdCounter* const& p_val1) const // FUNCTION: BETA10 0x10123980
int operator()(MxAtom* const& p_val0, MxAtom* const& p_val1) const
{ {
return strcmp(p_val0->GetKey()->GetData(), p_val1->GetKey()->GetData()) > 0; return strcmp(p_val0->GetKey().GetData(), p_val1->GetKey().GetData()) > 0;
} }
}; };
class MxAtomIdCounterSet : public set<MxAtomIdCounter*, MxAtomIdCounterCompare> {}; class MxAtomSet : public set<MxAtom*, MxAtomCompare> {};
enum LookupMode { enum LookupMode {
e_exact = 0, e_exact = 0,
@ -55,74 +61,160 @@ enum LookupMode {
class MxAtomId { class MxAtomId {
public: public:
MxAtomId(const char*, LookupMode); MxAtomId(const char*, LookupMode);
MxAtomId& operator=(const MxAtomId& p_atomId);
~MxAtomId(); ~MxAtomId();
MxAtomId() { this->m_internal = 0; } MxAtomId& operator=(const MxAtomId& p_atomId);
// FUNCTION: BETA10 0x100178d0
inline MxBool operator==(const MxAtomId& p_atomId) const { return this->m_internal == p_atomId.m_internal; } inline MxBool operator==(const MxAtomId& p_atomId) const { return this->m_internal == p_atomId.m_internal; }
#ifdef COMPAT_MODE
// Required for modern compilers.
// MSVC 4.20 uses a synthetic function from INCLUDE/UTILITY that inverts operator==
inline MxBool operator!=(const MxAtomId& p_atomId) const { return this->m_internal != p_atomId.m_internal; } inline MxBool operator!=(const MxAtomId& p_atomId) const { return this->m_internal != p_atomId.m_internal; }
#endif
// FUNCTION: BETA10 0x10025d40
MxAtomId() { this->m_internal = 0; }
void Clear(); void Clear();
// FUNCTION: BETA10 0x100735e0
const char* GetInternal() const { return m_internal; } const char* GetInternal() const { return m_internal; }
private: private:
MxAtomIdCounter* GetCounter(const char*, LookupMode); // FUNCTION: BETA10 0x101236f0
MxAtomId& operator=(const MxString& p_key)
{
m_internal = p_key.GetData();
return *this;
}
MxAtom* GetAtom(const char*, LookupMode);
void Destroy(); void Destroy();
const char* m_internal; // 0x00 const char* m_internal; // 0x00
}; };
// SYNTHETIC: BETA10 0x1002b520
// ??9@YAHABVMxAtomId@@0@Z
// aka MxAtomId::operator!=
// SYNTHETIC: LEGO1 0x100ad170 // SYNTHETIC: LEGO1 0x100ad170
// MxAtomIdCounter::~MxAtomIdCounter // MxAtom::~MxAtom
// clang-format off // clang-format off
// TEMPLATE: LEGO1 0x100ad480 // TEMPLATE: LEGO1 0x100ad480
// _Tree<MxAtomIdCounter *,MxAtomIdCounter *,set<MxAtomIdCounter *,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> >::_Kfn,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> >::iterator::_Dec // _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >::iterator::_Dec
// clang-format on // clang-format on
// clang-format off // clang-format off
// TEMPLATE: LEGO1 0x100ad780 // TEMPLATE: LEGO1 0x100ad780
// _Tree<MxAtomIdCounter *,MxAtomIdCounter *,set<MxAtomIdCounter *,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> >::_Kfn,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> >::_Lbound // _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >::_Lbound
// clang-format on // clang-format on
// clang-format off // clang-format off
// TEMPLATE: LEGO1 0x100ad4d0 // TEMPLATE: LEGO1 0x100ad4d0
// _Tree<MxAtomIdCounter *,MxAtomIdCounter *,set<MxAtomIdCounter *,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> >::_Kfn,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> >::_Insert // _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >::_Insert
// clang-format on // clang-format on
// TEMPLATE: BETA10 0x101237a0
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *>
// >::const_iterator::operator*
// clang-format off // clang-format off
// TEMPLATE: LEGO1 0x100af6d0 // TEMPLATE: LEGO1 0x100af6d0
// _Tree<MxAtomIdCounter *,MxAtomIdCounter *,set<MxAtomIdCounter *,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> >::_Kfn,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> >::~_Tree<MxAtomIdCounter *,MxAtomIdCounter *,set<MxAtomIdCounter *,MxAtomIdCou // TEMPLATE: BETA10 0x10131170
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >::~_Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >
// clang-format on // clang-format on
// clang-format off // clang-format off
// TEMPLATE: LEGO1 0x100af7a0 // TEMPLATE: LEGO1 0x100af7a0
// _Tree<MxAtomIdCounter *,MxAtomIdCounter *,set<MxAtomIdCounter *,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> >::_Kfn,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> >::iterator::_Inc // _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >::iterator::_Inc
// clang-format on // clang-format on
// clang-format off // clang-format off
// TEMPLATE: LEGO1 0x100af7e0 // TEMPLATE: LEGO1 0x100af7e0
// _Tree<MxAtomIdCounter *,MxAtomIdCounter *,set<MxAtomIdCounter *,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> >::_Kfn,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> >::erase // TEMPLATE: BETA10 0x10131210
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >::erase
// clang-format on // clang-format on
// TEMPLATE: BETA10 0x10131460
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *>
// >::size
// clang-format off // clang-format off
// TEMPLATE: LEGO1 0x100afc40 // TEMPLATE: LEGO1 0x100afc40
// _Tree<MxAtomIdCounter *,MxAtomIdCounter *,set<MxAtomIdCounter *,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> >::_Kfn,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> >::_Erase // _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >::_Erase
// clang-format on // clang-format on
// clang-format off // clang-format off
// TEMPLATE: LEGO1 0x100afc80 // TEMPLATE: LEGO1 0x100afc80
// set<MxAtomIdCounter *,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> >::~set<MxAtomIdCounter *,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> > // TEMPLATE: BETA10 0x10132080
// set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::~set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >
// clang-format on // clang-format on
// TEMPLATE: LEGO1 0x100afe40 // TEMPLATE: LEGO1 0x100afe40
// Set<MxAtomIdCounter *,MxAtomIdCounterCompare>::~Set<MxAtomIdCounter *,MxAtomIdCounterCompare> // TEMPLATE: BETA10 0x101320e0
// Set<MxAtom *,MxAtomCompare>::~Set<MxAtom *,MxAtomCompare>
// TEMPLATE: BETA10 0x10132140
// set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::begin
// clang-format off // clang-format off
// GLOBAL: LEGO1 0x101013f0 // GLOBAL: LEGO1 0x101013f0
// _Tree<MxAtomIdCounter *,MxAtomIdCounter *,set<MxAtomIdCounter *,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> >::_Kfn,MxAtomIdCounterCompare,allocator<MxAtomIdCounter *> >::_Nil // GLOBAL: BETA10 0x10201264
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >::_Nil
// clang-format on // clang-format on
// TEMPLATE: BETA10 0x10132170
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *>
// >::begin
// TEMPLATE: BETA10 0x101321d0
// set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::size
// TEMPLATE: BETA10 0x101321f0
// set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::erase
// TEMPLATE: BETA10 0x101237f0
// set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::end
// TEMPLATE: BETA10 0x101238b0
// set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::find
// clang-format off
// TEMPLATE: BETA10 0x101238e0
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >::find
// clang-format on
// SYNTHETIC: BETA10 0x10123bf0
// MxAtom::~MxAtom
// TEMPLATE: BETA10 0x10123c50
// set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::insert
// SYNTHETIC: BETA10 0x10130fc0
// MxAtomSet::MxAtomSet
// TEMPLATE: BETA10 0x10131030
// Set<MxAtom *,MxAtomCompare>::Set<MxAtom *,MxAtomCompare>
// clang-format off
// TEMPLATE: BETA10 0x101310a0
// set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >
// TEMPLATE: BETA10 0x10131120
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >::_Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >
// TEMPLATE: BETA10 0x10131f30
// _Tree<MxAtom *,MxAtom *,set<MxAtom *,MxAtomCompare,allocator<MxAtom *> >::_Kfn,MxAtomCompare,allocator<MxAtom *> >::_Init
// clang-format on
// SYNTHETIC: BETA10 0x101322a0
// MxAtomSet::`scalar deleting destructor'
// SYNTHETIC: BETA10 0x101322e0
// MxAtomSet::~MxAtomSet
#endif // MXATOM_H #endif // MXATOM_H

View file

@ -3,7 +3,7 @@
#include "mxtypes.h" #include "mxtypes.h"
class MxAtomIdCounterSet; class MxAtomSet;
class MxDSAction; class MxDSAction;
class MxEventManager; class MxEventManager;
class MxMusicManager; class MxMusicManager;
@ -26,7 +26,7 @@ MxEventManager* EventManager();
MxResult Start(MxDSAction*); MxResult Start(MxDSAction*);
MxNotificationManager* NotificationManager(); MxNotificationManager* NotificationManager();
MxVideoManager* MVideoManager(); MxVideoManager* MVideoManager();
MxAtomIdCounterSet* AtomIdCounterSet(); MxAtomSet* AtomSet();
MxObjectFactory* ObjectFactory(); MxObjectFactory* ObjectFactory();
void DeleteObject(MxDSAction& p_dsAction); void DeleteObject(MxDSAction& p_dsAction);

View file

@ -5,7 +5,7 @@
#include "mxcriticalsection.h" #include "mxcriticalsection.h"
#include "mxstring.h" #include "mxstring.h"
class MxAtomIdCounterSet; class MxAtomSet;
class MxDSAction; class MxDSAction;
class MxEntity; class MxEntity;
class MxEventManager; class MxEventManager;
@ -69,7 +69,7 @@ class MxOmni : public MxCore {
MxVariableTable* GetVariableTable() const { return this->m_variableTable; } MxVariableTable* GetVariableTable() const { return this->m_variableTable; }
MxMusicManager* GetMusicManager() const { return this->m_musicManager; } MxMusicManager* GetMusicManager() const { return this->m_musicManager; }
MxEventManager* GetEventManager() const { return this->m_eventManager; } MxEventManager* GetEventManager() const { return this->m_eventManager; }
MxAtomIdCounterSet* GetAtomIdCounterSet() const { return this->m_atomIdCounterSet; } MxAtomSet* GetAtomSet() const { return this->m_atomSet; }
MxLong HandleEndAction(MxParam& p_param); MxLong HandleEndAction(MxParam& p_param);
// SYNTHETIC: LEGO1 0x100aefd0 // SYNTHETIC: LEGO1 0x100aefd0
@ -90,7 +90,7 @@ class MxOmni : public MxCore {
MxEventManager* m_eventManager; // 0x38 MxEventManager* m_eventManager; // 0x38
MxTimer* m_timer; // 0x3c MxTimer* m_timer; // 0x3c
MxStreamer* m_streamer; // 0x40 MxStreamer* m_streamer; // 0x40
MxAtomIdCounterSet* m_atomIdCounterSet; // 0x44 MxAtomSet* m_atomSet; // 0x44
MxCriticalSection m_criticalSection; // 0x48 MxCriticalSection m_criticalSection; // 0x48
MxBool m_timerRunning; // 0x64 MxBool m_timerRunning; // 0x64
}; };

View file

@ -4,33 +4,38 @@
#include "mxmisc.h" #include "mxmisc.h"
#include "mxomni.h" #include "mxomni.h"
#include <assert.h>
DECOMP_SIZE_ASSERT(MxAtomId, 0x04); DECOMP_SIZE_ASSERT(MxAtomId, 0x04);
DECOMP_SIZE_ASSERT(MxAtomIdCounter, 0x14); DECOMP_SIZE_ASSERT(MxAtom, 0x14);
DECOMP_SIZE_ASSERT(MxAtomIdCounterSet, 0x10); DECOMP_SIZE_ASSERT(MxAtomSet, 0x10);
// FUNCTION: LEGO1 0x100acf90 // FUNCTION: LEGO1 0x100acf90
// FUNCTION: BETA10 0x1012308b
MxAtomId::MxAtomId(const char* p_str, LookupMode p_mode) MxAtomId::MxAtomId(const char* p_str, LookupMode p_mode)
{ {
if (!MxOmni::GetInstance()) { if (!MxOmni::GetInstance()) {
return; return;
} }
if (!AtomIdCounterSet()) { if (!AtomSet()) {
return; return;
} }
MxAtomIdCounter* counter = GetCounter(p_str, p_mode); MxAtom* atom = GetAtom(p_str, p_mode);
m_internal = counter->GetKey()->GetData(); *this = atom->GetKey();
counter->Inc(); atom->Inc();
} }
// FUNCTION: LEGO1 0x100acfd0 // FUNCTION: LEGO1 0x100acfd0
// FUNCTION: BETA10 0x10123130
MxAtomId::~MxAtomId() MxAtomId::~MxAtomId()
{ {
Destroy(); Destroy();
} }
// FUNCTION: LEGO1 0x100acfe0 // FUNCTION: LEGO1 0x100acfe0
// FUNCTION: BETA10 0x101231a6
void MxAtomId::Destroy() void MxAtomId::Destroy()
{ {
if (!m_internal) { if (!m_internal) {
@ -41,34 +46,36 @@ void MxAtomId::Destroy()
return; return;
} }
if (!AtomIdCounterSet()) { if (!AtomSet()) {
return; return;
} }
#ifdef COMPAT_MODE #ifdef COMPAT_MODE
MxAtomIdCounterSet::iterator it; MxAtomSet::iterator it;
{ {
MxAtomIdCounter idCounter(m_internal); MxAtom idAtom(m_internal);
it = AtomIdCounterSet()->find(&idCounter); it = AtomSet()->find(&idAtom);
} }
#else #else
MxAtomIdCounterSet::iterator it = AtomIdCounterSet()->find(&MxAtomIdCounter(m_internal)); MxAtomSet::iterator it = AtomSet()->find(&MxAtom(m_internal));
#endif #endif
assert(it != AtomSet()->end());
MxAtomIdCounter* counter = (MxAtomIdCounter*) (*it); MxAtom* atom = (MxAtom*) (*it);
counter->Dec(); atom->Dec();
} }
// FUNCTION: LEGO1 0x100ad1c0 // FUNCTION: LEGO1 0x100ad1c0
// FUNCTION: BETA10 0x101232b9
MxAtomId& MxAtomId::operator=(const MxAtomId& p_atomId) MxAtomId& MxAtomId::operator=(const MxAtomId& p_atomId)
{ {
if (m_internal) { if (m_internal) {
Destroy(); Destroy();
} }
if (p_atomId.m_internal && MxOmni::GetInstance() && AtomIdCounterSet()) { if (p_atomId.m_internal && MxOmni::GetInstance() && AtomSet()) {
MxAtomIdCounter* counter = GetCounter(p_atomId.m_internal, e_exact); MxAtom* atom = GetAtom(p_atomId.m_internal, e_exact);
counter->Inc(); atom->Inc();
} }
m_internal = p_atomId.m_internal; m_internal = p_atomId.m_internal;
@ -77,36 +84,41 @@ MxAtomId& MxAtomId::operator=(const MxAtomId& p_atomId)
} }
// FUNCTION: LEGO1 0x100ad210 // FUNCTION: LEGO1 0x100ad210
MxAtomIdCounter* MxAtomId::GetCounter(const char* p_str, LookupMode p_mode) // FUNCTION: BETA10 0x10123378
MxAtom* MxAtomId::GetAtom(const char* p_str, LookupMode p_mode)
{ {
MxAtomId unused; MxAtomId unused;
MxAtomIdCounter* counter = new MxAtomIdCounter(p_str); MxAtom* atom = new MxAtom(p_str);
assert(atom);
switch (p_mode) { switch (p_mode) {
case e_lowerCase: case e_exact:
case e_lowerCase2:
counter->GetKey()->ToLowerCase();
break; break;
case e_upperCase: case e_upperCase:
counter->GetKey()->ToUpperCase(); atom->GetKey().ToUpperCase();
break;
case e_lowerCase:
case e_lowerCase2:
atom->GetKey().ToLowerCase();
break; break;
} }
MxAtomIdCounterSet::iterator it = AtomIdCounterSet()->find(counter); MxAtomSet::iterator it = AtomSet()->find(atom);
if (it != AtomIdCounterSet()->end()) { if (it != AtomSet()->end()) {
// Counter already in the set. Delete temp value and return it. // Atom already in the set. Delete temp value and return it.
delete counter; delete atom;
counter = *it; atom = *it;
} }
else { else {
// Counter is not in the set. Add it. // Atom is not in the set. Add it.
AtomIdCounterSet()->insert(counter); AtomSet()->insert(atom);
} }
return counter; return atom;
} }
// FUNCTION: LEGO1 0x100ad7e0 // FUNCTION: LEGO1 0x100ad7e0
// FUNCTION: BETA10 0x100553e0
void MxAtomId::Clear() void MxAtomId::Clear()
{ {
// Reset but do not delete MxAtomId object. // Reset but do not delete MxAtomId object.
@ -115,13 +127,15 @@ void MxAtomId::Clear()
} }
// FUNCTION: LEGO1 0x100ad7f0 // FUNCTION: LEGO1 0x100ad7f0
void MxAtomIdCounter::Inc() // FUNCTION: BETA10 0x101235d5
void MxAtom::Inc()
{ {
m_value++; m_value++;
} }
// FUNCTION: LEGO1 0x100ad800 // FUNCTION: LEGO1 0x100ad800
void MxAtomIdCounter::Dec() // FUNCTION: BETA10 0x1012364a
void MxAtom::Dec()
{ {
if (m_value) { if (m_value) {
m_value--; m_value--;

View file

@ -2,6 +2,8 @@
#include "mxomni.h" #include "mxomni.h"
#include <assert.h>
// FUNCTION: LEGO1 0x100acea0 // FUNCTION: LEGO1 0x100acea0
MxObjectFactory* ObjectFactory() MxObjectFactory* ObjectFactory()
{ {
@ -27,9 +29,11 @@ MxTimer* Timer()
} }
// FUNCTION: LEGO1 0x100acee0 // FUNCTION: LEGO1 0x100acee0
MxAtomIdCounterSet* AtomIdCounterSet() // FUNCTION: BETA10 0x10124e4c
MxAtomSet* AtomSet()
{ {
return MxOmni::GetInstance()->GetAtomIdCounterSet(); assert(MxOmni::GetInstance());
return MxOmni::GetInstance()->GetAtomSet();
} }
// FUNCTION: LEGO1 0x100acef0 // FUNCTION: LEGO1 0x100acef0

View file

@ -66,7 +66,7 @@ void MxOmni::Init()
m_eventManager = NULL; m_eventManager = NULL;
m_timer = NULL; m_timer = NULL;
m_streamer = NULL; m_streamer = NULL;
m_atomIdCounterSet = NULL; m_atomSet = NULL;
m_timerRunning = FALSE; m_timerRunning = FALSE;
} }
@ -82,7 +82,7 @@ MxResult MxOmni::Create(MxOmniCreateParam& p_param)
{ {
MxResult result = FAILURE; MxResult result = FAILURE;
if (!(m_atomIdCounterSet = new MxAtomIdCounterSet())) { if (!(m_atomSet = new MxAtomSet())) {
goto done; goto done;
} }
@ -177,6 +177,7 @@ MxResult MxOmni::Create(MxOmniCreateParam& p_param)
} }
// FUNCTION: LEGO1 0x100afe90 // FUNCTION: LEGO1 0x100afe90
// FUNCTION: BETA10 0x1012fe5b
void MxOmni::Destroy() void MxOmni::Destroy()
{ {
{ {
@ -210,15 +211,15 @@ void MxOmni::Destroy()
delete m_tickleManager; delete m_tickleManager;
// There could be a tree/iterator function that does this inline // There could be a tree/iterator function that does this inline
if (m_atomIdCounterSet) { if (m_atomSet) {
while (!m_atomIdCounterSet->empty()) { while (m_atomSet->size() != 0) {
// Pop each node and delete its value // Pop each node and delete its value
MxAtomIdCounterSet::iterator begin = m_atomIdCounterSet->begin(); MxAtomSet::iterator begin = m_atomSet->begin();
MxAtomIdCounter* value = *begin; MxAtom* value = *begin;
m_atomIdCounterSet->erase(begin); m_atomSet->erase(begin);
delete value; delete value;
} }
delete m_atomIdCounterSet; delete m_atomSet;
} }
Init(); Init();
} }