From 8d729f77b7cf7790f6ac1d8e9721d69276642fdc Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Sat, 20 Apr 2024 10:24:12 -0400 Subject: [PATCH] Implement/match LegoAnimMMPresenter Streaming/RepeatingTickle and Notify (#825) --- .../legoomni/include/legoanimmmpresenter.h | 2 + .../src/common/legoanimmmpresenter.cpp | 45 ++++++++++++++++--- 2 files changed, 40 insertions(+), 7 deletions(-) diff --git a/LEGO1/lego/legoomni/include/legoanimmmpresenter.h b/LEGO1/lego/legoomni/include/legoanimmmpresenter.h index 3c4869d8..33ad2e52 100644 --- a/LEGO1/lego/legoomni/include/legoanimmmpresenter.h +++ b/LEGO1/lego/legoomni/include/legoanimmmpresenter.h @@ -44,6 +44,8 @@ class LegoAnimMMPresenter : public MxCompositePresenter { MxBool FUN_1004b8b0(); private: + MxBool FUN_1004b450(); + LegoAnimPresenter* m_unk0x4c; // 0x4c undefined4 m_unk0x50; // 0x50 undefined4 m_unk0x54; // 0x54 diff --git a/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp b/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp index 01f7f13c..52db2304 100644 --- a/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp +++ b/LEGO1/lego/legoomni/src/common/legoanimmmpresenter.cpp @@ -139,29 +139,52 @@ void LegoAnimMMPresenter::StartingTickle() } } -// STUB: LEGO1 0x1004b220 +// FUNCTION: LEGO1 0x1004b220 +// FUNCTION: BETA10 0x1004c372 void LegoAnimMMPresenter::StreamingTickle() { - // TODO + if (FUN_1004b450()) { + ProgressTickleState(e_repeating); + } } -// STUB: LEGO1 0x1004b250 +// FUNCTION: LEGO1 0x1004b250 +// FUNCTION: BETA10 0x1004c3a4 void LegoAnimMMPresenter::RepeatingTickle() { - // TODO + if (m_unk0x4c == NULL) { + ProgressTickleState(e_unk5); + } + else if (m_list.size() <= 1) { + if (m_list.front() == m_unk0x4c) { + m_unk0x4c->SetTickleState(e_done); + ProgressTickleState(e_unk5); + } + else { + ProgressTickleState(e_unk5); + } + } } // FUNCTION: LEGO1 0x1004b2c0 +// FUNCTION: BETA10 0x1004c469 void LegoAnimMMPresenter::DoneTickle() { // Empty } -// STUB: LEGO1 0x1004b2d0 +// FUNCTION: LEGO1 0x1004b2d0 +// FUNCTION: BETA10 0x1004c47f MxLong LegoAnimMMPresenter::Notify(MxParam& p_param) { - // TODO - return 0; + AUTOLOCK(m_criticalSection); + + if (((MxNotificationParam&) p_param).GetType() == c_notificationEndAction && + ((MxNotificationParam&) p_param).GetSender() == m_unk0x4c) { + m_unk0x4c = NULL; + } + + return MxCompositePresenter::Notify(p_param); } // FUNCTION: LEGO1 0x1004b360 @@ -200,6 +223,14 @@ void LegoAnimMMPresenter::ParseExtra() } } +// STUB: LEGO1 0x1004b450 +// FUNCTION: BETA10 0x1004c71d +MxBool LegoAnimMMPresenter::FUN_1004b450() +{ + // TODO + return TRUE; +} + // FUNCTION: LEGO1 0x1004b8b0 // FUNCTION: BETA10 0x1004d104 MxBool LegoAnimMMPresenter::FUN_1004b8b0()