Split wallification into two by function

This commit is contained in:
Pasi Kallinen
2016-01-03 00:36:36 +02:00
parent 0106901078
commit cb574aadcc
2 changed files with 28 additions and 11 deletions

View File

@@ -1190,6 +1190,7 @@ E void FDECL(remove_rooms, (int, int, int, int));
/* ### mkmaze.c ### */
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(makemaz, (const char *));
E void FDECL(mazexy, (coord *));

View File

@@ -135,17 +135,6 @@ 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)
@@ -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
* 1 and 2 into a single sweep because we depend on knowing if