mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-24 00:44:21 +00:00
Add MxSize32, match MxRegion ctor
This commit is contained in:
@@ -1,6 +1,9 @@
|
|||||||
#ifndef MXRECT32_H
|
#ifndef MXRECT32_H
|
||||||
#define MXRECT32_H
|
#define MXRECT32_H
|
||||||
|
|
||||||
|
#include "mxpoint32.h"
|
||||||
|
#include "mxsize32.h"
|
||||||
|
|
||||||
class MxRect32
|
class MxRect32
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -13,20 +16,33 @@ public:
|
|||||||
this->m_bottom = p_bottom;
|
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;
|
||||||
|
}
|
||||||
|
|
||||||
MxS32 m_left;
|
MxS32 m_left;
|
||||||
MxS32 m_top;
|
MxS32 m_top;
|
||||||
MxS32 m_right;
|
MxS32 m_right;
|
||||||
MxS32 m_bottom;
|
MxS32 m_bottom;
|
||||||
|
|
||||||
inline MxS32 GetWidth()
|
inline void SetPoint(const MxPoint32 &p_point)
|
||||||
{
|
{
|
||||||
return (m_right - m_left) + 1;
|
this->m_left = p_point.m_x;
|
||||||
|
this->m_top = p_point.m_y;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline MxS32 GetHeight()
|
inline void SetSize(const MxSize32 &p_size)
|
||||||
{
|
{
|
||||||
return (m_bottom - m_top) + 1;
|
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; }
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // MXRECT32_H
|
#endif // MXRECT32_H
|
||||||
|
|||||||
@@ -10,10 +10,8 @@ DECOMP_SIZE_ASSERT(MxRegionLeftRight, 0x08);
|
|||||||
MxRegion::MxRegion()
|
MxRegion::MxRegion()
|
||||||
{
|
{
|
||||||
m_list = new MxRegionList;
|
m_list = new MxRegionList;
|
||||||
m_rect.m_left = INT_MAX;
|
m_rect.SetPoint(MxPoint32(INT_MAX, INT_MAX));
|
||||||
m_rect.m_top = INT_MAX;
|
m_rect.SetSize(MxSize32(-1, -1));
|
||||||
m_rect.m_right = -1;
|
|
||||||
m_rect.m_bottom = - 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// OFFSET: LEGO1 0x100c3660 STUB
|
// OFFSET: LEGO1 0x100c3660 STUB
|
||||||
@@ -38,7 +36,10 @@ void MxRegion::Reset()
|
|||||||
// OFFSET: LEGO1 0x100c3750
|
// OFFSET: LEGO1 0x100c3750
|
||||||
void MxRegion::vtable18(MxRect32 &p_rect)
|
void MxRegion::vtable18(MxRect32 &p_rect)
|
||||||
{
|
{
|
||||||
MxRect32 rectCopy(p_rect.m_left, p_rect.m_top, p_rect.m_right, p_rect.m_bottom);
|
MxRect32 rectCopy(
|
||||||
|
MxPoint32(p_rect.m_left, p_rect.m_top),
|
||||||
|
MxSize32(p_rect.m_right, p_rect.m_bottom)
|
||||||
|
);
|
||||||
MxRegionListCursor cursor(m_list);
|
MxRegionListCursor cursor(m_list);
|
||||||
|
|
||||||
if (rectCopy.m_left < rectCopy.m_right) {
|
if (rectCopy.m_left < rectCopy.m_right) {
|
||||||
@@ -54,7 +55,11 @@ void MxRegion::vtable18(MxRect32 &p_rect)
|
|||||||
}
|
}
|
||||||
else if (rectCopy.m_top < topBottom->m_bottom) {
|
else if (rectCopy.m_top < topBottom->m_bottom) {
|
||||||
if (rectCopy.m_top < topBottom->m_top) {
|
if (rectCopy.m_top < topBottom->m_top) {
|
||||||
MxRect32 topBottomRect(rectCopy.m_left, rectCopy.m_top, rectCopy.m_right, topBottom->m_top);
|
MxRect32 topBottomRect(
|
||||||
|
MxPoint32(rectCopy.m_left, rectCopy.m_top),
|
||||||
|
MxSize32(rectCopy.m_right, topBottom->m_top)
|
||||||
|
);
|
||||||
|
|
||||||
MxRegionTopBottom *newTopBottom = new MxRegionTopBottom(topBottomRect);
|
MxRegionTopBottom *newTopBottom = new MxRegionTopBottom(topBottomRect);
|
||||||
cursor.Prepend(newTopBottom);
|
cursor.Prepend(newTopBottom);
|
||||||
rectCopy.m_top = topBottom->m_top;
|
rectCopy.m_top = topBottom->m_top;
|
||||||
|
|||||||
20
LEGO1/mxsize32.h
Normal file
20
LEGO1/mxsize32.h
Normal file
@@ -0,0 +1,20 @@
|
|||||||
|
#ifndef MXSIZE32_H
|
||||||
|
#define MXSIZE32_H
|
||||||
|
|
||||||
|
#include "mxtypes.h"
|
||||||
|
|
||||||
|
class MxSize32
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
MxSize32() { }
|
||||||
|
MxSize32(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
|
||||||
Reference in New Issue
Block a user