* fov.cc,fov.hh: Added tile_visible() and occupant_visible() functions which
directly inspect the visibility of a given Coord.
resolve_radiance(&player_fov);
}
+bool tile_visible(Coord c)
+{
+ Offset delta = c.delta(u.pos);
+ return (delta.len_cheb() <= MAX_FOV_RADIUS) ? player_fov.affected[MAX_FOV_RADIUS + delta.y][MAX_FOV_RADIUS + delta.x] & (Visflag_central | Visflag_partial) : false;
+}
+
+bool occupant_visible(Coord c)
+{
+ Offset delta = c.delta(u.pos);
+ return (delta.len_cheb() <= MAX_FOV_RADIUS) ? player_fov.affected[MAX_FOV_RADIUS + delta.y][MAX_FOV_RADIUS + delta.x] & Visflag_central : false;
+}
+
/* fov.c */
// vim:cindent
extern void compute_radiance(Radiance *rad);
extern void resolve_radiance(Radiance *rad);
extern void compute_fov(void);
+extern bool tile_visible(Coord c);
+extern bool occupant_visible(Coord c);
extern Radiance player_fov;
#endif