mirror of
https://github.com/isledecomp/isle.git
synced 2026-01-28 10:41:15 +00:00
Refactor atom
This commit is contained in:
parent
d7568f897d
commit
6b1e74137f
@ -211,8 +211,7 @@ add_library(omni STATIC
|
|||||||
LEGO1/omni/src/audio/mxsoundmanager.cpp
|
LEGO1/omni/src/audio/mxsoundmanager.cpp
|
||||||
LEGO1/omni/src/audio/mxsoundpresenter.cpp
|
LEGO1/omni/src/audio/mxsoundpresenter.cpp
|
||||||
LEGO1/omni/src/audio/mxwavepresenter.cpp
|
LEGO1/omni/src/audio/mxwavepresenter.cpp
|
||||||
LEGO1/omni/src/common/mxatomidcounter.cpp
|
LEGO1/omni/src/common/mxatom.cpp
|
||||||
LEGO1/omni/src/common/mxatomid.cpp
|
|
||||||
LEGO1/omni/src/common/mxcompositepresenter.cpp
|
LEGO1/omni/src/common/mxcompositepresenter.cpp
|
||||||
LEGO1/omni/src/common/mxcore.cpp
|
LEGO1/omni/src/common/mxcore.cpp
|
||||||
LEGO1/omni/src/common/mxmediamanager.cpp
|
LEGO1/omni/src/common/mxmediamanager.cpp
|
||||||
|
|||||||
@ -1,8 +1,9 @@
|
|||||||
#ifndef MXATOMIDCOUNTER_H
|
#ifndef MXATOM_H
|
||||||
#define MXATOMIDCOUNTER_H
|
#define MXATOM_H
|
||||||
|
|
||||||
#include "mxstl/stlcompat.h"
|
#include "mxstl/stlcompat.h"
|
||||||
#include "mxstring.h"
|
#include "mxstring.h"
|
||||||
|
#include "mxtypes.h"
|
||||||
|
|
||||||
// Counts the number of existing MxAtomId objects based
|
// Counts the number of existing MxAtomId objects based
|
||||||
// on the matching char* string. A <map> seems fit for purpose here:
|
// on the matching char* string. A <map> seems fit for purpose here:
|
||||||
@ -43,6 +44,36 @@ struct MxAtomIdCounterCompare {
|
|||||||
|
|
||||||
class MxAtomIdCounterSet : public set<MxAtomIdCounter*, MxAtomIdCounterCompare> {};
|
class MxAtomIdCounterSet : public set<MxAtomIdCounter*, MxAtomIdCounterCompare> {};
|
||||||
|
|
||||||
|
enum LookupMode {
|
||||||
|
e_exact = 0,
|
||||||
|
e_lowerCase,
|
||||||
|
e_upperCase,
|
||||||
|
e_lowerCase2,
|
||||||
|
};
|
||||||
|
|
||||||
|
// SIZE 0x04
|
||||||
|
class MxAtomId {
|
||||||
|
public:
|
||||||
|
MxAtomId(const char*, LookupMode);
|
||||||
|
MxAtomId& operator=(const MxAtomId& p_atomId);
|
||||||
|
~MxAtomId();
|
||||||
|
|
||||||
|
MxAtomId() { this->m_internal = 0; }
|
||||||
|
|
||||||
|
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; }
|
||||||
|
|
||||||
|
void Clear();
|
||||||
|
|
||||||
|
const char* GetInternal() const { return m_internal; }
|
||||||
|
|
||||||
|
private:
|
||||||
|
MxAtomIdCounter* GetCounter(const char*, LookupMode);
|
||||||
|
void Destroy();
|
||||||
|
|
||||||
|
const char* m_internal; // 0x00
|
||||||
|
};
|
||||||
|
|
||||||
// SYNTHETIC: LEGO1 0x100ad170
|
// SYNTHETIC: LEGO1 0x100ad170
|
||||||
// MxAtomIdCounter::~MxAtomIdCounter
|
// MxAtomIdCounter::~MxAtomIdCounter
|
||||||
|
|
||||||
@ -89,4 +120,4 @@ class MxAtomIdCounterSet : public set<MxAtomIdCounter*, MxAtomIdCounterCompare>
|
|||||||
// TEMPLATE: LEGO1 0x100afe40
|
// TEMPLATE: LEGO1 0x100afe40
|
||||||
// Set<MxAtomIdCounter *,MxAtomIdCounterCompare>::~Set<MxAtomIdCounter *,MxAtomIdCounterCompare>
|
// Set<MxAtomIdCounter *,MxAtomIdCounterCompare>::~Set<MxAtomIdCounter *,MxAtomIdCounterCompare>
|
||||||
|
|
||||||
#endif // MXATOMIDCOUNTER_H
|
#endif // MXATOM_H
|
||||||
@ -1,37 +0,0 @@
|
|||||||
#ifndef MXATOMID_H
|
|
||||||
#define MXATOMID_H
|
|
||||||
|
|
||||||
#include "mxatomidcounter.h"
|
|
||||||
#include "mxtypes.h"
|
|
||||||
|
|
||||||
enum LookupMode {
|
|
||||||
e_exact = 0,
|
|
||||||
e_lowerCase,
|
|
||||||
e_upperCase,
|
|
||||||
e_lowerCase2,
|
|
||||||
};
|
|
||||||
|
|
||||||
// SIZE 0x04
|
|
||||||
class MxAtomId {
|
|
||||||
public:
|
|
||||||
MxAtomId(const char*, LookupMode);
|
|
||||||
MxAtomId& operator=(const MxAtomId& p_atomId);
|
|
||||||
~MxAtomId();
|
|
||||||
|
|
||||||
MxAtomId() { this->m_internal = 0; }
|
|
||||||
|
|
||||||
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; }
|
|
||||||
|
|
||||||
void Clear();
|
|
||||||
|
|
||||||
const char* GetInternal() const { return m_internal; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
MxAtomIdCounter* GetCounter(const char*, LookupMode);
|
|
||||||
void Destroy();
|
|
||||||
|
|
||||||
const char* m_internal; // 0x00
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif // MXATOMID_H
|
|
||||||
@ -2,7 +2,7 @@
|
|||||||
#define MXDSOBJECT_H
|
#define MXDSOBJECT_H
|
||||||
|
|
||||||
#include "decomp.h"
|
#include "decomp.h"
|
||||||
#include "mxatomid.h"
|
#include "mxatom.h"
|
||||||
#include "mxcore.h"
|
#include "mxcore.h"
|
||||||
|
|
||||||
class MxPresenter;
|
class MxPresenter;
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
#define MXENTITY_H
|
#define MXENTITY_H
|
||||||
|
|
||||||
#include "decomp.h"
|
#include "decomp.h"
|
||||||
#include "mxatomid.h"
|
#include "mxatom.h"
|
||||||
#include "mxcore.h"
|
#include "mxcore.h"
|
||||||
#include "mxdsaction.h"
|
#include "mxdsaction.h"
|
||||||
#include "mxtypes.h"
|
#include "mxtypes.h"
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
#ifndef MXOBJECTFACTORY_H
|
#ifndef MXOBJECTFACTORY_H
|
||||||
#define MXOBJECTFACTORY_H
|
#define MXOBJECTFACTORY_H
|
||||||
|
|
||||||
#include "mxatomid.h"
|
#include "mxatom.h"
|
||||||
#include "mxcore.h"
|
#include "mxcore.h"
|
||||||
|
|
||||||
#define FOR_MXOBJECTFACTORY_OBJECTS(X) \
|
#define FOR_MXOBJECTFACTORY_OBJECTS(X) \
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
#define MXSOUNDMANAGER_H
|
#define MXSOUNDMANAGER_H
|
||||||
|
|
||||||
#include "decomp.h"
|
#include "decomp.h"
|
||||||
#include "mxatomid.h"
|
#include "mxatom.h"
|
||||||
#include "mxaudiomanager.h"
|
#include "mxaudiomanager.h"
|
||||||
|
|
||||||
#include <dsound.h>
|
#include <dsound.h>
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
#define MXSTREAMCONTROLLER_H
|
#define MXSTREAMCONTROLLER_H
|
||||||
|
|
||||||
#include "decomp.h"
|
#include "decomp.h"
|
||||||
#include "mxatomid.h"
|
#include "mxatom.h"
|
||||||
#include "mxcore.h"
|
#include "mxcore.h"
|
||||||
#include "mxcriticalsection.h"
|
#include "mxcriticalsection.h"
|
||||||
#include "mxdsaction.h"
|
#include "mxdsaction.h"
|
||||||
|
|||||||
@ -1,8 +1,13 @@
|
|||||||
#include "mxatomid.h"
|
#include "mxatom.h"
|
||||||
|
|
||||||
|
#include "decomp.h"
|
||||||
#include "mxmisc.h"
|
#include "mxmisc.h"
|
||||||
#include "mxomni.h"
|
#include "mxomni.h"
|
||||||
|
|
||||||
|
DECOMP_SIZE_ASSERT(MxAtomId, 0x04);
|
||||||
|
DECOMP_SIZE_ASSERT(MxAtomIdCounter, 0x14);
|
||||||
|
DECOMP_SIZE_ASSERT(MxAtomIdCounterSet, 0x10);
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100acf90
|
// FUNCTION: LEGO1 0x100acf90
|
||||||
MxAtomId::MxAtomId(const char* p_str, LookupMode p_mode)
|
MxAtomId::MxAtomId(const char* p_str, LookupMode p_mode)
|
||||||
{
|
{
|
||||||
@ -108,3 +113,17 @@ void MxAtomId::Clear()
|
|||||||
Destroy();
|
Destroy();
|
||||||
m_internal = NULL;
|
m_internal = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// FUNCTION: LEGO1 0x100ad7f0
|
||||||
|
void MxAtomIdCounter::Inc()
|
||||||
|
{
|
||||||
|
m_value++;
|
||||||
|
}
|
||||||
|
|
||||||
|
// FUNCTION: LEGO1 0x100ad800
|
||||||
|
void MxAtomIdCounter::Dec()
|
||||||
|
{
|
||||||
|
if (m_value) {
|
||||||
|
m_value--;
|
||||||
|
}
|
||||||
|
}
|
||||||
@ -1,20 +0,0 @@
|
|||||||
#include "mxatomidcounter.h"
|
|
||||||
|
|
||||||
#include "decomp.h"
|
|
||||||
|
|
||||||
DECOMP_SIZE_ASSERT(MxAtomIdCounter, 0x14);
|
|
||||||
DECOMP_SIZE_ASSERT(MxAtomIdCounterSet, 0x10);
|
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100ad7f0
|
|
||||||
void MxAtomIdCounter::Inc()
|
|
||||||
{
|
|
||||||
m_value++;
|
|
||||||
}
|
|
||||||
|
|
||||||
// FUNCTION: LEGO1 0x100ad800
|
|
||||||
void MxAtomIdCounter::Dec()
|
|
||||||
{
|
|
||||||
if (m_value) {
|
|
||||||
m_value--;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -1,7 +1,7 @@
|
|||||||
#include "mxomni.h"
|
#include "mxomni.h"
|
||||||
|
|
||||||
#include "mxactionnotificationparam.h"
|
#include "mxactionnotificationparam.h"
|
||||||
#include "mxatomidcounter.h"
|
#include "mxatom.h"
|
||||||
#include "mxautolocker.h"
|
#include "mxautolocker.h"
|
||||||
#include "mxdsmultiaction.h"
|
#include "mxdsmultiaction.h"
|
||||||
#include "mxeventmanager.h"
|
#include "mxeventmanager.h"
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user