mirror of
https://github.com/RTimothyEdwards/magic.git
synced 2026-10-06 01:43:00 +02:00
Plow() pass by-pointer const TileTypeBitMask* instead of by-value
sizeof(TileTypeBitMask) == 32
This commit is contained in:
committed by
Tim Edwards
parent
6db34b6aa9
commit
bc5a4a0fb1
+1
-1
@@ -212,7 +212,7 @@ wrongNumArgs:
|
||||
layers = cmd->tx_argc == 2 ? "*,l,subcell,space" : cmd->tx_argv[2];
|
||||
if (!CmdParseLayers(layers, &mask))
|
||||
break;
|
||||
if (Plow(editDef, &editBox, mask, dir))
|
||||
if (Plow(editDef, &editBox, &mask, dir))
|
||||
break;
|
||||
|
||||
TxPrintf("Reduced plow size to stay within the boundary.\n");
|
||||
|
||||
+6
-5
@@ -483,13 +483,13 @@ PlowSelection(def, pdistance, direction)
|
||||
*/
|
||||
|
||||
bool
|
||||
Plow(def, userRect, layers, direction)
|
||||
CellDef *def; /* Cell being plowed */
|
||||
Rect *userRect; /* The plow. Interpreted as per direction
|
||||
Plow(
|
||||
CellDef *def, /* Cell being plowed */
|
||||
Rect *userRect, /* The plow. Interpreted as per direction
|
||||
* below.
|
||||
*/
|
||||
TileTypeBitMask layers; /* The initial plow only sees these layers */
|
||||
int direction; /* One of GEO_NORTH, GEO_SOUTH, GEO_WEST,
|
||||
const TileTypeBitMask *layersp,/* The initial plow only sees these layers */
|
||||
int direction) /* One of GEO_NORTH, GEO_SOUTH, GEO_WEST,
|
||||
* or GEO_EAST.
|
||||
*/
|
||||
{
|
||||
@@ -497,6 +497,7 @@ Plow(def, userRect, layers, direction)
|
||||
extern int plowWidthNumCalls;
|
||||
extern int plowWidthNumChoices;
|
||||
#endif /* COUNTWIDTHCALLS */
|
||||
TileTypeBitMask layers = *layersp; /* TTMaskCopy(&layers, layersp) */
|
||||
TileTypeBitMask lc;
|
||||
Rect changedArea;
|
||||
bool firstTime;
|
||||
|
||||
+1
-1
@@ -118,7 +118,7 @@ PlowRandomTest(def)
|
||||
dir = plowGenRandom(0, 3);
|
||||
plowDir = dirs[dir];
|
||||
plowGenRect(&def->cd_bbox, &plowRect);
|
||||
(void) Plow(def, &plowRect, DBAllTypeBits, plowDir);
|
||||
(void) Plow(def, &plowRect, &DBAllTypeBits, plowDir);
|
||||
TxPrintf("%s %d %d %d %d\n", dirnames[dir],
|
||||
plowRect.r_xbot, plowRect.r_ybot,
|
||||
plowRect.r_xtop, plowRect.r_ytop);
|
||||
|
||||
+1
-1
@@ -207,7 +207,7 @@ PlowTest(w, cmd)
|
||||
okTypes = DBAllTypeBits;
|
||||
if (cmd->tx_argc > 3 && !CmdParseLayers(cmd->tx_argv[3], &okTypes))
|
||||
return;
|
||||
if (!Plow(def, &editArea, okTypes, dir))
|
||||
if (!Plow(def, &editArea, &okTypes, dir))
|
||||
{
|
||||
TxPrintf("Reduced plow size since we ran into the barrier.\n");
|
||||
GeoTransRect(&EditToRootTransform, &editArea, &rootBox);
|
||||
|
||||
+1
-1
@@ -30,7 +30,7 @@ extern int PlowDRCInit(), PlowDRCFinal();
|
||||
extern bool PlowDRCLine();
|
||||
|
||||
/* Called by CmdPlow() */
|
||||
extern bool Plow();
|
||||
extern bool Plow(CellDef *def, Rect *userRect, const TileTypeBitMask *layersp, int direction);
|
||||
|
||||
/* Debugging command procedure */
|
||||
extern int PlowTest();
|
||||
|
||||
Reference in New Issue
Block a user