OSDN Git Service

[Refactor] #40542 Changed macro function cave_have_flag_bold() to normal function
authorHourier <hourier@users.sourceforge.jp>
Sun, 12 Jul 2020 09:29:00 +0000 (18:29 +0900)
committerHourier <hourier@users.sourceforge.jp>
Sun, 12 Jul 2020 09:29:00 +0000 (18:29 +0900)
17 files changed:
src/cmd-action/cmd-move.c
src/cmd-item/cmd-activate.c
src/cmd-item/cmd-throw.c
src/combat/shoot.c
src/floor/floor-events.c
src/floor/floor.c
src/floor/floor.h
src/player-attack/player-attack.c
src/player/player-move.c
src/realm/realm-hissatsu.c
src/room/rooms.c
src/spell-kind/spells-fetcher.c
src/spell-kind/spells-floor.c
src/spell-kind/spells-neighbor.c
src/spell-realm/spells-crusade.c
src/spell/process-effect.c
src/spell/spells-status.c

index 50935fc..b68d6a5 100644 (file)
@@ -14,7 +14,6 @@
 #include "game-option/input-options.h"
 #include "game-option/play-record-options.h"
 #include "game-option/special-options.h"
-#include "grid/feature.h"
 #include "grid/grid.h"
 #include "info-reader/fixed-map-parser.h"
 #include "io/input-key-requester.h"
index 10c4c8c..5b09e37 100644 (file)
@@ -22,7 +22,7 @@
 #include "game-option/disturbance-options.h"
 #include "game-option/input-options.h"
 #include "game-option/special-options.h"
-#include "grid/feature.h"
+#include "grid/feature-flag-types.h"
 #include "grid/grid.h"
 #include "io/targeting.h"
 #include "main/sound-definitions-table.h"
index 87859f1..50e225b 100644 (file)
@@ -16,7 +16,7 @@
 #include "floor/geometry.h"
 #include "game-option/cheat-types.h"
 #include "game-option/special-options.h"
-#include "grid/feature.h"
+#include "grid/feature-flag-types.h"
 #include "grid/grid.h"
 #include "inventory/inventory-object.h"
 #include "inventory/inventory-slot-types.h"
index b2cf0ef..6fb8bd2 100644 (file)
@@ -11,6 +11,7 @@
 #include "game-option/cheat-types.h"
 #include "game-option/special-options.h"
 #include "grid/feature.h"
+#include "grid/feature-flag-types.h"
 #include "grid/grid.h"
 #include "inventory/inventory-object.h"
 #include "inventory/inventory-slot-types.h"
index 6627b13..504b435 100644 (file)
@@ -9,6 +9,7 @@
 #include "game-option/cheat-options.h"
 #include "game-option/disturbance-options.h"
 #include "game-option/map-screen-options.h"
+#include "grid/feature-flag-types.h"
 #include "grid/grid.h"
 #include "main/sound-of-music.h"
 #include "mind/mind-ninja.h"
index 6afcf71..1425042 100644 (file)
@@ -1695,3 +1695,8 @@ bool cave_los_bold(floor_type *floor_ptr, POSITION y, POSITION x)
 {
        return feat_supports_los(floor_ptr->grid_array[y][x].feat);
 }
+
+bool cave_have_flag_bold(floor_type *floor_ptr, POSITION y, POSITION x, feature_flag_type f_idx)
+{
+    return have_flag(f_info[floor_ptr->grid_array[y][x].feat].flags, f_idx);
+}
index 48eca0b..6d87cc9 100644 (file)
@@ -208,10 +208,6 @@ extern floor_type floor_info;
        ((G) == &(C)->current_floor_ptr->grid_array[(C)->y][(C)->x])
 
 
-#define cave_have_flag_bold(F,Y,X,INDEX) \
-       (have_flag(f_info[(F)->grid_array[(Y)][(X)].feat].flags, (INDEX)))
-
-
 #define cave_have_flag_grid(C,INDEX) \
        (have_flag(f_info[(C)->feat].flags, (INDEX)))
 
@@ -334,43 +330,37 @@ extern saved_floor_type saved_floors[MAX_SAVED_FLOORS];
 #define GRID_X(G) \
        ((int)((G) % 256U))
 
