From 587ac7a9d7c764e8570966efcab9d90bfba8ed4a Mon Sep 17 00:00:00 2001 From: vMidz <147055059+vMidz@users.noreply.github.com> Date: Mon, 23 Oct 2023 17:08:22 +0300 Subject: [PATCH] implement LegoPathPresenter (#238) * implement LegoPathPresenter implement some LegoPathPresenter functions * Update legopathpresenter.cpp * Minor fixes * Order functions --------- Co-authored-by: Christian Semmler --- LEGO1/legopathpresenter.cpp | 64 +++++++++++++++++++++++++++++++++++-- LEGO1/legopathpresenter.h | 13 +++++++- 2 files changed, 74 insertions(+), 3 deletions(-) diff --git a/LEGO1/legopathpresenter.cpp b/LEGO1/legopathpresenter.cpp index 43b05e26..14f383ab 100644 --- a/LEGO1/legopathpresenter.cpp +++ b/LEGO1/legopathpresenter.cpp @@ -1,7 +1,67 @@ #include "legopathpresenter.h" +#include "legoomni.h" +#include "legovideomanager.h" +#include "mxautolocker.h" -// OFFSET: LEGO1 0x100448d0 STUB +DECOMP_SIZE_ASSERT(LegoPathPresenter, 0x54); + +// OFFSET: LEGO1 0x100448d0 LegoPathPresenter::LegoPathPresenter() +{ + Init(); +} + +// OFFSET: LEGO1 0x10044ab0 +void LegoPathPresenter::Init() +{ + +} + +// OFFSET: LEGO1 0x10044b40 +MxResult LegoPathPresenter::AddToManager() +{ + MxResult status = FAILURE; + + if (VideoManager()) { + VideoManager()->AddPresenter(*this); + status = SUCCESS; + } + + return status; +} + +// OFFSET: LEGO1 0x10044b70 +void LegoPathPresenter::Destroy(MxBool p_fromDestructor) +{ + if (VideoManager()) + VideoManager()->RemovePresenter(*this); + + { + MxAutoLocker lock(&this->m_criticalSection); + Init(); + } + + if (!p_fromDestructor) + MxMediaPresenter::Destroy(FALSE); +} + +// OFFSET: LEGO1 0x10044c10 +void LegoPathPresenter::Destroy() +{ + Destroy(FALSE); +} + +// OFFSET: LEGO1 0x10044d40 +void LegoPathPresenter::RepeatingTickle() +{ + if (this->m_action->GetDuration() == -1) + return; + + EndAction(); +} + +// OFFSET: LEGO1 0x10044d60 STUB +void LegoPathPresenter::ParseExtra() { // TODO -} \ No newline at end of file +} diff --git a/LEGO1/legopathpresenter.h b/LEGO1/legopathpresenter.h index 225f4256..21341af3 100644 --- a/LEGO1/legopathpresenter.h +++ b/LEGO1/legopathpresenter.h @@ -23,7 +23,18 @@ class LegoPathPresenter : public MxMediaPresenter return !strcmp(name, LegoPathPresenter::ClassName()) || MxMediaPresenter::IsA(name); } + virtual void RepeatingTickle() override; // vtable+0x24 + virtual void ParseExtra() override; // vtable+0x30 + virtual MxResult AddToManager() override; // vtable+0x34 + virtual void Destroy() override; // vtable+0x38 + +private: + void Init(); + +protected: + void Destroy(MxBool p_fromDestructor); + + MxAtomId m_atomId; // 0x50 }; - #endif // LEGOPATHPRESENTER_H