From b77b3b3568d034fa0727e41ade5ff038e202f468 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Thu, 19 Oct 2023 16:31:26 -0400 Subject: [PATCH] Implement/match more functions --- LEGO1/mxregion.cpp | 20 ++++++++++++++++++-- LEGO1/mxregion.h | 14 ++++++++++---- LEGO1/mxregionlist.h | 3 +++ 3 files changed, 31 insertions(+), 6 deletions(-) diff --git a/LEGO1/mxregion.cpp b/LEGO1/mxregion.cpp index 5ecc7b5d..07cdf70b 100644 --- a/LEGO1/mxregion.cpp +++ b/LEGO1/mxregion.cpp @@ -105,6 +105,14 @@ void MxRegion::vtable1c() // TODO } +// OFFSET: LEGO1 0x100c4c90 +MxRegionTopBottom::MxRegionTopBottom(MxS32 p_top, MxS32 p_bottom) +{ + m_top = p_top; + m_bottom = p_bottom; + m_leftRightList = new MxRegionLeftRightList; +} + // OFFSET: LEGO1 0x100c50e0 MxRegionTopBottom::MxRegionTopBottom(MxRect32 &p_rect) { @@ -122,8 +130,16 @@ void MxRegionTopBottom::FUN_100c5280(MxS32 p_left, MxS32 p_right) } -// OFFSET: LEGO1 0x100c55d0 STUB +// OFFSET: LEGO1 0x100c55d0 MxRegionTopBottom *MxRegionTopBottom::Clone() { - return new MxRegionTopBottom(MxRect32()); + MxRegionTopBottom *clone = new MxRegionTopBottom(m_top, m_bottom); + + MxRegionLeftRightListCursor cursor(m_leftRightList); + MxRegionLeftRight *leftRight; + + while (cursor.Next(leftRight)) + clone->m_leftRightList->Append(leftRight->Clone()); + + return clone; } \ No newline at end of file diff --git a/LEGO1/mxregion.h b/LEGO1/mxregion.h index f79c89f7..1c7a0716 100644 --- a/LEGO1/mxregion.h +++ b/LEGO1/mxregion.h @@ -9,14 +9,15 @@ // SIZE 0x0c struct MxRegionTopBottom { - MxS32 m_top; - MxS32 m_bottom; - MxRegionLeftRightList *m_leftRightList; - MxRegionTopBottom(MxRect32 &p_rect); + MxRegionTopBottom(MxS32 m_top, MxS32 m_bottom); MxRegionTopBottom *Clone(); void FUN_100c5280(MxS32 p_left, MxS32 p_right); + + MxS32 m_top; + MxS32 m_bottom; + MxRegionLeftRightList *m_leftRightList; }; // SIZE 0x08 @@ -28,6 +29,11 @@ struct MxRegionLeftRight m_right = p_right; } + MxRegionLeftRight *Clone() + { + return new MxRegionLeftRight(m_left, m_right); + } + MxS32 m_left; MxS32 m_right; }; diff --git a/LEGO1/mxregionlist.h b/LEGO1/mxregionlist.h index 81b430b4..bf805332 100644 --- a/LEGO1/mxregionlist.h +++ b/LEGO1/mxregionlist.h @@ -47,4 +47,7 @@ public: // SIZE 0x18 class MxRegionLeftRightList : public MxRegionLeftRightListParent {}; +// VTABLE 0x100dcc10 +typedef MxListCursorChildChild MxRegionLeftRightListCursor; + #endif // MXREGIONLIST_H