diff --git a/LEGO1/lego/legoomni/include/act2actor.h b/LEGO1/lego/legoomni/include/act2actor.h index ae8090bd..e70a9ad5 100644 --- a/LEGO1/lego/legoomni/include/act2actor.h +++ b/LEGO1/lego/legoomni/include/act2actor.h @@ -12,9 +12,10 @@ class Act2Actor : public LegoAnimActor { public: struct UnknownListStructure { - undefined m_unk0x00[28]; - undefined m_unk0x1c; - undefined m_unk0x1d[3]; + MxFloat m_unk0x00[3]; // 0x00 + MxFloat m_unk0x0c[3]; // 0x0c + const LegoChar* m_unk0x18; // 0x18 + undefined m_unk0x1c; // 0x1c }; Act2Actor(); @@ -56,4 +57,7 @@ class Act2Actor : public LegoAnimActor { undefined4 m_unk0x4c; // 0x4c }; +// TEMPLATE: LEGO1 0x100194f0 +// list >::list > + #endif // ACT2ACTOR_H diff --git a/LEGO1/lego/legoomni/include/legopathcontroller.h b/LEGO1/lego/legoomni/include/legopathcontroller.h index ad0b5791..250e9e61 100644 --- a/LEGO1/lego/legoomni/include/legopathcontroller.h +++ b/LEGO1/lego/legoomni/include/legopathcontroller.h @@ -117,6 +117,17 @@ class LegoPathController : public MxCore { LegoUnknown100db7f4*& p_edge, LegoPathBoundary*& p_boundary ); + MxResult FUN_10048310( + LegoPathEdgeContainer* p_grec, + Vector3& p_position, + Vector3& p_direction, + LegoPathBoundary* p_boundary1, + Vector3& p_param5, + Vector3& p_param6, + LegoPathBoundary* p_boundary2, + MxBool p_param8, + MxFloat* p_param9 + ); static MxResult Init(); static MxResult Reset(); diff --git a/LEGO1/lego/legoomni/src/actors/act2actor.cpp b/LEGO1/lego/legoomni/src/actors/act2actor.cpp index e0a46824..83654ecd 100644 --- a/LEGO1/lego/legoomni/src/actors/act2actor.cpp +++ b/LEGO1/lego/legoomni/src/actors/act2actor.cpp @@ -1,6 +1,7 @@ #include "act2actor.h" #include "legocachesoundmanager.h" +#include "legopathcontroller.h" #include "legosoundmanager.h" #include "misc.h" #include "roi/legoroi.h" @@ -8,10 +9,21 @@ DECOMP_SIZE_ASSERT(Act2Actor, 0x1a8) DECOMP_SIZE_ASSERT(Act2Actor::UnknownListStructure, 0x20) -// TODO: Copy the data once we know more about its fields. Total: 10 entries // GLOBAL: LEGO1 0x100f0db8 // GLOBAL: BETA10 0x101dbd00 -Act2Actor::UnknownListStructure g_unk0x100f0db8[] = {{{0}, 0, {0}}}; +Act2Actor::UnknownListStructure g_unk0x100f0db8[] = { + {{-47.92, 7.0699968, -31.58}, {-0.999664, 0.0, -0.025916}, "edg01_27", FALSE}, + {{-70.393349, 8.07, 3.151935}, {-0.90653503, 0.0, 0.422131}, "int06", FALSE}, + {{-47.74, 4.079995, -52.3}, {-0.98293, 0.0, -0.18398}, "edg01_08", FALSE}, + {{-26.273487, 0.069, 12.170015}, {0.987199, 0.0, -0.159491}, "INT14", FALSE}, + {{26.16499, 0.069, 5.61}, {0.027719, 0.0, 0.999616}, "INT22", FALSE}, + {{66.383446, 4.07, 32.387417}, {0.979487, 0.0, -0.201506}, "edg02_27", FALSE}, + {{71.843285, 0.069, -49.524852}, {0.99031502, 0.0, 0.13884}, "edg02_39", FALSE}, + {{26.470566, 0.069, -44.670845}, {0.004602, 0.0, -0.99998897}, "int26", FALSE}, + {{-6.323625, 0.069, -47.96045}, {-0.982068, 0.0, 0.188529}, "edg02_53", FALSE}, + {{-36.689, -0.978409, 31.449}, {0.083792, -0.94303, -0.66398698}, "edg00_157", FALSE}, + {{-44.6, 0.1, 45.3}, {0.95, 0.0, -0.3}, "edg00_154", FALSE}, +}; // FUNCTION: LEGO1 0x100187e0 // FUNCTION: BETA10 0x1000c7fb @@ -34,7 +46,7 @@ Act2Actor::Act2Actor() m_unk0x38 = 0; m_unk0x3c = 0; - // TODO replace 10 by sizeOfArray once the data are there + // Odd: The code says < 10, but there are 11 entries in the array for (MxS32 i = 0; i < 10; i++) { g_unk0x100f0db8[i].m_unk0x1c = 0; } @@ -84,13 +96,45 @@ void Act2Actor::SetWorldSpeed(MxFloat p_worldSpeed) } // FUNCTION: LEGO1 0x100192a0 +// FUNCTION: BETA10 0x1000d4d6 void Act2Actor::FUN_100192a0(undefined4 p_param) { - // TODO + Mx3DPointFloat local38(0.0, 0.0, 0.0); + Mx3DPointFloat local4c(0.0, 0.0, 0.0); + + if (m_grec) { + delete m_grec; + } + + m_grec = new LegoPathEdgeContainer(); + assert(m_grec); + + local38 = Vector3(g_unk0x100f0db8[p_param].m_unk0x00); + local4c = Vector3(g_unk0x100f0db8[p_param].m_unk0x0c); + + LegoPathBoundary* otherBoundary = m_controller->GetPathBoundary(g_unk0x100f0db8[p_param].m_unk0x18); + + MxResult sts = m_controller->FUN_10048310( + m_grec, + Vector3(m_roi->GetWorldPosition()), + Vector3(m_roi->GetWorldDirection()), + m_boundary, + local38, + local4c, + otherBoundary, + TRUE, + NULL + ); + + assert(!sts); + + if (sts) { + delete m_grec; + m_grec = NULL; + } } // FUNCTION: LEGO1 0x10019520 -// FUNCTION: BETA10 0x1000d4d6 void Act2Actor::FUN_10019520() { m_unk0x1e = 4; diff --git a/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp b/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp index 480b43ec..c362dce5 100644 --- a/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp +++ b/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp @@ -733,6 +733,24 @@ MxResult LegoPathController::ReadVector(LegoStorage* p_storage, Mx4DPointFloat& return SUCCESS; } +// STUB: LEGO1 0x10048310 +// STUB: BETA10 0x100b8911 +MxResult LegoPathController::FUN_10048310( + LegoPathEdgeContainer* p_grec, + Vector3& p_position, + Vector3& p_direction, + LegoPathBoundary* p_boundary1, + Vector3& p_param5, + Vector3& p_param6, + LegoPathBoundary* p_boundary2, + MxBool p_param8, + MxFloat* p_param9 +) +{ + // TODO + return SUCCESS; +} + // FUNCTION: LEGO1 0x1004a240 // FUNCTION: BETA10 0x100b9160 MxS32 LegoPathController::FUN_1004a240(