#include <string.h> /* memset() */
#include "../common/rexit.h" /* exit_trouble() */
#include "../common/try_malloc.h" /* try_malloc() */
-#include "map.h" /* yx_to_map_pos() */
#include "things.h" /* Thing */
#include "yx_uint8.h" /* yx_uint8 */
#include "world.h" /* world */
uint32_t left_angle = correct_angle(left_angle_uncorrected);
uint32_t right_angle = correct_angle(right_angle_uncorrected);
uint32_t right_angle_1st = right_angle > left_angle ? 0 : right_angle;
- uint16_t pos_in_map = yx_to_map_pos(test_pos);
+ uint16_t pos_in_map = test_pos->y * world.map.length + test_pos->x;
set_shadow(left_angle, right_angle_1st, shadows, pos_in_map, fov_map);
if (right_angle_1st != right_angle)
{
#include "cleanup.h" /* set_cleanup_flag() */
#include "field_of_view.h" /* VISIBLE */
#include "hardcoded_strings.h" /* s */
-#include "map.h" /* yx_to_map_pos() */
#include "things.h" /* Thing, ThingType, ThingAction, get_thing_type(),
* get_player()
*/
{
for (t = world.things; t != 0; t = t->next)
{
- if ( player->fov_map[yx_to_map_pos(&t->pos)] & VISIBLE
+ if ( ( player->fov_map[t->pos.y * world.map.length +t->pos.x]
+ & VISIBLE)
&& ( (0 == i && 0 == t->lifepoints)
|| (1 == i && 0 < t->lifepoints)))
{
tt = get_thing_type(t->type);
c = tt->char_on_map;
- visible_map[yx_to_map_pos(&t->pos)] = c;
+ visible_map[t->pos.y * world.map.length + t->pos.x] = c;
}
}
}
}
return passable;
}
-
-
-
-extern uint16_t yx_to_map_pos(struct yx_uint8 * yx)
-{
- return (yx->y * world.map.length) + yx->x;
-}
*/
extern uint8_t is_passable(struct yx_uint8 pos);
-/* Transform "yx" to an index position in the world map. */
-extern uint16_t yx_to_map_pos(struct yx_uint8 * yx);
-
#endif