killer, level and rooms move to instance globals.

This commit is contained in:
Bart House
2018-12-24 19:50:08 -08:00
parent 198e44216e
commit be5cdcf77a
74 changed files with 793 additions and 790 deletions

View File

@@ -287,7 +287,7 @@ schar bg_typ, fg_typ;
if (g.n_loc_filled > 3) {
add_room(g.min_rx, g.min_ry, g.max_rx, g.max_ry, FALSE, OROOM,
TRUE);
rooms[g.nroom - 1].irregular = TRUE;
g.rooms[g.nroom - 1].irregular = TRUE;
if (g.nroom >= (MAXNROFROOMS * 2))
goto joinm;
} else {
@@ -313,7 +313,7 @@ joinm:
* so don't call sort_rooms(), which can screw up the roomno's
* validity in the levl structure.
*/
for (croom = &rooms[0], croom2 = croom + 1; croom2 < &rooms[g.nroom];) {
for (croom = &g.rooms[0], croom2 = croom + 1; croom2 < &g.rooms[g.nroom];) {
/* pick random starting and end locations for "corridor" */
if (!somexy(croom, &sm) || !somexy(croom2, &em)) {
/* ack! -- the level is going to be busted */
@@ -357,7 +357,7 @@ boolean lit, walled, icedpools;
|| (walled && IS_WALL(levl[i][j].typ)))
levl[i][j].lit = TRUE;
for (i = 0; i < g.nroom; i++)
rooms[i].rlit = 1;
g.rooms[i].rlit = 1;
}
/* light lava even if everything's otherwise unlit;
ice might be frozen pool rather than frozen moat */
@@ -387,7 +387,7 @@ int lx, ly, hx, hy;
struct mkroom *croom;
for (i = g.nroom - 1; i >= 0; --i) {
croom = &rooms[i];
croom = &g.rooms[i];
if (croom->hx < lx || croom->lx >= hx || croom->hy < ly
|| croom->ly >= hy)
continue; /* no overlap */
@@ -415,8 +415,8 @@ STATIC_OVL void
remove_room(roomno)
unsigned roomno;
{
struct mkroom *croom = &rooms[roomno];
struct mkroom *maxroom = &rooms[--g.nroom];
struct mkroom *croom = &g.rooms[roomno];
struct mkroom *maxroom = &g.rooms[--g.nroom];
int i, j;
unsigned oroomno;
@@ -478,8 +478,8 @@ lev_init *init_lev;
init_lev->icedpools);
/* a walled, joined level is cavernous, not mazelike -dlc */
if (walled && join) {
level.flags.is_maze_lev = FALSE;
level.flags.is_cavernous_lev = TRUE;
g.level.flags.is_maze_lev = FALSE;
g.level.flags.is_cavernous_lev = TRUE;
}
free(g.new_locations);
}