Implement/match LegoPathStruct (#944)

* Implement/match LegoPathStruct

* Rename some nums

* Consistent naming

* Naming

* relax regex

* Name some functions

* Improve naming

* Rename
This commit is contained in:
Christian Semmler
2024-05-21 15:03:50 -04:00
committed by GitHub
parent bc91fd2189
commit 8fee73c525
18 changed files with 225 additions and 40 deletions

View File

@@ -26,6 +26,7 @@ class Isle : public LegoWorld {
public:
// For g_unk0x100f1198
enum {
c_bit6 = 0x20,
c_bit7 = 0x40
};

View File

@@ -30,7 +30,7 @@ public:
// SYNTHETIC: LEGO1 0x1000f3d0
// JukeBoxState::`scalar deleting destructor'
protected:
// protected:
MxU32 m_state; // 0x08
MxU32 m_active; // 0x0c
};

View File

@@ -9,11 +9,11 @@
#include "mxgeometry/mxgeometry3d.h"
class AnimState;
class IslePathActor;
class LegoAnimPresenter;
class LegoEntity;
class LegoExtraActor;
class LegoFile;
class LegoPathActor;
class LegoPathBoundary;
class LegoROIList;
struct LegoUnknown100db7f4;
@@ -102,7 +102,7 @@ public:
MxBool p_param8,
MxBool p_param9
);
void CameraTriggerFire(IslePathActor* p_actor, undefined4, MxU32 p_location, MxBool p_bool);
void CameraTriggerFire(LegoPathActor* p_actor, undefined4, MxU32 p_location, MxBool p_bool);
void FUN_10061010(MxBool p_und);
LegoTranInfo* GetTranInfo(MxU32 p_index);
void FUN_10062770();

View File

@@ -47,10 +47,11 @@ public:
void VTable0x8c() override; // vtable+0x8c
void VTable0x90() override; // vtable+0x90
void FUN_1006db40(LegoTime p_time);
private:
void Init();
void Destroy(MxBool p_fromDestructor);
void FUN_1006db40(LegoTime p_time);
void FUN_1006db60(LegoTreeNode* p_node, LegoTime p_time);
void FUN_1006dc10();
void FUN_1006e3f0(LegoHideAnimStructMap& p_map, LegoTreeNode* p_node);

View File

@@ -9,7 +9,7 @@
#include "mxstl/stlcompat.h"
class LegoAnimPresenter;
struct LegoPathStruct;
class LegoPathStruct;
class LegoWorld;
class MxAtomId;
class Vector3;

View File

@@ -12,7 +12,17 @@ class LegoWorld;
// SIZE 0x0c
struct LegoPathStructBase {
public:
LegoPathStructBase() : m_name(NULL), m_unk0x08(0) {}
enum {
c_bit1 = 0x01 << 24,
c_bit2 = 0x02 << 24,
c_bit3 = 0x04 << 24,
c_bit4 = 0x08 << 24,
c_bit5 = 0x10 << 24,
c_bit6 = 0x20 << 24,
c_bit7 = 0x40 << 24
};
LegoPathStructBase() : m_name(NULL), m_flags(0) {}
// FUNCTION: LEGO1 0x10047420
virtual ~LegoPathStructBase()
@@ -22,25 +32,41 @@ public:
}
}
char* m_name; // 0x04
undefined4 m_unk0x08; // 0x08
char* m_name; // 0x04
MxU32 m_flags; // 0x08
};
// VTABLE: LEGO1 0x100d7da0
// SIZE 0x14
struct LegoPathStruct : public LegoPathStructBase {
class LegoPathStruct : public LegoPathStructBase {
public:
enum Trigger {
c_camAnim = 'C',
c_d = 'D',
c_e = 'E',
c_g = 'G',
c_h = 'H',
c_music = 'M',
c_s = 'S',
c_w = 'W'
};
// FUNCTION: LEGO1 0x100473a0
LegoPathStruct() : m_world(NULL) {}
// FUNCTION: LEGO1 0x10047470
~LegoPathStruct() override {}
virtual void VTable0x04(LegoPathActor*, undefined4, undefined4); // vtable+0x04
virtual void HandleTrigger(LegoPathActor* p_actor, MxBool p_direction, MxU32 p_data); // vtable+0x04
inline void SetWorld(LegoWorld* p_world) { m_world = p_world; }
inline void SetAtomId(const MxAtomId& p_atomId) { m_atomId = p_atomId; }
private:
MxBool HandleTrigger(LegoPathActor* p_actor, MxBool p_direction, MxU32 p_data, MxBool p_bool);
void FUN_1001bc40(const char* p_name, MxU32 p_data, MxBool p_bool);
void PlayMusic(MxBool p_direction, MxU32 p_data);
LegoWorld* m_world; // 0x0c
MxAtomId m_atomId; // 0x10
};

View File

@@ -7,12 +7,12 @@
#include <windows.h>
class IslePathActor;
class MxAtomId;
class LegoEntity;
class LegoFile;
class LegoAnimPresenter;
class LegoNamedTexture;
class LegoPathActor;
class LegoROI;
class LegoTreeNode;
@@ -24,7 +24,7 @@ Extra::ActionType MatchActionString(const char*);
void InvokeAction(Extra::ActionType p_actionId, const MxAtomId& p_pAtom, MxS32 p_targetEntityId, LegoEntity* p_sender);
void SetCameraControllerFromIsle();
void ConvertHSVToRGB(float p_h, float p_s, float p_v, float* p_rOut, float* p_bOut, float* p_gOut);
void PlayCamAnim(IslePathActor* p_actor, undefined4 p_unused, MxU32 p_location, MxBool p_bool);
void PlayCamAnim(LegoPathActor* p_actor, MxBool p_unused, MxU32 p_location, MxBool p_bool);
void FUN_1003eda0();
MxBool RemoveFromCurrentWorld(const MxAtomId& p_atomId, MxS32 p_id);
void FUN_1003ef00(MxBool p_enable);

View File

@@ -94,6 +94,7 @@ public:
inline MxS32 GetScriptIndex() { return m_scriptIndex; }
inline MxCoreSet& GetUnknown0xd0() { return m_set0xd0; }
inline list<LegoROI*>& GetROIList() { return m_roiList; }
inline LegoHideAnimPresenter* GetHideAnimPresenter() { return m_hideAnimPresenter; }
inline void SetScriptIndex(MxS32 p_scriptIndex) { m_scriptIndex = p_scriptIndex; }