- char dir = 'd';
- uint8_t i_dir = first_round = circle_on_map = 0;
- uint16_t i_dist, hex_i;
- for (hex_i = 0, i_dist = 1; hex_i < 6 * dist; i_dist++, hex_i++)
+ tm_prev = tm;
+ }
+ struct Thing * t = world.things;
+ for (; t; t = t->next)
+ {
+ if ( !t->lifepoints
+ && 'v' == t_eye->fov_map[t->pos.y * world.map.length + t->pos.x])
+ {
+ add_thing_to_memory_map(t_eye, t->type, t->pos.y, t->pos.x);
+ }
+ }
+}
+
+
+
+extern void build_fov_map(struct Thing * t)
+{
+ uint32_t map_size = world.map.length * world.map.length;
+ t->fov_map = t->fov_map ? t->fov_map : try_malloc(map_size, __func__);
+ memset(t->fov_map, 'v', map_size);
+ struct shadow_angle * shadows = NULL;
+ struct yx_uint8 test_pos = t->pos;
+ char * circledirs_string = "xswedc";
+ uint16_t circle_i;
+ uint8_t circle_is_on_map;
+ for (circle_i = 1, circle_is_on_map = 1; circle_is_on_map; circle_i++)
+ {
+ circle_is_on_map = 0;
+ if (1 < circle_i) /* All circles but the 1st are */
+ { /* moved into starting from a */
+ mv_yx_in_dir_legal('c', &test_pos);/* previous circle's last hex, */
+ } /* i.e. from the upper left. */
+ char dir_char = 'd'; /* Circle's 1st hex is entered by rightward move.*/
+ uint8_t dir_char_pos_in_circledirs_string = UINT8_MAX;
+ uint16_t dist_i, hex_i;
+ for (hex_i=0, dist_i=circle_i; hex_i < 6 * circle_i; dist_i++, hex_i++)