Refactor JukeBox, add enum for music (#988)

* Refactor JukeBox, add enum for music

* add BETA annotation

* Fix BETA annotation

* Fix BETA annotation

* Fix
This commit is contained in:
Christian Semmler
2024-06-03 07:00:38 -04:00
committed by GitHub
parent 828b35e9d2
commit 73bb37596e
12 changed files with 102 additions and 105 deletions

View File

@@ -79,6 +79,8 @@ public:
void FUN_10034b60();
void FUN_10034d00();
// TODO: Most likely getters/setters are not used according to BETA.
inline MxU32 GetUnknown18() { return m_unk0x018; }
inline ElevatorFloor GetElevatorFloor() { return (ElevatorFloor) m_elevFloor; }
inline MxU8 GetUnknown21() { return m_unk0x021; }
@@ -90,10 +92,6 @@ public:
// SYNTHETIC: LEGO1 0x10033960
// Act1State::`scalar deleting destructor'
friend class Isle;
friend class SkateBoard;
protected:
MxS32* m_unk0x008; // 0x008 FIXME: count for m_unk0x008
MxS16 m_unk0x00c; // 0x00c
undefined2 m_unk0x00e; // 0x00e

View File

@@ -7,6 +7,15 @@
// SIZE 0x10
class JukeBoxState : public LegoState {
public:
enum Music {
e_pasquell = 0,
e_right,
e_decal,
e_wallis,
e_nelson,
e_torpedos
};
// FUNCTION: LEGO1 0x1000f310
inline const char* ClassName() const override // vtable+0x0c
{
@@ -22,16 +31,10 @@ public:
MxBool IsSerializable() override; // vtable+0x14
inline MxU32 IsActive() { return m_active; }
inline void SetActive(MxU32 p_active) { m_active = p_active; }
inline MxU32 GetState() { return m_state; }
inline void SetState(MxU32 p_state) { m_state = p_state; }
// SYNTHETIC: LEGO1 0x1000f3d0
// JukeBoxState::`scalar deleting destructor'
// protected:
MxU32 m_state; // 0x08
Music m_music; // 0x08
MxU32 m_active; // 0x0c
};

View File

@@ -18,6 +18,8 @@ public:
m_clickedAtom = NULL;
}
// TODO: Most likely getters/setters are not used according to BETA.
inline MxS32 GetClickedObjectId() const { return m_clickedObjectId; }
inline const char* GetClickedAtom() const { return m_clickedAtom; }
inline MxS16 GetUnknown0x28() const { return m_unk0x28; }
@@ -26,7 +28,6 @@ public:
inline void SetClickedAtom(const char* p_clickedAtom) { m_clickedAtom = p_clickedAtom; }
inline void SetUnknown0x28(MxS16 p_unk0x28) { m_unk0x28 = p_unk0x28; }
private:
MxS32 m_clickedObjectId; // 0x20
const char* m_clickedAtom; // 0x24
MxS16 m_unk0x28; // 0x28

View File

@@ -90,7 +90,7 @@ public:
e_unk51,
e_unk52,
e_jukeboxw,
e_unk54,
e_jukeboxExterior,
e_unk55,
e_histbook,
e_bike,
@@ -174,7 +174,6 @@ public:
inline Act GetLoadedAct() { return m_loadedAct; }
inline Area GetCurrentArea() { return m_currentArea; }
inline Area GetPreviousArea() { return m_previousArea; }
inline JukeboxScript::Script GetUnknown0x41c() { return m_unk0x41c; }
inline Area GetUnknown0x42c() { return m_unk0x42c; }
inline History* GetHistory() { return &m_history; }
@@ -182,7 +181,6 @@ public:
inline void SetCurrentArea(Area p_currentArea) { m_currentArea = p_currentArea; }
inline void SetPreviousArea(Area p_previousArea) { m_previousArea = p_previousArea; }
inline void SetActorId(MxU8 p_actorId) { m_actorId = p_actorId; }
inline void SetUnknown0x41c(JukeboxScript::Script p_unk0x41c) { m_unk0x41c = p_unk0x41c; }
inline void SetUnknown0x42c(Area p_unk0x42c) { m_unk0x42c = p_unk0x42c; }
inline Username* GetPlayersIndex(MxS32 p_index) { return &m_players[p_index]; }
inline MxS16 GetPlayerCount() { return m_playerCount; }
@@ -210,24 +208,18 @@ private:
LegoFullScreenMovie* m_fullScreenMovie; // 0x20
MxU16 m_unk0x24; // 0x24
// Member visibility needs to be refactored, since most members are accessed directly.
// TODO: Most likely getters/setters are not used according to BETA for the following members:
public:
MxS16 m_playerCount; // 0x26
Username m_players[9]; // 0x28
private:
History m_history; // 0xa6
undefined2 m_unk0x41a; // 0x41a
JukeboxScript::Script m_unk0x41c; // 0x41c
MxBool m_isDirty; // 0x420
public:
Area m_currentArea; // 0x424
Area m_previousArea; // 0x428
private:
Area m_unk0x42c; // 0x42c
MxS16 m_playerCount; // 0x26
Username m_players[9]; // 0x28
History m_history; // 0xa6
undefined2 m_unk0x41a; // 0x41a
JukeboxScript::Script m_jukeboxMusic; // 0x41c
MxBool m_isDirty; // 0x420
Area m_currentArea; // 0x424
Area m_previousArea; // 0x428
Area m_unk0x42c; // 0x42c
};
MxBool ROIHandlerFunction(const char* p_input, char* p_output, MxU32 p_copyLen);

View File

@@ -44,7 +44,7 @@ void ConvertHSVToRGB(float p_h, float p_s, float p_v, float* p_rOut, float* p_bO
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);
void EnableAnimations(MxBool p_enable);
void SetAppCursor(Cursor p_cursor);
MxBool FUN_1003ef60();
MxBool RemoveFromWorld(MxAtomId& p_entityAtom, MxS32 p_entityId, MxAtomId& p_worldAtom, MxS32 p_worldEntityId);