Match loops

This commit is contained in:
Christian Semmler
2023-10-20 15:36:03 -04:00
parent 935c74513d
commit 19722d413c

View File

@@ -105,23 +105,20 @@ void MxRegion::vtable18(MxRect32 &p_rect)
// OFFSET: LEGO1 0x100c3e20 // OFFSET: LEGO1 0x100c3e20
MxBool MxRegion::vtable1c(MxRect32 &p_rect) MxBool MxRegion::vtable1c(MxRect32 &p_rect)
{ {
if (m_rect.m_left < p_rect.m_right && if (m_rect.m_left >= p_rect.m_right ||
p_rect.m_left < m_rect.m_right && p_rect.m_left >= m_rect.m_right ||
(m_rect.m_top < p_rect.m_bottom && m_rect.m_top >= p_rect.m_bottom ||
p_rect.m_top < m_rect.m_bottom)) { p_rect.m_top >= m_rect.m_bottom)
MxRegionListCursor cursor(m_list); return FALSE;
MxRegionTopBottom *topBottom;
MxRegionListCursor cursor(m_list);
MxRegionTopBottom *topBottom;
do { while (cursor.Next(topBottom)) {
do { if (topBottom->m_top >= p_rect.m_bottom)
if (!cursor.Next(topBottom)) return FALSE;
return FALSE; if (topBottom->m_bottom > p_rect.m_top && topBottom->FUN_100c57b0(p_rect))
if (topBottom->m_top >= p_rect.m_bottom) return TRUE;
return FALSE;
} while (topBottom->m_bottom <= p_rect.m_top);
} while (!topBottom->FUN_100c57b0(p_rect));
return TRUE;
} }
return FALSE; return FALSE;
@@ -215,12 +212,12 @@ MxBool MxRegionTopBottom::FUN_100c57b0(MxRect32 &p_rect)
MxRegionLeftRightListCursor cursor(m_leftRightList); MxRegionLeftRightListCursor cursor(m_leftRightList);
MxRegionLeftRight *leftRight; MxRegionLeftRight *leftRight;
do { while (cursor.Next(leftRight)) {
if (!cursor.Next(leftRight))
return FALSE;
if (p_rect.m_right <= leftRight->m_left) if (p_rect.m_right <= leftRight->m_left)
return FALSE; return FALSE;
} while (leftRight->m_right <= p_rect.m_left); if (leftRight->m_right > p_rect.m_left)
return TRUE;
}
return TRUE; return FALSE;
} }