Corrected the CIF "close" function to accommodate non-manhattan
geometry.
This commit is contained in:
parent
61188031cb
commit
904a60423e
12
cif/CIFgen.c
12
cif/CIFgen.c
|
|
@ -2004,6 +2004,7 @@ cifGatherFunc(tile, atotal, mode)
|
||||||
if ((*atotal != INFINITY) && (*atotal < growDistance))
|
if ((*atotal != INFINITY) && (*atotal < growDistance))
|
||||||
locarea = (dlong)(area.r_xtop - area.r_xbot)
|
locarea = (dlong)(area.r_xtop - area.r_xbot)
|
||||||
* (dlong)(area.r_ytop - area.r_ybot);
|
* (dlong)(area.r_ytop - area.r_ybot);
|
||||||
|
if (IsSplit(tile)) locarea /= 2;
|
||||||
if (locarea > (dlong)INFINITY)
|
if (locarea > (dlong)INFINITY)
|
||||||
*atotal = INFINITY;
|
*atotal = INFINITY;
|
||||||
else
|
else
|
||||||
|
|
@ -2011,7 +2012,8 @@ cifGatherFunc(tile, atotal, mode)
|
||||||
}
|
}
|
||||||
else if (mode == CLOSE_FILL)
|
else if (mode == CLOSE_FILL)
|
||||||
{
|
{
|
||||||
DBPaintPlane(cifPlane, &area, CIFPaintTable, (PaintUndoInfo *)NULL);
|
DBNMPaintPlane(cifPlane, TiGetTypeExact(tile), &area, CIFPaintTable,
|
||||||
|
(PaintUndoInfo *)NULL);
|
||||||
CIFTileOps++;
|
CIFTileOps++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2024,25 +2026,25 @@ cifGatherFunc(tile, atotal, mode)
|
||||||
/* Check top */
|
/* Check top */
|
||||||
if (area.r_ytop != TiPlaneRect.r_ytop)
|
if (area.r_ytop != TiPlaneRect.r_ytop)
|
||||||
for (tp = RT(tile); RIGHT(tp) > LEFT(tile); tp = BL(tp))
|
for (tp = RT(tile); RIGHT(tp) > LEFT(tile); tp = BL(tp))
|
||||||
if (tp->ti_client == cdata && TiGetType(tp) == TT_SPACE)
|
if (tp->ti_client == cdata && TiGetBottomType(tp) == TT_SPACE)
|
||||||
cifGatherFunc(tp, atotal, mode);
|
cifGatherFunc(tp, atotal, mode);
|
||||||
|
|
||||||
/* Check bottom */
|
/* Check bottom */
|
||||||
if (area.r_ybot != TiPlaneRect.r_ybot)
|
if (area.r_ybot != TiPlaneRect.r_ybot)
|
||||||
for (tp = LB(tile); LEFT(tp) < RIGHT(tile); tp = TR(tp))
|
for (tp = LB(tile); LEFT(tp) < RIGHT(tile); tp = TR(tp))
|
||||||
if (tp->ti_client == cdata && TiGetType(tp) == TT_SPACE)
|
if (tp->ti_client == cdata && TiGetTopType(tp) == TT_SPACE)
|
||||||
cifGatherFunc(tp, atotal, mode);
|
cifGatherFunc(tp, atotal, mode);
|
||||||
|
|
||||||
/* Check left */
|
/* Check left */
|
||||||
if (area.r_xbot != TiPlaneRect.r_xbot)
|
if (area.r_xbot != TiPlaneRect.r_xbot)
|
||||||
for (tp = BL(tile); BOTTOM(tp) < TOP(tile); tp = RT(tp))
|
for (tp = BL(tile); BOTTOM(tp) < TOP(tile); tp = RT(tp))
|
||||||
if (tp->ti_client == cdata && TiGetType(tp) == TT_SPACE)
|
if (tp->ti_client == cdata && TiGetRightType(tp) == TT_SPACE)
|
||||||
cifGatherFunc(tp, atotal, mode);
|
cifGatherFunc(tp, atotal, mode);
|
||||||
|
|
||||||
/* Check right */
|
/* Check right */
|
||||||
if (area.r_xtop != TiPlaneRect.r_xtop)
|
if (area.r_xtop != TiPlaneRect.r_xtop)
|
||||||
for (tp = TR(tile); TOP(tp) > BOTTOM(tile); tp = LB(tp))
|
for (tp = TR(tile); TOP(tp) > BOTTOM(tile); tp = LB(tp))
|
||||||
if (tp->ti_client == cdata && TiGetType(tp) == TT_SPACE)
|
if (tp->ti_client == cdata && TiGetLeftType(tp) == TT_SPACE)
|
||||||
cifGatherFunc(tp, atotal, mode);
|
cifGatherFunc(tp, atotal, mode);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue