From b902790c54aec89c009f398434705904437a79a1 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Tue, 30 Apr 2024 06:38:55 -0400 Subject: [PATCH] Implement/match LegoAnimationManager::FUN_1005f6d0 and FUN_1005f700 (#871) * Implement/match LegoAnimationManager::FUN_1005f6d0 and FUN_1005f700 * Use bool constants --- .../legoomni/include/legoanimationmanager.h | 12 +++--- .../src/common/legoanimationmanager.cpp | 40 +++++++++++++------ 2 files changed, 34 insertions(+), 18 deletions(-) diff --git a/LEGO1/lego/legoomni/include/legoanimationmanager.h b/LEGO1/lego/legoomni/include/legoanimationmanager.h index 10a9158e..7ba6705b 100644 --- a/LEGO1/lego/legoomni/include/legoanimationmanager.h +++ b/LEGO1/lego/legoomni/include/legoanimationmanager.h @@ -69,8 +69,8 @@ class LegoAnimationManager : public MxCore { void Reset(MxBool p_und); void Suspend(); void Resume(); - void FUN_1005f6d0(MxBool); - void FUN_1005f700(MxBool); + void FUN_1005f6d0(MxBool p_unk0x400); + void FUN_1005f700(MxBool p_unk0x3a); MxResult LoadScriptInfo(MxS32 p_scriptIndex); MxBool FindVehicle(const char* p_name, MxU32& p_index); MxResult ReadAnimInfo(LegoFile* p_file, AnimInfo* p_info); @@ -136,10 +136,10 @@ class LegoAnimationManager : public MxCore { MxLong m_unk0x30[2]; // 0x30 MxBool m_unk0x38; // 0x38 MxBool m_unk0x39; // 0x39 - undefined m_unk0x3a; // 0x3a + MxBool m_unk0x3a; // 0x3a Unknown0x3c m_unk0x3c[40]; // 0x3c undefined4 m_unk0x3fc; // 0x3fc - MxU8 m_unk0x400; // 0x400 + MxBool m_unk0x400; // 0x400 undefined m_unk0x401; // 0x401 MxU8 m_unk0x402; // 0x402 MxLong m_unk0x404; // 0x404 @@ -151,8 +151,8 @@ class LegoAnimationManager : public MxCore { undefined4 m_unk0x41c; // 0x41c AnimState* m_animState; // 0x420 LegoROIList* m_unk0x424; // 0x424 - undefined m_unk0x428; // 0x428 - undefined m_unk0x429; // 0x429 + MxBool m_unk0x428; // 0x428 + MxBool m_unk0x429; // 0x429 undefined m_unk0x42a; // 0x42a MxBool m_suspended; // 0x42b undefined4 m_unk0x42c; // 0x42c diff --git a/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp b/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp index 55ae98d7..61f801f2 100644 --- a/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp +++ b/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp @@ -236,8 +236,8 @@ void LegoAnimationManager::Suspend() m_unk0x18 = 0; m_unk0x1a = 0; - m_unk0x3a = 0; - m_unk0x400 = 0; + m_unk0x3a = FALSE; + m_unk0x400 = FALSE; m_unk0x414 = 0; m_unk0x401 = 0; @@ -290,9 +290,9 @@ void LegoAnimationManager::Init() m_unk0x38 = FALSE; m_unk0x39 = FALSE; - m_unk0x3a = 1; + m_unk0x3a = TRUE; m_unk0x3fc = 0; - m_unk0x400 = 0; + m_unk0x400 = FALSE; m_unk0x414 = 0; m_unk0x418 = 5; m_unk0x0e = 0; @@ -322,16 +322,32 @@ void LegoAnimationManager::Init() m_unk0x424 = new LegoROIList(); } -// STUB: LEGO1 0x1005f6d0 -void LegoAnimationManager::FUN_1005f6d0(MxBool) +// FUNCTION: LEGO1 0x1005f6d0 +// FUNCTION: BETA10 0x100401e7 +void LegoAnimationManager::FUN_1005f6d0(MxBool p_unk0x400) { - // TODO + if (m_suspended) { + m_unk0x429 = p_unk0x400; + } + else { + m_unk0x400 = p_unk0x400; + + if (!p_unk0x400) { + FUN_100627d0(TRUE); + } + } } -// STUB: LEGO1 0x1005f700 -void LegoAnimationManager::FUN_1005f700(MxBool) +// FUNCTION: LEGO1 0x1005f700 +// FUNCTION: BETA10 0x1004024c +void LegoAnimationManager::FUN_1005f700(MxBool p_unk0x3a) { - // TODO + if (m_suspended) { + m_unk0x428 = p_unk0x3a; + } + else { + m_unk0x3a = p_unk0x3a; + } } // FUNCTION: LEGO1 0x1005f720 @@ -477,8 +493,8 @@ MxResult LegoAnimationManager::LoadScriptInfo(MxS32 p_scriptIndex) m_unk0x428 = m_unk0x3a; m_unk0x429 = m_unk0x400; m_unk0x42a = 1; - m_unk0x3a = 0; - m_unk0x400 = 0; + m_unk0x3a = FALSE; + m_unk0x400 = FALSE; m_unk0x402 = 0; }