Fix matches

This commit is contained in:
Christian Semmler 2023-12-20 22:47:53 -05:00
parent f1ea99e440
commit 7efa698ab4
3 changed files with 16 additions and 12 deletions

View File

@ -12,6 +12,12 @@ class MxPoint32 {
this->m_y = p_y;
}
MxPoint32(const MxPoint32& p_point)
{
this->m_x = p_point.m_x;
this->m_y = p_point.m_y;
}
inline MxS32 GetX() const { return m_x; }
inline MxS32 GetY() const { return m_y; }

View File

@ -40,14 +40,6 @@ class MxRect32 {
return *this;
}
inline void CopyFrom(const MxRect32& p_rect)
{
this->m_left = p_rect.m_left;
this->m_top = p_rect.m_top;
this->m_right = p_rect.m_right;
this->m_bottom = p_rect.m_bottom;
}
inline void Intersect(const MxRect32& p_rect)
{
m_left = Max(p_rect.m_left, m_left);
@ -107,6 +99,14 @@ class MxRect32 {
inline void SetBottom(MxS32 p_bottom) { m_bottom = p_bottom; }
private:
inline void CopyFrom(const MxRect32& p_rect)
{
this->m_left = p_rect.m_left;
this->m_top = p_rect.m_top;
this->m_right = p_rect.m_right;
this->m_bottom = p_rect.m_bottom;
}
inline static MxS32 Min(MxS32 p_a, MxS32 p_b) { return p_a <= p_b ? p_a : p_b; };
inline static MxS32 Max(MxS32 p_a, MxS32 p_b) { return p_a <= p_b ? p_b : p_a; };

View File

@ -80,10 +80,8 @@ void MxSmkPresenter::LoadFrame(MxStreamChunk* p_chunk)
MxRect32* rect;
while (cursor.Next(rect)) {
// This should probably be using the assignment operator,
// but it's currently reducing the match significantly.
invalidateRect.CopyFrom(*rect);
invalidateRect.AddPoint(m_location);
invalidateRect = *rect;
invalidateRect.AddPoint(GetLocation());
MVideoManager()->InvalidateRect(invalidateRect);
}
}