From 6da5b394302df265de334fab743a22b1c006cd22 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Thu, 5 Dec 2024 17:47:01 -0700 Subject: [PATCH] More WIP --- .../legoomni/include/legopathcontroller.h | 4 +- .../legoomni/include/legopathedgecontainer.h | 5 +- .../legoomni/src/paths/legopathcontroller.cpp | 48 ++++++++++++++++++- 3 files changed, 51 insertions(+), 6 deletions(-) diff --git a/LEGO1/lego/legoomni/include/legopathcontroller.h b/LEGO1/lego/legoomni/include/legopathcontroller.h index 17ad51e3..7bb1adca 100644 --- a/LEGO1/lego/legoomni/include/legopathcontroller.h +++ b/LEGO1/lego/legoomni/include/legopathcontroller.h @@ -22,7 +22,9 @@ class Vector3; // VTABLE: LEGO1 0x100d7da8 // SIZE 0x40 -struct LegoPathCtrlEdge : public LegoUnknown100db7f4 {}; +struct LegoPathCtrlEdge : public LegoUnknown100db7f4 { + undefined4 FUN_10048c40(const Vector3&); +}; struct LegoPathCtrlEdgeCompare { MxU32 operator()(const LegoPathCtrlEdge* p_lhs, const LegoPathCtrlEdge* p_rhs) const diff --git a/LEGO1/lego/legoomni/include/legopathedgecontainer.h b/LEGO1/lego/legoomni/include/legopathedgecontainer.h index d6d548b1..58a25d43 100644 --- a/LEGO1/lego/legoomni/include/legopathedgecontainer.h +++ b/LEGO1/lego/legoomni/include/legopathedgecontainer.h @@ -7,20 +7,19 @@ class LegoPathBoundary; struct LegoPathCtrlEdge; -struct LegoUnknown100db7f4; // SIZE 0x08 struct LegoBoundaryEdge { LegoBoundaryEdge() {} // FUNCTION: BETA10 0x100bd620 - LegoBoundaryEdge(LegoUnknown100db7f4* p_edge, LegoPathBoundary* p_boundary) + LegoBoundaryEdge(LegoPathCtrlEdge* p_edge, LegoPathBoundary* p_boundary) { m_edge = p_edge; m_boundary = p_boundary; } - LegoUnknown100db7f4* m_edge; // 0x00 + LegoPathCtrlEdge* m_edge; // 0x00 LegoPathBoundary* m_boundary; // 0x04 int operator==(LegoBoundaryEdge) const { return 0; } diff --git a/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp b/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp index a7d6796b..29539c31 100644 --- a/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp +++ b/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp @@ -820,7 +820,21 @@ MxResult LegoPathController::FUN_10048310( if (e->Unknown(*bOther, p_mask)) { if (bOther == p_newBoundary) { - // TODO + shouldRemove = FALSE; + + LegoBoundaryEdgeWithFloat* pfs = *boundarySetItA; + assert(pfs); + + float dist = pfs->m_edge->DistanceToMidpoint(p_newPosition) + pfs->m_unk0x0c; + + if (dist < local70) { + local70 = dist; + edgeWithFloat.m_edge = NULL; + + if (dist < local14) { + // TODO + } + } } else { // TODO @@ -853,12 +867,42 @@ MxResult LegoPathController::FUN_10048310( return FAILURE; } - // TODO + if (p_grec->size() != 0) { + LegoPathCtrlEdge* edge = p_grec->front().m_edge; + + if (edge->FUN_10048c40(p_oldPosition)) { + p_grec->pop_front(); + } + } + + if (p_grec->size() != 0) { + LegoPathCtrlEdge* edge = p_grec->back().m_edge; + + if (edge->FUN_10048c40(p_newPosition)) { + if (edge->OtherFace(p_grec->back().m_boundary) != NULL && + edge->OtherFace(p_grec->back().m_boundary)->IsEqual(*p_newBoundary)) { + p_grec->m_boundary = p_grec->back().m_boundary; + p_grec->pop_back(); + } + } + } + + if (p_param9 != NULL) { + *p_param9 = local14; + } } return SUCCESS; } +// STUB: LEGO1 0x10048c40 +// STUB: BETA10 0x1001cc90 +undefined4 LegoPathCtrlEdge::FUN_10048c40(const Vector3&) +{ + // TODO + return 0; +} + // FUNCTION: LEGO1 0x1004a240 // FUNCTION: BETA10 0x100b9160 MxS32 LegoPathController::FUN_1004a240(