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-02-21 15:30:02 -05:00
|
|
|
#include "mxstl/stlcompat.h"
|
2023-10-24 19:38:27 -04:00
|
|
|
#include "mxtypes.h"
|
2024-05-03 12:19:12 -04:00
|
|
|
#include "roi/legoroi.h"
|
2023-10-12 12:18:24 -04:00
|
|
|
|
2024-05-03 12:19:12 -04:00
|
|
|
class CustomizeAnimFileVariable;
|
2024-03-19 14:23:34 -04:00
|
|
|
class LegoActor;
|
2024-05-03 12:19:12 -04:00
|
|
|
class LegoExtraActor;
|
|
|
|
class LegoStorage;
|
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-06-01 12:45:34 -04:00
|
|
|
struct LegoActorInfo;
|
2024-02-21 15:30:02 -05:00
|
|
|
|
2024-04-19 08:30:36 -04:00
|
|
|
typedef map<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-05-14 08:13:27 -04: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-06-01 12:45:34 -04:00
|
|
|
LegoROI* GetActorROI(const char* p_name, 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-06-01 12:45:34 -04:00
|
|
|
static MxBool IsActor(const char* p_name);
|
2024-02-21 15:30:02 -05:00
|
|
|
|
2024-06-01 12:45:34 -04:00
|
|
|
void ReleaseAllActors();
|
|
|
|
MxBool Exists(const char* p_name);
|
2024-03-29 13:30:31 -04:00
|
|
|
MxU32 GetRefCount(LegoROI* p_roi);
|
2024-06-01 12:45:34 -04:00
|
|
|
void ReleaseActor(const char* p_name);
|
|
|
|
void ReleaseActor(LegoROI* p_roi);
|
|
|
|
void ReleaseAutoROI(LegoROI* p_roi);
|
2024-04-17 07:52:59 -04:00
|
|
|
MxBool FUN_100849a0(LegoROI* p_roi, LegoTextureInfo* p_textureInfo);
|
2024-06-01 12:45:34 -04:00
|
|
|
LegoExtraActor* GetExtraActor(const char* p_name);
|
|
|
|
LegoActorInfo* GetActorInfo(const char* p_name);
|
|
|
|
LegoActorInfo* GetActorInfo(LegoROI* p_roi);
|
2024-06-05 13:40:44 -04:00
|
|
|
MxBool SwitchColor(LegoROI* p_roi, LegoROI* p_targetROI);
|
|
|
|
MxBool SwitchVariant(LegoROI* p_roi);
|
|
|
|
MxBool SwitchSound(LegoROI* p_roi);
|
|
|
|
MxBool SwitchMove(LegoROI* p_roi);
|
|
|
|
MxBool SwitchMood(LegoROI* p_roi);
|
2024-06-05 13:00:46 -04:00
|
|
|
MxU32 FUN_10085120(LegoROI* p_roi);
|
2024-03-29 14:34:50 -04:00
|
|
|
MxU32 FUN_10085140(LegoROI* p_roi, MxBool p_und);
|
2024-05-25 10:40:10 -04:00
|
|
|
MxU8 GetMood(LegoROI* p_roi);
|
2024-06-01 12:45:34 -04:00
|
|
|
LegoROI* CreateAutoROI(const char* p_name, const char* p_lodName, MxBool p_createEntity);
|
2024-03-31 10:05:38 -04:00
|
|
|
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-06-01 12:45:34 -04:00
|
|
|
LegoROI* CreateActorROI(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-06-05 13:40:44 -04:00
|
|
|
static MxU32 g_maxMove;
|
|
|
|
static MxU32 g_maxSound;
|
2024-02-21 15:30:02 -05:00
|
|
|
|
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
|
2024-04-19 08:30:36 -04:00
|
|
|
// _Tree<char *,pair<char * const,LegoCharacter *>,map<char *,LegoCharacter *,LegoCharacterComparator,allocator<LegoCharacter *> >::_Kfn,LegoCharacterComparator,allocator<LegoCharacter *> >::~_Tree<char *,pair<char * const,LegoCharacter *>,map<char *,LegoCharacter *,LegoCharacterComparator,allocator<LegoCharacter *> >::_Kfn,LegoCharacterComparator,allocator<LegoCharacter *> >
|
2024-03-19 14:23:34 -04:00
|
|
|
|
|
|
|
// TEMPLATE: LEGO1 0x10082c60
|
2024-04-19 08:30:36 -04:00
|
|
|
// _Tree<char *,pair<char * const,LegoCharacter *>,map<char *,LegoCharacter *,LegoCharacterComparator,allocator<LegoCharacter *> >::_Kfn,LegoCharacterComparator,allocator<LegoCharacter *> >::iterator::_Inc
|
2024-03-19 14:23:34 -04:00
|
|
|
|
|
|
|
// TEMPLATE: LEGO1 0x10082ca0
|
2024-04-19 08:30:36 -04:00
|
|
|
// _Tree<char *,pair<char * const,LegoCharacter *>,map<char *,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
|
2024-04-19 08:30:36 -04:00
|
|
|
// _Tree<char *,pair<char * const,LegoCharacter *>,map<char *,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
|
2024-04-19 08:30:36 -04:00
|
|
|
// _Tree<char *,pair<char * const,LegoCharacter *>,map<char *,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
|
2024-04-19 08:30:36 -04:00
|
|
|
// _Tree<char *,pair<char * const,LegoCharacter *>,map<char *,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
|
2024-04-19 08:30:36 -04:00
|
|
|
// _Tree<char *,pair<char * const,LegoCharacter *>,map<char *,LegoCharacter *,LegoCharacterComparator,allocator<LegoCharacter *> >::_Kfn,LegoCharacterComparator,allocator<LegoCharacter *> >::insert
|
2024-03-31 10:05:38 -04:00
|
|
|
|
2024-04-12 11:53:22 -04:00
|
|
|
// TEMPLATE: LEGO1 0x10085790
|
2024-04-19 08:30:36 -04:00
|
|
|
// _Tree<char *,pair<char * const,LegoCharacter *>,map<char *,LegoCharacter *,LegoCharacterComparator,allocator<LegoCharacter *> >::_Kfn,LegoCharacterComparator,allocator<LegoCharacter *> >::_Buynode
|
2024-04-12 11:53:22 -04:00
|
|
|
|
|
|
|
// TEMPLATE: LEGO1 0x100857b0
|
2024-04-19 08:30:36 -04:00
|
|
|
// _Tree<char *,pair<char * const,LegoCharacter *>,map<char *,LegoCharacter *,LegoCharacterComparator,allocator<LegoCharacter *> >::_Kfn,LegoCharacterComparator,allocator<LegoCharacter *> >::_Lrotate
|
2024-04-12 11:53:22 -04:00
|
|
|
|
|
|
|
// TEMPLATE: LEGO1 0x10085810
|
2024-04-19 08:30:36 -04:00
|
|
|
// _Tree<char *,pair<char * const,LegoCharacter *>,map<char *,LegoCharacter *,LegoCharacterComparator,allocator<LegoCharacter *> >::_Kfn,LegoCharacterComparator,allocator<LegoCharacter *> >::_Rrotate
|
2024-04-12 11:53:22 -04:00
|
|
|
|
2024-02-21 15:30:02 -05:00
|
|
|
// GLOBAL: LEGO1 0x100fc508
|
2024-04-19 08:30:36 -04:00
|
|
|
// _Tree<char *,pair<char * const,LegoCharacter *>,map<char *,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
|