mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-23 00:14:22 +00:00
MxRegion: initial implementation (#218)
* MxRegion structures
* MxRegion structures
* Remove junk
* Refactor
* WIP
* Use MxRect32 ctor
* Refactor
* Add MxSize32, match MxRegion ctor
* Add two template annotations
* Fix missing instructions
* Fix another bug
* Refactor
* Add GetPoint
* Implement/match MxRegionTopBottom::MxRegionTopBottom
* Implement/match more functions
* More implementation
* Don't expose internal match
* Fix indent
* Add template annotations
* Implement remaining functions
* Fix comment
* Match loops
* Simplify function
* Merge
* Remove junk
* Format
* Format
* match MxRegion::vtable1c
* revert vtable1c match-hack
This reverts commit 7b88625988
.
---------
Co-authored-by: Ramen2X <64166386+Ramen2X@users.noreply.github.com>
This commit is contained in:

committed by
GitHub

parent
cb286520e5
commit
9ac9fe2761
@@ -1,6 +1,9 @@
|
||||
#ifndef MXRECT32_H
|
||||
#define MXRECT32_H
|
||||
|
||||
#include "mxpoint32.h"
|
||||
#include "mxsize32.h"
|
||||
|
||||
class MxRect32 {
|
||||
public:
|
||||
MxRect32() {}
|
||||
@@ -12,14 +15,35 @@ public:
|
||||
this->m_bottom = p_bottom;
|
||||
}
|
||||
|
||||
MxRect32(const MxPoint32& p_point, const MxSize32& p_size)
|
||||
{
|
||||
this->m_left = p_point.m_x;
|
||||
this->m_top = p_point.m_y;
|
||||
this->m_right = p_size.m_width;
|
||||
this->m_bottom = p_size.m_height;
|
||||
}
|
||||
|
||||
inline void SetPoint(const MxPoint32& p_point)
|
||||
{
|
||||
this->m_left = p_point.m_x;
|
||||
this->m_top = p_point.m_y;
|
||||
}
|
||||
|
||||
inline void SetSize(const MxSize32& p_size)
|
||||
{
|
||||
this->m_right = p_size.m_width;
|
||||
this->m_bottom = p_size.m_height;
|
||||
}
|
||||
|
||||
inline MxS32 GetWidth() { return (m_right - m_left) + 1; }
|
||||
inline MxS32 GetHeight() { return (m_bottom - m_top) + 1; }
|
||||
|
||||
inline MxPoint32 GetPoint() { return MxPoint32(this->m_left, this->m_top); }
|
||||
|
||||
MxS32 m_left;
|
||||
MxS32 m_top;
|
||||
MxS32 m_right;
|
||||
MxS32 m_bottom;
|
||||
|
||||
inline MxS32 GetWidth() { return (m_right - m_left) + 1; }
|
||||
|
||||
inline MxS32 GetHeight() { return (m_bottom - m_top) + 1; }
|
||||
};
|
||||
|
||||
#endif // MXRECT32_H
|
||||
|
Reference in New Issue
Block a user