This commit is contained in:
Christian Semmler 2023-12-29 23:42:45 -05:00
parent 484f55448c
commit 70e5bcd937
4 changed files with 16 additions and 15 deletions

View File

@ -728,6 +728,7 @@ MxBool FUN_100b6e10(
if (!rect.IntersectsWith(videoParamRect)) if (!rect.IntersectsWith(videoParamRect))
return FALSE; return FALSE;
rect.Intersect(videoParamRect); rect.Intersect(videoParamRect);
rect.SubtractPoint(bottomRight); rect.SubtractPoint(bottomRight);
@ -737,7 +738,6 @@ MxBool FUN_100b6e10(
*p_bottom += rect.GetTop(); *p_bottom += rect.GetTop();
*p_width = rect.GetWidth(); *p_width = rect.GetWidth();
*p_height = rect.GetHeight(); *p_height = rect.GetHeight();
return TRUE; return TRUE;
} }

View File

@ -6,12 +6,7 @@
class MxPoint32 { class MxPoint32 {
public: public:
MxPoint32() {} MxPoint32() {}
MxPoint32(MxS32 p_x, MxS32 p_y) MxPoint32(MxS32 p_x, MxS32 p_y) { CopyFrom(p_x, p_y); }
{
this->m_x = p_x;
this->m_y = p_y;
}
MxPoint32(const MxPoint32& p_point) MxPoint32(const MxPoint32& p_point)
{ {
this->m_x = p_point.m_x; this->m_x = p_point.m_x;
@ -25,8 +20,14 @@ class MxPoint32 {
inline void SetY(MxS32 p_y) { m_y = p_y; } inline void SetY(MxS32 p_y) { m_y = p_y; }
private: private:
MxS32 m_x; inline void CopyFrom(MxS32 p_x, MxS32 p_y)
MxS32 m_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

@ -9,10 +9,7 @@ class MxRect32 {
public: public:
MxRect32() {} MxRect32() {}
MxRect32(MxS32 p_left, MxS32 p_top, MxS32 p_right, MxS32 p_bottom) { CopyFrom(p_left, p_top, p_right, p_bottom); } MxRect32(MxS32 p_left, MxS32 p_top, MxS32 p_right, MxS32 p_bottom) { CopyFrom(p_left, p_top, p_right, p_bottom); }
// FUNCTION: LEGO1 0x100b6fc0
MxRect32(const MxPoint32& p_point, const MxSize32& p_size) { CopyFrom(p_point, p_size); } MxRect32(const MxPoint32& p_point, const MxSize32& p_size) { CopyFrom(p_point, p_size); }
MxRect32(const MxRect32& p_a, const MxRect32& p_b) MxRect32(const MxRect32& p_a, const MxRect32& p_b)
{ {
m_left = Max(p_a.m_left, p_b.m_left); m_left = Max(p_a.m_left, p_b.m_left);
@ -106,12 +103,15 @@ class MxRect32 {
this->m_bottom = p_rect.m_bottom; this->m_bottom = p_rect.m_bottom;
} }
inline void CopyFrom(const MxPoint32& p_point, const MxSize32& p_size) // The address might also be the constructor that calls CopyFrom
// FUNCTION: LEGO1 0x100b6fc0
inline MxRect32* CopyFrom(const MxPoint32& p_point, const MxSize32& p_size)
{ {
this->m_left = p_point.GetX(); this->m_left = p_point.GetX();
this->m_top = p_point.GetY(); this->m_top = p_point.GetY();
this->m_right = p_size.GetWidth() + p_point.GetX() - 1; this->m_right = p_size.GetWidth() + p_point.GetX() - 1;
this->m_bottom = p_size.GetHeight() + p_point.GetY() - 1; this->m_bottom = p_size.GetHeight() + p_point.GetY() - 1;
return this;
} }
inline static MxS32 Min(MxS32 p_a, MxS32 p_b) { return p_a <= p_b ? p_a : p_b; }; inline static MxS32 Min(MxS32 p_a, MxS32 p_b) { return p_a <= p_b ? p_a : p_b; };

View File

@ -6,13 +6,13 @@
class MxSize32 { class MxSize32 {
public: public:
MxSize32() {} MxSize32() {}
MxSize32(MxS32 p_width, MxS32 p_height) { Assign(p_width, p_height); } MxSize32(MxS32 p_width, MxS32 p_height) { CopyFrom(p_width, p_height); }
inline MxS32 GetWidth() const { return m_width; } inline MxS32 GetWidth() const { return m_width; }
inline MxS32 GetHeight() const { return m_height; } inline MxS32 GetHeight() const { return m_height; }
private: private:
inline void Assign(MxS32 p_width, MxS32 p_height) inline void CopyFrom(MxS32 p_width, MxS32 p_height)
{ {
this->m_width = p_width; this->m_width = p_width;
this->m_height = p_height; this->m_height = p_height;