Corrected an issue with "bloat-all ... [dist]" in which an attempt

not to re-process processed tiles made an incorrect assumption,
causing tiles not to be re-processed when the clip area changed,
such that areas would be missed.  It is not clear that in its
corrected version, "bloat-all ... [dist]" is any more efficient
than the original implementation of an incremental series of bloat
+ AND.  At least the syntax in the tech file is much simplified.
This commit is contained in:
R. Timothy Edwards 2025-07-28 11:53:44 -04:00
parent 68e1c76f88
commit 1cc4d83425
2 changed files with 21 additions and 52 deletions

View File

@ -1 +1 @@
8.3.532 8.3.533

View File

@ -1282,8 +1282,13 @@ cifProcessSelectiveResetFunc(tile, clipArea)
* Find the first tile in the given area. * Find the first tile in the given area.
* *
* Results: * Results:
* Return 1 to stop the search and process. * Return 1 to stop the search and process if an
* Set clientData to the tile found. * unprocessed tile was found. Otherwise, return
* 0 to keep the search going.
*
* Side effects:
* Push tile pointer to the stack that is passed
* as client data.
* *
*------------------------------------------------------- *-------------------------------------------------------
*/ */
@ -1293,8 +1298,13 @@ cifFoundFunc(
Tile *tile, Tile *tile,
Stack **BloatStackPtr) Stack **BloatStackPtr)
{ {
PUSHTILE(tile, *BloatStackPtr); if (TiGetClient(tile) == CIF_UNPROCESSED)
return 0; {
PUSHTILE(tile, *BloatStackPtr);
return 1;
}
else
return 0;
} }
/* Data structure for bloat-all function */ /* Data structure for bloat-all function */
@ -1425,33 +1435,11 @@ cifBloatAllFunc(
if (bloats->bl_distance[ttype] > 0) if (bloats->bl_distance[ttype] > 0)
(void) DBSrPaintArea((Tile *)NULL, *temps, &area, (void) DBSrPaintArea((Tile *)NULL, *temps, &area,
&CIFSolidBits, cifFoundFunc, (ClientData)(&BloatStack)); &CIFSolidBits, cifFoundFunc, (ClientData)(&BloatStack));
/* Get clip area from intersection of found tile and t */
if (op->co_distance > 0)
{
if (!StackEmpty(BloatStack))
{
firstTile = (Tile *)StackLook(BloatStack);
TiToRect(firstTile, &foundArea);
GeoClip(&clipArea, &foundArea);
}
}
} }
else else
{ {
DBSrPaintArea((Tile *)NULL, def->cd_planes[bloats->bl_plane], &area, DBSrPaintArea((Tile *)NULL, def->cd_planes[bloats->bl_plane], &area,
connect, cifFoundFunc, (ClientData)(&BloatStack)); connect, cifFoundFunc, (ClientData)(&BloatStack));
/* Get clip area from intersection of found tile and t */
if (op->co_distance > 0)
{
if (!StackEmpty(BloatStack))
{
firstTile = (Tile *)StackLook(BloatStack);
TiToRect(firstTile, &foundArea);
GeoClip(&clipArea, &foundArea);
}
}
} }
} }
else else
@ -1490,10 +1478,12 @@ cifBloatAllFunc(
if (op->co_distance > 0) if (op->co_distance > 0)
{ {
if (!GEO_SURROUND(&clipArea, &area)) /* Note: This is non-optimal, as it causes all tiles
{ * in the "bloat" group to be re-processed for each
STACKPUSH(t, ResetStack); * tile processed in the search group. However, it
} * is difficult to find an optimal method.
*/
STACKPUSH(t, ResetStack);
GeoClip(&area, &clipArea); GeoClip(&area, &clipArea);
if (GEO_RECTNULL(&area)) if (GEO_RECTNULL(&area))
continue; continue;
@ -1557,27 +1547,6 @@ cifBloatAllFunc(
TiSetClient(t, CIF_UNPROCESSED); TiSetClient(t, CIF_UNPROCESSED);
} }
#if 0
if ((firstTile != NULL) && (op->co_distance > 0))
{
if (bloats->bl_plane < 0)
{
/* This would be a lot more efficient if the plane number of
* firstTile were pushed to the stack along with firstTile
*/
temps = bls->temps;
for (ttype = 0; ttype < TT_MAXTYPES; ttype++, temps++)
if (bloats->bl_distance[ttype] > 0)
(void) DBSrPaintArea((Tile *)NULL, *temps, &clipArea,
&CIFSolidBits, cifProcessSelectiveResetFunc,
&clipArea);
}
else
DBSrPaintArea((Tile *)firstTile, def->cd_planes[bloats->bl_plane],
&clipArea, connect, cifProcessSelectiveResetFunc, &clipArea);
}
#endif
return 0; /* Keep the search alive. . . */ return 0; /* Keep the search alive. . . */
} }