From ac89815663a89f59e26989b711f2bc98e19b71a7 Mon Sep 17 00:00:00 2001 From: Joshua Peisach Date: Thu, 3 Aug 2023 12:54:08 -0400 Subject: [PATCH] =?UTF-8?q?=20=F0=9F=8D=95=20=20(#79)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * start pizza * Add some pizza vtable functions (they are stubs at the moment) Unknown parameter types, likely either Pizzeria or PizzaMissionState. * Pizza: Add/update functions as according to MxCore inheritance IsleActor::Notify needs to be stubbed --------- Co-authored-by: Kai Kaufman * match pizza destructor * Update pizza members * add size asserts --------- Co-authored-by: Kai Kaufman Co-authored-by: itsmattkc <34096995+itsmattkc@users.noreply.github.com> --- CMakeLists.txt | 1 + LEGO1/isleactor.cpp | 3 +++ LEGO1/legoactor.cpp | 3 +++ LEGO1/legoactor.h | 5 +++++ LEGO1/pizza.cpp | 25 +++++++++++++++++++++---- LEGO1/pizza.h | 28 ++++++++++++++++++++++++++++ 6 files changed, 61 insertions(+), 4 deletions(-) create mode 100644 LEGO1/legoactor.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index fa4de1e5..8f0980d0 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -46,6 +46,7 @@ add_library(lego1 SHARED LEGO1/jukeboxstate.cpp LEGO1/legoact2state.cpp LEGO1/legoactioncontrolpresenter.cpp + LEGO1/legoactor.cpp LEGO1/legoanimactor.cpp LEGO1/legoanimationmanager.cpp LEGO1/legoanimmmpresenter.cpp diff --git a/LEGO1/isleactor.cpp b/LEGO1/isleactor.cpp index ca286e37..a28afc6b 100644 --- a/LEGO1/isleactor.cpp +++ b/LEGO1/isleactor.cpp @@ -1 +1,4 @@ #include "isleactor.h" + +// NOTE: This is copied from base class LegoActor. IsleActor may in fact be larger but we don't know yet. +DECOMP_SIZE_ASSERT(IsleActor, 0x78) diff --git a/LEGO1/legoactor.cpp b/LEGO1/legoactor.cpp new file mode 100644 index 00000000..c26cc1fc --- /dev/null +++ b/LEGO1/legoactor.cpp @@ -0,0 +1,3 @@ +#include "legoactor.h" + +DECOMP_SIZE_ASSERT(LegoActor, 0x78) diff --git a/LEGO1/legoactor.h b/LEGO1/legoactor.h index 9b23e943..828f48ad 100644 --- a/LEGO1/legoactor.h +++ b/LEGO1/legoactor.h @@ -1,6 +1,7 @@ #ifndef LEGOACTOR_H #define LEGOACTOR_H +#include "decomp.h" #include "legoentity.h" // VTABLE 0x100d6d68 @@ -20,6 +21,10 @@ class LegoActor : public LegoEntity { return !strcmp(name, LegoActor::ClassName()) || LegoEntity::IsA(name); } + +private: + undefined unk04_[0x68]; + }; #endif // LEGOACTOR_H diff --git a/LEGO1/pizza.cpp b/LEGO1/pizza.cpp index e7e9c552..93f67aaa 100644 --- a/LEGO1/pizza.cpp +++ b/LEGO1/pizza.cpp @@ -1,13 +1,30 @@ #include "pizza.h" -// OFFSET: LEGO1 0x10037ef0 STUB +#include "decomp.h" + +DECOMP_SIZE_ASSERT(Pizza, 0x9c); + +// OFFSET: LEGO1 0x10037ef0 Pizza::Pizza() { - // TODO + // FIXME: This inherits from LegoActor, probably why this isn't matching + this->m_unk80 = 0; + this->m_unk84 = 0; + this->m_unk88 = 0; + this->m_unk8c = -1; + this->m_unk98 = 0; + this->m_unk90 = 0x80000000; } -// OFFSET: LEGO1 0x10038100 STUB +// OFFSET: LEGO1 0x10038100 Pizza::~Pizza() { - // TODO + TickleManager()->Unregister(this); +} + +// OFFSET: LEGO1 0x100388a0 +MxResult Pizza::Tickle() +{ + // TODO + return SUCCESS; } diff --git a/LEGO1/pizza.h b/LEGO1/pizza.h index c47ef40e..34d781c9 100644 --- a/LEGO1/pizza.h +++ b/LEGO1/pizza.h @@ -2,6 +2,10 @@ #define PIZZA_H #include "isleactor.h" +#include "mxcore.h" +#include "mxomni.h" +#include "mxticklemanager.h" +#include "mxtypes.h" // VTABLE 0x100d7380 // SIZE 0x9c @@ -11,6 +15,30 @@ class Pizza : public IsleActor Pizza(); virtual ~Pizza() override; + virtual MxResult Tickle() override; // vtable+08 + + // OFFSET: LEGO1 0x10037f90 + inline const char *ClassName() const //vtable+0c + { + // 0x100f038c + return "Pizza"; + } + + // OFFSET: LEGO1 0x10037fa0 + inline MxBool Pizza::IsA(const char *name) const override //vtable+10 + { + return !strcmp(name, Pizza::ClassName()) || IsleActor::IsA(name); + } +private: + MxS32 m_unk78; + MxS32 m_unk7c; + MxS32 m_unk80; + MxS32 m_unk84; + MxS32 m_unk88; + MxS32 m_unk8c; + MxU32 m_unk90; + MxS32 m_unk94; + MxS32 m_unk98; }; #endif // PIZZA_H