-static void fill_shadow(struct yx_uint8 * yx_eye, struct yx_uint8 * yx_cell,
- uint8_t * fov_map, uint16_t pos_a, uint16_t pos_b);
-
-/* Flag with "flag" cells of a path from "yx_start" to the end of the map or (if
- * closer) the view border circle of the cells flagged as LIMIT, in a direction
- * parallel to the one determined by walking a path from "yx_eye" to the cell
- * reachable by moving one step into "dir" from "yx_start". If "shift_right" is
- * set, choose among the possible paths the one whose starting cell is set most
- * to the right, else do the opposite.
- */
-static uint16_t shadow_arm(struct yx_uint8 * yx_eye, struct yx_uint8 * yx_start,
- uint8_t * fov_map, char dir, uint8_t flag,
- uint8_t shift_right);
-
-/* From "yx_start", draw shadow of what is invisible as seen from "yx_eye" into
- * "fov_map" by extending shadow arms from "yx_start" as shadow borders until
- * the edges of the map or, if smaller, the maximum viewing distance, flag these
- * shadow arms' cells as HIDE_LATER and the area enclosed by them as HIDDEN.
- * "dir_left" and "dir_right" are hex directions to move to from "yx_start" for
- * cells whose shortest straight path to "yx_eye" serve as the lines of sight
- * enclosing the shadow left and right (left and right as seen from "yx_eye").
- */
-static void shadow(struct yx_uint8 * yx_eye, struct yx_uint8 * yx_start,
- uint8_t * fov_map, char dir_left, char dir_right);
-
-/* In "fov_map", if cell of position "yx_cell" is not HIDDEN, set it as VISIBLE,
- * and if an obstacle to view is positioned there in the game map, flag cells
- *behind it, unseen from "yx_eye", as HIDDEN on the interior and HIDE_LATER on
- * their borders.
- *
- * The shape and width of shadows is determined by 1) calculating an approximate
- * direction of "yx_cell" as seen from "yx_eye" as one hex movement direction,
- * or two directly neighboring each other (i.e. "east", "east and north-east"),
- * 2) deriving the two hex movement directions clockwise immediately preceding
- * the first (or only) direction and immediately succeeding the second (or only)
- * one and 3) passing the two directions thus gained as shadow arm direction
- * calibration values to shadow() (after this function's other arguments).
- */
-static void set_view_of_cell_and_shadows(struct yx_uint8 * yx_cell,
- struct yx_uint8 * yx_eye,
- uint8_t * fov_map);
-
-/* Return overlay of world map wherein all cell positions visible from player's
- * positions have flag VISIBLE set.
- *
- * This is achieved by spiraling out clock-wise from the player position,
- * flagging cells as VISIBLE unless they're already marked as HIDDEN, and, on
- * running into obstacles for view that are not HIDDEN, casting shadows from
- * these, i.e. drawing cells as HIDDEN that would be hidden by said obstacle,
- * before continuing the original spiraling path.
- *
- * Shadowcasting during spiraling is initially lazy, flagging only the shadows'
- * interior cells as HIDDEN and their border cells as HIDE_LATER. Only at the
- * end are all cells flagged HIDE_LATER flagged as HIDDEN. This is to handle
- * cases where obstacles to view sit right at the border of pre-estabilshed
- * shadows, therefore might be ignored if HIDDEN and not cast shadows on their
- * own that may slightly extend beyond the pre-established shadows they border.
- */
-static uint8_t * build_fov_map();