From 3cab98925001d5bac031eaecae6f06a3ca1ae556 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Sat, 20 Apr 2024 11:52:46 -0400 Subject: [PATCH] Implement/match LegoAnimMMPresenter::FUN_1004b580 (#829) --- .../legoomni/include/legoanimationmanager.h | 2 +- .../legoomni/include/legoanimmmpresenter.h | 2 +- LEGO1/lego/legoomni/include/legotraninfo.h | 6 ++--- .../src/common/legoanimationmanager.cpp | 4 +-- .../src/common/legoanimmmpresenter.cpp | 26 ++++++++++++++----- 5 files changed, 26 insertions(+), 14 deletions(-) diff --git a/LEGO1/lego/legoomni/include/legoanimationmanager.h b/LEGO1/lego/legoomni/include/legoanimationmanager.h index 2a948d7f..2076c181 100644 --- a/LEGO1/lego/legoomni/include/legoanimationmanager.h +++ b/LEGO1/lego/legoomni/include/legoanimationmanager.h @@ -113,7 +113,7 @@ class LegoAnimationManager : public MxCore { LegoTranInfoList* m_tranInfoList; // 0x20 LegoTranInfoList* m_tranInfoList2; // 0x24 MxPresenter* m_unk0x28[2]; // 0x28 - MxPresenter* m_unk0x30[2]; // 0x30 + MxLong m_unk0x30[2]; // 0x30 undefined m_unk0x38; // 0x38 MxBool m_unk0x39; // 0x39 undefined m_unk0x3a; // 0x3a diff --git a/LEGO1/lego/legoomni/include/legoanimmmpresenter.h b/LEGO1/lego/legoomni/include/legoanimmmpresenter.h index f5c40ac0..eb040af0 100644 --- a/LEGO1/lego/legoomni/include/legoanimmmpresenter.h +++ b/LEGO1/lego/legoomni/include/legoanimmmpresenter.h @@ -70,7 +70,7 @@ class LegoAnimMMPresenter : public MxCompositePresenter { MxLong m_unk0x50; // 0x50 undefined4 m_unk0x54; // 0x54 MxU8 m_unk0x58; // 0x58 - MxBool m_unk0x59; // 0x59 + MxU8 m_unk0x59; // 0x59 MxU32 m_animmanId; // 0x5c LegoTranInfo* m_tranInfo; // 0x60 LegoWorld* m_unk0x64; // 0x64 diff --git a/LEGO1/lego/legoomni/include/legotraninfo.h b/LEGO1/lego/legoomni/include/legotraninfo.h index 1c67d204..dfea986a 100644 --- a/LEGO1/lego/legoomni/include/legotraninfo.h +++ b/LEGO1/lego/legoomni/include/legotraninfo.h @@ -17,7 +17,7 @@ struct LegoTranInfo { m_index = 0; m_unk0x08 = NULL; m_unk0x0c = NULL; - m_unk0x10 = FALSE; + m_unk0x10 = 0; m_unk0x12 = -1; m_unk0x14 = FALSE; m_unk0x1c = NULL; @@ -34,13 +34,13 @@ struct LegoTranInfo { MxU32 m_index; // 0x04 LegoROI* m_unk0x08; // 0x08 MxMatrix* m_unk0x0c; // 0x0c - MxBool m_unk0x10; // 0x10 + MxU8 m_unk0x10; // 0x10 MxS16 m_unk0x12; // 0x12 MxBool m_unk0x14; // 0x14 MxBool m_unk0x15; // 0x15 MxU32 m_objectId; // 0x18 MxPresenter** m_unk0x1c; // 0x1c - MxPresenter** m_unk0x20; // 0x20 + MxLong* m_unk0x20; // 0x20 LegoAnimMMPresenter* m_presenter; // 0x24 MxBool m_unk0x28; // 0x28 MxBool m_unk0x29; // 0x29 diff --git a/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp b/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp index af86a088..581f0f2c 100644 --- a/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp +++ b/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp @@ -157,7 +157,7 @@ MxResult LegoAnimationManager::LoadScriptInfo(MxS32 p_scriptIndex) for (i = 0; i < (MxS32) _countof(m_unk0x28); i++) { m_unk0x28[i] = NULL; - m_unk0x30[i] = NULL; + m_unk0x30[i] = 0; } m_unk0x38 = 0; @@ -456,7 +456,7 @@ MxResult LegoAnimationManager::FUN_100609f0(MxU32 p_objectId, MxMatrix* p_matrix LegoTranInfo* info = new LegoTranInfo(); info->m_unk0x00 = 0; info->m_index = ++m_unk0x1c; - info->m_unk0x10 = FALSE; + info->m_unk0x10 = 0; info->m_unk0x08 = NULL; info->m_unk0x12 = -1; info->m_unk0x14 = 0; diff --git a/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp b/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp index 241900ec..487f4fff 100644 --- a/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp +++ b/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp @@ -23,7 +23,7 @@ LegoAnimMMPresenter::LegoAnimMMPresenter() { m_presenter = NULL; m_animmanId = 0; - m_unk0x59 = FALSE; + m_unk0x59 = 0; m_tranInfo = NULL; m_unk0x54 = 0; m_unk0x64 = NULL; @@ -308,20 +308,32 @@ MxBool LegoAnimMMPresenter::FUN_1004b530(MxLong p_time) return TRUE; } -// STUB: LEGO1 0x1004b570 +// FUNCTION: LEGO1 0x1004b570 // FUNCTION: BETA10 0x1004c9cc MxBool LegoAnimMMPresenter::FUN_1004b570(MxLong p_time) { - // TODO - return FALSE; + return TRUE; } -// STUB: LEGO1 0x1004b580 +// FUNCTION: LEGO1 0x1004b580 // FUNCTION: BETA10 0x1004ca3f MxBool LegoAnimMMPresenter::FUN_1004b580(MxLong p_time) { - // TODO - return FALSE; + switch (m_unk0x59) { + case 0: + if (m_tranInfo != NULL && m_tranInfo->m_unk0x15 != FALSE && m_tranInfo->m_unk0x20 != NULL && + m_tranInfo->m_unk0x20[0] > p_time) { + return FALSE; + } + case 1: + case 2: + case 3: + case 4: + case 5: + break; + } + + return TRUE; } // STUB: LEGO1 0x1004b5b0