From 70e5bcd937f9840a13cfaf83364048460893b422 Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Fri, 29 Dec 2023 23:42:45 -0500 Subject: [PATCH] Changes --- LEGO1/legoomni.cpp | 2 +- LEGO1/mxpoint32.h | 17 +++++++++-------- LEGO1/mxrect32.h | 8 ++++---- LEGO1/mxsize32.h | 4 ++-- 4 files changed, 16 insertions(+), 15 deletions(-) diff --git a/LEGO1/legoomni.cpp b/LEGO1/legoomni.cpp index 7acb592c..48c7a1f5 100644 --- a/LEGO1/legoomni.cpp +++ b/LEGO1/legoomni.cpp @@ -728,6 +728,7 @@ MxBool FUN_100b6e10( if (!rect.IntersectsWith(videoParamRect)) return FALSE; + rect.Intersect(videoParamRect); rect.SubtractPoint(bottomRight); @@ -737,7 +738,6 @@ MxBool FUN_100b6e10( *p_bottom += rect.GetTop(); *p_width = rect.GetWidth(); *p_height = rect.GetHeight(); - return TRUE; } diff --git a/LEGO1/mxpoint32.h b/LEGO1/mxpoint32.h index d041e894..37c6dd19 100755 --- a/LEGO1/mxpoint32.h +++ b/LEGO1/mxpoint32.h @@ -6,12 +6,7 @@ class MxPoint32 { public: MxPoint32() {} - MxPoint32(MxS32 p_x, MxS32 p_y) - { - this->m_x = p_x; - this->m_y = p_y; - } - + MxPoint32(MxS32 p_x, MxS32 p_y) { CopyFrom(p_x, p_y); } MxPoint32(const MxPoint32& p_point) { this->m_x = p_point.m_x; @@ -25,8 +20,14 @@ class MxPoint32 { inline void SetY(MxS32 p_y) { m_y = p_y; } private: - MxS32 m_x; - MxS32 m_y; + inline void CopyFrom(MxS32 p_x, MxS32 p_y) + { + this->m_x = p_x; + this->m_y = p_y; + } + + MxS32 m_x; // 0x00 + MxS32 m_y; // 0x04 }; #endif // MXPOINT32_H diff --git a/LEGO1/mxrect32.h b/LEGO1/mxrect32.h index 46610b7e..b52a0c31 100644 --- a/LEGO1/mxrect32.h +++ b/LEGO1/mxrect32.h @@ -9,10 +9,7 @@ class MxRect32 { public: MxRect32() {} MxRect32(MxS32 p_left, MxS32 p_top, MxS32 p_right, MxS32 p_bottom) { CopyFrom(p_left, p_top, p_right, p_bottom); } - - // FUNCTION: LEGO1 0x100b6fc0 MxRect32(const MxPoint32& p_point, const MxSize32& p_size) { CopyFrom(p_point, p_size); } - MxRect32(const MxRect32& p_a, const MxRect32& p_b) { m_left = Max(p_a.m_left, p_b.m_left); @@ -106,12 +103,15 @@ class MxRect32 { this->m_bottom = p_rect.m_bottom; } - inline void CopyFrom(const MxPoint32& p_point, const MxSize32& p_size) + // The address might also be the constructor that calls CopyFrom + // FUNCTION: LEGO1 0x100b6fc0 + inline MxRect32* CopyFrom(const MxPoint32& p_point, const MxSize32& p_size) { this->m_left = p_point.GetX(); this->m_top = p_point.GetY(); this->m_right = p_size.GetWidth() + p_point.GetX() - 1; this->m_bottom = p_size.GetHeight() + p_point.GetY() - 1; + return this; } inline static MxS32 Min(MxS32 p_a, MxS32 p_b) { return p_a <= p_b ? p_a : p_b; }; diff --git a/LEGO1/mxsize32.h b/LEGO1/mxsize32.h index 2c0141bc..8fb90210 100644 --- a/LEGO1/mxsize32.h +++ b/LEGO1/mxsize32.h @@ -6,13 +6,13 @@ class MxSize32 { public: MxSize32() {} - MxSize32(MxS32 p_width, MxS32 p_height) { Assign(p_width, p_height); } + MxSize32(MxS32 p_width, MxS32 p_height) { CopyFrom(p_width, p_height); } inline MxS32 GetWidth() const { return m_width; } inline MxS32 GetHeight() const { return m_height; } private: - inline void Assign(MxS32 p_width, MxS32 p_height) + inline void CopyFrom(MxS32 p_width, MxS32 p_height) { this->m_width = p_width; this->m_height = p_height;