From 3afbf808d186fee463385ce0067fc8774b2871c4 Mon Sep 17 00:00:00 2001 From: Misha <106913236+MishaProductions@users.noreply.github.com> Date: Sun, 8 Oct 2023 09:46:09 -0400 Subject: [PATCH] MxMediaPresenter vtable (#189) * Add vtables for MxMediaPresenter * remove comments and fix override --- LEGO1/mxmediapresenter.cpp | 56 ++++++++++++++++++++++++++++++++++++++ LEGO1/mxmediapresenter.h | 13 +++++++-- LEGO1/mxpresenter.h | 4 +-- 3 files changed, 68 insertions(+), 5 deletions(-) diff --git a/LEGO1/mxmediapresenter.cpp b/LEGO1/mxmediapresenter.cpp index f36ecbdc..00a2b851 100644 --- a/LEGO1/mxmediapresenter.cpp +++ b/LEGO1/mxmediapresenter.cpp @@ -2,6 +2,12 @@ DECOMP_SIZE_ASSERT(MxMediaPresenter, 0x50); +// OFFSET: LEGO1 0x1000c550 +MxMediaPresenter::~MxMediaPresenter() +{ + Destroy(TRUE); +} + // OFFSET: LEGO1 0x100b5d10 STUB MxResult MxMediaPresenter::Tickle() { @@ -18,6 +24,56 @@ void MxMediaPresenter::Init() this->m_unk4c = NULL; } +// OFFSET: LEGO1 0x100b54f0 STUB +void MxMediaPresenter::Destroy(MxBool p_destroy) +{ + // TODO +} + +// OFFSET: LEGO1 0x100b5d90 STUB +void MxMediaPresenter::StreamingTickle() +{ + // TODO +} + +// OFFSET: LEGO1 0x100b5e10 STUB +void MxMediaPresenter::RepeatingTickle() +{ + // TODO +} + +// OFFSET: LEGO1 0x100b5ef0 +void MxMediaPresenter::DoneTickle() +{ + m_previousTickleStates |= 1 << m_currentTickleState; + m_currentTickleState = TickleState_Idle; + EndAction(); +} + +// OFFSET: LEGO1 0x100b6030 STUB +void MxMediaPresenter::Enable(MxBool p_enable) +{ + // TODO +} + +// OFFSET: LEGO1 0x1000c5b0 +void MxMediaPresenter::InitVirtual() +{ + Destroy(FALSE); +} + +// OFFSET: LEGO1 0x100b5700 STUB +MxLong MxMediaPresenter::StartAction(MxStreamController * p_controller, MxDSAction * p_action) +{ + return 0; +} + +// OFFSET: LEGO1 0x100b5bc0 STUB +void MxMediaPresenter::EndAction() +{ + // TODO +} + // OFFSET: LEGO1 0x100b5f10 STUB void MxMediaPresenter::VTable0x58() { diff --git a/LEGO1/mxmediapresenter.h b/LEGO1/mxmediapresenter.h index 824dd399..167b10c1 100644 --- a/LEGO1/mxmediapresenter.h +++ b/LEGO1/mxmediapresenter.h @@ -13,8 +13,9 @@ class MxMediaPresenter : public MxPresenter { Init(); } + virtual ~MxMediaPresenter() override; - virtual MxResult Tickle() override; // vtable+0x8, override MxCore + virtual MxResult Tickle() override; // OFFSET: LEGO1 0x1000c5c0 inline virtual const char *ClassName() const override // vtable+0xc @@ -29,7 +30,14 @@ class MxMediaPresenter : public MxPresenter return !strcmp(name, MxMediaPresenter::ClassName()) || MxPresenter::IsA(name); } - virtual void VTable0x58(); // vtable+0x58 + virtual void StreamingTickle() override; + virtual void RepeatingTickle() override; + virtual void DoneTickle() override; + virtual void InitVirtual() override; + virtual MxLong StartAction(MxStreamController *, MxDSAction *) override; + virtual void EndAction() override; + virtual void Enable(MxBool p_enable) override; + virtual void VTable0x58(); undefined4 m_unk40; undefined4 m_unk44; @@ -37,6 +45,7 @@ class MxMediaPresenter : public MxPresenter undefined4 m_unk4c; private: void Init(); + void Destroy(MxBool); }; diff --git a/LEGO1/mxpresenter.h b/LEGO1/mxpresenter.h index 156065f4..959533c5 100644 --- a/LEGO1/mxpresenter.h +++ b/LEGO1/mxpresenter.h @@ -15,7 +15,7 @@ class MxStreamController; class MxPresenter : public MxCore { public: - enum TickleState + enum TickleState { TickleState_Idle = 0, TickleState_Ready, @@ -78,8 +78,6 @@ class MxPresenter : public MxCore protected: __declspec(dllexport) void Init(); void SendTo_unkPresenter(MxOmni *); - -private: TickleState m_currentTickleState; // 0x8 MxU32 m_previousTickleStates; MxPoint32 m_location;