2024-03-09 15:07:52 -05:00
|
|
|
#ifndef LEGOCHARACTERMANAGER_H
|
|
|
|
#define LEGOCHARACTERMANAGER_H
|
2023-10-12 12:18:24 -04:00
|
|
|
|
|
|
|
#include "decomp.h"
|
2024-03-23 10:09:20 -04:00
|
|
|
#include "legoextraactor.h"
|
2024-02-21 15:30:02 -05:00
|
|
|
#include "legovariables.h"
|
2024-02-23 10:06:16 -05:00
|
|
|
#include "misc/legostorage.h"
|
2024-02-21 15:30:02 -05:00
|
|
|
#include "mxstl/stlcompat.h"
|
2023-10-24 19:38:27 -04:00
|
|
|
#include "mxtypes.h"
|
2023-10-12 12:18:24 -04:00
|
|
|
|
2024-03-19 14:23:34 -04:00
|
|
|
class LegoActor;
|
2024-01-16 14:33:03 -05:00
|
|
|
class LegoROI;
|
2023-10-12 12:18:24 -04:00
|
|
|
|
2024-02-21 15:30:02 -05:00
|
|
|
#pragma warning(disable : 4237)
|
|
|
|
|
2024-03-19 14:23:34 -04:00
|
|
|
struct LegoCharacterComparator {
|
|
|
|
MxBool operator()(const char* const& p_a, const char* const& p_b) const { return strcmpi(p_a, p_b) < 0; }
|
2024-02-21 15:30:02 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
// SIZE 0x08
|
2024-03-19 14:23:34 -04:00
|
|
|
struct LegoCharacter {
|
|
|
|
LegoCharacter(LegoROI* p_roi)
|
|
|
|
{
|
|
|
|
m_roi = p_roi;
|
|
|
|
m_refCount = 1;
|
|
|
|
}
|
2024-04-06 11:46:40 -04:00
|
|
|
~LegoCharacter() { delete m_roi; }
|
2024-03-19 14:23:34 -04:00
|
|
|
|
|
|
|
inline void AddRef() { m_refCount++; }
|
2024-04-06 11:46:40 -04:00
|
|
|
inline MxU32 RemoveRef()
|
|
|
|
{
|
|
|
|
if (m_refCount != 0) {
|
|
|
|
m_refCount--;
|
|
|
|
}
|
|
|
|
|
|
|
|
return m_refCount;
|
|
|
|
}
|
2024-03-19 15:54:13 -04:00
|
|
|
|
|
|
|
LegoROI* m_roi; // 0x00
|
|
|
|
MxU32 m_refCount; // 0x04
|
2024-02-21 15:30:02 -05:00
|
|
|
};
|
|
|
|
|
2024-03-22 13:40:19 -04:00
|
|
|
struct LegoCharacterData;
|
2024-02-21 15:30:02 -05:00
|
|
|
|
2024-03-22 13:40:19 -04:00
|
|
|
typedef map<const char*, LegoCharacter*, LegoCharacterComparator> LegoCharacterMap;
|
2023-10-12 12:18:24 -04:00
|
|
|
|
2024-02-10 20:52:16 -05:00
|
|
|
// SIZE 0x08
|
2024-03-09 15:07:52 -05:00
|
|
|
class LegoCharacterManager {
|
2024-01-16 14:33:03 -05:00
|
|
|
public:
|
2024-03-09 15:07:52 -05:00
|
|
|
LegoCharacterManager();
|
2024-02-10 20:52:16 -05:00
|
|
|
|
2024-03-22 13:40:19 -04:00
|
|
|
MxResult Write(LegoStorage* p_storage);
|
|
|
|
MxResult Read(LegoStorage* p_storage);
|
2024-03-19 14:23:34 -04:00
|
|
|
LegoROI* GetROI(const char* p_key, MxBool p_createEntity);
|
2024-02-21 15:30:02 -05:00
|
|
|
|
2024-03-22 13:40:19 -04:00
|
|
|
void Init();
|
2024-02-21 15:30:02 -05:00
|
|
|
static void SetCustomizeAnimFile(const char* p_value);
|
2024-03-29 13:30:46 -04:00
|
|
|
static MxBool Exists(const char* p_key);
|
2024-02-21 15:30:02 -05:00
|
|
|
|
2024-02-05 12:35:26 -05:00
|
|
|
void FUN_100832a0();
|
2024-03-29 13:30:31 -04:00
|
|
|
MxU32 GetRefCount(LegoROI* p_roi);
|
2024-04-17 11:03:17 -04:00
|
|
|
void FUN_10083c30(const char* p_name);
|
2024-01-16 14:33:03 -05:00
|
|
|
void FUN_10083db0(LegoROI* p_roi);
|
2024-02-13 18:34:14 -05:00
|
|
|
void FUN_10083f10(LegoROI* p_roi);
|
2024-04-17 07:52:59 -04:00
|
|
|
MxBool FUN_100849a0(LegoROI* p_roi, LegoTextureInfo* p_textureInfo);
|
2024-03-29 13:30:46 -04:00
|
|
|
LegoExtraActor* GetActor(const char* p_key);
|
|
|
|
LegoCharacterData* GetData(const char* p_key);
|
2024-03-29 14:34:50 -04:00
|
|
|
LegoCharacterData* GetData(LegoROI* p_roi);
|
2024-03-15 22:20:44 -04:00
|
|
|
MxBool FUN_10084ec0(LegoROI* p_roi);
|
2024-03-29 14:34:50 -04:00
|
|
|
MxU32 FUN_10085140(LegoROI* p_roi, MxBool p_und);
|
2024-03-31 10:05:38 -04:00
|
|
|
LegoROI* FUN_10085210(const char* p_name, const char* p_lodName, MxBool p_createEntity);
|
|
|
|
LegoROI* FUN_10085a80(const char* p_name, const char* p_lodName, MxBool p_createEntity);
|
2024-02-10 20:52:16 -05:00
|
|
|
|
2024-03-06 14:12:20 -05:00
|
|
|
static const char* GetCustomizeAnimFile() { return g_customizeAnimFile; }
|
|
|
|
|
2024-02-10 20:52:16 -05:00
|
|
|
private:
|
2024-03-19 14:23:34 -04:00
|
|
|
LegoROI* CreateROI(const char* p_key);
|
2024-04-06 11:46:40 -04:00
|
|
|
void RemoveROI(LegoROI* p_roi);
|
2024-04-17 07:52:59 -04:00
|
|
|
LegoROI* FindChildROI(LegoROI* p_roi, const char* p_name);
|
2024-03-31 10:05:38 -04:00
|
|
|
MxResult FUN_10085870(LegoROI* p_roi);
|
2024-03-19 14:23:34 -04:00
|
|
|
|
2024-02-21 15:30:02 -05:00
|
|
|
static char* g_customizeAnimFile;
|
|
|
|
|
2024-03-19 14:23:34 -04:00
|
|
|
LegoCharacterMap* m_characters; // 0x00
|
2024-02-21 15:30:02 -05:00
|
|
|
CustomizeAnimFileVariable* m_customizeAnimFile; // 0x04
|
2023-10-12 12:18:24 -04:00
|
|
|
};
|
|
|
|
|
2024-02-21 15:30:02 -05:00
|
|
|
// clang-format off
|
2024-03-22 13:40:19 -04:00
|
|
|
// TEMPLATE: LEGO1 0x1001a690
|
|
|
|
// list<ROI *,allocator<ROI *> >::_Buynode
|
|
|
|
|
|
|
|
// TEMPLATE: LEGO1 0x10035790
|
|
|
|
// _Construct
|
|
|
|
|
2024-03-19 14:23:34 -04:00
|
|
|
// TEMPLATE: LEGO1 0x10082b90
|
|
|
|
// _Tree<char const *,pair<char const * const,LegoCharacter *>,map<char const *,LegoCharacter *,LegoCharacterComparator,allocator<LegoCharacter *> >::_Kfn,LegoCharacterComparator,allocator<LegoCharacter *> >::~_Tree<char const *,pair<char const * const,LegoCharacter *>,map<char const *,LegoCharacter *,LegoCharacterComparator,allocator<LegoCharacter *> >::_Kfn,LegoCharacterComparator,allocator<LegoCharacter *> >
|
|
|
|
|
|
|
|
// TEMPLATE: LEGO1 0x10082c60
|
|
|
|
// _Tree<char const *,pair<char const * const,LegoCharacter *>,map<char const *,LegoCharacter *,LegoCharacterComparator,allocator<LegoCharacter *> >::_Kfn,LegoCharacterComparator,allocator<LegoCharacter *> >::iterator::_Inc
|
|
|
|
|
|
|
|
// TEMPLATE: LEGO1 0x10082ca0
|
|
|
|
// _Tree<char const *,pair<char const * const,LegoCharacter *>,map<char const *,LegoCharacter *,LegoCharacterComparator,allocator<LegoCharacter *> >::_Kfn,LegoCharacterComparator,allocator<LegoCharacter *> >::erase
|
2024-02-21 15:30:02 -05:00
|
|
|
|
2024-03-19 14:23:34 -04:00
|
|
|
// TEMPLATE: LEGO1 0x100830f0
|
|
|
|
// _Tree<char const *,pair<char const * const,LegoCharacter *>,map<char const *,LegoCharacter *,LegoCharacterComparator,allocator<LegoCharacter *> >::_Kfn,LegoCharacterComparator,allocator<LegoCharacter *> >::_Erase
|
2024-02-21 15:30:02 -05:00
|
|
|
|
2024-03-19 14:23:34 -04:00
|
|
|
// TEMPLATE: LEGO1 0x10083130
|
|
|
|
// map<char *,LegoCharacter *,LegoCharacterComparator,allocator<LegoCharacter *> >::~map<char *,LegoCharacter *,LegoCharacterComparator,allocator<LegoCharacter *> >
|
2024-02-21 15:30:02 -05:00
|
|
|
|
2024-03-19 14:23:34 -04:00
|
|
|
// TEMPLATE: LEGO1 0x10083840
|
|
|
|
// _Tree<char const *,pair<char const * const,LegoCharacter *>,map<char const *,LegoCharacter *,LegoCharacterComparator,allocator<LegoCharacter *> >::_Kfn,LegoCharacterComparator,allocator<LegoCharacter *> >::iterator::_Dec
|
2024-02-21 15:30:02 -05:00
|
|
|
|
2024-03-19 14:23:34 -04:00
|
|
|
// TEMPLATE: LEGO1 0x10083890
|
|
|
|
// _Tree<char const *,pair<char const * const,LegoCharacter *>,map<char const *,LegoCharacter *,LegoCharacterComparator,allocator<LegoCharacter *> >::_Kfn,LegoCharacterComparator,allocator<LegoCharacter *> >::_Insert
|
2024-02-21 15:30:02 -05:00
|
|
|
|
2024-03-31 10:05:38 -04:00
|
|
|
// TEMPLATE: LEGO1 0x10085500
|
|
|
|
// _Tree<char const *,pair<char const * const,LegoCharacter *>,map<char const *,LegoCharacter *,LegoCharacterComparator,allocator<LegoCharacter *> >::_Kfn,LegoCharacterComparator,allocator<LegoCharacter *> >::insert
|
|
|
|
|
2024-04-12 11:53:22 -04:00
|
|
|
// TEMPLATE: LEGO1 0x10085790
|
|
|
|
// _Tree<char const *,pair<char const * const,LegoCharacter *>,map<char const *,LegoCharacter *,LegoCharacterComparator,allocator<LegoCharacter *> >::_Kfn,LegoCharacterComparator,allocator<LegoCharacter *> >::_Buynode
|
|
|
|
|
|
|
|
// TEMPLATE: LEGO1 0x100857b0
|
|
|
|
// _Tree<char const *,pair<char const * const,LegoCharacter *>,map<char const *,LegoCharacter *,LegoCharacterComparator,allocator<LegoCharacter *> >::_Kfn,LegoCharacterComparator,allocator<LegoCharacter *> >::_Lrotate
|
|
|
|
|
|
|
|
// TEMPLATE: LEGO1 0x10085810
|
|
|
|
// _Tree<char const *,pair<char const * const,LegoCharacter *>,map<char const *,LegoCharacter *,LegoCharacterComparator,allocator<LegoCharacter *> >::_Kfn,LegoCharacterComparator,allocator<LegoCharacter *> >::_Rrotate
|
|
|
|
|
2024-02-21 15:30:02 -05:00
|
|
|
// GLOBAL: LEGO1 0x100fc508
|
2024-03-19 14:23:34 -04:00
|
|
|
// _Tree<char const *,pair<char const * const,LegoCharacter *>,map<char const *,LegoCharacter *,LegoCharacterComparator,allocator<LegoCharacter *> >::_Kfn,LegoCharacterComparator,allocator<LegoCharacter *> >::_Nil
|
2024-02-21 15:30:02 -05:00
|
|
|
// clang-format on
|
|
|
|
|
2024-03-09 15:07:52 -05:00
|
|
|
#endif // LEGOCHARACTERMANAGER_H
|