2023-04-27 22:19:39 -04:00
|
|
|
#ifndef LEGOBUILDINGMANAGER_H
|
|
|
|
#define LEGOBUILDINGMANAGER_H
|
|
|
|
|
2024-02-10 20:52:16 -05:00
|
|
|
#include "decomp.h"
|
2024-05-09 09:57:38 -04:00
|
|
|
#include "misc/legotypes.h"
|
2023-06-29 04:10:08 -04:00
|
|
|
#include "mxcore.h"
|
|
|
|
|
2024-03-15 22:20:44 -04:00
|
|
|
class LegoEntity;
|
2024-03-06 14:12:20 -05:00
|
|
|
class LegoROI;
|
2024-05-03 12:19:12 -04:00
|
|
|
class LegoStorage;
|
2024-05-06 07:15:19 -04:00
|
|
|
class LegoWorld;
|
2024-05-09 09:57:38 -04:00
|
|
|
class LegoCacheSound;
|
|
|
|
class LegoPathBoundary;
|
2024-05-06 07:15:19 -04:00
|
|
|
|
|
|
|
// SIZE 0x2c
|
|
|
|
struct LegoBuildingInfo {
|
|
|
|
enum {
|
2024-06-05 13:40:44 -04:00
|
|
|
c_hasVariants = 0x01,
|
|
|
|
c_hasSounds = 0x02,
|
|
|
|
c_hasMoves = 0x04,
|
|
|
|
c_hasMoods = 0x08
|
2024-05-06 07:15:19 -04:00
|
|
|
};
|
|
|
|
|
2024-05-09 09:57:38 -04:00
|
|
|
LegoEntity* m_entity; // 0x00
|
2024-06-17 14:11:27 -04:00
|
|
|
const char* m_variant; // 0x04
|
2024-06-05 13:40:44 -04:00
|
|
|
MxU32 m_sound; // 0x08
|
|
|
|
MxU32 m_move; // 0x0c
|
|
|
|
MxU8 m_mood; // 0x10
|
2024-05-09 09:57:38 -04:00
|
|
|
MxS8 m_unk0x11; // 0x11
|
2024-06-17 14:11:27 -04:00
|
|
|
MxS8 m_initialUnk0x11; // 0x12 - initial value loaded to m_unk0x11
|
2024-05-09 09:57:38 -04:00
|
|
|
MxU8 m_flags; // 0x13
|
|
|
|
float m_unk0x014; // 0x14
|
|
|
|
const char* m_unk0x18; // 0x18
|
|
|
|
float m_x; // 0x1c
|
|
|
|
float m_y; // 0x20
|
|
|
|
float m_z; // 0x24
|
|
|
|
LegoPathBoundary* m_boundary; // 0x28
|
2024-05-06 07:15:19 -04:00
|
|
|
};
|
2024-03-06 14:12:20 -05:00
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// VTABLE: LEGO1 0x100d6f50
|
2023-06-29 04:10:08 -04:00
|
|
|
// SIZE 0x30
|
2023-10-24 19:38:27 -04:00
|
|
|
class LegoBuildingManager : public MxCore {
|
2023-04-27 22:19:39 -04:00
|
|
|
public:
|
2024-05-09 09:57:38 -04:00
|
|
|
// SIZE 0x14
|
|
|
|
struct AnimEntry {
|
|
|
|
LegoEntity* m_entity; // 0x00
|
|
|
|
LegoROI* m_roi; // 0x04
|
2024-07-01 19:14:04 -04:00
|
|
|
MxLong m_time; // 0x08
|
2024-05-09 09:57:38 -04:00
|
|
|
float m_unk0x0c; // 0x0c
|
|
|
|
MxBool m_muted; // 0x10
|
|
|
|
};
|
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
LegoBuildingManager();
|
2024-02-01 15:42:10 -05:00
|
|
|
~LegoBuildingManager() override;
|
2023-06-29 04:10:08 -04:00
|
|
|
|
2024-02-01 15:42:10 -05:00
|
|
|
MxResult Tickle() override; // vtable+0x08
|
2024-01-20 18:04:46 -05:00
|
|
|
|
2023-12-06 07:10:45 -05:00
|
|
|
// FUNCTION: LEGO1 0x1002f930
|
2024-02-01 15:42:10 -05:00
|
|
|
inline const char* ClassName() const override // vtable+0x0c
|
2023-10-24 19:38:27 -04:00
|
|
|
{
|
2023-12-27 15:59:42 -05:00
|
|
|
// STRING: LEGO1 0x100f37d0
|
2023-10-24 19:38:27 -04:00
|
|
|
return "LegoBuildingManager";
|
|
|
|
}
|
2023-06-29 04:10:08 -04:00
|
|
|
|
2024-01-24 21:16:29 -05:00
|
|
|
static void configureLegoBuildingManager(MxS32);
|
2024-02-21 15:30:02 -05:00
|
|
|
static void SetCustomizeAnimFile(const char* p_value);
|
2023-06-29 04:10:08 -04:00
|
|
|
|
2024-02-28 15:03:27 -05:00
|
|
|
void Init();
|
2024-06-25 11:28:10 -04:00
|
|
|
void LoadWorldInfo();
|
2024-06-18 13:35:03 -04:00
|
|
|
void CreateBuilding(MxS32 p_index, LegoWorld* p_world);
|
2024-06-19 12:02:54 -04:00
|
|
|
void Reset();
|
2024-04-21 09:42:08 -04:00
|
|
|
MxResult Write(LegoStorage* p_storage);
|
|
|
|
MxResult Read(LegoStorage* p_storage);
|
2024-05-06 07:15:19 -04:00
|
|
|
LegoBuildingInfo* GetInfo(LegoEntity* p_entity);
|
2024-06-05 13:00:46 -04:00
|
|
|
MxBool SwitchVariant(LegoEntity* p_entity);
|
2024-06-05 13:40:44 -04:00
|
|
|
MxBool SwitchSound(LegoEntity* p_entity);
|
|
|
|
MxBool SwitchMove(LegoEntity* p_entity);
|
|
|
|
MxBool SwitchMood(LegoEntity* p_entity);
|
2024-06-19 12:57:05 -04:00
|
|
|
MxU32 GetAnimationId(LegoEntity* p_entity);
|
2024-06-25 11:28:10 -04:00
|
|
|
MxU32 GetSoundId(LegoEntity* p_entity, MxBool p_state);
|
2024-05-06 07:15:19 -04:00
|
|
|
MxBool FUN_10030000(LegoEntity* p_entity);
|
|
|
|
MxBool FUN_10030030(MxS32 p_index);
|
|
|
|
MxBool FUN_10030110(LegoBuildingInfo* p_data);
|
2024-07-01 19:14:04 -04:00
|
|
|
void ScheduleAnimation(LegoEntity* p_entity, MxLong p_length, MxBool p_haveSound, MxBool p_unk0x28);
|
2024-02-05 12:35:26 -05:00
|
|
|
void FUN_10030590();
|
2024-05-06 07:15:19 -04:00
|
|
|
void AdjustHeight(MxS32 p_index);
|
2024-05-09 09:57:38 -04:00
|
|
|
MxResult FUN_10030630();
|
|
|
|
LegoBuildingInfo* GetInfoArray(MxS32& p_length);
|
|
|
|
void FUN_100307b0(LegoEntity* p_entity, MxS32 p_adjust);
|
|
|
|
|
|
|
|
static void FUN_10030800();
|
2024-06-05 13:00:46 -04:00
|
|
|
static const char* GetCustomizeAnimFile() { return g_customizeAnimFile; }
|
2024-01-12 17:27:07 -05:00
|
|
|
|
2024-01-18 08:34:14 -05:00
|
|
|
// SYNTHETIC: LEGO1 0x1002f940
|
|
|
|
// LegoBuildingManager::`scalar deleting destructor'
|
|
|
|
|
2023-06-29 04:10:08 -04:00
|
|
|
private:
|
2024-02-21 15:30:02 -05:00
|
|
|
static char* g_customizeAnimFile;
|
2024-06-05 13:40:44 -04:00
|
|
|
static MxS32 g_maxMove[16];
|
|
|
|
static MxU32 g_maxSound;
|
2024-02-21 15:30:02 -05:00
|
|
|
|
2024-05-09 09:57:38 -04:00
|
|
|
MxU8 m_nextVariant; // 0x08
|
|
|
|
MxU8 m_unk0x09; // 0x09
|
|
|
|
AnimEntry* m_entries[5]; // 0x0c
|
|
|
|
MxS8 m_numEntries; // 0x20
|
|
|
|
LegoCacheSound* m_sound; // 0x24
|
|
|
|
MxBool m_unk0x28; // 0x28
|
|
|
|
LegoWorld* m_world; // 0x2c
|
2023-04-27 22:19:39 -04:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // LEGOBUILDINGMANAGER_H
|