Split wallification into two by function
This commit is contained in:
@@ -1190,6 +1190,7 @@ E void FDECL(remove_rooms, (int, int, int, int));
|
|||||||
/* ### mkmaze.c ### */
|
/* ### mkmaze.c ### */
|
||||||
|
|
||||||
E void FDECL(wallification, (int, int, int, int));
|
E void FDECL(wallification, (int, int, int, int));
|
||||||
|
E void FDECL(fix_wall_spines, (int, int, int, int));
|
||||||
E void FDECL(walkfrom, (int, int, SCHAR_P));
|
E void FDECL(walkfrom, (int, int, SCHAR_P));
|
||||||
E void FDECL(makemaz, (const char *));
|
E void FDECL(makemaz, (const char *));
|
||||||
E void FDECL(mazexy, (coord *));
|
E void FDECL(mazexy, (coord *));
|
||||||
|
|||||||
38
src/mkmaze.c
38
src/mkmaze.c
@@ -135,17 +135,6 @@ int x1, y1, x2, y2;
|
|||||||
uchar type;
|
uchar type;
|
||||||
register int x, y;
|
register int x, y;
|
||||||
struct rm *lev;
|
struct rm *lev;
|
||||||
int bits;
|
|
||||||
int locale[3][3]; /* rock or wall status surrounding positions */
|
|
||||||
/*
|
|
||||||
* Value 0 represents a free-standing wall. It could be anything,
|
|
||||||
* so even though this table says VWALL, we actually leave whatever
|
|
||||||
* typ was there alone.
|
|
||||||
*/
|
|
||||||
static xchar spine_array[16] = { VWALL, HWALL, HWALL, HWALL,
|
|
||||||
VWALL, TRCORNER, TLCORNER, TDWALL,
|
|
||||||
VWALL, BRCORNER, BLCORNER, TUWALL,
|
|
||||||
VWALL, TLWALL, TRWALL, CROSSWALL };
|
|
||||||
|
|
||||||
/* sanity check on incoming variables */
|
/* sanity check on incoming variables */
|
||||||
if (x1 < 0 || x2 >= COLNO || x1 > x2 || y1 < 0 || y2 >= ROWNO || y1 > y2)
|
if (x1 < 0 || x2 >= COLNO || x1 > x2 || y1 < 0 || y2 >= ROWNO || y1 > y2)
|
||||||
@@ -165,6 +154,33 @@ int x1, y1, x2, y2;
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fix_wall_spines(x1,y1,x2,y2);
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
fix_wall_spines(x1, y1, x2, y2)
|
||||||
|
int x1, y1, x2, y2;
|
||||||
|
{
|
||||||
|
uchar type;
|
||||||
|
register int x,y;
|
||||||
|
struct rm *lev;
|
||||||
|
int bits;
|
||||||
|
int locale[3][3]; /* rock or wall status surrounding positions */
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Value 0 represents a free-standing wall. It could be anything,
|
||||||
|
* so even though this table says VWALL, we actually leave whatever
|
||||||
|
* typ was there alone.
|
||||||
|
*/
|
||||||
|
static xchar spine_array[16] = { VWALL, HWALL, HWALL, HWALL,
|
||||||
|
VWALL, TRCORNER, TLCORNER, TDWALL,
|
||||||
|
VWALL, BRCORNER, BLCORNER, TUWALL,
|
||||||
|
VWALL, TLWALL, TRWALL, CROSSWALL };
|
||||||
|
|
||||||
|
/* sanity check on incoming variables */
|
||||||
|
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
|
* 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
|
* 1 and 2 into a single sweep because we depend on knowing if
|
||||||
|
|||||||
Reference in New Issue
Block a user