Refactor files based on beta debug build (#645)

* Rename LegoUnkSaveDataWriter -> LegoCharacterManager

* Refactor mxomni into mxomni/mxmisc

* Refactor legoomni into legoomni/misc

* Resolve deps

* Refactor atom

* Refactor mxutil

* Refactor mxio

* Rename/relocate files

* Fix format
This commit is contained in:
Christian Semmler
2024-03-09 15:07:52 -05:00
committed by GitHub
parent c62469fef4
commit 8069923651
150 changed files with 734 additions and 609 deletions

View File

@@ -1,8 +1,9 @@
#ifndef MXATOMIDCOUNTER_H
#define MXATOMIDCOUNTER_H
#ifndef MXATOM_H
#define MXATOM_H
#include "mxstl/stlcompat.h"
#include "mxstring.h"
#include "mxtypes.h"
// Counts the number of existing MxAtomId objects based
// on the matching char* string. A <map> seems fit for purpose here:
@@ -43,6 +44,36 @@ struct 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
// MxAtomIdCounter::~MxAtomIdCounter
@@ -89,4 +120,4 @@ class MxAtomIdCounterSet : public set<MxAtomIdCounter*, MxAtomIdCounterCompare>
// TEMPLATE: LEGO1 0x100afe40
// Set<MxAtomIdCounter *,MxAtomIdCounterCompare>::~Set<MxAtomIdCounter *,MxAtomIdCounterCompare>
#endif // MXATOMIDCOUNTER_H
#endif // MXATOM_H

View File

@@ -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

View File

@@ -82,7 +82,7 @@ public:
// https://learn.microsoft.com/en-us/windows/win32/medfound/image-stride
inline MxLong AlignToFourByte(MxLong p_value) const { return (p_value + 3) & -4; }
// Same as the one from legoutil.h, but flipped the other way
// Same as the one from legoutils.h, but flipped the other way
// TODO: While it's not outside the realm of possibility that they
// reimplemented Abs for only this file, that seems odd, right?
inline MxLong AbsFlipped(MxLong p_value) const { return p_value > 0 ? p_value : -p_value; }

View File

@@ -2,7 +2,7 @@
#define MXDSFILE_H
#include "mxdssource.h"
#include "mxioinfo.h"
#include "mxio.h"
#include "mxstring.h"
#include "mxtypes.h"

View File

@@ -2,7 +2,7 @@
#define MXDSOBJECT_H
#include "decomp.h"
#include "mxatomid.h"
#include "mxatom.h"
#include "mxcore.h"
class MxPresenter;

View File

@@ -2,7 +2,7 @@
#define MXENTITY_H
#include "decomp.h"
#include "mxatomid.h"
#include "mxatom.h"
#include "mxcore.h"
#include "mxdsaction.h"
#include "mxtypes.h"

View File

@@ -1,5 +1,5 @@
#ifndef MXIOINFO_H
#define MXIOINFO_H
#ifndef MXIO_H
#define MXIO_H
#include "mxtypes.h"
@@ -29,4 +29,4 @@ public:
MMIOINFO m_info;
};
#endif // MXIOINFO_H
#endif // MXIO_H

View File

@@ -0,0 +1,33 @@
#ifndef MXMISC_H
#define MXMISC_H
#include "mxtypes.h"
class MxAtomIdCounterSet;
class MxDSAction;
class MxEventManager;
class MxMusicManager;
class MxNotificationManager;
class MxObjectFactory;
class MxSoundManager;
class MxStreamer;
class MxTickleManager;
class MxTimer;
class MxVariableTable;
class MxVideoManager;
MxTickleManager* TickleManager();
MxTimer* Timer();
MxStreamer* Streamer();
MxSoundManager* MSoundManager();
MxVariableTable* VariableTable();
MxMusicManager* MusicManager();
MxEventManager* EventManager();
MxResult Start(MxDSAction*);
MxNotificationManager* NotificationManager();
MxVideoManager* MVideoManager();
MxAtomIdCounterSet* AtomIdCounterSet();
MxObjectFactory* ObjectFactory();
void DeleteObject(MxDSAction& p_dsAction);
#endif // MXMISC_H

View File

@@ -1,7 +1,7 @@
#ifndef MXOBJECTFACTORY_H
#define MXOBJECTFACTORY_H
#include "mxatomid.h"
#include "mxatom.h"
#include "mxcore.h"
#define FOR_MXOBJECTFACTORY_OBJECTS(X) \

View File

@@ -5,9 +5,9 @@
#include "mxcriticalsection.h"
#include "mxstring.h"
class MxAtomId;
class MxAtomIdCounterSet;
class MxDSAction;
class MxEntity;
class MxEventManager;
class MxMusicManager;
class MxNotificationManager;
@@ -17,12 +17,11 @@ class MxOmniCreateParam;
class MxPresenter;
class MxSoundManager;
class MxStreamer;
class MxStreamController;
class MxTickleManager;
class MxTimer;
class MxVariableTable;
class MxVideoManager;
class MxEntity;
class MxStreamController;
// VTABLE: LEGO1 0x100dc168
// SIZE 0x68
@@ -96,19 +95,4 @@ protected:
MxBool m_timerRunning; // 0x64
};
MxTickleManager* TickleManager();
MxTimer* Timer();
MxStreamer* Streamer();
MxSoundManager* MSoundManager();
MxVariableTable* VariableTable();
MxMusicManager* MusicManager();
MxEventManager* EventManager();
MxResult Start(MxDSAction*);
MxNotificationManager* NotificationManager();
MxVideoManager* MVideoManager();
MxAtomIdCounterSet* AtomIdCounterSet();
MxObjectFactory* ObjectFactory();
void DeleteObject(MxDSAction& p_dsAction);
#endif // MXOMNI_H

View File

@@ -5,7 +5,6 @@
#include "mxcore.h"
#include "mxcriticalsection.h"
#include "mxdsaction.h"
#include "mxomni.h"
#include "mxpoint32.h"
class MxCompositePresenter;

View File

@@ -2,7 +2,7 @@
#define MXSOUNDMANAGER_H
#include "decomp.h"
#include "mxatomid.h"
#include "mxatom.h"
#include "mxaudiomanager.h"
#include <dsound.h>

View File

@@ -2,7 +2,6 @@
#define MXSOUNDPRESENTER_H
#include "mxaudiopresenter.h"
#include "mxomni.h"
// VTABLE: LEGO1 0x100d4b08
// SIZE 0x54

View File

@@ -2,7 +2,7 @@
#define MXSTREAMCONTROLLER_H
#include "decomp.h"
#include "mxatomid.h"
#include "mxatom.h"
#include "mxcore.h"
#include "mxcriticalsection.h"
#include "mxdsaction.h"

View File

@@ -1,5 +1,5 @@
#ifndef MXUTIL_H
#define MXUTIL_H
#ifndef MXUTILITIES_H
#define MXUTILITIES_H
#include "mxtypes.h"
@@ -77,7 +77,6 @@ void SetOmniUserMessage(void (*p_omniUserMessage)(const char*, MxS32));
MxBool ContainsPresenter(MxCompositePresenterList& p_presenterList, MxPresenter* p_presenter);
void FUN_100b7220(MxDSAction* p_action, MxU32 p_newFlags, MxBool p_setFlags);
MxDSObject* CreateStreamObject(MxDSFile*, MxS16);
MxBool KeyValueStringParse(char*, const char*, const char*);
#endif // MXUTIL_H
#endif // MXUTILITIES_H