Implement remaining functions

This commit is contained in:
Christian Semmler
2023-10-20 09:23:04 -04:00
parent 6569a6a8c7
commit 1919135682
2 changed files with 49 additions and 11 deletions

View File

@@ -14,23 +14,25 @@ MxRegion::MxRegion()
m_rect.SetSize(MxSize32(-1, -1));
}
// OFFSET: LEGO1 0x100c3660 STUB
// OFFSET: LEGO1 0x100c3660
MxBool MxRegion::vtable20()
{
// TODO
return FALSE;
return m_list->GetCount() == 0;
}
// OFFSET: LEGO1 0x100c3690 STUB
// OFFSET: LEGO1 0x100c3690
MxRegion::~MxRegion()
{
// TODO
if (m_list)
delete m_list;
}
// OFFSET: LEGO1 0x100c3700 STUB
// OFFSET: LEGO1 0x100c3700
void MxRegion::Reset()
{
// TODO
m_list->DeleteAll();
m_rect.SetPoint(MxPoint32(INT_MAX, INT_MAX));
m_rect.SetSize(MxSize32(-1, -1));
}
// OFFSET: LEGO1 0x100c3750
@@ -100,10 +102,29 @@ void MxRegion::vtable18(MxRect32 &p_rect)
m_rect.m_bottom = m_rect.m_bottom <= p_rect.m_bottom ? p_rect.m_bottom : m_rect.m_bottom;
}
// OFFSET: LEGO1 0x100c3e20 STUB
void MxRegion::vtable1c()
// OFFSET: LEGO1 0x100c3e20
MxBool MxRegion::vtable1c(MxRect32 &p_rect)
{
// TODO
if (m_rect.m_left < p_rect.m_right &&
p_rect.m_left < m_rect.m_right &&
(m_rect.m_top < p_rect.m_bottom &&
p_rect.m_top < m_rect.m_bottom)) {
MxRegionListCursor cursor(m_list);
MxRegionTopBottom *topBottom;
do {
do {
if (!cursor.Next(topBottom))
return FALSE;
if (topBottom->m_top >= p_rect.m_bottom)
return FALSE;
} while (topBottom->m_bottom <= p_rect.m_top);
} while (!topBottom->FUN_100c57b0(p_rect));
return TRUE;
}
return FALSE;
}
// OFFSET: LEGO1 0x100c4c90
@@ -187,3 +208,19 @@ MxRegionTopBottom *MxRegionTopBottom::Clone()
return clone;
}
// OFFSET: LEGO1 0x100c57b0
MxBool MxRegionTopBottom::FUN_100c57b0(MxRect32 &p_rect)
{
MxRegionLeftRightListCursor cursor(m_leftRightList);
MxRegionLeftRight *leftRight;
do {
if (!cursor.Next(leftRight))
return FALSE;
if (p_rect.m_right <= leftRight->m_left)
return FALSE;
} while (leftRight->m_right <= p_rect.m_left);
return TRUE;
}

View File

@@ -14,6 +14,7 @@ struct MxRegionTopBottom
MxRegionTopBottom *Clone();
void FUN_100c5280(MxS32 p_left, MxS32 p_right);
MxBool FUN_100c57b0(MxRect32 &p_rect);
MxS32 m_top;
MxS32 m_bottom;
@@ -48,7 +49,7 @@ public:
virtual void Reset();
virtual void vtable18(MxRect32 &p_rect);
virtual void vtable1c();
virtual MxBool vtable1c(MxRect32 &p_rect);
virtual MxBool vtable20();
inline MxRect32 &GetRect() { return this->m_rect; }