From bac891cb0cc343d2a333e6abf0b9e85b5cfb17d3 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Tue, 7 May 2024 10:54:06 -0400 Subject: [PATCH] Implement/match LegoAnimationManager::FUN_10060570 (#886) --- .../legoomni/include/legoanimationmanager.h | 2 +- .../src/common/legoanimationmanager.cpp | 22 ++++++++++++++++--- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/LEGO1/lego/legoomni/include/legoanimationmanager.h b/LEGO1/lego/legoomni/include/legoanimationmanager.h index 56efee8c..5683b9d2 100644 --- a/LEGO1/lego/legoomni/include/legoanimationmanager.h +++ b/LEGO1/lego/legoomni/include/legoanimationmanager.h @@ -82,7 +82,7 @@ class LegoAnimationManager : public MxCore { MxBool FindVehicle(const char* p_name, MxU32& p_index); MxResult ReadAnimInfo(LegoFile* p_file, AnimInfo* p_info); MxResult ReadModelInfo(LegoFile* p_file, ModelInfo* p_info); - void FUN_10060570(MxBool); + void FUN_10060570(MxBool p_unk0x1a); MxResult StartEntityAction(MxDSAction& p_dsAction, LegoEntity* p_entity); MxResult FUN_10060dc0( IsleScript::Script p_objectId, diff --git a/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp b/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp index 8f304edf..7e3aedc0 100644 --- a/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp +++ b/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp @@ -667,10 +667,26 @@ void LegoAnimationManager::DeleteAnimations() m_suspended = suspended; } -// STUB: LEGO1 0x10060570 -void LegoAnimationManager::FUN_10060570(MxBool) +// FUNCTION: LEGO1 0x10060570 +// FUNCTION: BETA10 0x10041463 +void LegoAnimationManager::FUN_10060570(MxBool p_unk0x1a) { - // TODO + m_unk0x39 = FALSE; + m_unk0x430 = FALSE; + m_unk0x42c = NULL; + + if (m_unk0x1a != p_unk0x1a && (m_unk0x1a = p_unk0x1a)) { + do { + if (FUN_100605e0(m_unk0x18, TRUE, NULL, TRUE, NULL, FALSE, TRUE, TRUE, TRUE) != FAILURE) { + return; + } + + m_unk0x18++; + } while (m_unk0x18 < m_animCount); + + m_unk0x1a = FALSE; + m_unk0x18 = 0; + } } // FUNCTION: LEGO1 0x100605e0