From 7efa698ab4b2c381b8f3fb56102cb46649caeb05 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Wed, 20 Dec 2023 22:47:53 -0500 Subject: [PATCH] Fix matches --- LEGO1/mxpoint32.h | 6 ++++++ LEGO1/mxrect32.h | 16 ++++++++-------- LEGO1/mxsmkpresenter.cpp | 6 ++---- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/LEGO1/mxpoint32.h b/LEGO1/mxpoint32.h index 9d06be4c..d041e894 100755 --- a/LEGO1/mxpoint32.h +++ b/LEGO1/mxpoint32.h @@ -12,6 +12,12 @@ class MxPoint32 { this->m_y = p_y; } + MxPoint32(const MxPoint32& p_point) + { + this->m_x = p_point.m_x; + this->m_y = p_point.m_y; + } + inline MxS32 GetX() const { return m_x; } inline MxS32 GetY() const { return m_y; } diff --git a/LEGO1/mxrect32.h b/LEGO1/mxrect32.h index 9a0b710f..1393d6be 100644 --- a/LEGO1/mxrect32.h +++ b/LEGO1/mxrect32.h @@ -40,14 +40,6 @@ class MxRect32 { return *this; } - inline void CopyFrom(const MxRect32& p_rect) - { - this->m_left = p_rect.m_left; - this->m_top = p_rect.m_top; - this->m_right = p_rect.m_right; - this->m_bottom = p_rect.m_bottom; - } - inline void Intersect(const MxRect32& p_rect) { m_left = Max(p_rect.m_left, m_left); @@ -107,6 +99,14 @@ class MxRect32 { inline void SetBottom(MxS32 p_bottom) { m_bottom = p_bottom; } private: + inline void CopyFrom(const MxRect32& p_rect) + { + this->m_left = p_rect.m_left; + this->m_top = p_rect.m_top; + this->m_right = p_rect.m_right; + this->m_bottom = p_rect.m_bottom; + } + inline static MxS32 Min(MxS32 p_a, MxS32 p_b) { return p_a <= p_b ? p_a : p_b; }; inline static MxS32 Max(MxS32 p_a, MxS32 p_b) { return p_a <= p_b ? p_b : p_a; }; diff --git a/LEGO1/mxsmkpresenter.cpp b/LEGO1/mxsmkpresenter.cpp index 415b3eb6..613d7050 100644 --- a/LEGO1/mxsmkpresenter.cpp +++ b/LEGO1/mxsmkpresenter.cpp @@ -80,10 +80,8 @@ void MxSmkPresenter::LoadFrame(MxStreamChunk* p_chunk) MxRect32* rect; while (cursor.Next(rect)) { - // This should probably be using the assignment operator, - // but it's currently reducing the match significantly. - invalidateRect.CopyFrom(*rect); - invalidateRect.AddPoint(m_location); + invalidateRect = *rect; + invalidateRect.AddPoint(GetLocation()); MVideoManager()->InvalidateRect(invalidateRect); } }