-extern bool pattern_tile(floor_type *floor_ptr, POSITION y, POSITION x);
-extern bool is_cave_empty_bold(player_type *player_ptr, POSITION x, POSITION y);
-extern bool is_cave_empty_bold2(player_type *player_ptr, POSITION x, POSITION y);
-extern void update_smell(floor_type *floor_ptr, player_type *subject_ptr);
-
-extern void add_door(player_type *player_ptr, POSITION x, POSITION y);
-extern void place_secret_door(player_type *player_ptr, POSITION y, POSITION x, int type);
-extern void place_locked_door(player_type *player_ptr, POSITION y, POSITION x);
-extern void forget_flow(floor_type *floor_ptr);
-extern void place_random_stairs(player_type *player_ptr, POSITION y, POSITION x);
-
-extern bool los(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2);
-extern bool projectable(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2);
-
-extern void vault_monsters(player_type *player_ptr, POSITION y1, POSITION x1, int num);
-extern bool cave_valid_bold(floor_type *floor_ptr, POSITION y, POSITION x);
-extern void cave_set_feat(player_type *player_ptr, POSITION y, POSITION x, FEAT_IDX feat);
-extern void place_random_door(player_type *player_ptr, POSITION y, POSITION x, bool room);
-extern void place_closed_door(player_type *player_ptr, POSITION y, POSITION x, int type);
-
-extern void wipe_o_list(floor_type *floor_ptr);
-extern void vault_trap_aux(player_type *player_ptr, POSITION y, POSITION x, POSITION yd, POSITION xd);
-
-extern bool get_is_floor(floor_type *floor_ptr, POSITION x, POSITION y);
-extern void try_door(player_type *player_ptr, POSITION y, POSITION x);
-
-extern FEAT_IDX conv_dungeon_feat(floor_type *floor_ptr, FEAT_IDX newfeat);
-extern void vault_objects(player_type *player_ptr, POSITION y, POSITION x, int num);
-
-extern int project_path(player_type *player_ptr, u16b *gp, POSITION range, POSITION y1, POSITION x1, POSITION y2, POSITION x2, BIT_FLAGS flg);
-
-extern void set_floor(player_type *player_ptr, POSITION x, POSITION y);
-extern void place_object(player_type *owner_ptr, POSITION y, POSITION x, BIT_FLAGS mode);
-extern void place_gold(player_type *player_ptr, POSITION y, POSITION x);
-extern void delete_monster(player_type *player_ptr, POSITION y, POSITION x);
-extern void compact_objects(player_type *owner_ptr, int size);
-extern void vault_traps(player_type *player_ptr, POSITION y, POSITION x, POSITION yd, POSITION xd, int num);
-extern void scatter(player_type *player_ptr, POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION d, BIT_FLAGS mode);
-
-extern bool cave_los_bold(floor_type *floor_ptr, POSITION y, POSITION x);
+bool pattern_tile(floor_type *floor_ptr, POSITION y, POSITION x);
+bool is_cave_empty_bold(player_type *player_ptr, POSITION x, POSITION y);
+bool is_cave_empty_bold2(player_type *player_ptr, POSITION x, POSITION y);
+void update_smell(floor_type *floor_ptr, player_type *subject_ptr);
+void add_door(player_type *player_ptr, POSITION x, POSITION y);
+void place_secret_door(player_type *player_ptr, POSITION y, POSITION x, int type);
+void place_locked_door(player_type *player_ptr, POSITION y, POSITION x);
+void forget_flow(floor_type *floor_ptr);
+void place_random_stairs(player_type *player_ptr, POSITION y, POSITION x);
+bool los(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2);
+bool projectable(player_type *player_ptr, POSITION y1, POSITION x1, POSITION y2, POSITION x2);
+void vault_monsters(player_type *player_ptr, POSITION y1, POSITION x1, int num);
+bool cave_valid_bold(floor_type *floor_ptr, POSITION y, POSITION x);
+void cave_set_feat(player_type *player_ptr, POSITION y, POSITION x, FEAT_IDX feat);
+void place_random_door(player_type *player_ptr, POSITION y, POSITION x, bool room);
+void place_closed_door(player_type *player_ptr, POSITION y, POSITION x, int type);
+void wipe_o_list(floor_type *floor_ptr);
+void vault_trap_aux(player_type *player_ptr, POSITION y, POSITION x, POSITION yd, POSITION xd);
+bool get_is_floor(floor_type *floor_ptr, POSITION x, POSITION y);
+void try_door(player_type *player_ptr, POSITION y, POSITION x);
+FEAT_IDX conv_dungeon_feat(floor_type *floor_ptr, FEAT_IDX newfeat);
+void vault_objects(player_type *player_ptr, POSITION y, POSITION x, int num);
+int project_path(player_type *player_ptr, u16b *gp, POSITION range, POSITION y1, POSITION x1, POSITION y2, POSITION x2, BIT_FLAGS flg);
+void set_floor(player_type *player_ptr, POSITION x, POSITION y);
+void place_object(player_type *owner_ptr, POSITION y, POSITION x, BIT_FLAGS mode);
+void place_gold(player_type *player_ptr, POSITION y, POSITION x);
+void delete_monster(player_type *player_ptr, POSITION y, POSITION x);
+void compact_objects(player_type *owner_ptr, int size);
+void vault_traps(player_type *player_ptr, POSITION y, POSITION x, POSITION yd, POSITION xd, int num);
+void scatter(player_type *player_ptr, POSITION *yp, POSITION *xp, POSITION y, POSITION x, POSITION d, BIT_FLAGS mode);
+bool cave_los_bold(floor_type *floor_ptr, POSITION y, POSITION x);
+
+typedef enum feature_flag_type feature_flag_type;
+bool cave_have_flag_bold(floor_type *floor_ptr, POSITION y, POSITION x, feature_flag_type f_idx);
index 8d88695..d523847 100644 (file)
@@ -14,7 +14,7 @@
 #include "core/player-update-types.h"
 #include "floor/floor.h"
 #include "game-option/cheat-types.h"
