Plane[GS]etHint() added to encapsulate access to Plane->pl_hint
This is ground work to intercept usage and validate changes in this area. Fixed conflicts with earler patch in extract/ExtNghbors.c
This commit is contained in:
parent
f942ae6e78
commit
1a84eab4ce
|
|
@ -2544,7 +2544,7 @@ cifRectBoundingBox(
|
|||
/* (Largely copied from cifSquaresFillArea) */
|
||||
|
||||
simple = TRUE;
|
||||
tile = plane->pl_hint;
|
||||
tile = PlaneGetHint(plane);
|
||||
TiToRect(tile, &bbox);
|
||||
|
||||
PUSHTILE(tile, BoxStack);
|
||||
|
|
@ -2813,7 +2813,7 @@ cifSquaresFillArea(
|
|||
/* (Largely copied from cifBloatAllFunc) */
|
||||
|
||||
simple = TRUE;
|
||||
tile = plane->pl_hint;
|
||||
tile = PlaneGetHint(plane);
|
||||
TiToRect(tile, &bbox);
|
||||
|
||||
PUSHTILE(tile, CutStack);
|
||||
|
|
@ -3155,7 +3155,7 @@ cifSlotsFillArea(
|
|||
/* (Largely copied from cifBloatAllFunc) */
|
||||
|
||||
simple = TRUE;
|
||||
tile = plane->pl_hint;
|
||||
tile = PlaneGetHint(plane);
|
||||
TiToRect(tile, &bbox);
|
||||
|
||||
PUSHTILE(tile, CutStack);
|
||||
|
|
@ -4751,7 +4751,7 @@ cifInteractingRegions(
|
|||
/* part of the region overlapped the specified type(s). */
|
||||
|
||||
interacts = FALSE;
|
||||
tile = plane->pl_hint;
|
||||
tile = PlaneGetHint(plane);
|
||||
PUSHTILE(tile, RegStack);
|
||||
while (!StackEmpty(RegStack))
|
||||
{
|
||||
|
|
|
|||
|
|
@ -262,7 +262,7 @@ DBClearPaintPlane(plane)
|
|||
|
||||
/* Allocate a new central space tile */
|
||||
newCenterTile = TiAlloc();
|
||||
plane->pl_hint = newCenterTile;
|
||||
PlaneSetHint(plane, newCenterTile);
|
||||
TiSetBody(newCenterTile, TT_SPACE);
|
||||
dbSetPlaneTile(plane, newCenterTile);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -273,7 +273,7 @@ DBPaintPlane0(plane, area, resultTbl, undo, method)
|
|||
|
||||
start.p_x = area->r_xbot;
|
||||
start.p_y = area->r_ytop - 1;
|
||||
tile = plane->pl_hint;
|
||||
tile = PlaneGetHint(plane);
|
||||
GOTOPOINT(tile, &start);
|
||||
|
||||
/* Each iteration visits another tile on the LHS of the search area */
|
||||
|
|
@ -648,7 +648,7 @@ done:
|
|||
start.p_x = area->r_xbot;
|
||||
start.p_y = area->r_ytop - 1;
|
||||
|
||||
tile = plane->pl_hint;
|
||||
tile = PlaneGetHint(plane);
|
||||
GOTOPOINT(tile, &start);
|
||||
|
||||
while (TOP(tile) > area->r_ybot)
|
||||
|
|
@ -696,7 +696,7 @@ enum2:
|
|||
}
|
||||
|
||||
done2:
|
||||
plane->pl_hint = tile;
|
||||
PlaneSetHint(plane, tile);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -719,7 +719,7 @@ DBSplitTile(plane, point, splitx)
|
|||
int splitx;
|
||||
{
|
||||
Tile *tile, *newtile, *tp;
|
||||
tile = plane->pl_hint;
|
||||
tile = PlaneGetHint(plane);
|
||||
GOTOPOINT(tile, point);
|
||||
|
||||
if (IsSplit(tile)) /* This should always be true */
|
||||
|
|
@ -793,7 +793,7 @@ DBFracturePlane(plane, area, resultTbl, undo)
|
|||
|
||||
start.p_x = area->r_xbot;
|
||||
start.p_y = area->r_ytop - 1;
|
||||
tile = plane->pl_hint;
|
||||
tile = PlaneGetHint(plane);
|
||||
GOTOPOINT(tile, &start);
|
||||
|
||||
/* Each iteration visits another tile on the LHS of the search area */
|
||||
|
|
@ -990,7 +990,7 @@ paintdone:
|
|||
}
|
||||
|
||||
done:
|
||||
plane->pl_hint = tile;
|
||||
PlaneSetHint(plane, tile);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -1036,7 +1036,7 @@ DBMergeNMTiles0(plane, area, undo, mergeOnce)
|
|||
|
||||
start.p_x = area->r_xbot;
|
||||
start.p_y = area->r_ytop - 1;
|
||||
tile = plane->pl_hint;
|
||||
tile = PlaneGetHint(plane);
|
||||
GOTOPOINT(tile, &start);
|
||||
|
||||
/* Each iteration visits another tile on the LHS of the search area */
|
||||
|
|
@ -1306,7 +1306,7 @@ nmenum:
|
|||
}
|
||||
|
||||
nmdone:
|
||||
plane->pl_hint = tile;
|
||||
PlaneSetHint(plane, tile);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -1499,7 +1499,7 @@ DBNMPaintPlane0(plane, exacttype, area, resultTbl, undo, method)
|
|||
/* linked list out of them. */
|
||||
|
||||
lhead = NULL;
|
||||
DBSrPaintArea(plane->pl_hint, plane, area, &DBAllTypeBits,
|
||||
DBSrPaintArea(PlaneGetHint(plane), plane, area, &DBAllTypeBits,
|
||||
dbNMEnumFunc, (ClientData) &lhead);
|
||||
|
||||
/*--------------------------------------------------------------*/
|
||||
|
|
@ -1519,7 +1519,7 @@ DBNMPaintPlane0(plane, exacttype, area, resultTbl, undo, method)
|
|||
GeoClip(&lhead->r_r, area);
|
||||
start.p_x = area->r_xbot;
|
||||
start.p_y = area->r_ytop - 1;
|
||||
tile = plane->pl_hint;
|
||||
tile = PlaneGetHint(plane);
|
||||
GOTOPOINT(tile, &start);
|
||||
|
||||
/* Ignore tiles that don't interact. This has */
|
||||
|
|
@ -1608,7 +1608,7 @@ DBNMPaintPlane0(plane, exacttype, area, resultTbl, undo, method)
|
|||
{
|
||||
result = DBPaintPlane(plane, &(lr->r_r), DBSpecialPaintTbl,
|
||||
(PaintUndoInfo *)NULL);
|
||||
tile = plane->pl_hint;
|
||||
tile = PlaneGetHint(plane);
|
||||
GOTOPOINT(tile, &(lr->r_r.r_ll));
|
||||
if (undo && UndoIsEnabled())
|
||||
{
|
||||
|
|
@ -2096,7 +2096,7 @@ DBPaintType(plane, area, resultTbl, client, undo, tileMask)
|
|||
|
||||
start.p_x = area->r_xbot;
|
||||
start.p_y = area->r_ytop - 1;
|
||||
tile = plane->pl_hint;
|
||||
tile = PlaneGetHint(plane);
|
||||
GOTOPOINT(tile, &start);
|
||||
|
||||
/* Each iteration visits another tile on the LHS of the search area */
|
||||
|
|
@ -2333,7 +2333,7 @@ paintdone:
|
|||
}
|
||||
|
||||
done:
|
||||
plane->pl_hint = tile;
|
||||
PlaneSetHint(plane, tile);
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
@ -2583,7 +2583,7 @@ DBPaintPlaneVert(plane, area, resultTbl, undo)
|
|||
|
||||
start.p_x = area->r_xbot;
|
||||
start.p_y = area->r_ytop - 1;
|
||||
tile = plane->pl_hint;
|
||||
tile = PlaneGetHint(plane);
|
||||
GOTOPOINT(tile, &start);
|
||||
|
||||
/* Each iteration visits another tile on the LHS of the search area */
|
||||
|
|
@ -2796,7 +2796,7 @@ paintdone:
|
|||
}
|
||||
|
||||
done:
|
||||
plane->pl_hint = tile;
|
||||
PlaneSetHint(plane, tile);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ DBSrPaintNMArea(hintTile, plane, ttype, rect, mask, func, arg)
|
|||
|
||||
start.p_x = rect->r_xbot;
|
||||
start.p_y = rect->r_ytop - 1;
|
||||
tp = hintTile ? hintTile : plane->pl_hint;
|
||||
tp = hintTile ? hintTile : PlaneGetHint(plane);
|
||||
GOTOPOINT(tp, &start);
|
||||
|
||||
/* Each iteration visits another tile on the LHS of the search area */
|
||||
|
|
@ -129,7 +129,7 @@ DBSrPaintNMArea(hintTile, plane, ttype, rect, mask, func, arg)
|
|||
{
|
||||
/* Each iteration enumerates another tile */
|
||||
nm_enum:
|
||||
plane->pl_hint = tp;
|
||||
PlaneSetHint(plane, tp);
|
||||
if (SigInterruptPending)
|
||||
return (1);
|
||||
|
||||
|
|
@ -372,7 +372,7 @@ DBSrPaintArea(hintTile, plane, rect, mask, func, arg)
|
|||
|
||||
start.p_x = rect->r_xbot;
|
||||
start.p_y = rect->r_ytop - 1;
|
||||
tp = hintTile ? hintTile : plane->pl_hint;
|
||||
tp = hintTile ? hintTile : PlaneGetHint(plane);
|
||||
GOTOPOINT(tp, &start);
|
||||
|
||||
/* Each iteration visits another tile on the LHS of the search area */
|
||||
|
|
@ -380,7 +380,7 @@ DBSrPaintArea(hintTile, plane, rect, mask, func, arg)
|
|||
{
|
||||
/* Each iteration enumerates another tile */
|
||||
enumerate:
|
||||
plane->pl_hint = tp;
|
||||
PlaneSetHint(plane, tp);
|
||||
if (SigInterruptPending)
|
||||
return (1);
|
||||
|
||||
|
|
@ -532,7 +532,7 @@ DBSrPaintClient(hintTile, plane, rect, mask, client, func, arg)
|
|||
|
||||
start.p_x = rect->r_xbot;
|
||||
start.p_y = rect->r_ytop - 1;
|
||||
tp = hintTile ? hintTile : plane->pl_hint;
|
||||
tp = hintTile ? hintTile : PlaneGetHint(plane);
|
||||
GOTOPOINT(tp, &start);
|
||||
|
||||
/* Each iteration visits another tile on the LHS of the search area */
|
||||
|
|
@ -540,7 +540,7 @@ DBSrPaintClient(hintTile, plane, rect, mask, client, func, arg)
|
|||
{
|
||||
/* Each iteration enumerates another tile */
|
||||
enumerate:
|
||||
plane->pl_hint = tp;
|
||||
PlaneSetHint(plane, tp);
|
||||
if (SigInterruptPending)
|
||||
return (1);
|
||||
|
||||
|
|
|
|||
|
|
@ -4325,9 +4325,9 @@ Tile *extNodeToTile(np, et)
|
|||
|
||||
myplane = et->et_use->cu_def->cd_planes[np->nreg_pnum];
|
||||
|
||||
tp = myplane->pl_hint;
|
||||
tp = PlaneGetHint(myplane);
|
||||
GOTOPOINT(tp, &np->nreg_ll);
|
||||
myplane->pl_hint = tp;
|
||||
PlaneSetHint(myplane, tp);
|
||||
|
||||
if (IsSplit(tp))
|
||||
{
|
||||
|
|
@ -5092,9 +5092,9 @@ donesides:
|
|||
{
|
||||
Plane *plane = arg->fra_def->cd_planes[pNum];
|
||||
|
||||
tp = plane->pl_hint;
|
||||
tp = PlaneGetHint(plane);
|
||||
GOTOPOINT(tp, &tile->ti_ll);
|
||||
plane->pl_hint = tp;
|
||||
PlaneSetHint(plane, tp);
|
||||
|
||||
if (TiGetClient(tp) != extUnInit) continue;
|
||||
|
||||
|
|
|
|||
|
|
@ -335,9 +335,9 @@ extHardSetLabel(scx, reg, arg)
|
|||
GEOCLIP(&r,&scx->scx_area);
|
||||
|
||||
pNum = DBPlane(oldlab->lab_type);
|
||||
tp = scx->scx_use->cu_def->cd_planes[pNum]->pl_hint;
|
||||
tp = PlaneGetHint(scx->scx_use->cu_def->cd_planes[pNum]);
|
||||
GOTOPOINT(tp, &r.r_ll);
|
||||
scx->scx_use->cu_def->cd_planes[pNum]->pl_hint = tp;
|
||||
PlaneSetHint(scx->scx_use->cu_def->cd_planes[pNum], tp);
|
||||
if ((TransRegion *)extGetRegion(tp) == reg)
|
||||
{
|
||||
/* found an OK point */
|
||||
|
|
|
|||
|
|
@ -851,9 +851,9 @@ extPathFlood(tile, p, distance, epa)
|
|||
Plane *plane = extPathDef->cd_planes[pNum];
|
||||
|
||||
/* Find the point on the new plane */
|
||||
tp = plane->pl_hint;
|
||||
tp = PlaneGetHint(plane);
|
||||
GOTOPOINT(tp, &tile->ti_ll);
|
||||
plane->pl_hint = tp;
|
||||
PlaneSetHint(plane, tp);
|
||||
|
||||
/* If not yet visited, process tp */
|
||||
if (TiGetClient(tp) == CLIENTDEFAULT
|
||||
|
|
|
|||
|
|
@ -237,9 +237,12 @@ donesides:
|
|||
{
|
||||
Plane *plane = arg->fra_def->cd_planes[pNum];
|
||||
|
||||
tp = plane->pl_hint;
|
||||
/* Find the point on the new plane */
|
||||
tp = PlaneGetHint(plane);
|
||||
GOTOPOINT(tp, &tile->ti_ll);
|
||||
plane->pl_hint = tp;
|
||||
PlaneSetHint(plane, tp);
|
||||
|
||||
/* If not yet visited, process tp */
|
||||
if (TiGetClient(tp) != extNbrUn) continue;
|
||||
|
||||
/* tp and tile should have the same geometry for a contact */
|
||||
|
|
|
|||
|
|
@ -241,9 +241,9 @@ ExtLabelRegions(def, connTo, nodeList, clipArea)
|
|||
+ offsets[quad].p_x;
|
||||
p.p_y = ((lab->lab_rect.r_ybot + lab->lab_rect.r_ytop) >> 1)
|
||||
+ offsets[quad].p_y;
|
||||
tp = def->cd_planes[pNum]->pl_hint;
|
||||
tp = PlaneGetHint(def->cd_planes[pNum]);
|
||||
GOTOPOINT(tp, &p);
|
||||
def->cd_planes[pNum]->pl_hint = tp;
|
||||
PlaneSetHint(def->cd_planes[pNum], tp);
|
||||
if (extConnectsTo(TiGetType(tp), lab->lab_type, connTo)
|
||||
&& extHasRegion(tp, extUnInit))
|
||||
{
|
||||
|
|
@ -408,9 +408,9 @@ ExtLabelOneRegion(def, connTo, reg)
|
|||
*/
|
||||
p.p_x = lab->lab_rect.r_xbot + offsets[quad].p_x;
|
||||
p.p_y = lab->lab_rect.r_ybot + offsets[quad].p_y;
|
||||
tp = def->cd_planes[pNum]->pl_hint;
|
||||
tp = PlaneGetHint(def->cd_planes[pNum]);
|
||||
GOTOPOINT(tp, &p);
|
||||
def->cd_planes[pNum]->pl_hint = tp;
|
||||
PlaneSetHint(def->cd_planes[pNum], tp);
|
||||
if (extConnectsTo(TiGetType(tp), lab->lab_type, connTo)
|
||||
&& (NodeRegion *) extGetRegion(tp) == reg)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -834,7 +834,7 @@ extSubtreeFunc(scx, ha)
|
|||
* instead of an area search.
|
||||
*/
|
||||
Plane *plane = cumDef->cd_planes[DBPlane(lab->lab_type)];
|
||||
Tile *tile = plane->pl_hint;
|
||||
Tile *tile = PlaneGetHint(plane);
|
||||
GOTOPOINT(tile, &r.r_ll);
|
||||
if (TTMaskHasType(&DBConnectTbl[lab->lab_type], TiGetType(tile)))
|
||||
continue;
|
||||
|
|
|
|||
|
|
@ -278,7 +278,7 @@ glChanFreeMap()
|
|||
|
||||
/* Allocate a new central space tile */
|
||||
newCenterTile = TiAlloc();
|
||||
glChanPlane->pl_hint = newCenterTile;
|
||||
PlaneSetHint(glChanPlane, newCenterTile);
|
||||
TiSetBody(newCenterTile, CHAN_BLOCKED);
|
||||
dbSetPlaneTile(glChanPlane, newCenterTile);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -724,7 +724,7 @@ endCoord:
|
|||
{
|
||||
Tile *tp;
|
||||
Plane *plane = rootDef->cd_planes[DBPlane(routeTop->r_type)];
|
||||
tp = plane->pl_hint;
|
||||
tp = PlaneGetHint(plane);
|
||||
GOTOPOINT(tp, &routeTop->r_r.r_ll);
|
||||
if (TiGetType(tp) == routeTop->r_type)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -384,7 +384,7 @@ mzPaintBlockType(r, type, buildArea, blockType)
|
|||
if (blockType != TT_SAMENODE)
|
||||
{
|
||||
RouteContact *rC;
|
||||
Tile *tp = rT->rt_hBlock->pl_hint;
|
||||
Tile *tp = PlaneGetHint(rT->rt_hBlock);
|
||||
GOTOPOINT(tp, &r->r_ll);
|
||||
if (TiGetType(tp) == TT_SAMENODE)
|
||||
{
|
||||
|
|
@ -404,16 +404,16 @@ mzPaintBlockType(r, type, buildArea, blockType)
|
|||
Tile *tp2;
|
||||
if (rC->rc_rLayer1->rl_routeType.rt_tileType == type)
|
||||
{
|
||||
tp2 = rC->rc_rLayer1->
|
||||
rl_routeType.rt_hBlock->pl_hint;
|
||||
tp2 = PlaneGetHint(rC->rc_rLayer1->
|
||||
rl_routeType.rt_hBlock);
|
||||
GOTOPOINT(tp2, &r->r_ll);
|
||||
if (TiGetType(tp) == TT_SAMENODE) break;
|
||||
}
|
||||
else if (rC->rc_rLayer2->rl_routeType.rt_tileType
|
||||
== type)
|
||||
{
|
||||
tp2 = rC->rc_rLayer2->
|
||||
rl_routeType.rt_hBlock->pl_hint;
|
||||
tp2 = PlaneGetHint(rC->rc_rLayer2->
|
||||
rl_routeType.rt_hBlock);
|
||||
GOTOPOINT(tp2, &r->r_ll);
|
||||
if (TiGetType(tp) == TT_SAMENODE) break;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -235,7 +235,7 @@ plowSrShadow(
|
|||
/* Walk along the LHS of the sweep area from top to bottom */
|
||||
p.p_x = s.s_area.r_xbot;
|
||||
p.p_y = s.s_area.r_ytop - 1;
|
||||
tp = plane->pl_hint;
|
||||
tp = PlaneGetHint(plane);
|
||||
while (p.p_y >= s.s_area.r_ybot)
|
||||
{
|
||||
/* Find the next tile along the LHS of the sweep area */
|
||||
|
|
@ -254,7 +254,7 @@ plowSrShadow(
|
|||
}
|
||||
}
|
||||
|
||||
plane->pl_hint = tp;
|
||||
PlaneSetHint(plane, tp);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
|
|
@ -389,7 +389,7 @@ plowSrShadowInitial(
|
|||
/* Walk along the LHS of the sweep area from top to bottom */
|
||||
p.p_x = s.s_area.r_xbot;
|
||||
p.p_y = s.s_area.r_ytop - 1;
|
||||
tp = plane->pl_hint;
|
||||
tp = PlaneGetHint(plane);
|
||||
while (p.p_y >= s.s_area.r_ybot)
|
||||
{
|
||||
/* Find the next tile along the LHS of the sweep area */
|
||||
|
|
@ -408,7 +408,7 @@ plowSrShadowInitial(
|
|||
}
|
||||
}
|
||||
|
||||
plane->pl_hint = tp;
|
||||
PlaneSetHint(plane, tp);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
|
|
@ -545,7 +545,7 @@ plowSrShadowBack(
|
|||
/* Walk along the RHS of the sweep area from bottom to top */
|
||||
p.p_x = s.s_area.r_xtop - 1;
|
||||
p.p_y = s.s_area.r_ybot;
|
||||
tp = plane->pl_hint;
|
||||
tp = PlaneGetHint(plane);
|
||||
while (p.p_y < s.s_area.r_ytop)
|
||||
{
|
||||
/* Find the next tile along the RHS of the sweep area */
|
||||
|
|
@ -566,7 +566,7 @@ plowSrShadowBack(
|
|||
}
|
||||
|
||||
/* if ret = 1 then tp may point to an invalid tile --- Tim 6/15/01 */
|
||||
if (!ret) plane->pl_hint = tp;
|
||||
if (!ret) PlaneSetHint(plane, tp);
|
||||
return (ret);
|
||||
}
|
||||
|
||||
|
|
@ -700,9 +700,9 @@ plowAtomize(pNum, rect, proc, cdata)
|
|||
startPoint.p_y = rect->r_ytop - 1;
|
||||
|
||||
/* Walk down the RHS of the edge */
|
||||
tpR = plane->pl_hint;
|
||||
tpR = PlaneGetHint(plane);
|
||||
GOTOPOINT(tpR, &startPoint);
|
||||
plane->pl_hint = tpR;
|
||||
PlaneSetHint(plane, tpR);
|
||||
for ( ; TOP(tpR) > rect->r_ybot; tpR = LB(tpR))
|
||||
{
|
||||
/* Only process edges that haven't moved far enough */
|
||||
|
|
@ -912,7 +912,7 @@ plowSrOutlineInit(outline)
|
|||
*
|
||||
* It is possible for 'in' and 'out' to be the same tile.
|
||||
*/
|
||||
out = plane->pl_hint;
|
||||
out = PlaneGetHint(plane);
|
||||
p = outline->o_rect.r_ll;
|
||||
GOTOPOINT(out, &p);
|
||||
p.p_x--;
|
||||
|
|
@ -975,7 +975,7 @@ plowSrOutlineInit(outline)
|
|||
*/
|
||||
p.p_x = outline->o_rect.r_xbot - 1;
|
||||
p.p_y = outline->o_rect.r_ybot - 1;
|
||||
out = plane->pl_hint;
|
||||
out = PlaneGetHint(plane);
|
||||
GOTOPOINT(out, &p);
|
||||
p.p_x++;
|
||||
in = out;
|
||||
|
|
|
|||
|
|
@ -73,7 +73,7 @@ ResFracture(plane, rect)
|
|||
|
||||
start.p_x = rect->r_xbot;
|
||||
start.p_y = rect->r_ytop - 1;
|
||||
resSrTile = plane->pl_hint;
|
||||
resSrTile = PlaneGetHint(plane);
|
||||
GOTOPOINT(resSrTile, &start);
|
||||
|
||||
/* Each iteration visits another tile on the LHS of the search area */
|
||||
|
|
@ -81,7 +81,7 @@ ResFracture(plane, rect)
|
|||
{
|
||||
/* Each iteration enumerates another tile */
|
||||
enumerate:
|
||||
plane->pl_hint = resSrTile;
|
||||
PlaneSetHint(plane, resSrTile);
|
||||
if (SigInterruptPending)
|
||||
return (1);
|
||||
|
||||
|
|
|
|||
|
|
@ -169,7 +169,7 @@ ResDissolveContacts(contacts)
|
|||
if (TTMaskHasType(&residues, t))
|
||||
DBPaint(ResUse->cu_def, &(contacts->cp_rect), t);
|
||||
|
||||
tp = ResDef->cd_planes[DBPlane(contacts->cp_type)]->pl_hint;
|
||||
tp = PlaneGetHint(ResDef->cd_planes[DBPlane(contacts->cp_type)]);
|
||||
GOTOPOINT(tp, &(contacts->cp_rect.r_ll));
|
||||
|
||||
#ifdef PARANOID
|
||||
|
|
@ -410,7 +410,7 @@ ResFindNewContactTiles(contacts)
|
|||
|
||||
for (pNum = PL_TECHDEPBASE; pNum < DBNumPlanes; pNum++)
|
||||
{
|
||||
tile = ResDef->cd_planes[pNum]->pl_hint;
|
||||
tile = PlaneGetHint(ResDef->cd_planes[pNum]);
|
||||
GOTOPOINT(tile, &(contacts->cp_center));
|
||||
#ifdef PARANOID
|
||||
if (tile == (Tile *) NULL)
|
||||
|
|
@ -517,7 +517,7 @@ ResProcessTiles(goodies, origin)
|
|||
Tile *tile = fix->fp_tile;
|
||||
if (tile == NULL)
|
||||
{
|
||||
tile = ResDef->cd_planes[DBPlane(fix->fp_ttype)]->pl_hint;
|
||||
tile = PlaneGetHint(ResDef->cd_planes[DBPlane(fix->fp_ttype)]);
|
||||
GOTOPOINT(tile, &(fix->fp_loc));
|
||||
if (TiGetTypeExact(tile) != TT_SPACE)
|
||||
{
|
||||
|
|
@ -1129,7 +1129,7 @@ ResExtractNet(node, goodies, cellname)
|
|||
for (pNum = PL_TECHDEPBASE; pNum < DBNumPlanes; pNum++)
|
||||
{
|
||||
Plane *plane = ResUse->cu_def->cd_planes[pNum];
|
||||
DBSrPaintArea(plane->pl_hint, plane, &(ResUse->cu_def->cd_bbox),
|
||||
DBSrPaintArea(PlaneGetHint(plane), plane, &(ResUse->cu_def->cd_bbox),
|
||||
&DBAllButSpaceAndDRCBits, ResShaveContacts,
|
||||
(ClientData)ResUse->cu_def);
|
||||
}
|
||||
|
|
@ -1192,7 +1192,7 @@ ResExtractNet(node, goodies, cellname)
|
|||
{
|
||||
for (fix = startlist; fix != NULL; fix = fix->fp_next)
|
||||
{
|
||||
fix->fp_tile = ResUse->cu_def->cd_planes[DBPlane(fix->fp_ttype)]->pl_hint;
|
||||
fix->fp_tile = PlaneGetHint(ResUse->cu_def->cd_planes[DBPlane(fix->fp_ttype)]);
|
||||
GOTOPOINT(fix->fp_tile, &fix->fp_loc);
|
||||
if (TiGetTypeExact(fix->fp_tile) == TT_SPACE) fix->fp_tile = NULL;
|
||||
}
|
||||
|
|
@ -1358,7 +1358,7 @@ FindStartTile(goodies, SourcePoint)
|
|||
/* for drivepoints, we don't have to find a device */
|
||||
if (goodies->rg_status & DRIVEONLY)
|
||||
{
|
||||
tile = ResUse->cu_def->cd_planes[pnum]->pl_hint;
|
||||
tile = PlaneGetHint(ResUse->cu_def->cd_planes[pnum]);
|
||||
GOTOPOINT(tile, &workingPoint);
|
||||
SourcePoint->p_x = workingPoint.p_x;
|
||||
SourcePoint->p_y = workingPoint.p_y;
|
||||
|
|
@ -1390,7 +1390,7 @@ FindStartTile(goodies, SourcePoint)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
tile = ResUse->cu_def->cd_planes[pnum]->pl_hint;
|
||||
tile = PlaneGetHint(ResUse->cu_def->cd_planes[pnum]);
|
||||
GOTOPOINT(tile, &workingPoint);
|
||||
|
||||
if (IsSplit(tile))
|
||||
|
|
@ -1743,7 +1743,7 @@ ResGetDevice(pt, type)
|
|||
|
||||
/* Start at hint tile for device plane */
|
||||
|
||||
tile = ResUse->cu_def->cd_planes[pnum]->pl_hint;
|
||||
tile = PlaneGetHint(ResUse->cu_def->cd_planes[pnum]);
|
||||
GOTOPOINT(tile, &workingPoint);
|
||||
|
||||
const ClientData ticlient = TiGetClient(tile);
|
||||
|
|
|
|||
|
|
@ -721,7 +721,7 @@ ResPreProcessDevices(TileList, DeviceList, Def)
|
|||
else
|
||||
pNum = DBPlane(tt); /* always correct for non-contact types */
|
||||
|
||||
tile = (Def->cd_planes[pNum])->pl_hint;
|
||||
tile = PlaneGetHint(Def->cd_planes[pNum]);
|
||||
GOTOPOINT(tile, &(TileList->area.r_ll));
|
||||
|
||||
tt = TiGetType(tile);
|
||||
|
|
|
|||
|
|
@ -894,9 +894,9 @@ donesrch:
|
|||
{
|
||||
if (PlaneMaskHasPlane(pmask, p) && (p != pnum))
|
||||
{
|
||||
tp = SelectDef->cd_planes[p]->pl_hint;
|
||||
tp = PlaneGetHint(SelectDef->cd_planes[p]);
|
||||
GOTOPOINT(tp, &tile->ti_ll);
|
||||
SelectDef->cd_planes[p]->pl_hint = tp;
|
||||
PlaneSetHint(SelectDef->cd_planes[p], tp);
|
||||
if (selShortProcessTile(tp, cost + 1, GEO_CENTER, lmask) == 0)
|
||||
{
|
||||
sd = NewSD(cost + 1, tp, TiGetLeftType(tp), p);
|
||||
|
|
@ -994,7 +994,7 @@ SelectShort(char *lab1, char *lab2)
|
|||
if (PlaneMaskHasPlane(pmask, destpnum))
|
||||
{
|
||||
plane = SelectDef->cd_planes[destpnum];
|
||||
desttile = plane->pl_hint;
|
||||
desttile = PlaneGetHint(plane);
|
||||
GOTOPOINT(desttile, &destlab->lab_rect.r_ll)
|
||||
desttype = TiGetTopType(desttile);
|
||||
if (TTMaskHasType(&DBConnectTbl[destlab->lab_type], desttype)) break;
|
||||
|
|
@ -1008,7 +1008,7 @@ SelectShort(char *lab1, char *lab2)
|
|||
if (PlaneMaskHasPlane(pmask, srcpnum))
|
||||
{
|
||||
plane = SelectDef->cd_planes[srcpnum];
|
||||
srctile = plane->pl_hint;
|
||||
srctile = PlaneGetHint(plane);
|
||||
GOTOPOINT(srctile, &srclab->lab_rect.r_ll)
|
||||
srctype = TiGetTopType(srctile);
|
||||
if (TTMaskHasType(&DBConnectTbl[srclab->lab_type], srctype)) break;
|
||||
|
|
|
|||
|
|
@ -55,9 +55,9 @@ TiSrPoint(hintTile, plane, point)
|
|||
Plane * plane; /* Plane (containing hint tile pointer) */
|
||||
Point * point; /* Point for which to search */
|
||||
{
|
||||
Tile *tp = (hintTile) ? hintTile : plane->pl_hint;
|
||||
Tile *tp = (hintTile) ? hintTile : PlaneGetHint(plane);
|
||||
|
||||
GOTOPOINT(tp, point);
|
||||
plane->pl_hint = tp;
|
||||
PlaneSetHint(plane, tp);
|
||||
return(tp);
|
||||
}
|
||||
|
|
|
|||
10
tiles/tile.c
10
tiles/tile.c
|
|
@ -162,7 +162,7 @@ TiNewPlane(tile)
|
|||
BL(newplane->pl_right) = tile;
|
||||
TiSetBody(newplane->pl_right, -1);
|
||||
|
||||
newplane->pl_hint = tile;
|
||||
PlaneSetHint(newplane, tile);
|
||||
return (newplane);
|
||||
}
|
||||
|
||||
|
|
@ -571,8 +571,8 @@ TiJoinX(tile1, tile2, plane)
|
|||
LEFT(tile1) = LEFT(tile2);
|
||||
}
|
||||
|
||||
if (plane->pl_hint == tile2)
|
||||
plane->pl_hint = tile1;
|
||||
if (PlaneGetHint(plane) == tile2)
|
||||
PlaneSetHint(plane, tile1);
|
||||
TiFree(tile2);
|
||||
}
|
||||
|
||||
|
|
@ -656,8 +656,8 @@ TiJoinY(tile1, tile2, plane)
|
|||
BOTTOM(tile1) = BOTTOM(tile2);
|
||||
}
|
||||
|
||||
if (plane->pl_hint == tile2)
|
||||
plane->pl_hint = tile1;
|
||||
if (PlaneGetHint(plane) == tile2)
|
||||
PlaneSetHint(plane, tile1);
|
||||
TiFree(tile2);
|
||||
}
|
||||
|
||||
|
|
|
|||
18
tiles/tile.h
18
tiles/tile.h
|
|
@ -139,6 +139,24 @@ typedef struct
|
|||
*/
|
||||
} Plane;
|
||||
|
||||
#define PlaneGetHint(pl) ((pl)->pl_hint)
|
||||
#define PlaneSetHint(pl, ti) ((pl)->pl_hint = (ti))
|
||||
|
||||
inline Tile*
|
||||
PlaneGetHint_inline(const Plane *pl)
|
||||
{
|
||||
return pl->pl_hint;
|
||||
}
|
||||
|
||||
inline void
|
||||
PlaneSetHint_inline(Plane *pl, Tile *ti)
|
||||
{
|
||||
pl->pl_hint = ti;
|
||||
}
|
||||
|
||||
//#define PlaneGetHint(pl) PlaneGetHint_inline(pl)
|
||||
//#define PlaneSetHint(pl, ti) PlaneSetHint_inline((pl), (ti))
|
||||
|
||||
/*
|
||||
* The following coordinate, INFINITY, is used to represent a
|
||||
* tile location outside of the tile plane.
|
||||
|
|
|
|||
|
|
@ -259,7 +259,7 @@ FindMaxRectangle(bbox, startpoint, plane, expandtypes)
|
|||
int s, sidx = -1;
|
||||
|
||||
/* Find tile in def that surrounds or touches startpoint */
|
||||
starttile = plane->pl_hint;
|
||||
starttile = PlaneGetHint(plane);
|
||||
GOTOPOINT(starttile, startpoint);
|
||||
mrd = genCanonicalMaxwidth(bbox, starttile, plane, NULL);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue