From e4453c410014eaaa0db5411085e7f8f64db794d1 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Sun, 3 Nov 2024 09:41:15 -0700 Subject: [PATCH] Implement/match Act1State::Act1State (#1130) * Implement/match Act1State::Act1State * Remove obsolete enum --- LEGO1/lego/legoomni/include/isle.h | 12 +---------- LEGO1/lego/legoomni/include/legostate.h | 1 - LEGO1/lego/legoomni/src/worlds/isle.cpp | 27 ++++++++++--------------- 3 files changed, 12 insertions(+), 28 deletions(-) diff --git a/LEGO1/lego/legoomni/include/isle.h b/LEGO1/lego/legoomni/include/isle.h index 84aebed9..3d50b835 100644 --- a/LEGO1/lego/legoomni/include/isle.h +++ b/LEGO1/lego/legoomni/include/isle.h @@ -32,12 +32,6 @@ class Act1State : public LegoState { c_floor3 }; - enum { - e_unk953 = 953, - e_unk954 = 954, - e_unk955 = 955, - }; - // SIZE 0x4c class NamedPlane { public: @@ -109,11 +103,7 @@ class Act1State : public LegoState { // TODO: Most likely getters/setters are not used according to BETA. - MxS32* m_unk0x008; // 0x008 FIXME: count for m_unk0x008 - MxS16 m_unk0x00c; // 0x00c - undefined2 m_unk0x00e; // 0x00e - undefined2 m_unk0x010; // 0x010 - undefined m_unk0x012; // 0x012 + Playlist m_unk0x008; // 0x008 MxS32 m_unk0x014; // 0x014 MxU32 m_unk0x018; // 0x018 MxS16 m_elevFloor; // 0x01c diff --git a/LEGO1/lego/legoomni/include/legostate.h b/LEGO1/lego/legoomni/include/legostate.h index 23a8599e..23d9f9df 100644 --- a/LEGO1/lego/legoomni/include/legostate.h +++ b/LEGO1/lego/legoomni/include/legostate.h @@ -73,7 +73,6 @@ class LegoState : public MxCore { return SUCCESS; } - private: MxU32* m_objectIds; // 0x00 MxS16 m_length; // 0x04 MxS16 m_mode; // 0x06 diff --git a/LEGO1/lego/legoomni/src/worlds/isle.cpp b/LEGO1/lego/legoomni/src/worlds/isle.cpp index 347e4b07..4a37afdd 100644 --- a/LEGO1/lego/legoomni/src/worlds/isle.cpp +++ b/LEGO1/lego/legoomni/src/worlds/isle.cpp @@ -46,11 +46,8 @@ DECOMP_SIZE_ASSERT(Isle, 0x140) MxU32 g_isleFlags = 0x7f; // GLOBAL: LEGO1 0x100f37f0 -MxS32 g_unk0x100f37f0[] = { - Act1State::e_unk953, - Act1State::e_unk954, - Act1State::e_unk955, -}; +IsleScript::Script g_unk0x100f37f0[] = + {IsleScript::c_Avo905Ps_PlayWav, IsleScript::c_Avo906Ps_PlayWav, IsleScript::c_Avo907Ps_PlayWav}; // FUNCTION: LEGO1 0x10030820 Isle::Isle() @@ -1283,16 +1280,16 @@ void Isle::FUN_10033350() m_destLocation = LegoGameState::e_infomain; } -// STUB: LEGO1 0x100334b0 -Act1State::Act1State() : m_unk0x00c(0), m_unk0x00e(0), m_unk0x008(NULL), m_unk0x010(0) +// FUNCTION: LEGO1 0x100334b0 +// FUNCTION: BETA10 0x10035197 +Act1State::Act1State() { - m_unk0x01e = FALSE; + m_elevFloor = Act1State::c_floor1; m_unk0x018 = 1; - m_unk0x010 = 0; - m_planeActive = FALSE; - m_unk0x00e = 0; + m_unk0x01e = FALSE; + m_unk0x008 = Playlist((MxU32*) g_unk0x100f37f0, sizeOfArray(g_unk0x100f37f0), Playlist::e_loop); m_unk0x01f = FALSE; - m_unk0x008 = g_unk0x100f37f0; + m_planeActive = FALSE; m_unk0x014 = -1; m_unk0x022 = FALSE; m_unk0x154 = NULL; @@ -1301,8 +1298,6 @@ Act1State::Act1State() : m_unk0x00c(0), m_unk0x00e(0), m_unk0x008(NULL), m_unk0x m_helicopter = NULL; m_unk0x1b0 = NULL; m_unk0x021 = 1; - m_elevFloor = Act1State::c_floor1; - m_unk0x00c = sizeOfArray(g_unk0x100f37f0); m_unk0x1b4 = NULL; m_jetski = NULL; m_unk0x208 = NULL; @@ -1391,7 +1386,7 @@ MxResult Act1State::Serialize(LegoFile* p_file) } } - Write(p_file, m_unk0x010); + Write(p_file, m_unk0x008.m_nextIndex); Write(p_file, m_unk0x022); } else if (p_file->IsReadMode()) { @@ -1445,7 +1440,7 @@ MxResult Act1State::Serialize(LegoFile* p_file) } } - Read(p_file, &m_unk0x010); + Read(p_file, &m_unk0x008.m_nextIndex); Read(p_file, &m_unk0x022); }