From: Deskull Date: Wed, 20 Feb 2019 14:38:40 +0000 (+0900) Subject: [Refactor] #37353 set_bound_perm_wall() を place_bound_perm_wall() に改名して grid.c に移動... X-Git-Tag: vmacos2.2.1-7a~665 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=8aa8762952f74c69d57db4f6461e974c68bcda26;p=hengbandforosx%2Fhengbandosx.git [Refactor] #37353 set_bound_perm_wall() を place_bound_perm_wall() に改名して grid.c に移動。 / Rename set_bound_perm_wall() to place_bound_perm_wall() and move to grid.c. --- diff --git a/src/floor-generate.c b/src/floor-generate.c index 776dc25a9..799c070f2 100644 --- a/src/floor-generate.c +++ b/src/floor-generate.c @@ -462,36 +462,6 @@ bool place_quest_monsters(void) return TRUE; } - -/*! - * @brief マスにフロア端用の永久壁を配置する / Set boundary mimic and add "solid" perma-wall - * @param g_ptr 永久壁を廃止したいマス構造体の参照ポインタ - * @return なし - */ -static void set_bound_perm_wall(grid_type *g_ptr) -{ - if (bound_walls_perm) - { - /* Clear boundary mimic */ - g_ptr->mimic = 0; - } - else - { - feature_type *f_ptr = &f_info[g_ptr->feat]; - - /* Hack -- Decline boundary walls with known treasure */ - if ((have_flag(f_ptr->flags, FF_HAS_GOLD) || have_flag(f_ptr->flags, FF_HAS_ITEM)) && - !have_flag(f_ptr->flags, FF_SECRET)) - g_ptr->feat = feat_state(g_ptr->feat, FF_ENSECRET); - - /* Set boundary mimic */ - g_ptr->mimic = g_ptr->feat; - } - - /* Add "solid" perma-wall */ - place_solid_perm_grid(g_ptr); -} - /*! * @brief フロアに洞窟や湖を配置する / Generate various caverns and lakes * @details There were moved from cave_gen(). @@ -899,15 +869,15 @@ static bool cave_gen(void) /* Special boundary walls -- Top and bottom */ for (x = 0; x < cur_wid; x++) { - set_bound_perm_wall(&grid_array[0][x]); - set_bound_perm_wall(&grid_array[cur_hgt - 1][x]); + place_bound_perm_wall(&grid_array[0][x]); + place_bound_perm_wall(&grid_array[cur_hgt - 1][x]); } /* Special boundary walls -- Left and right */ for (y = 1; y < (cur_hgt - 1); y++) { - set_bound_perm_wall(&grid_array[y][0]); - set_bound_perm_wall(&grid_array[y][cur_wid - 1]); + place_bound_perm_wall(&grid_array[y][0]); + place_bound_perm_wall(&grid_array[y][cur_wid - 1]); } /* Determine the character location */ diff --git a/src/grid.c b/src/grid.c index 981da6c7f..4e50102f0 100644 --- a/src/grid.c +++ b/src/grid.c @@ -749,4 +749,31 @@ void set_floor(POSITION x, POSITION y) place_floor_bold(y, x); } +/*! + * @brief マスにフロア端用の永久壁を配置する / Set boundary mimic and add "solid" perma-wall + * @param g_ptr 永久壁を配置したいマス構造体の参照ポインタ + * @return なし + */ +void place_bound_perm_wall(grid_type *g_ptr) +{ + if (bound_walls_perm) + { + /* Clear boundary mimic */ + g_ptr->mimic = 0; + } + else + { + feature_type *f_ptr = &f_info[g_ptr->feat]; + + /* Hack -- Decline boundary walls with known treasure */ + if ((have_flag(f_ptr->flags, FF_HAS_GOLD) || have_flag(f_ptr->flags, FF_HAS_ITEM)) && + !have_flag(f_ptr->flags, FF_SECRET)) + g_ptr->feat = feat_state(g_ptr->feat, FF_ENSECRET); + /* Set boundary mimic */ + g_ptr->mimic = g_ptr->feat; + } + + /* Add "solid" perma-wall */ + place_solid_perm_grid(g_ptr); +} diff --git a/src/grid.h b/src/grid.h index cac31f4a9..9c11372b7 100644 --- a/src/grid.h +++ b/src/grid.h @@ -281,4 +281,5 @@ extern void vault_traps(POSITION y, POSITION x, POSITION yd, POSITION xd, int nu extern bool get_is_floor(POSITION x, POSITION y); extern void set_floor(POSITION x, POSITION y); +extern void place_bound_perm_wall(grid_type *g_ptr);