From: Pasi Kallinen Date: Sun, 6 Dec 2020 16:36:37 +0000 (+0200) Subject: Remove duplicate wallify_map code X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=13359648dd31931313e1c4f06acc6281d05a5842;p=nethack Remove duplicate wallify_map code --- diff --git a/include/extern.h b/include/extern.h index b8b73c1ff..4fc957d30 100644 --- a/include/extern.h +++ b/include/extern.h @@ -2495,6 +2495,7 @@ E boolean FDECL(create_room, (XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, XCHAR_P, E void FDECL(create_secret_door, (struct mkroom *, XCHAR_P)); E boolean FDECL(dig_corridor, (coord *, coord *, BOOLEAN_P, SCHAR_P, SCHAR_P)); E void FDECL(fill_special_room, (struct mkroom *)); +E void FDECL(wallify_map, (int, int, int, int)); E boolean FDECL(load_special, (const char *)); E xchar FDECL(selection_getpoint, (int, int, struct selectionvar *)); E struct selectionvar *NDECL(selection_new); diff --git a/src/mkmap.c b/src/mkmap.c index 14f7973d8..8100394ca 100644 --- a/src/mkmap.c +++ b/src/mkmap.c @@ -14,7 +14,6 @@ static schar FDECL(get_map, (int, int, SCHAR_P)); static void FDECL(pass_one, (SCHAR_P, SCHAR_P)); static void FDECL(pass_two, (SCHAR_P, SCHAR_P)); static void FDECL(pass_three, (SCHAR_P, SCHAR_P)); -static void NDECL(wallify_map); static void FDECL(join_map, (SCHAR_P, SCHAR_P)); static void FDECL(finish_map, (SCHAR_P, SCHAR_P, BOOLEAN_P, BOOLEAN_P, BOOLEAN_P)); @@ -247,29 +246,6 @@ boolean anyroom; g.max_ry = sy; } -/* - * If we have drawn a map without walls, this allows us to - * auto-magically wallify it. Taken from lev_main.c. - */ -static void -wallify_map() -{ - int x, y, xx, yy; - - for (x = 1; x < COLNO; x++) - for (y = 0; y < ROWNO; y++) - if (levl[x][y].typ == STONE) { - for (yy = y - 1; yy <= y + 1; yy++) - for (xx = x - 1; xx <= x + 1; xx++) - if (isok(xx, yy) && levl[xx][yy].typ == ROOM) { - if (yy != y) - levl[x][y].typ = HWALL; - else - levl[x][y].typ = VWALL; - } - } -} - static void join_map(bg_typ, fg_typ) schar bg_typ, fg_typ; @@ -351,7 +327,7 @@ boolean lit, walled, icedpools; int i, j; if (walled) - wallify_map(); + wallify_map(1, 0, COLNO-1, ROWNO-1); if (lit) { for (i = 1; i < COLNO; i++) diff --git a/src/sp_lev.c b/src/sp_lev.c index a21fc72ab..6d64c182c 100755 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -63,7 +63,6 @@ static boolean FDECL(search_door, (struct mkroom *, static void FDECL(create_corridor, (corridor *)); static struct mkroom *FDECL(build_room, (room *, struct mkroom *)); static void FDECL(light_region, (region *)); -static void FDECL(wallify_map, (int, int, int, int)); static void FDECL(maze1xy, (coord *, int)); static void NDECL(fill_empty_maze); static void FDECL(splev_initlev, (lev_init *)); @@ -2740,7 +2739,7 @@ region *tmpregion; } } -static void +void wallify_map(x1, y1, x2, y2) int x1, y1, x2, y2; {