return spine;
}
-/*
- * Wall cleanup. This function has two purposes: (1) remove walls that
- * are totally surrounded by stone - they are redundant. (2) correct
- * the types so that they extend and connect to each other.
- */
+/* Remove walls totally surrounded by stone */
void
-wallification(x1, y1, x2, y2)
+wall_cleanup(x1, y1, x2, y2)
int x1, y1, x2, y2;
{
uchar type;
/* sanity check on incoming variables */
if (x1 < 0 || x2 >= COLNO || x1 > x2 || y1 < 0 || y2 >= ROWNO || y1 > y2)
- panic("wallification: bad bounds (%d,%d) to (%d,%d)", x1, y1, x2, y2);
+ panic("wall_cleanup: bad bounds (%d,%d) to (%d,%d)", x1, y1, x2, y2);
- /* Step 1: change walls surrounded by rock to rock. */
+ /* change walls surrounded by rock to rock. */
for (x = x1; x <= x2; x++)
for (y = y1; y <= y2; y++) {
lev = &levl[x][y];
lev->typ = STONE;
}
}
-
- fix_wall_spines(x1,y1,x2,y2);
}
+/* Correct wall types so they extend and connect to each other */
void
fix_wall_spines(x1, y1, x2, y2)
int x1, y1, x2, y2;
if (x1<0 || x2>=COLNO || x1>x2 || y1<0 || y2>=ROWNO || y1>y2)
panic("wall_extends: bad bounds (%d,%d) to (%d,%d)",x1,y1,x2,y2);
- /*
- * Step 2: set the correct wall type. We can't combine steps
- * 1 and 2 into a single sweep because we depend on knowing if
- * the surrounding positions are stone.
- */
+ /* set the correct wall type. */
for (x = x1; x <= x2; x++)
for (y = y1; y <= y2; y++) {
lev = &levl[x][y];
}
}
+void
+wallification(x1, y1, x2, y2)
+int x1, y1, x2, y2;
+{
+ wall_cleanup(x1,y1,x2,y2);
+ fix_wall_spines(x1,y1,x2,y2);
+}
+
STATIC_OVL boolean
okay(x, y, dir)
int x, y;