diff options
author | Bardur Arantsson <bardur@scientician.net> | 2015-03-07 16:55:42 +0100 |
---|---|---|
committer | Bardur Arantsson <bardur@scientician.net> | 2015-03-07 16:55:42 +0100 |
commit | 45fac786776f6664727daf160919f22313061017 (patch) | |
tree | 48c27ccd3e323f24b22cc38059d0b0465b21bb68 /src/defines.h | |
parent | 8153d8af2716359c43913fdd93691450d3a625af (diff) |
Convert cave-related macros from defines.h into functions
Diffstat (limited to 'src/defines.h')
-rw-r--r-- | src/defines.h | 176 |
1 files changed, 0 insertions, 176 deletions
diff --git a/src/defines.h b/src/defines.h index c032151f..a7eddd0d 100644 --- a/src/defines.h +++ b/src/defines.h @@ -3451,182 +3451,6 @@ -/* - * Determine if a "legal" grid is a "floor" grid - * - * Line 1 -- forbid doors, rubble, seams, walls - * - * Note that the terrain features are split by a one bit test - * into those features which block line of sight and those that - * do not, allowing an extremely fast single bit check below. - * - * Add in the fact that some new terrain (water & lava) do NOT block sight - * -KMW- - */ -#define cave_floor_bold(Y,X) \ - ((f_info[cave[Y][X].feat].flags1 & FF1_FLOOR) && \ - (cave[Y][X].feat != FEAT_MON_TRAP)) - - -/* - * Determine if a "legal" grid is floor without the REMEMBER flag set - * Sometimes called "boring" grid - */ -#define cave_plain_floor_bold(Y,X) \ - ((f_info[cave[Y][X].feat].flags1 & FF1_FLOOR) && \ - !(f_info[cave[Y][X].feat].flags1 & FF1_REMEMBER)) - - -/* - * Determine if a "legal" grid isn't a "blocking line of sight" grid - * - * Line 1 -- forbid doors, rubble, seams, walls - * - * Note that the terrain features are split by a one bit test - * into those features which block line of sight and those that - * do not, allowing an extremely fast single bit check below. - * - * Add in the fact that some new terrain (water & lava) do NOT block sight - * -KMW- - */ -#define cave_sight_bold(Y,X) \ - (!(f_info[cave[Y][X].feat].flags1 & FF1_NO_VISION)) - - -/* - * Determine if a "legal" grid is a "clean" floor grid - * - * Line 1 -- forbid non-floors - * Line 2 -- forbid deep water -KMW- - * Line 3 -- forbid deep lava -KMW- - * Line 4 -- forbid normal objects - */ -#define cave_clean_bold(Y,X) \ - ((f_info[cave[Y][X].feat].flags1 & FF1_FLOOR) && \ - (cave[Y][X].feat != FEAT_MON_TRAP) && \ - (cave[Y][X].o_idx == 0) && \ - !(f_info[cave[Y][X].feat].flags1 & FF1_PERMANENT)) - - -/* - * Determine if a "legal" grid is an "empty" floor grid - * - * Line 1 -- forbid doors, rubble, seams, walls - * Line 2 -- forbid normal monsters - * Line 3 -- forbid the player - */ -#define cave_empty_bold(Y,X) \ - (cave_floor_bold(Y,X) && \ - !(cave[Y][X].m_idx) && \ - !(((Y) == p_ptr->py) && ((X) == p_ptr->px))) - - -/* - * Determine if a "legal" grid is an "naked" floor grid - * - * Line 1 -- forbid non-floors, non-shallow water & lava -KMW- - * Line 2 -- forbid normal objects - * Line 3 -- forbid player/monsters - */ -#define cave_naked_bold(Y,X) \ - ((f_info[cave[Y][X].feat].flags1 & FF1_FLOOR) && \ - (cave[Y][X].feat != FEAT_MON_TRAP) && \ - !(f_info[cave[Y][X].feat].flags1 & FF1_PERMANENT) && \ - (cave[Y][X].o_idx == 0) && \ - (cave[Y][X].m_idx == 0)) - -#define cave_naked_bold2(Y,X) \ - ((f_info[cave[Y][X].feat].flags1 & FF1_FLOOR) && \ - (cave[Y][X].feat != FEAT_MON_TRAP) && \ - (cave[Y][X].o_idx == 0) && \ - (cave[Y][X].m_idx == 0)) - - - -/* - * Determine if a "legal" grid is "permanent" - * - * Line 1 -- perma-walls - * Line 2-3 -- stairs - * Line 4-5 -- building doors -KMW- - * Line 6-7 -- shop doors - */ -#define cave_perma_bold(Y,X) \ - (f_info[cave[Y][X].feat].flags1 & FF1_PERMANENT) - - -/* - * Grid based version of "cave_floor_bold()" - */ -#define cave_floor_grid(C) \ - ((f_info[(C)->feat].flags1 & FF1_FLOOR) && ((C)->feat != FEAT_MON_TRAP)) - - -/* - * Grid based version of "cave_plain_floor_bold()" - */ -#define cave_plain_floor_grid(C) \ - ((f_info[(C)->feat].flags1 & FF1_FLOOR) && \ - !(f_info[(C)->feat].flags1 & FF1_REMEMBER)) - - -/* - * Grid based version of "cave_clean_bold()" - */ -#define cave_clean_grid(C) \ - ((f_info[(C)->feat].flags1 & FF1_FLOOR) && ((C)->feat != FEAT_MON_TRAP) && \ - (!(C)->o_idx)) - -/* - * Grid based version of "cave_sight_bold()" - */ -#define cave_sight_grid(C) \ - (!(f_info[(C)->feat].flags1 & FF1_NO_VISION)) - -/* - * Grid based version of "cave_empty_bold()" - */ -#define cave_empty_grid(C) \ - (cave_floor_grid(C) && \ - !((C)->m_idx) && \ - !((C) == &cave[p_ptr->py][p_ptr->px])) - -/* - * Grid based version of "cave_empty_bold()" - */ -#define cave_naked_grid(C) \ - ((f_info[(C)->feat].flags1 & FF1_FLOOR) && ((C)->feat != FEAT_MON_TRAP) && \ - !((C)->o_idx) && \ - !((C)->m_idx) && \ - !((C) == &cave[p_ptr->py][p_ptr->px])) - - -/* - * Grid based version of "cave_perma_bold()" - */ -#define cave_perma_grid(C) \ - (f_info[(C)->feat].flags1 & FF1_PERMANENT) - - - -/* - * 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_bold(Y,X) \ - ((cave[Y][X].info & (CAVE_VIEW)) != 0) - - - -/* - * Determine if a "legal" grid can be "seen" by the player - * - * Note the use of comparison to zero to force a "boolean" result - */ -#define player_can_see_bold(Y,X) \ - ((cave[Y][X].info & (CAVE_SEEN)) != 0) - /*** Color constants ***/ |