-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 uint8_t shade_hex(uint32_t left_angle, uint32_t right_angle,
+ uint32_t middle_angle, struct shadow_angle ** shadows,
+ uint16_t pos_in_map, char * fov_map);
+
+/* Free shadow angles list "angles". */
+static void free_angles(struct shadow_angle * angles);
+
+/* Evaluate map position "test_pos" in distance "dist" to the view origin, and
+ * on the circle of that distance to the origin on hex "hex_i" (as counted from
+ * the circle's rightmost point), for setting shaded hexes in "fov_map" and
+ * potentially adding a new shadow to linked shadow angle list "shadows".