mirror of
https://github.com/isledecomp/isle.git
synced 2025-10-24 08:54:15 +00:00
Refactor
This commit is contained in:
@@ -42,40 +42,41 @@ void MxRegion::vtable18(MxRect32 &p_rect)
|
|||||||
MxRegionListCursor cursor(m_list);
|
MxRegionListCursor cursor(m_list);
|
||||||
|
|
||||||
if (rectCopy.m_left < rectCopy.m_right) {
|
if (rectCopy.m_left < rectCopy.m_right) {
|
||||||
MxRegionTopBottom *topBottom;
|
while (rectCopy.m_top < rectCopy.m_bottom) {
|
||||||
while (rectCopy.m_top < rectCopy.m_bottom && cursor.Next(topBottom)) {
|
MxRegionTopBottom *topBottom;
|
||||||
|
if (!cursor.Next(topBottom))
|
||||||
|
break;
|
||||||
|
|
||||||
if (topBottom->m_top >= rectCopy.m_bottom) {
|
if (topBottom->m_top >= rectCopy.m_bottom) {
|
||||||
MxRegionTopBottom *newTopBottom = new MxRegionTopBottom(rectCopy);
|
MxRegionTopBottom *newTopBottom = new MxRegionTopBottom(rectCopy);
|
||||||
cursor.Prepend(newTopBottom);
|
cursor.Prepend(newTopBottom);
|
||||||
rectCopy.m_top = rectCopy.m_bottom;
|
rectCopy.m_top = rectCopy.m_bottom;
|
||||||
}
|
}
|
||||||
else {
|
else if (rectCopy.m_top < topBottom->m_bottom) {
|
||||||
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(rectCopy.m_left, rectCopy.m_top, 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;
|
}
|
||||||
}
|
else if (topBottom->m_top < rectCopy.m_top) {
|
||||||
else if (topBottom->m_top < rectCopy.m_top) {
|
MxRegionTopBottom *newTopBottom = topBottom->Clone();
|
||||||
MxRegionTopBottom *newTopBottom = topBottom->Clone();
|
newTopBottom->m_bottom = rectCopy.m_top;
|
||||||
newTopBottom->m_bottom = rectCopy.m_top;
|
topBottom->m_top = rectCopy.m_top;
|
||||||
topBottom->m_top = rectCopy.m_top;
|
cursor.Prepend(newTopBottom);
|
||||||
cursor.Prepend(newTopBottom);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (rectCopy.m_bottom < topBottom->m_top) {
|
if (rectCopy.m_bottom < topBottom->m_top) {
|
||||||
MxRegionTopBottom *newTopBottom = topBottom->Clone();
|
MxRegionTopBottom *newTopBottom = topBottom->Clone();
|
||||||
newTopBottom->m_bottom = rectCopy.m_bottom;
|
newTopBottom->m_bottom = rectCopy.m_bottom;
|
||||||
topBottom->m_top = rectCopy.m_bottom;
|
topBottom->m_top = rectCopy.m_bottom;
|
||||||
newTopBottom->FUN_100c5280(rectCopy.m_left, rectCopy.m_right);
|
newTopBottom->FUN_100c5280(rectCopy.m_left, rectCopy.m_right);
|
||||||
cursor.Prepend(newTopBottom);
|
cursor.Prepend(newTopBottom);
|
||||||
rectCopy.m_top = rectCopy.m_bottom;
|
rectCopy.m_top = rectCopy.m_bottom;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
topBottom->FUN_100c5280(rectCopy.m_left, rectCopy.m_right);
|
topBottom->FUN_100c5280(rectCopy.m_left, rectCopy.m_right);
|
||||||
rectCopy.m_top = topBottom->m_top;
|
rectCopy.m_top = topBottom->m_top;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user