OSDN Git Service

[Refactor] #40577 Changed macro functions to normal functions in floor.c/h
authorHourier <hourier@users.sourceforge.jp>
Sat, 25 Jul 2020 10:01:44 +0000 (19:01 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sun, 26 Jul 2020 08:04:23 +0000 (17:04 +0900)
src/floor/floor.c
src/floor/floor.h

index 21e3d2c..7ce8d17 100644 (file)
@@ -487,6 +487,11 @@ bool projectable(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2,
 }
 
 /*
+ * Grid based version of "creature_bold()"
+ */
+static bool player_grid(player_type *player_ptr, grid_type *g_ptr) { return g_ptr == &player_ptr->current_floor_ptr->grid_array[player_ptr->y][player_ptr->x]; }
+
+/*
  * Grid based version of "cave_empty_bold()"
  */
 static bool is_cave_empty_grid(player_type *player_ptr, grid_type *g_ptr)
@@ -555,6 +560,12 @@ bool cave_valid_bold(floor_type *floor_ptr, POSITION y, POSITION x)
 }
 
 /*
+ * Determine if a "legal" grid is within "los" of the player *
+ * Note the use of comparison to zero to force a "boolean" result
+ */
+static bool player_has_los_grid(grid_type *g_ptr) { return (g_ptr->info & CAVE_VIEW) != 0; }
+
+/*
  * Change the "feat" flag for a grid, and notice/redraw the grid
  */
 void cave_set_feat(player_type *player_ptr, POSITION y, POSITION x, FEAT_IDX feat)
index b24b73a..74880db 100644 (file)
@@ -5,21 +5,6 @@
 extern floor_type floor_info;
 
 /*
- * Grid based version of "creature_bold()"
- */
-#define player_grid(C, G) \
-       ((G) == &(C)->current_floor_ptr->grid_array[(C)->y][(C)->x])
-
-
-/*
- * Determine if a "legal" grid is within "los" of the player
- *
- * Note the use of comparison to zero to force a "boolean" result
- */
-#define player_has_los_grid(C) \
-    (((C)->info & (CAVE_VIEW)) != 0)
-
-/*
  * Convert a "location" (Y,X) into a "grid" (G)
  */
 #define GRID(Y,X) \