From a45706a854aa54dae49cdf093a6348da2909ec80 Mon Sep 17 00:00:00 2001 From: Nathan Date: Fri, 22 Mar 2024 11:09:26 -0400 Subject: [PATCH] Fix size annotations for legoomni Fix structure and add placeholder annotations for LegoAnimActor and subclasses --- CMakeLists.txt | 4 ++ LEGO1/lego/legoomni/include/act2actor.h | 16 +++++++ LEGO1/lego/legoomni/include/act3actor.h | 15 ++++--- LEGO1/lego/legoomni/include/act3shark.h | 10 ++++- LEGO1/lego/legoomni/include/buildingentity.h | 2 +- LEGO1/lego/legoomni/include/bumpbouy.h | 7 +++- LEGO1/lego/legoomni/include/elevatorbottom.h | 2 +- LEGO1/lego/legoomni/include/isleactor.h | 1 + LEGO1/lego/legoomni/include/legoactor.h | 2 +- LEGO1/lego/legoomni/include/legoanimactor.h | 35 ++++++++++++++-- .../lego/legoomni/include/legocarraceactor.h | 34 ++++++++++++++- LEGO1/lego/legoomni/include/legoextraactor.h | 24 ++++++++++- LEGO1/lego/legoomni/include/legogamestate.h | 1 + LEGO1/lego/legoomni/include/legojetski.h | 15 ++++++- .../legoomni/include/legojetskiraceactor.h | 11 ++++- .../include/legoloopinganimpresenter.h | 2 +- .../legoomni/include/legometerpresenter.h | 2 +- .../legoomni/include/legomodelpresenter.h | 2 +- .../lego/legoomni/include/legoobjectfactory.h | 1 + .../lego/legoomni/include/legopartpresenter.h | 2 +- LEGO1/lego/legoomni/include/legopathactor.h | 2 +- LEGO1/lego/legoomni/include/legoraceactor.h | 16 ++++++- LEGO1/lego/legoomni/include/legoracecar.h | 23 +++++++++- LEGO1/lego/legoomni/include/legoracemap.h | 35 ++++++++++++++++ .../legoomni/include/legotexturepresenter.h | 2 +- .../legoomni/include/legounknown100d7c88.h | 1 + LEGO1/lego/legoomni/include/police.h | 1 - LEGO1/lego/legoomni/include/raceskel.h | 16 +++++++ LEGO1/lego/legoomni/src/act3/act3shark.cpp | 13 ++++++ LEGO1/lego/legoomni/src/actors/act2actor.cpp | 7 ++++ LEGO1/lego/legoomni/src/actors/act3actor.cpp | 7 ++++ LEGO1/lego/legoomni/src/actors/bumpbouy.cpp | 5 +++ .../src/common/legocharactermanager.cpp | 2 +- .../legoomni/src/entity/legocarraceactor.cpp | 35 ++++++++++++++++ LEGO1/lego/legoomni/src/entity/legojetski.cpp | 22 ++++++++++ .../src/entity/legojetskiraceactor.cpp | 9 ++++ .../lego/legoomni/src/paths/legoanimactor.cpp | 24 +++++++++-- .../legoomni/src/paths/legoextraactor.cpp | 14 +++++++ .../lego/legoomni/src/race/legoraceactor.cpp | 7 ++++ LEGO1/lego/legoomni/src/race/legoracecar.cpp | 42 +++++++++++++++++++ LEGO1/lego/legoomni/src/race/legoracemap.cpp | 19 +++++++++ LEGO1/lego/legoomni/src/race/raceskel.cpp | 7 ++++ 42 files changed, 460 insertions(+), 37 deletions(-) create mode 100644 LEGO1/lego/legoomni/include/act2actor.h create mode 100644 LEGO1/lego/legoomni/include/legoracemap.h create mode 100644 LEGO1/lego/legoomni/include/raceskel.h create mode 100644 LEGO1/lego/legoomni/src/actors/act2actor.cpp create mode 100644 LEGO1/lego/legoomni/src/actors/act3actor.cpp create mode 100644 LEGO1/lego/legoomni/src/paths/legoextraactor.cpp create mode 100644 LEGO1/lego/legoomni/src/race/legoracemap.cpp create mode 100644 LEGO1/lego/legoomni/src/race/raceskel.cpp diff --git a/CMakeLists.txt b/CMakeLists.txt index 369c646e..c96cc111 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -282,6 +282,8 @@ add_library(lego1 SHARED LEGO1/lego/legoomni/src/act2/legoact2state.cpp LEGO1/lego/legoomni/src/act3/act3shark.cpp LEGO1/lego/legoomni/src/act3/act3state.cpp + LEGO1/lego/legoomni/src/actors/act2actor.cpp + LEGO1/lego/legoomni/src/actors/act3actor.cpp LEGO1/lego/legoomni/src/actors/ambulance.cpp LEGO1/lego/legoomni/src/actors/bike.cpp LEGO1/lego/legoomni/src/actors/bumpbouy.cpp @@ -373,7 +375,9 @@ add_library(lego1 SHARED LEGO1/lego/legoomni/src/race/legorace.cpp LEGO1/lego/legoomni/src/race/legoraceactor.cpp LEGO1/lego/legoomni/src/race/legoracecar.cpp + LEGO1/lego/legoomni/src/race/legoracemap.cpp LEGO1/lego/legoomni/src/race/racestandsentity.cpp + LEGO1/lego/legoomni/src/race/raceskel.cpp LEGO1/lego/legoomni/src/race/racestate.cpp LEGO1/lego/legoomni/src/towtrack/towtrackmissionstate.cpp LEGO1/lego/legoomni/src/unknown/legounknown100d7c88.cpp diff --git a/LEGO1/lego/legoomni/include/act2actor.h b/LEGO1/lego/legoomni/include/act2actor.h new file mode 100644 index 00000000..048162ba --- /dev/null +++ b/LEGO1/lego/legoomni/include/act2actor.h @@ -0,0 +1,16 @@ +#include "legoanimactor.h" + +/* + VTABLE: LEGO1 0x100d6078 LegoPathActor + VTABLE: LEGO1 0x100d6148 LegoAnimActor +*/ +// SIZE 0x1a8 +class Act2Actor : public LegoAnimActor { + Act2Actor(); + + // SYNTHETIC: LEGO1 0x1001a090 + // Act2Actor::`scalar deleting destructor' + +private: + undefined m_unk0x1c[0x34]; // 0x1c +}; diff --git a/LEGO1/lego/legoomni/include/act3actor.h b/LEGO1/lego/legoomni/include/act3actor.h index 3d146cb7..c87c52bf 100644 --- a/LEGO1/lego/legoomni/include/act3actor.h +++ b/LEGO1/lego/legoomni/include/act3actor.h @@ -1,13 +1,18 @@ #ifndef ACT3ACTOR_H #define ACT3ACTOR_H -#include "mxcore.h" +#include "legoanimactor.h" -// FIXME: Uncertain location. There are three vtables which eventually call this -// class' ClassName() function, but none of them call it directly. -class Act3Actor : public MxCore { +/* + VTABLE : LEGO1 0x100d7668 LegoPathActor + VTABLE : LEGO1 0x100d7738 LegoAnimActor +*/ +// SIZE 0x178 +class Act3Actor : public LegoAnimActor { public: - // FUNCTION: LEGO1 0x100431b0 + Act3Actor(); + + // FUNCTION: LEGO1 0x100433b0 inline const char* ClassName() const override { // STRING: LEGO1 0x100f03ac diff --git a/LEGO1/lego/legoomni/include/act3shark.h b/LEGO1/lego/legoomni/include/act3shark.h index b0b26a48..0fb549a4 100644 --- a/LEGO1/lego/legoomni/include/act3shark.h +++ b/LEGO1/lego/legoomni/include/act3shark.h @@ -3,9 +3,15 @@ #include "legoanimactor.h" -// VTABLE: LEGO1 0x100d7920 +/* + VTABLE : LEGO1 0x100d7920 LegoPathActor + VTABLE : LEGO1 0x100d79f0 LegoAnimActor +*/ +// SIZE 0x1a8 class Act3Shark : public LegoAnimActor { public: + Act3Shark(); + // FUNCTION: LEGO1 0x100430c0 inline const char* ClassName() const override // vtable+0x0c { @@ -24,6 +30,8 @@ class Act3Shark : public LegoAnimActor { void VTable0x70(float p_float) override; // vtable+0x70 void VTable0x74(Matrix4& p_transform) override; // vtable+0x74 + virtual MxResult FUN_10042ce0(void*); + // SYNTHETIC: LEGO1 0x10043020 // Act3Shark::`scalar deleting destructor' }; diff --git a/LEGO1/lego/legoomni/include/buildingentity.h b/LEGO1/lego/legoomni/include/buildingentity.h index 57297558..dd6d4594 100644 --- a/LEGO1/lego/legoomni/include/buildingentity.h +++ b/LEGO1/lego/legoomni/include/buildingentity.h @@ -4,7 +4,7 @@ #include "legoentity.h" // VTABLE: LEGO1 0x100d5c88 -// SIZE <= 0x68, hard to tell because it's always constructed as a derivative +// SIZE 0x68 class BuildingEntity : public LegoEntity { public: BuildingEntity(); diff --git a/LEGO1/lego/legoomni/include/bumpbouy.h b/LEGO1/lego/legoomni/include/bumpbouy.h index c6308d57..c7fc3831 100644 --- a/LEGO1/lego/legoomni/include/bumpbouy.h +++ b/LEGO1/lego/legoomni/include/bumpbouy.h @@ -4,9 +4,14 @@ #include "legoanimactor.h" #include "mxtypes.h" -// VTABLE: LEGO1 0x100d6790 +/* + VTABLE : LEGO1 0x100d6790 LegoPathActor + VTABLE : LEGO1 0x100d6860 LegoAnimActor +*/ +// SIZE 0x174 class BumpBouy : public LegoAnimActor { public: + BumpBouy(); MxLong Notify(MxParam& p_param) override; // vtable+0x04 // FUNCTION: LEGO1 0x100274e0 diff --git a/LEGO1/lego/legoomni/include/elevatorbottom.h b/LEGO1/lego/legoomni/include/elevatorbottom.h index 38fbc19a..e2886f5c 100644 --- a/LEGO1/lego/legoomni/include/elevatorbottom.h +++ b/LEGO1/lego/legoomni/include/elevatorbottom.h @@ -8,7 +8,7 @@ class LegoControlManagerEvent; // VTABLE: LEGO1 0x100d5f20 -// SIZE: 0xfc (from inlined ctor at 0x1000a8aa) +// SIZE 0xfc class ElevatorBottom : public LegoWorld { public: ElevatorBottom(); diff --git a/LEGO1/lego/legoomni/include/isleactor.h b/LEGO1/lego/legoomni/include/isleactor.h index c51946d3..5ddf79ac 100644 --- a/LEGO1/lego/legoomni/include/isleactor.h +++ b/LEGO1/lego/legoomni/include/isleactor.h @@ -4,6 +4,7 @@ #include "legoactor.h" // VTABLE: LEGO1 0x100d5178 +// SIZE 0x78 class IsleActor : public LegoActor { public: MxLong Notify(MxParam& p_param) override; // vtable+0x04 diff --git a/LEGO1/lego/legoomni/include/legoactor.h b/LEGO1/lego/legoomni/include/legoactor.h index 8cccbd71..5c3fe3e0 100644 --- a/LEGO1/lego/legoomni/include/legoactor.h +++ b/LEGO1/lego/legoomni/include/legoactor.h @@ -48,7 +48,7 @@ class LegoActor : public LegoEntity { static const char* GetActorName(MxU8 p_id); -private: +protected: MxFloat m_unk0x68; // 0x68 LegoCacheSound* m_sound; // 0x6c MxFloat m_unk0x70; // 0x70 diff --git a/LEGO1/lego/legoomni/include/legoanimactor.h b/LEGO1/lego/legoomni/include/legoanimactor.h index 8d1900e1..9a287701 100644 --- a/LEGO1/lego/legoomni/include/legoanimactor.h +++ b/LEGO1/lego/legoomni/include/legoanimactor.h @@ -4,10 +4,39 @@ #include "decomp.h" #include "legopathactor.h" -class LegoAnimActor : public LegoPathActor { +/* + VTABLE: LEGO1 0x100d5440 LegoPathActor + VTABLE: LEGO1 0x100d5510 LegoAnimActor +*/ +// SIZE 0x174 +class LegoAnimActor : public virtual LegoPathActor { public: - LegoAnimActor() {} - LegoAnimActor(undefined4); + LegoAnimActor() { m_index = -1; } + + // FUNCTION: LEGO1 0x1000fb90 + inline const char* ClassName() const override // vtable+0x0c + { + // STRING: LEGO1 0x100f057c + return "LegoAnimActor"; + } + + // FUNCTION: LEGO1 0x1000fbb0 + inline MxBool IsA(const char* p_name) const override // vtable+0x10 + { + return !strcmp(p_name, LegoAnimActor::ClassName()) || LegoPathActor::IsA(p_name); + } + + virtual MxResult FUN_1001c1f0(float& p_out); + virtual MxResult FUN_1001c360(float, undefined4); + virtual MxResult FUN_1001c450(undefined4, undefined4, undefined4, undefined4); + virtual void FUN_1001c800(); + + // SYNTHETIC: LEGO1 0x1000fb50 + // LegoAnimActor::`scalar deleting destructor' + +private: + vector m_vector; // 0x00 + MxU16 m_index; // 0x14 }; #endif // LEGOANIMACTOR_H diff --git a/LEGO1/lego/legoomni/include/legocarraceactor.h b/LEGO1/lego/legoomni/include/legocarraceactor.h index 3905be16..31ac97ad 100644 --- a/LEGO1/lego/legoomni/include/legocarraceactor.h +++ b/LEGO1/lego/legoomni/include/legocarraceactor.h @@ -3,9 +3,16 @@ #include "legoraceactor.h" -// VTABLE: LEGO1 0x100da0d8 -class LegoCarRaceActor : public LegoRaceActor { +/* + VTABLE: LEGO1 0x100da0c0 LegoRaceActor + VTABLE: LEGO1 0x100da0c8 LegoAnimActor + VTABLE: LEGO1 0x100da0d8 LegoPathActor + VTABLE: LEGO1 0x100da1a8 LegoCarRaceActor +*/ +// SIZE 0x1a0 +class LegoCarRaceActor : public virtual LegoRaceActor { public: + LegoCarRaceActor(); // FUNCTION: LEGO1 0x10081650 inline const char* ClassName() const override // vtable+0x0c { @@ -27,8 +34,31 @@ class LegoCarRaceActor : public LegoRaceActor { void VTable0x98() override; // vtable+0x98 void VTable0x9c() override; // vtable+0x9c + virtual void FUN_10080590(); + // FUNCTION: LEGO1 0x10012bb0 + virtual void FUN_10012bb0(float p_unk0x14) { m_unk0x14 = p_unk0x14; } + // FUNCTION: LEGO1 0x10012bc0 + virtual float FUN_10012bc0() { return m_unk0x14; } + // FUNCTION: LEGO1 0x10012bd0 + virtual void FUN_10012bd0(float p_unk0x10) { m_unk0x10 = p_unk0x10; } + // FUNCTION: LEGO1 0x10012be0 + virtual float FUN_10012be0() { return m_unk0x10; } + // FUNCTION: LEGO1 0x10012bf0 + virtual void FUN_10012bf0(float p_unk0x18) { m_unk0x18 = p_unk0x18; } + // FUNCTION: LEGO1 0x10012c00 + virtual float FUN_10012c00() { return m_unk0x18; } + virtual void FUN_10080740(); + // SYNTHETIC: LEGO1 0x10081610 // LegoCarRaceActor::`scalar deleting destructor' + +protected: + float m_unk0x08; // 0x08 + MxU8 m_unk0x0c; // 0x0c + float m_unk0x10; // 0x10 + float m_unk0x14; // 0x14 + float m_unk0x18; // 0x18 + undefined4 m_unk0x1c; // 0x1c }; #endif // LEGOCARRACEACTOR_H diff --git a/LEGO1/lego/legoomni/include/legoextraactor.h b/LEGO1/lego/legoomni/include/legoextraactor.h index 87a0ab21..579702c5 100644 --- a/LEGO1/lego/legoomni/include/legoextraactor.h +++ b/LEGO1/lego/legoomni/include/legoextraactor.h @@ -3,9 +3,16 @@ #include "legoanimactor.h" -// VTABLE: LEGO1 0x100d6c10 -class LegoExtraActor : public LegoAnimActor { +/* + VTABLE : LEGO1 0x100d6c00 LegoAnimActor + VTABLE : LEGO1 0x100d6c10 LegoPathActor + VTABLE : LEGO1 0x100d6cdc LegoExtraActor +*/ +// SIZE 0x1dc +class LegoExtraActor : public virtual LegoAnimActor { public: + LegoExtraActor(); + // FUNCTION: LEGO1 0x1002b7a0 inline const char* ClassName() const override // vtable+0x0c { @@ -18,6 +25,19 @@ class LegoExtraActor : public LegoAnimActor { { return !strcmp(p_name, LegoExtraActor::ClassName()) || LegoAnimActor::IsA(p_name); } + + virtual MxResult FUN_1002aae0(); + +private: + undefined4 m_unk0x08; // 0x08 + undefined m_unk0x0c; // 0x0c + undefined m_unk0x0d; // 0x0d + undefined m_unk0x0e; // 0x0e + undefined4 m_unk0x10; // 0x10 + undefined m_unk0x14; // 0x14 + MxMatrix m_unk0x18; // 0x18 + undefined4 m_unk0x60; // 0x60 + undefined4 m_unk0x64; // 0x64 }; #endif // LEGOEXTRAACTOR_H diff --git a/LEGO1/lego/legoomni/include/legogamestate.h b/LEGO1/lego/legoomni/include/legogamestate.h index f6fc965e..f3b976a1 100644 --- a/LEGO1/lego/legoomni/include/legogamestate.h +++ b/LEGO1/lego/legoomni/include/legogamestate.h @@ -13,6 +13,7 @@ class LegoState; class MxVariable; class MxString; +// SIZE 0x08 struct ColorStringStruct { const char* m_targetName; const char* m_colorName; diff --git a/LEGO1/lego/legoomni/include/legojetski.h b/LEGO1/lego/legoomni/include/legojetski.h index 1ec0b9bb..1d121412 100644 --- a/LEGO1/lego/legoomni/include/legojetski.h +++ b/LEGO1/lego/legoomni/include/legojetski.h @@ -2,10 +2,19 @@ #define LEGOJETSKI_H #include "legojetskiraceactor.h" +#include "legoracemap.h" -// VTABLE: LEGO1 0x100d5a40 -class LegoJetski : public LegoJetskiRaceActor { +/* + VTABLE: LEGO1 0x100d5a08 LegoJetskiRaceActor + VTABLE: LEGO1 0x100d5a28 LegoRaceActor + VTABLE: LEGO1 0x100d5a30 LegoAnimActor + VTABLE: LEGO1 0x100d5a40 LegoPathActor + VTABLE: LEGO1 0x100d5b10 LegoRaceMap +*/ +// SIZE 0x1dc +class LegoJetski : public LegoJetskiRaceActor, public LegoRaceMap { public: + LegoJetski(); MxLong Notify(MxParam& p_param) override; // vtable+0x04 // FUNCTION: LEGO1 0x10013e80 @@ -29,6 +38,8 @@ class LegoJetski : public LegoJetskiRaceActor { void VTable0x98() override; // vtable+0x98 void VTable0x9c() override; // vtable+0x9c + virtual void FUN_100136f0(float p_worldSpeed); + // SYNTHETIC: LEGO1 0x10013e20 // LegoJetski::`scalar deleting destructor' }; diff --git a/LEGO1/lego/legoomni/include/legojetskiraceactor.h b/LEGO1/lego/legoomni/include/legojetskiraceactor.h index fd7d88bb..acd717de 100644 --- a/LEGO1/lego/legoomni/include/legojetskiraceactor.h +++ b/LEGO1/lego/legoomni/include/legojetskiraceactor.h @@ -3,9 +3,16 @@ #include "legocarraceactor.h" -// VTABLE: LEGO1 0x100da240 -class LegoJetskiRaceActor : public LegoCarRaceActor { +/* + VTABLE: LEGO1 0x100da208 LegoCarRaceActor + VTABLE: LEGO1 0x100da228 LegoRaceActor + VTABLE: LEGO1 0x100da230 LegoAnimActor + VTABLE: LEGO1 0x100da240 LegoPathActor +*/ +// SIZE 0x1a8 +class LegoJetskiRaceActor : public virtual LegoCarRaceActor { public: + LegoJetskiRaceActor(); // FUNCTION: LEGO1 0x10081d80 inline const char* ClassName() const override // vtable+0x0c { diff --git a/LEGO1/lego/legoomni/include/legoloopinganimpresenter.h b/LEGO1/lego/legoomni/include/legoloopinganimpresenter.h index 50815015..07154297 100644 --- a/LEGO1/lego/legoomni/include/legoloopinganimpresenter.h +++ b/LEGO1/lego/legoomni/include/legoloopinganimpresenter.h @@ -4,7 +4,7 @@ #include "legoanimpresenter.h" // VTABLE: LEGO1 0x100d4900 -// SIZE 0xc0 (discovered through inlined constructor at 0x10009ecd) +// SIZE 0xc0 class LegoLoopingAnimPresenter : public LegoAnimPresenter { public: // FUNCTION: LEGO1 0x1000c9a0 diff --git a/LEGO1/lego/legoomni/include/legometerpresenter.h b/LEGO1/lego/legoomni/include/legometerpresenter.h index 378c0574..8bb57608 100644 --- a/LEGO1/lego/legoomni/include/legometerpresenter.h +++ b/LEGO1/lego/legoomni/include/legometerpresenter.h @@ -4,7 +4,7 @@ #include "mxstillpresenter.h" // VTABLE: LEGO1 0x100d7ac8 -// SIZE 0x94 (from 0x1000a163) +// SIZE 0x94 class LegoMeterPresenter : public MxStillPresenter { public: LegoMeterPresenter(); diff --git a/LEGO1/lego/legoomni/include/legomodelpresenter.h b/LEGO1/lego/legoomni/include/legomodelpresenter.h index 8bc784a4..f8b4cea1 100644 --- a/LEGO1/lego/legoomni/include/legomodelpresenter.h +++ b/LEGO1/lego/legoomni/include/legomodelpresenter.h @@ -9,7 +9,7 @@ class LegoEntity; class MxDSChunk; // VTABLE: LEGO1 0x100d4e50 -// SIZE 0x6c (discovered through inline constructor at 0x10009ae6) +// SIZE 0x6c class LegoModelPresenter : public MxVideoPresenter { public: LegoModelPresenter() { Reset(); } diff --git a/LEGO1/lego/legoomni/include/legoobjectfactory.h b/LEGO1/lego/legoomni/include/legoobjectfactory.h index b119631b..6745814e 100644 --- a/LEGO1/lego/legoomni/include/legoobjectfactory.h +++ b/LEGO1/lego/legoomni/include/legoobjectfactory.h @@ -102,6 +102,7 @@ X(AnimState) // VTABLE: LEGO1 0x100d4768 +// SIZE 0x1c8 class LegoObjectFactory : public MxObjectFactory { public: LegoObjectFactory(); diff --git a/LEGO1/lego/legoomni/include/legopartpresenter.h b/LEGO1/lego/legoomni/include/legopartpresenter.h index 875c39a7..5de1402d 100644 --- a/LEGO1/lego/legoomni/include/legopartpresenter.h +++ b/LEGO1/lego/legoomni/include/legopartpresenter.h @@ -5,7 +5,7 @@ #include "mxmediapresenter.h" // VTABLE: LEGO1 0x100d4df0 -// SIZE 0x54 (from inlined construction at 0x10009fac) +// SIZE 0x54 class LegoPartPresenter : public MxMediaPresenter { public: LegoPartPresenter() { Reset(); } diff --git a/LEGO1/lego/legoomni/include/legopathactor.h b/LEGO1/lego/legoomni/include/legopathactor.h index 01bb91e0..509b4c18 100644 --- a/LEGO1/lego/legoomni/include/legopathactor.h +++ b/LEGO1/lego/legoomni/include/legopathactor.h @@ -6,7 +6,7 @@ #include "realtime/matrix.h" // VTABLE: LEGO1 0x100d6e28 -// SIZE 0x154 (from inlined construction at 0x1000a346) +// SIZE 0x154 class LegoPathActor : public LegoActor { public: LegoPathActor(); diff --git a/LEGO1/lego/legoomni/include/legoraceactor.h b/LEGO1/lego/legoomni/include/legoraceactor.h index 48f66b26..153e8b19 100644 --- a/LEGO1/lego/legoomni/include/legoraceactor.h +++ b/LEGO1/lego/legoomni/include/legoraceactor.h @@ -4,9 +4,15 @@ #include "legoanimactor.h" #include "realtime/matrix.h" -// VTABLE: LEGO1 0x100d5b88 -class LegoRaceActor : public LegoAnimActor { +/* + VTABLE: LEGO1 0x100d5b78 LegoAnimActor + VTABLE: LEGO1 0x100d5b88 LegoPathActor + VTABLE: LEGO1 0x100d5c54 LegoRaceActor +*/ +// SIZE 0x180 +class LegoRaceActor : public virtual LegoAnimActor { public: + LegoRaceActor(); // FUNCTION: LEGO1 0x10014af0 inline const char* ClassName() const override // vtable+0x0c { @@ -28,8 +34,14 @@ class LegoRaceActor : public LegoAnimActor { MxS32 VTable0x90() override; // vtable+0x90 MxS32 VTable0x94() override; // vtable+0x94 + // FUNCTION: LEGO1 0x10014aa0 + virtual MxResult FUN_10014aa0() { return SUCCESS; } + // SYNTHETIC: LEGO1 0x10014ab0 // LegoRaceActor::`scalar deleting destructor' + +private: + undefined4 m_unk0x08; // 0x08 }; #endif // LEGORACEACTOR_H diff --git a/LEGO1/lego/legoomni/include/legoracecar.h b/LEGO1/lego/legoomni/include/legoracecar.h index f90c4cad..8c86cb2f 100644 --- a/LEGO1/lego/legoomni/include/legoracecar.h +++ b/LEGO1/lego/legoomni/include/legoracecar.h @@ -3,11 +3,19 @@ #include "legocarraceactor.h" #include "legopathactor.h" +#include "legoracemap.h" -// VTABLE: LEGO1 0x100d58b8 +/* + VTABLE: LEGO1 0x100d58a0 LegoRaceActor + VTABLE: LEGO1 0x100d58a8 LegoAnimActor + VTABLE: LEGO1 0x100d58b8 LegoPathActor + VTABLE: LEGO1 0x100d5894 LegoRaceMap + VTABLE: LEGO1 0x100d5898 LegoCarRaceActor +*/ // SIZE 0x200 -class LegoRaceCar : public LegoCarRaceActor { +class LegoRaceCar : public LegoCarRaceActor, public LegoRaceMap { public: + LegoRaceCar(); MxLong Notify(MxParam& p_param) override; // vtable+0x04 // FUNCTION: LEGO1 0x10014290 @@ -31,8 +39,19 @@ class LegoRaceCar : public LegoCarRaceActor { void VTable0x98() override; // vtable+0x98 void VTable0x9c() override; // vtable+0x9c + virtual void FUN_10012ea0(float p_worldSpeed); + virtual void FUN_10012bf0(float); + virtual MxBool FUN_10013130(float); + // SYNTHETIC: LEGO1 0x10014230 // LegoRaceCar::`scalar deleting destructor' + byte m_unk0x54; // 0x54 + undefined4 m_unk0x58; // 0x58 + Mx3DPointFloat m_unk0x5c; // 0x5c + undefined4 m_unk0x70; // 0x70 + undefined4 m_unk0x74; // 0x74 + undefined4 m_unk0x78; // 0x78 + undefined4 m_unk0x7c; // 0x7c }; #endif // LEGOCARRACE_H diff --git a/LEGO1/lego/legoomni/include/legoracemap.h b/LEGO1/lego/legoomni/include/legoracemap.h new file mode 100644 index 00000000..3fd23d3e --- /dev/null +++ b/LEGO1/lego/legoomni/include/legoracemap.h @@ -0,0 +1,35 @@ +#ifndef LEGORACEMAP_H +#define LEGORACEMAP_H + +#include "legoraceactor.h" + +/* + VTABLE: LEGO1 0x100d5510 LegoRaceActor + VTABLE: LEGO1 0x100d5510 LegoAnimActor + VTABLE: LEGO1 0x100d5440 LegoPathActor + VTABLE: LEGO1 0x100d5510 LegoRaceMap +*/ +// SIZE 0x1b4 +class LegoRaceMap : public virtual LegoRaceActor { +public: + LegoRaceMap(); + virtual void FUN_1005d4b0(); + + // SYNTHETIC: LEGO1 0x1005d5c0 + // LegoRaceMap::`scalar deleting destructor' + +private: + MxBool m_unk0x08; // 0x08 + void* m_unk0x0c; // 0x0c + undefined4 m_unk0x10; // 0x10 + float m_unk0x14; // 0x14 + float m_unk0x18; // 0x18 + float m_unk0x1c; // 0x1c + float m_unk0x20; // 0x20 + float m_unk0x24; // 0x24 + float m_unk0x28; // 0x28 + float m_unk0x2c; // 0x2c + undefined4 m_unk0x30; // 0x30 +}; + +#endif // LEGORACEMAP_H diff --git a/LEGO1/lego/legoomni/include/legotexturepresenter.h b/LEGO1/lego/legoomni/include/legotexturepresenter.h index be42cc59..49947295 100644 --- a/LEGO1/lego/legoomni/include/legotexturepresenter.h +++ b/LEGO1/lego/legoomni/include/legotexturepresenter.h @@ -5,7 +5,7 @@ #include "mxmediapresenter.h" // VTABLE: LEGO1 0x100d4d90 -// SIZE 0x54 (from inlined construction at 0x10009bb5) +// SIZE 0x54 class LegoTexturePresenter : public MxMediaPresenter { public: LegoTexturePresenter() : m_textures(NULL) {} diff --git a/LEGO1/lego/legoomni/include/legounknown100d7c88.h b/LEGO1/lego/legoomni/include/legounknown100d7c88.h index 2fa960c8..36f20e85 100644 --- a/LEGO1/lego/legoomni/include/legounknown100d7c88.h +++ b/LEGO1/lego/legoomni/include/legounknown100d7c88.h @@ -5,6 +5,7 @@ #include "mxstring.h" // VTABLE: LEGO1 0x100d7c88 +// SIZE 0x18 class LegoUnknown100d7c88 { public: ~LegoUnknown100d7c88(); diff --git a/LEGO1/lego/legoomni/include/police.h b/LEGO1/lego/legoomni/include/police.h index 721ec7cb..5b4e4778 100644 --- a/LEGO1/lego/legoomni/include/police.h +++ b/LEGO1/lego/legoomni/include/police.h @@ -12,7 +12,6 @@ class PoliceState; // VTABLE: LEGO1 0x100d8a80 // SIZE 0x110 -// Radio at 0xf8 class Police : public LegoWorld { public: Police(); diff --git a/LEGO1/lego/legoomni/include/raceskel.h b/LEGO1/lego/legoomni/include/raceskel.h new file mode 100644 index 00000000..5b890881 --- /dev/null +++ b/LEGO1/lego/legoomni/include/raceskel.h @@ -0,0 +1,16 @@ +#ifndef RACESKEL_H +#define RACESKEL_H + +#include "legoanimactor.h" + +/* + VTABLE : LEGO1 0x100d7668 LegoPathActor + VTABLE : LEGO1 0x100d7738 LegoAnimActor +*/ +// SIZE 0x178 +class RaceSkel : public LegoAnimActor { +public: + RaceSkel(); +}; + +#endif // RACESKEL_H diff --git a/LEGO1/lego/legoomni/src/act3/act3shark.cpp b/LEGO1/lego/legoomni/src/act3/act3shark.cpp index f695234d..052382d1 100644 --- a/LEGO1/lego/legoomni/src/act3/act3shark.cpp +++ b/LEGO1/lego/legoomni/src/act3/act3shark.cpp @@ -6,6 +6,19 @@ void Act3Shark::VTable0x74(Matrix4& p_transform) // TODO } +// STUB: LEGO1 0x10042ab0 +Act3Shark::Act3Shark() +{ + // TODO +} + +// STUB: LEGO1 0x10042ce0 +MxResult Act3Shark::FUN_10042ce0(void*) +{ + // TODO + return SUCCESS; +} + // STUB: LEGO1 0x100430e0 void Act3Shark::ParseAction(char*) { diff --git a/LEGO1/lego/legoomni/src/actors/act2actor.cpp b/LEGO1/lego/legoomni/src/actors/act2actor.cpp new file mode 100644 index 00000000..52f698af --- /dev/null +++ b/LEGO1/lego/legoomni/src/actors/act2actor.cpp @@ -0,0 +1,7 @@ +#include "act2actor.h" + +// STUB: LEGO1 0x100187e0 +Act2Actor::Act2Actor() +{ + // TODO +} diff --git a/LEGO1/lego/legoomni/src/actors/act3actor.cpp b/LEGO1/lego/legoomni/src/actors/act3actor.cpp new file mode 100644 index 00000000..e8918dec --- /dev/null +++ b/LEGO1/lego/legoomni/src/actors/act3actor.cpp @@ -0,0 +1,7 @@ +#include "act3actor.h" + +// STUB: LEGO1 0x1003fa50 +Act3Actor::Act3Actor() +{ + // TODO +} diff --git a/LEGO1/lego/legoomni/src/actors/bumpbouy.cpp b/LEGO1/lego/legoomni/src/actors/bumpbouy.cpp index 6ae105ff..a35c12ef 100644 --- a/LEGO1/lego/legoomni/src/actors/bumpbouy.cpp +++ b/LEGO1/lego/legoomni/src/actors/bumpbouy.cpp @@ -24,6 +24,11 @@ void BumpBouy::VTable0x74(Matrix4& p_transform) // TODO } +// STUB: LEGO1 0x10027220 +BumpBouy::BumpBouy() +{ +} + // STUB: LEGO1 0x100274d0 MxLong BumpBouy::Notify(MxParam& p_param) { diff --git a/LEGO1/lego/legoomni/src/common/legocharactermanager.cpp b/LEGO1/lego/legoomni/src/common/legocharactermanager.cpp index 6503b2e3..9854dd39 100644 --- a/LEGO1/lego/legoomni/src/common/legocharactermanager.cpp +++ b/LEGO1/lego/legoomni/src/common/legocharactermanager.cpp @@ -170,7 +170,7 @@ LegoROI* LegoCharacterManager::GetROI(const char* p_key, MxBool p_createEntity) if (character != NULL) { if (p_createEntity && character->m_roi->GetEntity() == NULL) { // TODO: Match - LegoAnimActor* actor = new LegoAnimActor(1); + LegoAnimActor* actor = new LegoAnimActor(); actor->SetROI(character->m_roi, FALSE, FALSE); actor->FUN_100114e0(0); diff --git a/LEGO1/lego/legoomni/src/entity/legocarraceactor.cpp b/LEGO1/lego/legoomni/src/entity/legocarraceactor.cpp index 6e967472..a1c4b74e 100644 --- a/LEGO1/lego/legoomni/src/entity/legocarraceactor.cpp +++ b/LEGO1/lego/legoomni/src/entity/legocarraceactor.cpp @@ -1,5 +1,30 @@ #include "legocarraceactor.h" +#include "mxmisc.h" +#include "mxvariabletable.h" + +// GLOBAL: LEGO1 0x100f7af0 +// STRING: LEGO1 0x100f7ae4 +const char* g_fuel = "FUEL"; + +// FUNCTION: LEGO1 0x10080350 +LegoCarRaceActor::LegoCarRaceActor() +{ + m_unk0x08 = 1.0f; + m_unk0x70 = 0.0f; + m_unk0x0c = 0; + m_unk0x13c = 0.0f; + m_unk0x68 = 1.0f; + m_unk0x1c = 0.65f; + m_unk0x10 = 0.65f; + m_unk0x14 = 0.03f; + m_unk0x18 = 0.6f; + m_unk0x140 = 0.1f; + m_unk0x150 = -5.0f; + m_unk0x148 = 1; + VariableTable()->SetVariable(g_fuel, "0.8"); +} + // STUB: LEGO1 0x10014130 void LegoCarRaceActor::VTable0x68() { @@ -20,6 +45,16 @@ MxS32 LegoCarRaceActor::VTable0x94() return 0; } +// STUB: LEGO1 0x10080590 +void LegoCarRaceActor::FUN_10080590() +{ +} + +// STUB: LEGO1 0x10080740 +void LegoCarRaceActor::FUN_10080740() +{ +} + // STUB: LEGO1 0x10081830 void LegoCarRaceActor::VTable0x6c() { diff --git a/LEGO1/lego/legoomni/src/entity/legojetski.cpp b/LEGO1/lego/legoomni/src/entity/legojetski.cpp index 828b4f5b..c66f9297 100644 --- a/LEGO1/lego/legoomni/src/entity/legojetski.cpp +++ b/LEGO1/lego/legoomni/src/entity/legojetski.cpp @@ -1,5 +1,27 @@ #include "legojetski.h" +#include "mxmisc.h" +#include "mxnotificationmanager.h" + +// FUNCTION: LEGO1 0x100136f0 +void LegoJetski::FUN_100136f0(float p_worldSpeed) +{ + if (p_worldSpeed < 0) { + LegoCarRaceActor::m_unk0x0c = 2; + m_unk0x13c = 0; + SetWorldSpeed(0); + } + else { + m_unk0x13c = p_worldSpeed; + } +} + +// FUNCTION: LEGO1 0x10013820 +LegoJetski::LegoJetski() +{ + NotificationManager()->Register(this); +} + // STUB: LEGO1 0x10013e70 MxLong LegoJetski::Notify(MxParam& p_param) { diff --git a/LEGO1/lego/legoomni/src/entity/legojetskiraceactor.cpp b/LEGO1/lego/legoomni/src/entity/legojetskiraceactor.cpp index e8c7801f..e43e1ff5 100644 --- a/LEGO1/lego/legoomni/src/entity/legojetskiraceactor.cpp +++ b/LEGO1/lego/legoomni/src/entity/legojetskiraceactor.cpp @@ -1,5 +1,14 @@ #include "legojetskiraceactor.h" +// FUNCTION: LEGO1 0x10080ef0 +LegoJetskiRaceActor::LegoJetskiRaceActor() +{ + m_unk0x10 = 0.95f; + m_unk0x14 = 0.04f; + m_unk0x18 = 0.5f; + m_unk0x150 = 1.5f; +} + // STUB: LEGO1 0x10081fc0 void LegoJetskiRaceActor::VTable0x6c() { diff --git a/LEGO1/lego/legoomni/src/paths/legoanimactor.cpp b/LEGO1/lego/legoomni/src/paths/legoanimactor.cpp index f55a5150..292f1b9e 100644 --- a/LEGO1/lego/legoomni/src/paths/legoanimactor.cpp +++ b/LEGO1/lego/legoomni/src/paths/legoanimactor.cpp @@ -1,9 +1,25 @@ #include "legoanimactor.h" -// TODO: This might not be the actual constructor of this class, -// it only exists temporarily to match other code -// STUB: LEGO1 0x1002a500 -LegoAnimActor::LegoAnimActor(undefined4) +// STUB: LEGO1 0x1001c1f0 +MxResult LegoAnimActor::FUN_1001c1f0(float& p_out) { // TODO + return SUCCESS; +} + +// STUB: LEGO1 0x1001c360 +MxResult LegoAnimActor::FUN_1001c360(float, undefined4) +{ + return FAILURE; +} + +// STUB: LEGO1 0x1001c450 +MxResult LegoAnimActor::FUN_1001c450(undefined4, undefined4, undefined4, undefined4) +{ + return SUCCESS; +} + +// STUB: LEGO1 0x1001c800 +void LegoAnimActor::FUN_1001c800() +{ } diff --git a/LEGO1/lego/legoomni/src/paths/legoextraactor.cpp b/LEGO1/lego/legoomni/src/paths/legoextraactor.cpp new file mode 100644 index 00000000..914d58b9 --- /dev/null +++ b/LEGO1/lego/legoomni/src/paths/legoextraactor.cpp @@ -0,0 +1,14 @@ +#include "legoextraactor.h" + +// STUB : LEGO1 0x1002a500 +LegoExtraActor::LegoExtraActor() +{ +} + +// STUB: LEGO1 0x1002aae0 +MxResult LegoExtraActor::FUN_1002aae0() +{ + // TODO + VTable0x9c(); + return SUCCESS; +} diff --git a/LEGO1/lego/legoomni/src/race/legoraceactor.cpp b/LEGO1/lego/legoomni/src/race/legoraceactor.cpp index 84022005..a2fcd61d 100644 --- a/LEGO1/lego/legoomni/src/race/legoraceactor.cpp +++ b/LEGO1/lego/legoomni/src/race/legoraceactor.cpp @@ -6,6 +6,13 @@ void LegoRaceActor::VTable0x74(Matrix4& p_transform) // TODO } +// FUNCTION: LEGO1 0x100145d0 +LegoRaceActor::LegoRaceActor() +{ + m_unk0x70 = 0; + m_unk0x08 = 0; +} + // STUB: LEGO1 0x10014ca0 void LegoRaceActor::ParseAction(char*) { diff --git a/LEGO1/lego/legoomni/src/race/legoracecar.cpp b/LEGO1/lego/legoomni/src/race/legoracecar.cpp index 8728783a..eb6095c4 100644 --- a/LEGO1/lego/legoomni/src/race/legoracecar.cpp +++ b/LEGO1/lego/legoomni/src/race/legoracecar.cpp @@ -1,5 +1,47 @@ #include "legoracecar.h" +#include "mxmisc.h" +#include "mxnotificationmanager.h" + +// FUNCTION: LEGO1 0x10012950 +LegoRaceCar::LegoRaceCar() +{ + m_unk0x54 = 0; + m_unk0x70 = 0; + m_unk0x74 = 0; + m_unk0x5c.Clear(); + m_unk0x58 = 0; + m_unk0x78 = 0; + m_unk0x7c = 0; + NotificationManager()->Register(this); +} + +// FUNCTION: LEGO1 0x10012ea0 +void LegoRaceCar::FUN_10012ea0(float p_worldSpeed) +{ + if (p_worldSpeed < 0) { + LegoCarRaceActor::m_unk0x0c = 2; + m_unk0x13c = 0; + SetWorldSpeed(0); + } + else { + m_unk0x13c = p_worldSpeed; + } +} + +// STUB: LEGO1 0x10012ff0 +void LegoRaceCar::FUN_10012bf0(float) +{ + // TODO +} + +// STUB: LEGO1 0x10013130 +MxBool LegoRaceCar::FUN_10013130(float) +{ + // TODO + return TRUE; +} + // STUB: LEGO1 0x10014280 MxLong LegoRaceCar::Notify(MxParam& p_param) { diff --git a/LEGO1/lego/legoomni/src/race/legoracemap.cpp b/LEGO1/lego/legoomni/src/race/legoracemap.cpp new file mode 100644 index 00000000..0c6331cf --- /dev/null +++ b/LEGO1/lego/legoomni/src/race/legoracemap.cpp @@ -0,0 +1,19 @@ +#include "legoracemap.h" + +#include "legocontrolmanager.h" +#include "misc.h" + +// FUNCTION: LEGO1 0x1005d0d0 +LegoRaceMap::LegoRaceMap() +{ + m_unk0x08 = FALSE; + m_unk0x0c = NULL; + m_unk0x10 = 0; + ControlManager()->Register(this); +} + +// FUNCTION: LEGO1 0x1005d4b0 +void LegoRaceMap::FUN_1005d4b0() +{ + // TODO +} diff --git a/LEGO1/lego/legoomni/src/race/raceskel.cpp b/LEGO1/lego/legoomni/src/race/raceskel.cpp new file mode 100644 index 00000000..e334598c --- /dev/null +++ b/LEGO1/lego/legoomni/src/race/raceskel.cpp @@ -0,0 +1,7 @@ +#include "raceskel.h" + +// STUB: LEGO1 0x100719b0 +RaceSkel::RaceSkel() +{ + // TODO +}