OSDN Git Service

[Refactor] #40577 Moved set_floor() from floor.c/h to space-finder.c
authorHourier <hourier@users.sourceforge.jp>
Thu, 20 Aug 2020 10:29:34 +0000 (19:29 +0900)
committerHourier <hourier@users.sourceforge.jp>
Thu, 20 Aug 2020 10:29:34 +0000 (19:29 +0900)
src/floor/floor.c
src/floor/floor.h
src/room/space-finder.c

index 26a6576..c0e4c03 100644 (file)
@@ -166,28 +166,6 @@ void wipe_o_list(floor_type *floor_ptr)
     floor_ptr->o_cnt = 0;
 }
 
-/*!
- * @brief 指定のマスを床地形に変える / Set a square to be floor.  (Includes range checking.)
- * @param player_ptr プレーヤーへの参照ポインタ
- * @param x 地形を変えたいマスのX座標
- * @param y 地形を変えたいマスのY座標
- * @return なし
- */
-void set_floor(player_type *player_ptr, POSITION x, POSITION y)
-{
-    floor_type *floor_ptr = player_ptr->current_floor_ptr;
-    if (!in_bounds(floor_ptr, y, x)) {
-        return;
-    }
-
-    if (floor_ptr->grid_array[y][x].info & CAVE_ROOM) {
-        return;
-    }
-
-    if (is_extra_bold(floor_ptr, y, x))
-        place_bold(player_ptr, y, x, GB_FLOOR);
-}
-
 /*
  * Standard "find me a location" function
  *
index a6a1451..5faa1b6 100644 (file)
@@ -7,5 +7,4 @@ extern floor_type floor_info;
 void update_smell(floor_type *floor_ptr, player_type *subject_ptr);
 void forget_flow(floor_type *floor_ptr);
 void wipe_o_list(floor_type *floor_ptr);
-void set_floor(player_type *player_ptr, POSITION x, POSITION y);
 void scatter(player_type *player_ptr, POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION d, BIT_FLAGS mode);
index 79729c7..4060308 100644 (file)
@@ -2,7 +2,6 @@
 #include "dungeon/dungeon-flag-types.h"
 #include "dungeon/dungeon.h"
 #include "floor/cave.h"
-#include "floor/floor.h"
 #include "grid/grid.h"
 #include "system/dungeon-data-definition.h"
 #include "system/floor-type-definition.h"
@@ -26,6 +25,26 @@ static bool get_is_floor(floor_type *floor_ptr, POSITION x, POSITION y)
 }
 
 /*!
+ * @brief 指定のマスを床地形に変える / Set a square to be floor.  (Includes range checking.)
+ * @param player_ptr プレーヤーへの参照ポインタ
+ * @param x 地形を変えたいマスのX座標
+ * @param y 地形を変えたいマスのY座標
+ * @return なし
+ */
+static void set_floor(player_type *player_ptr, POSITION x, POSITION y)
+{
+    floor_type *floor_ptr = player_ptr->current_floor_ptr;
+    if (!in_bounds(floor_ptr, y, x))
+        return;
+
+    if (floor_ptr->grid_array[y][x].info & CAVE_ROOM)
+        return;
+
+    if (is_extra_bold(floor_ptr, y, x))
+        place_bold(player_ptr, y, x, GB_FLOOR);
+}
+
+/*!
  * @brief
  * 指定範囲に通路が通っていることを確認した上で床で埋める
  * This function tunnels around a room if it will cut off part of a grid system.