From ace2a9f0470e7750ff5a1e614352e96ce44d0dcc Mon Sep 17 00:00:00 2001 From: jonschz <17198703+jonschz@users.noreply.github.com> Date: Sun, 15 Dec 2024 13:50:52 +0100 Subject: [PATCH] Add `g_copDest` (#1229) * Implement `AddCop` and `g_copDest` * Fix formatting --------- Co-authored-by: jonschz --- LEGO1/lego/legoomni/include/act3.h | 1 + LEGO1/lego/legoomni/include/act3actors.h | 11 ++++ LEGO1/lego/legoomni/src/actors/act3actors.cpp | 62 +++++++++++++++++++ .../legoomni/src/common/legoobjectfactory.cpp | 1 + LEGO1/lego/legoomni/src/worlds/act3.cpp | 12 ++++ 5 files changed, 87 insertions(+) diff --git a/LEGO1/lego/legoomni/include/act3.h b/LEGO1/lego/legoomni/include/act3.h index fad19342..da9910d2 100644 --- a/LEGO1/lego/legoomni/include/act3.h +++ b/LEGO1/lego/legoomni/include/act3.h @@ -126,6 +126,7 @@ class Act3 : public LegoWorld { MxResult FUN_10073360(Act3Ammo& p_ammo, const Vector3& p_param2); MxResult FUN_10073390(Act3Ammo& p_ammo, const Vector3& p_param2); void SetBrickster(Act3Brickster* p_brickster); + void AddCop(Act3Cop* p_cop); void FUN_10073400(); void FUN_10073430(); void GoodEnding(const Matrix4& p_destination); diff --git a/LEGO1/lego/legoomni/include/act3actors.h b/LEGO1/lego/legoomni/include/act3actors.h index 545b6480..660ebba6 100644 --- a/LEGO1/lego/legoomni/include/act3actors.h +++ b/LEGO1/lego/legoomni/include/act3actors.h @@ -14,6 +14,17 @@ class LegoWorld; // SIZE 0x178 class Act3Actor : public LegoAnimActor { public: + struct Act3CopDest { + // name verified by BETA10 0x10018776 + const char* m_bName; // 0x00 + + // name verified by BETA10 0x100187cb + LegoPathBoundary* m_boundary; // 0x04 + + MxFloat m_unk0x08[3]; // 0x08 + MxFloat m_unk0x14[3]; // 0x14 + }; + Act3Actor(); // FUNCTION: LEGO1 0x100431b0 diff --git a/LEGO1/lego/legoomni/src/actors/act3actors.cpp b/LEGO1/lego/legoomni/src/actors/act3actors.cpp index 96f5c113..7526846d 100644 --- a/LEGO1/lego/legoomni/src/actors/act3actors.cpp +++ b/LEGO1/lego/legoomni/src/actors/act3actors.cpp @@ -17,9 +17,71 @@ DECOMP_SIZE_ASSERT(Act3Actor, 0x178) DECOMP_SIZE_ASSERT(Act3Cop, 0x188) +DECOMP_SIZE_ASSERT(Act3Cop::Act3CopDest, 0x20) DECOMP_SIZE_ASSERT(Act3Brickster, 0x1b4) DECOMP_SIZE_ASSERT(Act3Shark, 0x1a8) +// name verified by BETA10 0x10018776 +// GLOBAL: LEGO1 0x100f4120 +// GLOBAL: BETA10 0x101dcdc8 +Act3Actor::Act3CopDest g_copDest[5] = { + {"INT38", NULL, {3.69, -1.31251, -59.231}, {-0.99601698, 0.0, -0.089166}}, + { + "EDG02_08", + NULL, + { + -96.459999, + 4.0, + 11.22, + }, + { + -0.9725, + 0.0, + -0.23, + }, + }, + { + "INT18", + NULL, + { + 28.076799, + 2.0, + 32.11, + }, + { + -0.19769999, + 0.0, + 0.98, + }, + }, + { + "INT48", + NULL, + { + 84.736, + 9.0, + -1.965, + }, + { + 0.241, + 0.0, + -0.97, + }, + }, + {"INT42", + NULL, + { + 63.76178, + 0.999993, + -77.739998, + }, + { + 0.47999999, + 0.0, + -0.87699997, + }} +}; + // Initialized at LEGO1 0x1003fa20 // GLOBAL: LEGO1 0x10104ef0 Mx3DPointFloat Act3Actor::g_unk0x10104ef0 = Mx3DPointFloat(0.0, 5.0, 0.0); diff --git a/LEGO1/lego/legoomni/src/common/legoobjectfactory.cpp b/LEGO1/lego/legoomni/src/common/legoobjectfactory.cpp index f5953b2e..b5c4f521 100644 --- a/LEGO1/lego/legoomni/src/common/legoobjectfactory.cpp +++ b/LEGO1/lego/legoomni/src/common/legoobjectfactory.cpp @@ -74,6 +74,7 @@ DECOMP_SIZE_ASSERT(LegoObjectFactory, 0x1c8) // FUNCTION: LEGO1 0x10006e40 +// FUNCTION: BETA10 0x1009e930 LegoObjectFactory::LegoObjectFactory() { m_idLegoEntityPresenter = MxAtomId("LegoEntityPresenter", e_exact); diff --git a/LEGO1/lego/legoomni/src/worlds/act3.cpp b/LEGO1/lego/legoomni/src/worlds/act3.cpp index b415e40e..170343fd 100644 --- a/LEGO1/lego/legoomni/src/worlds/act3.cpp +++ b/LEGO1/lego/legoomni/src/worlds/act3.cpp @@ -728,6 +728,18 @@ MxResult Act3::FUN_10073390(Act3Ammo& p_ammo, const Vector3& p_param2) return SUCCESS; } +// FUNCTION: LEGO1 0x100733d0 +// FUNCTION: BETA10 0x10016b5d +void Act3::AddCop(Act3Cop* p_cop) +{ + if (m_cop1) { + m_cop2 = p_cop; + } + else { + m_cop1 = p_cop; + } +} + // FUNCTION: LEGO1 0x100733f0 // FUNCTION: BETA10 0x10016ba2 void Act3::SetBrickster(Act3Brickster* p_brickster)