Function TCOD_map_compute_fov¶
Defined in File fov.h
Function Documentation¶
-
TCOD_Error TCOD_map_compute_fov(TCOD_Map *map, int pov_x, int pov_y, int max_radius, bool light_walls, TCOD_fov_algorithm_t algo)¶
Calculate the field-of-view.
pov_x and pov_y are the used as the field-of-view source. These coordinates must be within the map.
max_radius is the maximum distance for the field-of-view algorithm.
If light_walls is false then only transparent cells will be touched by the field-of-view.
algo is one of the
TCOD_fov_algorithm_t
algorithms.After this call you may check if a cell is within the field-of-view by calling
TCOD_map_is_in_fov()
.Returns an error code on failure. See
TCOD_get_error()
for details.