#define is_outer_grid(C) ((C)->info & CAVE_OUTER)
#define is_solid_grid(C) ((C)->info & CAVE_SOLID)
-#define place_floor_bold(F, Y, X) \
-{ \
- set_cave_feat((F), Y,X,feat_ground_type[randint0(100)]); \
- (F)->grid_array[Y][X].info &= ~(CAVE_MASK); \
- add_cave_info((F), Y,X,CAVE_FLOOR); \
- delete_monster(F, Y, X); \
-}
-
-#define place_floor_grid(C) \
-{ \
- (C)->feat = feat_ground_type[randint0(100)]; \
- (C)->info &= ~(CAVE_MASK); \
- (C)->info |= CAVE_FLOOR; \
- if ((C)->m_idx) delete_monster_idx((C)->m_idx); \
-}
-
-#define place_extra_bold(F, Y, X) \
-{ \
- set_cave_feat((F), Y,X,feat_wall_type[randint0(100)]); \
- (F)->grid_array[Y][X].info &= ~(CAVE_MASK); \
- add_cave_info((F), Y,X,CAVE_EXTRA); \
- delete_monster(F, Y, X); \
-}
-
-#define place_extra_grid(C) \
-{ \
- (C)->feat = feat_wall_type[randint0(100)]; \
- (C)->info &= ~(CAVE_MASK); \
- (C)->info |= CAVE_EXTRA; \
- if ((C)->m_idx) delete_monster_idx((C)->m_idx); \
-}
-
-#define place_extra_perm_bold(F, Y, X) \
-{ \
- set_cave_feat(F, Y, X,feat_permanent); \
- (F)->grid_array[Y][X].info &= ~(CAVE_MASK); \
- add_cave_info(F, Y, X, CAVE_EXTRA); \
- delete_monster(F, Y, X); \
-}
-
-#define place_extra_perm_grid(C) \
-{ \
- (C)->feat = feat_permanent; \
- (C)->info &= ~(CAVE_MASK); \
- (C)->info |= CAVE_EXTRA; \
- if ((C)->m_idx) delete_monster_idx((C)->m_idx); \
-}
-
-#define place_extra_noperm_bold(F, Y, X) \
-{ \
- feature_type *_f_ptr; \
- set_cave_feat((F), Y,X,feat_wall_type[randint0(100)]); \
- _f_ptr = &f_info[(F)->grid_array[Y][X].feat]; \
- if (permanent_wall(_f_ptr)) (F)->grid_array[Y][X].feat = feat_state((F)->grid_array[Y][X].feat, FF_UNPERM); \
- (F)->grid_array[Y][X].info &= ~(CAVE_MASK); \
- add_cave_info((F), Y, X, CAVE_EXTRA); \
- delete_monster(Y, X); \
-}
-
-#define place_inner_bold(F, Y, X) \
-{ \
- set_cave_feat((F), Y, X, feat_wall_inner); \
- (F)->grid_array[Y][X].info &= ~(CAVE_MASK); \
- add_cave_info((F), Y, X, CAVE_INNER); \
- delete_monster(F, Y, X); \
-}
-
-#define place_inner_grid(C) \
-{ \
- (C)->feat = feat_wall_inner; \
- (C)->info &= ~(CAVE_MASK); \
- (C)->info |= CAVE_INNER; \
- if ((C)->m_idx) delete_monster_idx((C)->m_idx); \
-}
-
-#define place_inner_perm_bold(F, Y, X) \
-{ \
- set_cave_feat(F, Y,X,feat_permanent); \
- (F)->grid_array[Y][X].info &= ~(CAVE_MASK); \
- add_cave_info((F), Y,X,CAVE_INNER); \
- delete_monster(F, Y, X); \
-}
-
-#define place_inner_perm_grid(C) \
-{ \
- (C)->feat = feat_permanent; \
- (C)->info &= ~(CAVE_MASK); \
- (C)->info |= CAVE_INNER; \
- if ((C)->m_idx) delete_monster_idx((C)->m_idx); \
-}
-
-#define place_outer_bold(F, Y, X) \
-{ \
- set_cave_feat((F), Y, X, feat_wall_outer); \
- (F)->grid_array[Y][X].info &= ~(CAVE_MASK); \
- add_cave_info((F), Y,X,CAVE_OUTER); \
- delete_monster(F, Y, X); \
-}
-
-#define place_outer_grid(C) \
-{ \
- (C)->feat = feat_wall_outer; \
- (C)->info &= ~(CAVE_MASK); \
- (C)->info |= CAVE_OUTER; \
- if ((C)->m_idx) delete_monster_idx((C)->m_idx); \
-}
-
-#define place_outer_perm_bold(F, Y, X) \
-{ \
- set_cave_feat(F, Y, X, feat_permanent); \
- (F)->grid_array[Y][X].info &= ~(CAVE_MASK); \
- add_cave_info((F), Y,X,CAVE_OUTER); \
- delete_monster(F, Y, X); \
-}
-
-#define place_outer_perm_grid(C) \
-{ \
- (C)->feat = feat_permanent; \
- (C)->info &= ~(CAVE_MASK); \
- (C)->info |= CAVE_OUTER; \
- if ((C)->m_idx) delete_monster_idx((C)->m_idx); \
-}
-
-#define place_outer_noperm_bold(F, Y, X) \
-{ \
- feature_type *_f_ptr = &f_info[feat_wall_outer]; \
- if (permanent_wall(_f_ptr)) set_cave_feat((F), Y, X, (s16b)feat_state(feat_wall_outer, FF_UNPERM)); \
- else set_cave_feat((F), Y,X,feat_wall_outer); \
- (F)->grid_array[Y][X].info &= ~(CAVE_MASK); \
- add_cave_info((F), Y,X,(CAVE_OUTER | CAVE_VAULT)); \
- delete_monster(F, Y, X); \
-}
-
-#define place_outer_noperm_grid(C) \
-{ \
- feature_type *_f_ptr = &f_info[feat_wall_outer]; \
- if (permanent_wall(_f_ptr)) (C)->feat = (s16b)feat_state(feat_wall_outer, FF_UNPERM); \
- else (C)->feat = feat_wall_outer; \
- (C)->info &= ~(CAVE_MASK); \
- (C)->info |= (CAVE_OUTER | CAVE_VAULT); \
- if ((C)->m_idx) delete_monster_idx((C)->m_idx); \
-}
-
-#define place_solid_bold(F, Y, X) \
-{ \
- set_cave_feat(F,Y,X,feat_wall_solid); \
- F->grid_array[Y][X].info &= ~(CAVE_MASK); \
- add_cave_info(F,Y,X,CAVE_SOLID); \
- delete_monster(F, Y, X); \
-}
-
-#define place_solid_grid(C) \
-{ \
- (C)->feat = feat_wall_solid; \
- (C)->info &= ~(CAVE_MASK); \
- (C)->info |= CAVE_SOLID; \
- if ((C)->m_idx) delete_monster_idx((C)->m_idx); \
-}
-
-#define place_solid_perm_bold(F, Y, X) \
-{ \
- set_cave_feat(F, Y, X, feat_permanent); \
- F->grid_array[Y][X].info &= ~(CAVE_MASK); \
- add_cave_info(F, Y, X, CAVE_SOLID); \
- delete_monster(F, Y, X); \
-}
-
-#define place_solid_perm_grid(C) \
-{ \
- (C)->feat = feat_permanent; \
- (C)->info &= ~(CAVE_MASK); \
- (C)->info |= CAVE_SOLID; \
- if ((C)->m_idx) delete_monster_idx((C)->m_idx); \
-}
-
-#define place_solid_noperm_bold(F, Y, X) \
-{ \
- feature_type *_f_ptr = &f_info[feat_wall_solid]; \
- if ((F->grid_array[Y][X].info & CAVE_VAULT) && permanent_wall(_f_ptr)) \
- set_cave_feat(F, Y, X, feat_state(feat_wall_solid, FF_UNPERM)); \
- else set_cave_feat(F, Y, X, feat_wall_solid); \
- F->grid_array[Y][X].info &= ~(CAVE_MASK); \
- add_cave_info(F, Y, X, CAVE_SOLID); \
- delete_monster(F, Y, X); \
-}
-
-#define place_solid_noperm_grid(C) \
-{ \
- feature_type *_f_ptr = &f_info[feat_wall_solid]; \
- if (((C)->info & CAVE_VAULT) && permanent_wall(_f_ptr)) \
- (C)->feat = feat_state(feat_wall_solid, FF_UNPERM); \
- else (C)->feat = feat_wall_solid; \
- (C)->info &= ~(CAVE_MASK); \
- (C)->info |= CAVE_SOLID; \
- if ((C)->m_idx) delete_monster_idx((C)->m_idx); \
-}
-
-
/*
* 特殊なマス状態フラグ / Special grid flags
*/
#define CAVE_MNLT 0x0100 /*!< モンスターの光源によって照らされている / Illuminated by monster */
#define CAVE_MNDK 0x8000 /*!< モンスターの暗源によって暗闇になっている / Darken by monster */
- /* Used only while floor generation */
+/* Used only while floor generation */
#define CAVE_FLOOR 0x0200 /*!< フロア属性のあるマス */
#define CAVE_EXTRA 0x0400
#define CAVE_INNER 0x0800
#define MAX_DOOR_TYPES 3
-extern void place_bound_perm_wall(grid_type *g_ptr);
+extern void place_bound_perm_wall(player_type *player_ptr, grid_type *g_ptr);
-extern bool is_known_trap(grid_type *g_ptr);
-extern bool is_hidden_door(grid_type *g_ptr);
+extern bool is_known_trap(player_type *player_ptr, grid_type *g_ptr);
+extern bool is_hidden_door(player_type *player_ptr, grid_type *g_ptr);
extern bool is_mirror_grid(grid_type *g_ptr);
extern bool is_glyph_grid(grid_type *g_ptr);
extern bool is_explosive_rune_grid(grid_type *g_ptr);
*/
#define feat_uses_special(F) (have_flag(f_info[(F)].flags, FF_SPECIAL))
-/* grids.c */
+/*!
+ * grids.c
+ * ここにfloor_type を引数として加えるとコンパイルエラー
+ */
extern POSITION distance(POSITION y1, POSITION x1, POSITION y2, POSITION x2);
extern void update_local_illumination(player_type *creature_ptr, POSITION y, POSITION x);
extern bool no_lite(player_type *creature_ptr);
-extern void map_info(POSITION y, POSITION x, TERM_COLOR *ap, SYMBOL_CODE *cp, TERM_COLOR *tap, SYMBOL_CODE *tcp);
extern void print_rel(player_type *subject_ptr, SYMBOL_CODE c, TERM_COLOR a, TERM_LEN y, TERM_LEN x);
-extern void note_spot(POSITION y, POSITION x);
-extern void lite_spot(POSITION y, POSITION x);
-extern void delayed_visual_update(void);
+extern void note_spot(player_type *player_ptr, POSITION y, POSITION x);
+extern void lite_spot(player_type *player_ptr, POSITION y, POSITION x);
extern void update_flow(player_type *subject_ptr);
-extern FEAT_IDX feat_state(FEAT_IDX feat, int action);
-extern void cave_alter_feat(POSITION y, POSITION x, int action);
+extern FEAT_IDX feat_state(player_type *player_ptr, FEAT_IDX feat, int action);
+extern void cave_alter_feat(player_type *player_ptr, POSITION y, POSITION x, int action);
extern void remove_mirror(player_type *caster_ptr, POSITION y, POSITION x);
-extern bool is_open(FEAT_IDX feat);
+extern bool is_open(player_type *player_ptr, FEAT_IDX feat);
extern bool check_local_illumination(player_type *creature_ptr, POSITION y, POSITION x);
-extern bool cave_monster_teleportable_bold(MONSTER_IDX m_idx, POSITION y, POSITION x, BIT_FLAGS mode);
-extern bool cave_player_teleportable_bold(POSITION y, POSITION x, BIT_FLAGS mode);
-
+extern bool cave_monster_teleportable_bold(player_type *player_ptr, MONSTER_IDX m_idx, POSITION y, POSITION x, BIT_FLAGS mode);
+extern bool cave_player_teleportable_bold(player_type *player_ptr, POSITION y, POSITION x, BIT_FLAGS mode);
-/*!
- * モンスターにより照明が消されている地形か否かを判定する。 / Is this grid "darkened" by monster?
- */
-#define darkened_grid(C) \
- ((((C)->info & (CAVE_VIEW | CAVE_LITE | CAVE_MNLT | CAVE_MNDK)) == (CAVE_VIEW | CAVE_MNDK)) && \
- !p_ptr->see_nocto)
+typedef enum grid_bold_type
+{
+ gb_floor,
+ gb_extra,
+ gb_extra_perm,
+ gb_inner,
+ gb_inner_perm,
+ gb_outer,
+ gb_outer_noperm,
+ gb_solid,
+ gb_solid_perm,
+ gb_solid_noperm
+} grid_bold_type;
+
+extern void place_grid(player_type *player_ptr, grid_type *g_ptr, grid_bold_type pg_type);
+extern bool darkened_grid(player_type *player_ptr, grid_type *g_ptr);
+extern void delete_monster(player_type *player_ptr, POSITION y, POSITION x);
+extern void place_bold(player_type *player_ptr, POSITION y, POSITION x, grid_bold_type gh_type);
/*
* Get feature mimic from f_info[] (applying "mimic" field)
/*
* For delayed visual update
*/
-#define cave_note_and_redraw_later(C,Y,X) \
+#define cave_note_and_redraw_later(F,C,Y,X) \
{\
(C)->info |= CAVE_NOTE; \
- cave_redraw_later(p_ptr->current_floor_ptr, (C), (Y), (X)); \
+ cave_redraw_later((F), (C), (Y), (X)); \
}
/*
- * For delayed visual update
- */
+* For delayed visual update
+*/
#define cave_redraw_later(F,G,Y,X) \
{\
if (!((G)->info & CAVE_REDRAW)) \
} \
}
- /*
- * This macro allows us to efficiently add a grid to the "view" array,
- * note that we are never called for illegal grids, or for grids which
- * have already been placed into the "view" array, and we are never
- * called when the "view" array is full.
- */
-#define cave_view_hack(C,Y,X) \
+/*
+ * This macro allows us to efficiently add a grid to the "view" array,
+ * note that we are never called for illegal grids, or for grids which
+ * have already been placed into the "view" array, and we are never
+ * called when the "view" array is full.
+ */
+#define cave_view_hack(F,C,Y,X) \
{\
if (!((C)->info & (CAVE_VIEW))){\
(C)->info |= (CAVE_VIEW); \
- p_ptr->current_floor_ptr->view_y[p_ptr->current_floor_ptr->view_n] = (Y); \
- p_ptr->current_floor_ptr->view_x[p_ptr->current_floor_ptr->view_n] = (X); \
- p_ptr->current_floor_ptr->view_n++;}\
+ (F)->view_y[(F)->view_n] = (Y); \
+ (F)->view_x[(F)->view_n] = (X); \
+ (F)->view_n++;}\
}
-