-#include "grid/feature.h"
+#include "grid/feature-flag-types.h"
 #include "inventory/inventory-slot-types.h"
 #include "main/sound-definitions-table.h"
 #include "main/sound-of-music.h"
index 7c93ea3..69afa47 100644 (file)
@@ -33,7 +33,7 @@
 #include "game-option/play-record-options.h"
 #include "game-option/special-options.h"
 #include "game-option/text-display-options.h"
-#include "grid/feature.h"
+#include "grid/feature-flag-types.h"
 #include "grid/grid.h"
 #include "grid/trap.h"
 #include "inventory/inventory-object.h"
index 9990ce7..1232da1 100644 (file)
@@ -11,7 +11,7 @@
 #include "dungeon/dungeon.h"
 #include "effect/effect-characteristics.h"
 #include "effect/spells-effect-util.h"
-#include "grid/feature.h"
+#include "grid/feature-flag-types.h"
 #include "grid/grid.h"
 #include "inventory/inventory-slot-types.h"
 #include "io/input-key-acceptor.h"
index 73310ea..3160588 100644 (file)
@@ -42,7 +42,7 @@
 #include "floor/floor.h"
 #include "game-option/birth-options.h"
 #include "game-option/cheat-types.h"
-#include "grid/feature.h"
+#include "grid/feature-flag-types.h"
 #include "grid/grid.h"
 #include "grid/trap.h"
 #include "monster-floor/monster-generator.h"
index e5ba031..645c2cb 100644 (file)
@@ -5,7 +5,7 @@
 #include "flavor/flavor-describer.h"
 #include "flavor/object-flavor-types.h"
 #include "floor/floor.h"
-#include "grid/feature.h"
+#include "grid/feature-flag-types.h"
 #include "grid/grid.h"
 #include "io/targeting.h"
 #include "monster-race/monster-race.h"
index a2747f6..7d4898a 100644 (file)
@@ -22,7 +22,7 @@
 #include "game-option/cheat-options.h"
 #include "game-option/map-screen-options.h"
 #include "game-option/play-record-options.h"
-#include "grid/feature.h"
+#include "grid/feature-flag-types.h"
 #include "grid/grid.h"
 #include "io/write-diary.h"
 #include "mind/mind-ninja.h"
index 9774312..1d7e4a3 100644 (file)
@@ -3,7 +3,7 @@
 #include "core/player-update-types.h"
 #include "effect/effect-characteristics.h"
 #include "floor/floor.h"
-#include "grid/feature.h"
+#include "grid/feature-flag-types.h"
 #include "grid/grid.h"
 #include "spell/process-effect.h"
 #include "spell-kind/earthquake.h"
index f79cd27..d151eff 100644 (file)
@@ -11,7 +11,7 @@
 #include "effect/effect-characteristics.h"
 #include "floor/floor.h"
 #include "game-option/disturbance-options.h"
-#include "grid/feature.h"
+#include "grid/feature-flag-types.h"
 #include "grid/grid.h"
 #include "io/targeting.h"
 #include "player/player-move.h"
index 18a59b1..f53c8b2 100644 (file)
@@ -8,7 +8,7 @@
 #include "effect/spells-effect-util.h"
 #include "floor/floor.h"
 #include "game-option/special-options.h"
-#include "grid/feature.h"
+#include "grid/feature-flag-types.h"
 #include "io/cursor.h"
 #include "io/screen-util.h"
 #include "io/targeting.h"
index 8c03625..2410942 100644 (file)
@@ -17,7 +17,7 @@
 #include "flavor/object-flavor-types.h"
 #include "floor/floor-object.h"
 #include "floor/floor.h"
-#include "grid/feature.h"
+#include "grid/feature-flag-types.h"
 #include "grid/grid.h"
 #include "inventory/inventory-object.h"
 #include "inventory/inventory-slot-types.h"