From 1fa2fd9737b16b7f12f5ad96d8417c503e8176bd Mon Sep 17 00:00:00 2001 From: Joshua Peisach Date: Sun, 10 Sep 2023 08:01:39 -0400 Subject: [PATCH] The IslePathActor's (#113) * pizza: fix type m_unk90 * Initial implementation of a lot of IslePathActor's All IslePathActor's seem to have (for the most part), the same few variables in common, probably some ID. SkateBoard, Pizza and TowTrack seem to be a bit more complicated with additional fields surrounding it. * Add missing ClassName(s) and IsA(s) * Add decomp size asserts * Fix size assertions * Make legopathactor fields protected for now, fix a type in Pizza * Fix TowTrack structure --------- Co-authored-by: Christian Semmler --- LEGO1/ambulance.cpp | 18 ++++++++++++++++-- LEGO1/ambulance.h | 15 ++++++++++++++- LEGO1/bike.cpp | 8 ++++++-- LEGO1/bike.h | 5 ++++- LEGO1/dunebuggy.cpp | 9 +++++++-- LEGO1/dunebuggy.h | 7 ++++++- LEGO1/jetski.cpp | 8 ++++++-- LEGO1/jetski.h | 5 ++++- LEGO1/legopathactor.h | 12 ++++++++---- LEGO1/racecar.cpp | 6 ++++-- LEGO1/racecar.h | 17 +++++++++++++++++ LEGO1/skateboard.cpp | 14 ++++++++++++-- LEGO1/skateboard.h | 17 +++++++++++++++++ LEGO1/towtrack.cpp | 14 ++++++++++++-- LEGO1/towtrack.h | 26 ++++++++++++++++++++++++++ 15 files changed, 159 insertions(+), 22 deletions(-) diff --git a/LEGO1/ambulance.cpp b/LEGO1/ambulance.cpp index 6b5e76ad..707f7a8d 100644 --- a/LEGO1/ambulance.cpp +++ b/LEGO1/ambulance.cpp @@ -1,7 +1,21 @@ #include "ambulance.h" -// OFFSET: LEGO1 0x10035ee0 STUB +#include "decomp.h" + +DECOMP_SIZE_ASSERT(Ambulance, 0x184); + +// OFFSET: LEGO1 0x10035ee0 Ambulance::Ambulance() { - // TODO + this->m_unk168 = 0; + this->m_unk16a = -1; + this->m_unk164 = 0; + this->m_unk16c = 0; + this->m_unk174 = -1; + this->m_unk16e = 0; + this->m_unk178 = -1; + this->m_unk170 = 0; + this->m_unk172 = 0; + this->m_unk13c = 40.0; + this->m_unk17c = 1.0; } \ No newline at end of file diff --git a/LEGO1/ambulance.h b/LEGO1/ambulance.h index dd89af3c..3371830f 100644 --- a/LEGO1/ambulance.h +++ b/LEGO1/ambulance.h @@ -22,7 +22,20 @@ class Ambulance : public IslePathActor { return !strcmp(name, Ambulance::ClassName()) || IslePathActor::IsA(name); } - +private: + // TODO: Ambulance fields + undefined m_unk160[4]; + MxS32 m_unk164; + MxS16 m_unk168; + MxS16 m_unk16a; + MxS16 m_unk16c; + MxS16 m_unk16e; + MxS16 m_unk170; + MxS16 m_unk172; + MxS32 m_unk174; + MxS32 m_unk178; + MxFloat m_unk17c; + undefined m_unk180[4]; }; #endif // AMBULANCE_H diff --git a/LEGO1/bike.cpp b/LEGO1/bike.cpp index ac741a44..217e8c64 100644 --- a/LEGO1/bike.cpp +++ b/LEGO1/bike.cpp @@ -1,8 +1,12 @@ #include "bike.h" -// OFFSET: LEGO1 0x10076670 STUB +DECOMP_SIZE_ASSERT(Bike, 0x164); + +// OFFSET: LEGO1 0x10076670 Bike::Bike() { - // TODO + this->m_unk13c = 20.0; + this->m_unk150 = 3.0; + this->m_unk148 = 1; } diff --git a/LEGO1/bike.h b/LEGO1/bike.h index 8d2de0f1..af8711a5 100644 --- a/LEGO1/bike.h +++ b/LEGO1/bike.h @@ -1,6 +1,7 @@ #ifndef BIKE_H #define BIKE_H +#include "decomp.h" #include "islepathactor.h" // VTABLE 0x100d9808 @@ -22,7 +23,9 @@ class Bike : public IslePathActor { return !strcmp(name, Bike::ClassName()) || IslePathActor::IsA(name); } - +private: + // TODO: Bike fields + undefined m_unk160[4]; }; diff --git a/LEGO1/dunebuggy.cpp b/LEGO1/dunebuggy.cpp index babf21cb..42fd4c37 100644 --- a/LEGO1/dunebuggy.cpp +++ b/LEGO1/dunebuggy.cpp @@ -1,7 +1,12 @@ #include "dunebuggy.h" -// OFFSET: LEGO1 0x10067bb0 STUB +#include "decomp.h" + +DECOMP_SIZE_ASSERT(DuneBuggy, 0x16c); + +// OFFSET: LEGO1 0x10067bb0 DuneBuggy::DuneBuggy() { - // TODO + this->m_unk13c = 25.0; + this->m_unk164 = 1.0; } \ No newline at end of file diff --git a/LEGO1/dunebuggy.h b/LEGO1/dunebuggy.h index 1f89784e..1a083207 100644 --- a/LEGO1/dunebuggy.h +++ b/LEGO1/dunebuggy.h @@ -1,6 +1,7 @@ #ifndef DUNEBUGGY_H #define DUNEBUGGY_H +#include "decomp.h" #include "islepathactor.h" // VTABLE 0x100d8f98 @@ -22,7 +23,11 @@ class DuneBuggy : public IslePathActor { return !strcmp(name, DuneBuggy::ClassName()) || IslePathActor::IsA(name); } - +private: + // TODO: Double check DuneBuggy field types + undefined4 m_unk160; + MxFloat m_unk164; + undefined4 m_unk168; }; #endif // DUNEBUGGY_H diff --git a/LEGO1/jetski.cpp b/LEGO1/jetski.cpp index 50676253..20993cf3 100644 --- a/LEGO1/jetski.cpp +++ b/LEGO1/jetski.cpp @@ -1,7 +1,11 @@ #include "jetski.h" -// OFFSET: LEGO1 0x1007e3b0 STUB +DECOMP_SIZE_ASSERT(Jetski, 0x164); + +// OFFSET: LEGO1 0x1007e3b0 Jetski::Jetski() { - // TODO + this->m_unk13c = 25.0; + this->m_unk150 = 2.0; + this->m_unk148 = 1; } \ No newline at end of file diff --git a/LEGO1/jetski.h b/LEGO1/jetski.h index 7cabea4d..d5de5a76 100644 --- a/LEGO1/jetski.h +++ b/LEGO1/jetski.h @@ -1,6 +1,7 @@ #ifndef JETSKI_H #define JETSKI_H +#include "decomp.h" #include "islepathactor.h" // VTABLE 0x100d9ec8 @@ -22,7 +23,9 @@ class Jetski : public IslePathActor { return !strcmp(name, Jetski::ClassName()) || IslePathActor::IsA(name); } - +private: + // TODO: Jetski fields + undefined m_unk160[4]; }; diff --git a/LEGO1/legopathactor.h b/LEGO1/legopathactor.h index 7e524b08..41c6d843 100644 --- a/LEGO1/legopathactor.h +++ b/LEGO1/legopathactor.h @@ -25,11 +25,15 @@ class LegoPathActor : public LegoActor { return !strcmp(name, LegoPathActor::ClassName()) || LegoActor::IsA(name); } - - // TODO: the types. Pizza needs this as public: +protected: + // TODO: the types undefined unk78[0xc4]; - MxS32 m_unk13c; - undefined unk140[0x14]; + MxFloat m_unk13c; + MxS32 m_unk140; + MxS32 m_unk144; + undefined m_unk148; + MxS32 m_unk14c; + MxFloat m_unk150; }; #endif // LEGOPATHACTOR_H diff --git a/LEGO1/racecar.cpp b/LEGO1/racecar.cpp index 59bb5146..4e4a4a21 100644 --- a/LEGO1/racecar.cpp +++ b/LEGO1/racecar.cpp @@ -1,9 +1,11 @@ #include "racecar.h" -// OFFSET: LEGO1 0x10028200 STUB +DECOMP_SIZE_ASSERT(RaceCar, 0x164); + +// OFFSET: LEGO1 0x10028200 RaceCar::RaceCar() { - // TODO + this->m_unk13c = 40.0; } // OFFSET: LEGO1 0x10028420 STUB diff --git a/LEGO1/racecar.h b/LEGO1/racecar.h index f8bd6ccf..f10d9b62 100644 --- a/LEGO1/racecar.h +++ b/LEGO1/racecar.h @@ -1,6 +1,7 @@ #ifndef RACECAR_H #define RACECAR_H +#include "decomp.h" #include "islepathactor.h" // VTABLE 0x100d6918 @@ -10,6 +11,22 @@ class RaceCar : public IslePathActor public: RaceCar(); virtual ~RaceCar() override; // vtable+0x0 + + // OFFSET: LEGO1 0x10028270 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f03e0 + return "RaceCar"; + } + + // OFFSET: LEGO1 0x10028280 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, RaceCar::ClassName()) || IslePathActor::IsA(name); + } +private: + // TODO: RaceCar fields + undefined m_unk160[4]; }; #endif // RACECAR_H diff --git a/LEGO1/skateboard.cpp b/LEGO1/skateboard.cpp index 42466206..5c5cbf38 100644 --- a/LEGO1/skateboard.cpp +++ b/LEGO1/skateboard.cpp @@ -1,7 +1,17 @@ #include "skateboard.h" +#include "mxomni.h" -// OFFSET: LEGO1 0x1000fd40 STUB +#include "decomp.h" + +DECOMP_SIZE_ASSERT(SkateBoard, 0x168); + +// OFFSET: LEGO1 0x1000fd40 SkateBoard::SkateBoard() { - // TODO + this->m_unk160 = 0; + this->m_unk13c = 15.0; + this->m_unk150 = 3.5; + this->m_unk148 = 1; + + NotificationManager()->Register(this); } diff --git a/LEGO1/skateboard.h b/LEGO1/skateboard.h index f290dc7b..e7fb1fc8 100644 --- a/LEGO1/skateboard.h +++ b/LEGO1/skateboard.h @@ -1,6 +1,7 @@ #ifndef SKATEBOARD_H #define SKATEBOARD_H +#include "decomp.h" #include "islepathactor.h" // VTABLE 0x100d55f0 @@ -10,6 +11,22 @@ class SkateBoard : public IslePathActor public: SkateBoard(); + // OFFSET: LEGO1 0x1000fdd0 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f041c + return "SkateBoard"; + } + + // OFFSET: LEGO1 0x1000fde0 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, SkateBoard::ClassName()) || IslePathActor::IsA(name); + } +private: + // TODO: SkateBoard types + undefined m_unk160; + undefined m_unk161[0x7]; }; #endif // SKATEBOARD_H diff --git a/LEGO1/towtrack.cpp b/LEGO1/towtrack.cpp index 90d3d018..3b7a9264 100644 --- a/LEGO1/towtrack.cpp +++ b/LEGO1/towtrack.cpp @@ -1,7 +1,17 @@ #include "towtrack.h" -// OFFSET: LEGO1 0x1004c720 STUB +DECOMP_SIZE_ASSERT(TowTrack, 0x180); + +// OFFSET: LEGO1 0x1004c720 TowTrack::TowTrack() { - // TODO + this->m_unk168 = 0; + this->m_unk16a = -1; + this->m_unk164 = 0; + this->m_unk16c = 0; + this->m_unk170 = -1; + this->m_unk16e = 0; + this->m_unk174 = -1; + this->m_unk13c = 40.0; + this->m_unk178 = 1.0; } diff --git a/LEGO1/towtrack.h b/LEGO1/towtrack.h index 95e6885a..7263ab3a 100644 --- a/LEGO1/towtrack.h +++ b/LEGO1/towtrack.h @@ -1,6 +1,7 @@ #ifndef TOWTRACK_H #define TOWTRACK_H +#include "decomp.h" #include "islepathactor.h" // VTABLE 0x100d7ee0 @@ -10,6 +11,31 @@ class TowTrack : public IslePathActor public: TowTrack(); + // OFFSET: LEGO1 0x1004c7c0 + inline virtual const char *ClassName() const override // vtable+0x0c + { + // 0x100f03b8 + return "TowTrack"; + } + + // OFFSET: LEGO1 0x1004c7d0 + inline virtual MxBool IsA(const char *name) const override // vtable+0x10 + { + return !strcmp(name, TowTrack::ClassName()) || IslePathActor::IsA(name); + } + +private: + // TODO: TowTrack field types + undefined m_unk154[4]; + MxS32 m_unk164; + MxS16 m_unk168; + MxS16 m_unk16a; + MxS16 m_unk16c; + MxS16 m_unk16e; + MxS32 m_unk170; + MxS32 m_unk174; + MxFloat m_unk178; + undefined4 m_unk17c; };