Corrected a crash condition caused by yesterday's commit, if the

new CIF operator is used in a tech file.  Reworked yesterday's
commit to add more related operators, so there are now four new
ones (also renamed them):  interacting, noninteracting, overlapping,
and nonoverlapping.  "interacting" now means overlapping or touching;
so the four cases allow all variations of adjacency between the two
material types.
This commit is contained in:
Tim Edwards 2025-02-05 14:49:32 -05:00
parent a5653c8fca
commit 619191c6dd
4 changed files with 38 additions and 10 deletions

View File

@ -1 +1 @@
8.3.516
8.3.517

View File

@ -4664,8 +4664,8 @@ cifBridgeLimFunc2(
* cifInteractingRegions --
*
* Process each disjoint region and copy the entire content of each
* region for which any part of the region overlaps with <...>
* to the current CIF plane.
* region for which any part of the region overlaps with co_cifMask
* or co_paintMask to the current CIF plane.
*
* Results:
* None.
@ -4714,6 +4714,19 @@ cifInteractingRegions(
/* Get tile area for interaction search */
TiToRect(t, &area);
/* "interacting" includes touching as well as overlapping, so expand
* search by one unit in every direction and then check overlap.
* NOTE: This catches catecorner-touching material, which is
* assumed not to be an issue.
*/
if ((pointertype)op->co_client & CIFOP_INT_TOUCHING)
{
area.r_xbot -= 1;
area.r_xtop += 1;
area.r_ybot -= 1;
area.r_ytop += 1;
}
/* Check if this tile interacts with the rule's types, or skip */
/* if already known to be interacting. */
@ -4752,11 +4765,12 @@ cifInteractingRegions(
}
}
/* op->co_client is an invert bit indicating the rule is "not-interact",
* so invert the sense of "interacts". Then the non-interacting regions
* will be kept and the interacting regions will be discarded.
/* op->co_client has an invert bit indicating the rule is "not interacting"
* or "not-overlapping", so invert the sense of "interacts". Then the non-
* interacting/overlapping regions will be kept and the interacting/
* overlapping regions will be discarded.
*/
if (op->co_client == (ClientData)1)
if ((pointertype)op->co_client & CIFOP_INT_NOT)
interacts = (interacts) ? FALSE : TRUE;
/* Clear the tiles that were processed in this set, first copying them */

View File

@ -171,6 +171,9 @@ typedef struct cifop
#define CIFOP_BRIDGELIM 23
#define CIFOP_MASKHINTS 24
/* Definitions of bit fields used in the value of co_client for CIFOP_INTERACT */
#define CIFOP_INT_NOT 0x1 /* Inverted sense (not interacting) */
#define CIFOP_INT_TOUCHING 0x2 /* Include both touching and overlapping */
/* Added by Tim 10/21/2004 */
/* The following structure is used to pass information on how to draw

View File

@ -1095,12 +1095,22 @@ CIFTechLine(
newOp->co_opcode = CIFOP_BRIDGE;
else if (strcmp(argv[0], "bridge-lim") == 0)
newOp->co_opcode = CIFOP_BRIDGELIM;
else if (strcmp(argv[0], "interact") == 0)
else if (strcmp(argv[0], "overlapping") == 0)
newOp->co_opcode = CIFOP_INTERACT;
else if (strcmp(argv[0], "not-interact") == 0)
else if (strcmp(argv[0], "nonoverlapping") == 0)
{
newOp->co_opcode = CIFOP_INTERACT;
newOp->co_client = (ClientData)1;
newOp->co_client = (ClientData)CIFOP_INT_NOT;
}
else if (strcmp(argv[0], "interacting") == 0)
{
newOp->co_opcode = CIFOP_INTERACT;
newOp->co_client = (ClientData)CIFOP_INT_TOUCHING;
}
else if (strcmp(argv[0], "noninteracting") == 0)
{
newOp->co_opcode = CIFOP_INTERACT;
newOp->co_client = (ClientData)(CIFOP_INT_TOUCHING | CIFOP_INT_NOT);
}
else
{
@ -2463,6 +2473,7 @@ CIFTechOutputScale(
case CIFOP_MASKHINTS:
case CIFOP_MAXRECT:
case CIFOP_NET:
case CIFOP_INTERACT:
break;
case CIFOP_BRIDGELIM:
case CIFOP_BRIDGE: