Use MFC base classes for MxPoint32, MxSize32

This commit is contained in:
Christian Semmler 2024-12-26 09:09:11 -07:00
parent 026bc23d01
commit 0b51291674
3 changed files with 14 additions and 40 deletions

View File

@ -1,36 +1,27 @@
#ifndef MXPOINT32_H #ifndef MXPOINT32_H
#define MXPOINT32_H #define MXPOINT32_H
#include "mfc.h"
#include "mxtypes.h" #include "mxtypes.h"
class MxPoint32 { class MxPoint32 : public CPoint {
public: public:
MxPoint32() {} MxPoint32() {}
// FUNCTION: LEGO1 0x10012170 // 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) MxPoint32(const MxPoint32& p_point)
{ {
this->m_x = p_point.m_x; x = p_point.x;
this->m_y = p_point.m_y; y = p_point.y;
} }
MxS32 GetX() const { return m_x; } MxS32 GetX() const { return x; }
MxS32 GetY() const { return m_y; } MxS32 GetY() const { return y; }
void SetX(MxS32 p_x) { m_x = p_x; } void SetX(MxS32 p_x) { x = p_x; }
void SetY(MxS32 p_y) { m_y = p_y; } void SetY(MxS32 p_y) { 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
}; };
#endif // MXPOINT32_H #endif // MXPOINT32_H

View File

@ -89,14 +89,6 @@ class MxRect32 : public CRect {
void SetBottom(MxS32 p_bottom) { bottom = p_bottom; } void SetBottom(MxS32 p_bottom) { bottom = p_bottom; }
private: 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) void CopyFrom(const MxRect32& p_rect)
{ {
this->left = p_rect.left; this->left = p_rect.left;

View File

@ -1,25 +1,16 @@
#ifndef MXSIZE32_H #ifndef MXSIZE32_H
#define MXSIZE32_H #define MXSIZE32_H
#include "mfc.h"
#include "mxtypes.h" #include "mxtypes.h"
class MxSize32 { class MxSize32 : public CSize {
public: public:
MxSize32() {} 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 GetWidth() const { return cx; }
MxS32 GetHeight() const { return m_height; } MxS32 GetHeight() const { return cy; }
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;
}; };
#endif // MXSIZE32_H #endif // MXSIZE32_H