From 27e064e69d15fcfecfc720cdcda78bc623696d9a Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Thu, 19 Oct 2023 09:19:23 -0400 Subject: [PATCH] Add GetPoint --- LEGO1/mxrect32.h | 2 ++ LEGO1/mxregion.cpp | 10 ++++------ 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/LEGO1/mxrect32.h b/LEGO1/mxrect32.h index 53297b59..bea602a9 100644 --- a/LEGO1/mxrect32.h +++ b/LEGO1/mxrect32.h @@ -43,6 +43,8 @@ public: inline MxS32 GetWidth() { return (m_right - m_left) + 1; } inline MxS32 GetHeight() { return (m_bottom - m_top) + 1; } + + inline MxPoint32 GetPoint() { return MxPoint32(this->m_left, this->m_top); } }; #endif // MXRECT32_H diff --git a/LEGO1/mxregion.cpp b/LEGO1/mxregion.cpp index 960c6580..44028f15 100644 --- a/LEGO1/mxregion.cpp +++ b/LEGO1/mxregion.cpp @@ -37,7 +37,7 @@ void MxRegion::Reset() void MxRegion::vtable18(MxRect32 &p_rect) { MxRect32 rectCopy( - MxPoint32(p_rect.m_left, p_rect.m_top), + p_rect.GetPoint(), MxSize32(p_rect.m_right, p_rect.m_bottom) ); MxRegionListCursor cursor(m_list); @@ -49,19 +49,17 @@ void MxRegion::vtable18(MxRect32 &p_rect) break; if (topBottom->m_top >= rectCopy.m_bottom) { - MxRegionTopBottom *newTopBottom = new MxRegionTopBottom(rectCopy); - cursor.Prepend(newTopBottom); + cursor.Prepend(new MxRegionTopBottom(rectCopy)); rectCopy.m_top = rectCopy.m_bottom; } else if (rectCopy.m_top < topBottom->m_bottom) { if (rectCopy.m_top < topBottom->m_top) { MxRect32 topBottomRect( - MxPoint32(rectCopy.m_left, rectCopy.m_top), + rectCopy.GetPoint(), MxSize32(rectCopy.m_right, topBottom->m_top) ); - MxRegionTopBottom *newTopBottom = new MxRegionTopBottom(topBottomRect); - cursor.Prepend(newTopBottom); + cursor.Prepend(new MxRegionTopBottom(topBottomRect)); rectCopy.m_top = topBottom->m_top; } else if (topBottom->m_top < rectCopy.m_top) {