From 9cc5df8c400f3789e7a9742e0a2fe361a0f18373 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Sat, 20 Apr 2024 10:07:58 -0400 Subject: [PATCH] Implement/match LegoAnimMMPresenter::StartingTickle (#824) --- LEGO1/lego/legoomni/include/legoanimpresenter.h | 1 + LEGO1/lego/legoomni/include/legotraninfo.h | 4 ++-- .../legoomni/src/common/legoanimationmanager.cpp | 2 +- .../legoomni/src/common/legoanimmmpresenter.cpp | 13 +++++++++++-- LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp | 8 ++++++++ 5 files changed, 23 insertions(+), 5 deletions(-) diff --git a/LEGO1/lego/legoomni/include/legoanimpresenter.h b/LEGO1/lego/legoomni/include/legoanimpresenter.h index b503a995..31832560 100644 --- a/LEGO1/lego/legoomni/include/legoanimpresenter.h +++ b/LEGO1/lego/legoomni/include/legoanimpresenter.h @@ -71,6 +71,7 @@ class LegoAnimPresenter : public MxVideoPresenter { virtual void VTable0xa0(Matrix4*); // vtable+0xa0 + MxResult FUN_1006b140(LegoROI* p_roi); void FUN_1006d680(LegoAnimActor* p_actor, MxFloat p_value); inline LegoAnim* GetAnimation() { return m_anim; } diff --git a/LEGO1/lego/legoomni/include/legotraninfo.h b/LEGO1/lego/legoomni/include/legotraninfo.h index e3c80868..1c67d204 100644 --- a/LEGO1/lego/legoomni/include/legotraninfo.h +++ b/LEGO1/lego/legoomni/include/legotraninfo.h @@ -15,7 +15,7 @@ struct LegoTranInfo { LegoTranInfo() { m_index = 0; - m_unk0x08 = 0; + m_unk0x08 = NULL; m_unk0x0c = NULL; m_unk0x10 = FALSE; m_unk0x12 = -1; @@ -32,7 +32,7 @@ struct LegoTranInfo { undefined4 m_unk0x00; // 0x00 MxU32 m_index; // 0x04 - undefined4 m_unk0x08; // 0x08 + LegoROI* m_unk0x08; // 0x08 MxMatrix* m_unk0x0c; // 0x0c MxBool m_unk0x10; // 0x10 MxS16 m_unk0x12; // 0x12 diff --git a/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp b/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp index 172ac406..af86a088 100644 --- a/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp +++ b/LEGO1/lego/legoomni/src/common/legoanimationmanager.cpp @@ -457,7 +457,7 @@ MxResult LegoAnimationManager::FUN_100609f0(MxU32 p_objectId, MxMatrix* p_matrix info->m_unk0x00 = 0; info->m_index = ++m_unk0x1c; info->m_unk0x10 = FALSE; - info->m_unk0x08 = 0; + info->m_unk0x08 = NULL; info->m_unk0x12 = -1; info->m_unk0x14 = 0; info->m_objectId = p_objectId; diff --git a/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp b/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp index 7b4d5c39..01f7f13c 100644 --- a/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp +++ b/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp @@ -12,6 +12,7 @@ #include "mxmisc.h" #include "mxnotificationmanager.h" #include "mxobjectfactory.h" +#include "mxtimer.h" #include "mxutilities.h" DECOMP_SIZE_ASSERT(LegoAnimMMPresenter, 0x74) @@ -124,10 +125,18 @@ void LegoAnimMMPresenter::ReadyTickle() ProgressTickleState(e_starting); } -// STUB: LEGO1 0x1004b1c0 +// FUNCTION: LEGO1 0x1004b1c0 +// FUNCTION: BETA10 0x1004c2cc void LegoAnimMMPresenter::StartingTickle() { - // TODO + if (m_unk0x4c == NULL || m_unk0x4c->GetCurrentTickleState() == e_idle) { + if (m_tranInfo != NULL && m_tranInfo->m_unk0x08 != NULL) { + m_unk0x4c->FUN_1006b140(m_tranInfo->m_unk0x08); + } + + m_unk0x50 = Timer()->GetTime(); + ProgressTickleState(e_streaming); + } } // STUB: LEGO1 0x1004b220 diff --git a/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp b/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp index a79a77f2..196acac1 100644 --- a/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp +++ b/LEGO1/lego/legoomni/src/video/legoanimpresenter.cpp @@ -563,6 +563,14 @@ void LegoAnimPresenter::PutFrame() } } +// STUB: LEGO1 0x1006b140 +// FUNCTION: BETA10 0x100507e0 +MxResult LegoAnimPresenter::FUN_1006b140(LegoROI* p_roi) +{ + // TODO + return FAILURE; +} + // FUNCTION: LEGO1 0x1006b550 void LegoAnimPresenter::ReadyTickle() {