diff --git a/LEGO1/lego/legoomni/include/legopathboundary.h b/LEGO1/lego/legoomni/include/legopathboundary.h index 6eae5ae6..9adf1474 100644 --- a/LEGO1/lego/legoomni/include/legopathboundary.h +++ b/LEGO1/lego/legoomni/include/legopathboundary.h @@ -31,6 +31,8 @@ class LegoPathBoundary : public LegoWEGEdge { MxResult AddActor(LegoPathActor* p_actor); void FUN_100575b0(Vector3& p_point1, Vector3& p_point2, LegoPathActor* p_actor); MxU32 Intersect(float p_scale, Vector3& p_point1, Vector3& p_point2, Vector3& p_point3, LegoEdge*& p_edge); + MxU32 FUN_10057fe0(LegoAnimPresenter* p_presenter); + MxU32 FUN_100586e0(LegoAnimPresenter* p_presenter); inline LegoPathActorSet* GetActors() { return &m_actors; } inline LegoAnimPresenterSet* GetPresenters() { return &m_presenters; } diff --git a/LEGO1/lego/legoomni/include/legopathcontroller.h b/LEGO1/lego/legoomni/include/legopathcontroller.h index 74957fb7..43c4a419 100644 --- a/LEGO1/lego/legoomni/include/legopathcontroller.h +++ b/LEGO1/lego/legoomni/include/legopathcontroller.h @@ -92,7 +92,7 @@ class LegoPathController : public MxCore { undefined4 FUN_10046770(LegoPathActor* p_actor); void FUN_100468f0(LegoAnimPresenter* p_presenter); void FUN_10046930(LegoAnimPresenter* p_presenter); - MxResult FUN_10046b30(LegoPathBoundary** p_path, MxS32& p_value); + MxResult FUN_10046b30(LegoPathBoundary*& p_boundaries, MxS32& p_numL); LegoPathBoundary* GetPathBoundary(const char* p_name); void Enable(MxBool p_enable); void FUN_10046bb0(LegoWorld* p_world); diff --git a/LEGO1/lego/legoomni/include/legopathstruct.h b/LEGO1/lego/legoomni/include/legopathstruct.h index 587972ba..fd752050 100644 --- a/LEGO1/lego/legoomni/include/legopathstruct.h +++ b/LEGO1/lego/legoomni/include/legopathstruct.h @@ -5,6 +5,8 @@ #include "mxatom.h" #include "mxtypes.h" +class LegoWorld; + // VTABLE: LEGO1 0x100d7d9c // SIZE 0x0c struct LegoPathStructBase { @@ -28,17 +30,18 @@ struct LegoPathStructBase { struct LegoPathStruct : public LegoPathStructBase { public: // FUNCTION: LEGO1 0x100473a0 - LegoPathStruct() : m_unk0x0c(0) {} + LegoPathStruct() : m_world(NULL) {} // FUNCTION: LEGO1 0x10047470 ~LegoPathStruct() override {} void VTable0x04(undefined4, undefined4, undefined4); // vtable+0x04 + inline void SetWorld(LegoWorld* p_world) { m_world = p_world; } inline void SetAtomId(const MxAtomId& p_atomId) { m_atomId = p_atomId; } - undefined4 m_unk0x0c; // 0x0c - MxAtomId m_atomId; // 0x10 + LegoWorld* m_world; // 0x0c + MxAtomId m_atomId; // 0x10 }; // SYNTHETIC: LEGO1 0x10047440 diff --git a/LEGO1/lego/legoomni/include/legoworld.h b/LEGO1/lego/legoomni/include/legoworld.h index d2179266..c0121f2b 100644 --- a/LEGO1/lego/legoomni/include/legoworld.h +++ b/LEGO1/lego/legoomni/include/legoworld.h @@ -85,7 +85,7 @@ class LegoWorld : public LegoEntity { void FUN_1001fe90(LegoAnimPresenter* p_presenter); LegoPathBoundary* FindPathBoundary(const char* p_name); void AddPath(LegoPathController* p_controller); - MxResult GetCurrPathInfo(LegoPathBoundary** p_path, MxS32& p_value); + MxResult GetCurrPathInfo(LegoPathBoundary** p_boundaries, MxS32& p_numL); MxCore* Find(const char* p_class, const char* p_name); MxCore* Find(const MxAtomId& p_atom, MxS32 p_entityId); diff --git a/LEGO1/lego/legoomni/src/entity/legoworld.cpp b/LEGO1/lego/legoomni/src/entity/legoworld.cpp index d776b0e1..e4974ba7 100644 --- a/LEGO1/lego/legoomni/src/entity/legoworld.cpp +++ b/LEGO1/lego/legoomni/src/entity/legoworld.cpp @@ -376,7 +376,7 @@ LegoPathBoundary* LegoWorld::FindPathBoundary(const char* p_name) } // FUNCTION: LEGO1 0x10020120 -MxResult LegoWorld::GetCurrPathInfo(LegoPathBoundary** p_path, MxS32& p_value) +MxResult LegoWorld::GetCurrPathInfo(LegoPathBoundary** p_boundaries, MxS32& p_numL) { LegoPathControllerListCursor cursor(&m_list0x68); LegoPathController* controller; @@ -387,7 +387,7 @@ MxResult LegoWorld::GetCurrPathInfo(LegoPathBoundary** p_path, MxS32& p_value) return FAILURE; } - return controller->FUN_10046b30(p_path, p_value); + return controller->FUN_10046b30(*p_boundaries, p_numL); } // FUNCTION: LEGO1 0x10020220 diff --git a/LEGO1/lego/legoomni/src/paths/legopathboundary.cpp b/LEGO1/lego/legoomni/src/paths/legopathboundary.cpp index dc1dc21d..f8242c19 100644 --- a/LEGO1/lego/legoomni/src/paths/legopathboundary.cpp +++ b/LEGO1/lego/legoomni/src/paths/legopathboundary.cpp @@ -41,3 +41,19 @@ MxU32 LegoPathBoundary::Intersect( { return 0; } + +// STUB: LEGO1 0x10057fe0 +// FUNCTION: BETA10 0x100b2220 +MxU32 LegoPathBoundary::FUN_10057fe0(LegoAnimPresenter* p_presenter) +{ + // TODO + return 0; +} + +// STUB: LEGO1 0x100586e0 +// FUNCTION: BETA10 0x100b22d1 +MxU32 LegoPathBoundary::FUN_100586e0(LegoAnimPresenter* p_presenter) +{ + // TODO + return 0; +} diff --git a/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp b/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp index 48ac9249..decfa9f6 100644 --- a/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp +++ b/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp @@ -233,16 +233,24 @@ undefined4 LegoPathController::FUN_10046770(LegoPathActor* p_actor) return 0; } -// STUB: LEGO1 0x100468f0 +// FUNCTION: LEGO1 0x100468f0 // FUNCTION: BETA10 0x100b72f7 void LegoPathController::FUN_100468f0(LegoAnimPresenter* p_presenter) { + for (MxS32 i = 0; i < m_numL; i++) { + if (!(m_boundaries[i].m_flags & LegoWEGEdge::c_bit3)) { + m_boundaries[i].FUN_10057fe0(p_presenter); + } + } } -// STUB: LEGO1 0x10046930 +// FUNCTION: LEGO1 0x10046930 // FUNCTION: BETA10 0x100b737b void LegoPathController::FUN_10046930(LegoAnimPresenter* p_presenter) { + for (MxS32 i = 0; i < m_numL; i++) { + m_boundaries[i].FUN_100586e0(p_presenter); + } } // FUNCTION: LEGO1 0x10046970 @@ -264,9 +272,11 @@ void LegoPathController::FUN_10046970() } } -// STUB: LEGO1 0x10046b30 -MxResult LegoPathController::FUN_10046b30(LegoPathBoundary** p_path, MxS32& p_value) +// FUNCTION: LEGO1 0x10046b30 +MxResult LegoPathController::FUN_10046b30(LegoPathBoundary*& p_boundaries, MxS32& p_numL) { + p_boundaries = m_boundaries; + p_numL = m_numL; return SUCCESS; } @@ -283,16 +293,25 @@ LegoPathBoundary* LegoPathController::GetPathBoundary(const char* p_name) return NULL; } -// STUB: LEGO1 0x10046bb0 +// FUNCTION: LEGO1 0x10046bb0 +// FUNCTION: BETA10 0x100b75bc void LegoPathController::FUN_10046bb0(LegoWorld* p_world) { - // TODO + for (MxS32 i = 0; i < m_numT; i++) { + m_structs[i].SetWorld(p_world); + } } -// STUB: LEGO1 0x10046be0 +// FUNCTION: LEGO1 0x10046be0 +// FUNCTION: BETA10 0x100b7614 void LegoPathController::Enable(MxBool p_enable) { - // TODO + if (p_enable) { + TickleManager()->RegisterClient(this, 10); + } + else { + TickleManager()->UnregisterClient(this); + } } // FUNCTION: LEGO1 0x10046c10 @@ -493,7 +512,7 @@ MxResult LegoPathController::ReadBoundaries(LegoStorage* p_storage) edges[j] = &m_edges[s]; } - if (p_storage->Read(&boundary.m_unk0x0c, sizeof(boundary.m_unk0x0c)) != SUCCESS) { + if (p_storage->Read(&boundary.m_flags, sizeof(boundary.m_flags)) != SUCCESS) { return FAILURE; } diff --git a/LEGO1/lego/sources/geom/legowegedge.cpp b/LEGO1/lego/sources/geom/legowegedge.cpp index 21fee167..1eb88448 100644 --- a/LEGO1/lego/sources/geom/legowegedge.cpp +++ b/LEGO1/lego/sources/geom/legowegedge.cpp @@ -10,7 +10,7 @@ LegoWEGEdge::LegoWEGEdge() m_name = NULL; m_unk0x14.Clear(); m_edgeNormals = NULL; - m_unk0x0c = 0; + m_flags = 0; m_unk0x48 = 0; m_unk0x4c = NULL; m_unk0x50 = NULL; diff --git a/LEGO1/lego/sources/geom/legowegedge.h b/LEGO1/lego/sources/geom/legowegedge.h index 018c9cf8..e34dfcdf 100644 --- a/LEGO1/lego/sources/geom/legowegedge.h +++ b/LEGO1/lego/sources/geom/legowegedge.h @@ -12,6 +12,11 @@ struct LegoPathStruct; // SIZE 0x54 class LegoWEGEdge : public LegoWEEdge { public: + enum { + c_bit3 = 0x04, + c_bit5 = 0x10 + }; + // SIZE 0x0c struct Path { // FUNCTION: LEGO1 0x10048280 @@ -33,7 +38,7 @@ class LegoWEGEdge : public LegoWEEdge { LegoResult VTable0x04() override; // vtable+0x04 - inline LegoU32 GetFlag0x10() { return m_unk0x0c & 0x10 ? FALSE : TRUE; } + inline LegoU32 GetFlag0x10() { return m_flags & c_bit5 ? FALSE : TRUE; } inline Mx4DPointFloat* GetUnknown0x14() { return &m_unk0x14; } inline Mx4DPointFloat* GetEdgeNormal(int index) { return &m_edgeNormals[index]; } inline LegoChar* GetName() { return m_name; } @@ -44,7 +49,7 @@ class LegoWEGEdge : public LegoWEEdge { friend class LegoPathController; private: - LegoU8 m_unk0x0c; // 0x0c + LegoU8 m_flags; // 0x0c LegoU8 m_unk0x0d; // 0x0d LegoChar* m_name; // 0x10 Mx4DPointFloat m_unk0x14; // 0x14