From f70b1e7ad6b75462104e5ec6d2d2d4337cd43a53 Mon Sep 17 00:00:00 2001 From: Hourier Date: Sat, 18 Jan 2020 19:45:40 +0900 Subject: [PATCH] =?utf8?q?[Refactor]=20#38997=20place=5Fextra=5Fperm=5Fbol?= =?utf8?q?d()=20=E3=82=92=E5=89=8A=E9=99=A4=E3=81=97=E3=80=81place=5Fgrid(?= =?utf8?q?)=20=E3=81=AB=E7=B5=B1=E5=90=88=20/=20Removed=20place=5Fextra=5F?= =?utf8?q?perm=5Fbold()=20and=20unified=20into=20place=5Fbold()?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- src/floor-generate.c | 32 ++++++++++++++++---------------- src/grid.c | 10 ---------- src/grid.h | 1 - 3 files changed, 16 insertions(+), 27 deletions(-) diff --git a/src/floor-generate.c b/src/floor-generate.c index d37ba8e01..0cbf804ff 100644 --- a/src/floor-generate.c +++ b/src/floor-generate.c @@ -1020,35 +1020,35 @@ static void build_arena(player_type *player_ptr, POSITION *start_y, POSITION *st for (i = y_height; i <= y_height + 5; i++) for (j = x_left; j <= x_right; j++) { - place_extra_perm_bold(player_ptr, i, j); + place_bold(player_ptr, i, j, extra_perm); floor_ptr->grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK); } for (i = y_depth; i >= y_depth - 5; i--) for (j = x_left; j <= x_right; j++) { - place_extra_perm_bold(player_ptr, i, j); + place_bold(player_ptr, i, j, extra_perm); floor_ptr->grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK); } for (j = x_left; j <= x_left + 17; j++) for (i = y_height; i <= y_depth; i++) { - place_extra_perm_bold(player_ptr, i, j); + place_bold(player_ptr, i, j, extra_perm); floor_ptr->grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK); } for (j = x_right; j >= x_right - 17; j--) for (i = y_height; i <= y_depth; i++) { - place_extra_perm_bold(player_ptr, i, j); + place_bold(player_ptr, i, j, extra_perm); floor_ptr->grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK); } - place_extra_perm_bold(player_ptr, y_height + 6, x_left + 18); + place_bold(player_ptr, y_height + 6, x_left + 18, extra_perm); floor_ptr->grid_array[y_height + 6][x_left + 18].info |= (CAVE_GLOW | CAVE_MARK); - place_extra_perm_bold(player_ptr, y_depth - 6, x_left + 18); + place_bold(player_ptr, y_depth - 6, x_left + 18, extra_perm); floor_ptr->grid_array[y_depth - 6][x_left + 18].info |= (CAVE_GLOW | CAVE_MARK); - place_extra_perm_bold(player_ptr, y_height + 6, x_right - 18); + place_bold(player_ptr, y_height + 6, x_right - 18, extra_perm); floor_ptr->grid_array[y_height + 6][x_right - 18].info |= (CAVE_GLOW | CAVE_MARK); - place_extra_perm_bold(player_ptr, y_depth - 6, x_right - 18); + place_bold(player_ptr, y_depth - 6, x_right - 18, extra_perm); floor_ptr->grid_array[y_depth - 6][x_right - 18].info |= (CAVE_GLOW | CAVE_MARK); *start_y = y_height + 5; @@ -1128,35 +1128,35 @@ static void build_battle(player_type *player_ptr, POSITION *y, POSITION *x) for (i = y_height; i <= y_height + 5; i++) for (j = x_left; j <= x_right; j++) { - place_extra_perm_bold(player_ptr, i, j); + place_bold(player_ptr, i, j, extra_perm); floor_ptr->grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK); } for (i = y_depth; i >= y_depth - 3; i--) for (j = x_left; j <= x_right; j++) { - place_extra_perm_bold(player_ptr, i, j); + place_bold(player_ptr, i, j, extra_perm); floor_ptr->grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK); } for (j = x_left; j <= x_left + 17; j++) for (i = y_height; i <= y_depth; i++) { - place_extra_perm_bold(player_ptr, i, j); + place_bold(player_ptr, i, j, extra_perm); floor_ptr->grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK); } for (j = x_right; j >= x_right - 17; j--) for (i = y_height; i <= y_depth; i++) { - place_extra_perm_bold(player_ptr, i, j); + place_bold(player_ptr, i, j, extra_perm); floor_ptr->grid_array[i][j].info |= (CAVE_GLOW | CAVE_MARK); } - place_extra_perm_bold(player_ptr, y_height+6, x_left+18); + place_bold(player_ptr, y_height+6, x_left+18, extra_perm); floor_ptr->grid_array[y_height+6][x_left+18].info |= (CAVE_GLOW | CAVE_MARK); - place_extra_perm_bold(player_ptr, y_depth-4, x_left+18); + place_bold(player_ptr, y_depth-4, x_left+18, extra_perm); floor_ptr->grid_array[y_depth-4][x_left+18].info |= (CAVE_GLOW | CAVE_MARK); - place_extra_perm_bold(player_ptr, y_height+6, x_right-18); + place_bold(player_ptr, y_height+6, x_right-18, extra_perm); floor_ptr->grid_array[y_height+6][x_right-18].info |= (CAVE_GLOW | CAVE_MARK); - place_extra_perm_bold(player_ptr, y_depth-4, x_right-18); + place_bold(player_ptr, y_depth-4, x_right-18, extra_perm); floor_ptr->grid_array[y_depth-4][x_right-18].info |= (CAVE_GLOW | CAVE_MARK); for (i = y_height + 1; i <= y_height + 5; i++) diff --git a/src/grid.c b/src/grid.c index b6b101fdb..014a3b8e1 100644 --- a/src/grid.c +++ b/src/grid.c @@ -1295,16 +1295,6 @@ bool darkened_grid(player_type *player_ptr, grid_type *g_ptr) } -void place_extra_perm_bold(player_type *player_ptr, POSITION y, POSITION x) -{ - floor_type *floor_ptr = player_ptr->current_floor_ptr; - set_cave_feat(floor_ptr, y, x, feat_permanent); - floor_ptr->grid_array[y][x].info &= ~(CAVE_MASK); - add_cave_info(floor_ptr, y, x, CAVE_EXTRA); - delete_monster(player_ptr, y, x); -} - - void place_inner_bold(player_type *player_ptr, POSITION y, POSITION x) { floor_type *floor_ptr = player_ptr->current_floor_ptr; diff --git a/src/grid.h b/src/grid.h index 7c2fa24f1..2e686e62d 100644 --- a/src/grid.h +++ b/src/grid.h @@ -218,7 +218,6 @@ extern void place_grid(player_type *player_ptr, grid_type *g_ptr, grid_bold_type extern bool darkened_grid(player_type *player_ptr, grid_type *g_ptr); extern void delete_monster(player_type *player_ptr, POSITION y, POSITION x); extern void place_bold(player_type *player_ptr, POSITION y, POSITION x, grid_bold_type gh_type); -void place_extra_perm_bold(player_type *player_ptr, POSITION y, POSITION x); void place_inner_bold(player_type *player_ptr, POSITION y, POSITION x); void place_inner_perm_bold(player_type *player_ptr, POSITION y, POSITION x); void place_outer_bold(player_type *player_ptr, POSITION y, POSITION x); -- 2.11.0