From 0b512916749ea6d1ee79c1b7d90ecc923266710d Mon Sep 17 00:00:00 2001 From: Christian Semmler Date: Thu, 26 Dec 2024 09:09:11 -0700 Subject: [PATCH] Use MFC base classes for MxPoint32, MxSize32 --- LEGO1/omni/include/mxpoint32.h | 27 +++++++++------------------ LEGO1/omni/include/mxrect32.h | 8 -------- LEGO1/omni/include/mxsize32.h | 19 +++++-------------- 3 files changed, 14 insertions(+), 40 deletions(-) diff --git a/LEGO1/omni/include/mxpoint32.h b/LEGO1/omni/include/mxpoint32.h index b3ee2267ff..d2322ccafe 100644 --- a/LEGO1/omni/include/mxpoint32.h +++ b/LEGO1/omni/include/mxpoint32.h @@ -1,36 +1,27 @@ #ifndef MXPOINT32_H #define MXPOINT32_H +#include "mfc.h" #include "mxtypes.h" -class MxPoint32 { +class MxPoint32 : public CPoint { public: MxPoint32() {} // FUNCTION: LEGO1 0x10012170 - MxPoint32(MxS32 p_x, MxS32 p_y) { CopyFrom(p_x, p_y); } + MxPoint32(MxS32 p_x, MxS32 p_y) : CPoint(p_x, p_y) {} MxPoint32(const MxPoint32& p_point) { - this->m_x = p_point.m_x; - this->m_y = p_point.m_y; + x = p_point.x; + y = p_point.y; } - MxS32 GetX() const { return m_x; } - MxS32 GetY() const { return m_y; } + MxS32 GetX() const { return x; } + MxS32 GetY() const { return y; } - void SetX(MxS32 p_x) { m_x = p_x; } - void SetY(MxS32 p_y) { m_y = p_y; } - -private: - 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 + void SetX(MxS32 p_x) { x = p_x; } + void SetY(MxS32 p_y) { y = p_y; } }; #endif // MXPOINT32_H diff --git a/LEGO1/omni/include/mxrect32.h b/LEGO1/omni/include/mxrect32.h index 25af61db23..3a4fc122a3 100644 --- a/LEGO1/omni/include/mxrect32.h +++ b/LEGO1/omni/include/mxrect32.h @@ -89,14 +89,6 @@ class MxRect32 : public CRect { void SetBottom(MxS32 p_bottom) { bottom = p_bottom; } private: - void CopyFrom(MxS32 p_left, MxS32 p_top, MxS32 p_right, MxS32 p_bottom) - { - this->left = p_left; - this->top = p_top; - this->right = p_right; - this->bottom = p_bottom; - } - void CopyFrom(const MxRect32& p_rect) { this->left = p_rect.left; diff --git a/LEGO1/omni/include/mxsize32.h b/LEGO1/omni/include/mxsize32.h index 28ac7fccb7..debde44903 100644 --- a/LEGO1/omni/include/mxsize32.h +++ b/LEGO1/omni/include/mxsize32.h @@ -1,25 +1,16 @@ #ifndef MXSIZE32_H #define MXSIZE32_H +#include "mfc.h" #include "mxtypes.h" -class MxSize32 { +class MxSize32 : public CSize { public: MxSize32() {} - MxSize32(MxS32 p_width, MxS32 p_height) { CopyFrom(p_width, p_height); } + MxSize32(MxS32 p_width, MxS32 p_height) : CSize(p_width, p_height) {} - MxS32 GetWidth() const { return m_width; } - MxS32 GetHeight() const { return m_height; } - -private: - void CopyFrom(MxS32 p_width, MxS32 p_height) - { - this->m_width = p_width; - this->m_height = p_height; - } - - MxS32 m_width; - MxS32 m_height; + MxS32 GetWidth() const { return cx; } + MxS32 GetHeight() const { return cy; } }; #endif // MXSIZE32_H