Skip to content

Commit

Permalink
Use MFC base classes for MxPoint32, MxSize32
Browse files Browse the repository at this point in the history
  • Loading branch information
foxtacles committed Dec 26, 2024
1 parent 026bc23 commit 0b51291
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 40 deletions.
27 changes: 9 additions & 18 deletions LEGO1/omni/include/mxpoint32.h
Original file line number Diff line number Diff line change
@@ -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
8 changes: 0 additions & 8 deletions LEGO1/omni/include/mxrect32.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
19 changes: 5 additions & 14 deletions LEGO1/omni/include/mxsize32.h
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit 0b51291

Please sign in to comment.