From 174a7aa5b0d5f61c7a15471864b2022bfb211c57 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Fri, 6 Dec 2024 09:23:25 -0700 Subject: [PATCH] Annotations --- .../legoomni/include/legopathcontroller.h | 57 +++++++++++++++++++ .../legoomni/include/legopathedgecontainer.h | 31 +++++----- .../legoomni/src/paths/legopathcontroller.cpp | 21 ++++--- LEGO1/lego/sources/geom/legounkown100db7f4.h | 2 +- LEGO1/mxgeometry/mxgeometry3d.h | 1 + 5 files changed, 82 insertions(+), 30 deletions(-) diff --git a/LEGO1/lego/legoomni/include/legopathcontroller.h b/LEGO1/lego/legoomni/include/legopathcontroller.h index 7bb1adca..d534e0b2 100644 --- a/LEGO1/lego/legoomni/include/legopathcontroller.h +++ b/LEGO1/lego/legoomni/include/legopathcontroller.h @@ -223,14 +223,71 @@ class LegoPathController : public MxCore { // SYNTHETIC: LEGO1 0x10047ae0 // LegoUnknown100db7f4::~LegoUnknown100db7f4 +// TEMPLATE: LEGO1 0x10048f00 +// list >::begin + +// TEMPLATE: LEGO1 0x10048f10 +// list >::insert + // TEMPLATE: LEGO1 0x10048f70 // list >::erase +// TEMPLATE: LEGO1 0x10048fc0 +// _Tree >::_Kfn,LegoPathCtrlEdgeCompare,allocator >::_Tree >::_Kfn,LegoPathCtrlEdgeCompare,allocator >::erase + +// TEMPLATE: LEGO1 0x10049290 +// _Tree >::_Kfn,LegoPathCtrlEdgeCompare,allocator >::find + +// TEMPLATE: LEGO1 0x100492f0 +// _Tree >::_Kfn,LegoPathCtrlEdgeCompare,allocator >::_Copy + +// TEMPLATE: LEGO1 0x10049410 +// list >::insert + +// TEMPLATE: LEGO1 0x10049470 +// list >::_Buynode + +// TEMPLATE: LEGO1 0x100494a0 +// _Tree >::_Kfn,LegoBEWithFloatComparator,allocator >::iterator::_Inc + +// TEMPLATE: LEGO1 0x100495b0 +// _Tree >::_Kfn,LegoBEWithFloatComparator,allocator >::insert + +// TEMPLATE: LEGO1 0x10049840 +// _Tree >::_Kfn,LegoBEWithFloatComparator,allocator >::iterator::_Dec + +// TEMPLATE: LEGO1 0x10049890 +// _Tree >::_Kfn,LegoBEWithFloatComparator,allocator >::erase + +// TEMPLATE: LEGO1 0x10049cf0 +// _Tree >::_Kfn,LegoBEWithFloatComparator,allocator >::_Buynode + +// TEMPLATE: LEGO1 0x10049d50 +// _Tree >::_Kfn,LegoBEWithFloatComparator,allocator >::_Init + +// TEMPLATE: LEGO1 0x10049e00 +// _Tree >::_Kfn,LegoBEWithFloatComparator,allocator >::_Insert + +// TEMPLATE: LEGO1 0x1004a090 +// _Tree >::_Kfn,LegoBEWithFloatComparator,allocator >::_Lrotate + +// TEMPLATE: LEGO1 0x1004a0f0 +// _Tree >::_Kfn,LegoBEWithFloatComparator,allocator >::_Rrotate + +// TEMPLATE: LEGO1 0x1004a760 +// _Construct + // TEMPLATE: LEGO1 0x1004a780 // _Construct // GLOBAL: LEGO1 0x100f4360 // _Tree >::_Kfn,LegoPathCtrlEdgeCompare,allocator >::_Nil + +// GLOBAL: LEGO1 0x100f4364 +// _Tree >::_Kfn,LegoBEWithFloatComparator,allocator >::_Nil // clang-format on #endif // LEGOPATHCONTROLLER_H diff --git a/LEGO1/lego/legoomni/include/legopathedgecontainer.h b/LEGO1/lego/legoomni/include/legopathedgecontainer.h index d342e911..5d6a79aa 100644 --- a/LEGO1/lego/legoomni/include/legopathedgecontainer.h +++ b/LEGO1/lego/legoomni/include/legopathedgecontainer.h @@ -27,8 +27,8 @@ struct LegoBoundaryEdge { }; // SIZE 0x10 -struct LegoBoundaryEdgeWithFloat { - LegoBoundaryEdgeWithFloat() +struct LegoBEWithFloat { + LegoBEWithFloat() { m_edge = NULL; m_boundary = NULL; @@ -37,7 +37,7 @@ struct LegoBoundaryEdgeWithFloat { } // FUNCTION: BETA10 0x100bd9a0 - LegoBoundaryEdgeWithFloat(LegoPathCtrlEdge* p_edge, LegoPathBoundary* p_boundary, MxFloat p_unk0x0c) + LegoBEWithFloat(LegoPathCtrlEdge* p_edge, LegoPathBoundary* p_boundary, MxFloat p_unk0x0c) { m_edge = p_edge; m_boundary = p_boundary; @@ -46,12 +46,7 @@ struct LegoBoundaryEdgeWithFloat { } // FUNCTION: BETA10 0x100bd9f0 - LegoBoundaryEdgeWithFloat( - LegoPathCtrlEdge* p_edge, - LegoPathBoundary* p_boundary, - LegoBoundaryEdgeWithFloat* p_next, - MxFloat p_unk0x0c - ) + LegoBEWithFloat(LegoPathCtrlEdge* p_edge, LegoPathBoundary* p_boundary, LegoBEWithFloat* p_next, MxFloat p_unk0x0c) { m_edge = p_edge; m_boundary = p_boundary; @@ -59,24 +54,24 @@ struct LegoBoundaryEdgeWithFloat { m_unk0x0c = p_unk0x0c; } - LegoPathCtrlEdge* m_edge; // 0x00 - LegoPathBoundary* m_boundary; // 0x04 - LegoBoundaryEdgeWithFloat* m_next; // 0x08 - MxFloat m_unk0x0c; // 0x0c + LegoPathCtrlEdge* m_edge; // 0x00 + LegoPathBoundary* m_boundary; // 0x04 + LegoBEWithFloat* m_next; // 0x08 + MxFloat m_unk0x0c; // 0x0c - int operator==(LegoBoundaryEdgeWithFloat) const { return 0; } - int operator<(LegoBoundaryEdgeWithFloat) const { return 0; } + int operator==(LegoBEWithFloat) const { return 0; } + int operator<(LegoBEWithFloat) const { return 0; } }; -struct LegoBoundaryEdgeWithFloatComparator { +struct LegoBEWithFloatComparator { // FUNCTION: BETA10 0x100bef80 - bool operator()(LegoBoundaryEdgeWithFloat* const& p_a, LegoBoundaryEdgeWithFloat* const& p_b) const + bool operator()(LegoBEWithFloat* const& p_a, LegoBEWithFloat* const& p_b) const { return p_a->m_unk0x0c < p_b->m_unk0x0c; } }; -typedef multiset LegoBoundaryEdgeWithFloatSet; +typedef multiset LegoBEWithFloatSet; // SIZE 0x3c struct LegoPathEdgeContainer : public list { diff --git a/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp b/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp index 4a46cdb4..ab96069e 100644 --- a/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp +++ b/LEGO1/lego/legoomni/src/paths/legopathcontroller.cpp @@ -755,12 +755,12 @@ MxResult LegoPathController::FUN_10048310( p_grec->SetBit1(TRUE); } else { - list boundaryList; - list::iterator boundaryListIt; + list boundaryList; + list::iterator boundaryListIt; - LegoBoundaryEdgeWithFloatSet boundarySet; - LegoBoundaryEdgeWithFloatSet::iterator boundarySetItA; - LegoBoundaryEdgeWithFloatSet::iterator boundarySetItB; + LegoBEWithFloatSet boundarySet; + LegoBEWithFloatSet::iterator boundarySetItA; + LegoBEWithFloatSet::iterator boundarySetItB; LegoPathCtrlEdgeSet pathCtrlEdgeSet(m_pfsE); @@ -787,7 +787,7 @@ MxResult LegoPathController::FUN_10048310( } else { boundaryList.push_back( - LegoBoundaryEdgeWithFloat(edge, p_oldBoundary, edge->DistanceToMidpoint(p_oldPosition)) + LegoBEWithFloat(edge, p_oldBoundary, edge->DistanceToMidpoint(p_oldPosition)) ); boundarySet.insert(&boundaryList.back()); } @@ -798,8 +798,8 @@ MxResult LegoPathController::FUN_10048310( } if (!p_grec->GetBit1()) { - while (pathCtrlEdgeSet.size() != 0) { - LegoBoundaryEdgeWithFloat edgeWithFloat; + while (pathCtrlEdgeSet.size() > 0) { + LegoBEWithFloat edgeWithFloat; MxFloat local70 = 999999.0f; boundarySetItA = boundarySetItB = boundarySet.begin(); @@ -822,7 +822,7 @@ MxResult LegoPathController::FUN_10048310( if (bOther == p_newBoundary) { shouldRemove = FALSE; - LegoBoundaryEdgeWithFloat* pfs = *boundarySetItA; + LegoBEWithFloat* pfs = *boundarySetItA; assert(pfs); float dist = pfs->m_edge->DistanceToMidpoint(p_newPosition) + pfs->m_unk0x0c; @@ -855,8 +855,7 @@ MxResult LegoPathController::FUN_10048310( if (dist < local70) { local70 = dist; - edgeWithFloat = - LegoBoundaryEdgeWithFloat(edge, bOther, *boundarySetItA, dist); + edgeWithFloat = LegoBEWithFloat(edge, bOther, *boundarySetItA, dist); } } } diff --git a/LEGO1/lego/sources/geom/legounkown100db7f4.h b/LEGO1/lego/sources/geom/legounkown100db7f4.h index 110b7089..f8de433d 100644 --- a/LEGO1/lego/sources/geom/legounkown100db7f4.h +++ b/LEGO1/lego/sources/geom/legounkown100db7f4.h @@ -81,7 +81,7 @@ struct LegoUnknown100db7f4 : public LegoEdge { Mx3DPointFloat point2(*p_other.m_pointA); ((Vector3&) point1).Add(*m_pointB); ((Vector3&) point1).Mul(0.5f); - ((Vector3&) point2).Add(*m_pointB); + ((Vector3&) point2).Add(*p_other.m_pointB); ((Vector3&) point2).Mul(0.5f); ((Vector3&) point1).Sub(point2); return sqrt(point1.LenSquared()); diff --git a/LEGO1/mxgeometry/mxgeometry3d.h b/LEGO1/mxgeometry/mxgeometry3d.h index b2f4d53a..4819790c 100644 --- a/LEGO1/mxgeometry/mxgeometry3d.h +++ b/LEGO1/mxgeometry/mxgeometry3d.h @@ -26,6 +26,7 @@ class Mx3DPointFloat : public Vector3 { // FUNCTION: BETA10 0x10011600 Mx3DPointFloat(const Mx3DPointFloat& p_other) : Vector3(m_elements) { EqualsImpl(p_other.m_data); } + // FUNCTION: LEGO1 0x10048ed0 // FUNCTION: BETA10 0x100151e0 Mx3DPointFloat(const Vector3& p_other) : Vector3(m_elements) { EqualsImpl(p_other.m_data); }