From b0b6aecd5cb3a9a02376ec071699f827feee6934 Mon Sep 17 00:00:00 2001 From: Kirill Petrashin Date: Sun, 22 Mar 2026 11:25:36 +0300 Subject: Add rendering of visited tiles --- map.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'map.c') diff --git a/map.c b/map.c index 0c0bf86..3d89efc 100644 --- a/map.c +++ b/map.c @@ -145,7 +145,7 @@ Map file_plaintext_map(char *filename, size_t *width, size_t *height, Position * /* FIXME: I don't think we need DRAW_MAP_OFFSET_{X,Y} anymore * Although, at the same time, it does make less magic values, so I guess it's fine */ /* TODO: Maybe add an option to render with ▄? that doubles the resolution, but requires us to use ncursesw, probably. */ -void draw_map(Map map, size_t width, size_t height, int offset_x, int offset_y, Position start, Position goal, Path path) { +void draw_map(Map map, size_t width, size_t height, int offset_x, int offset_y, Position start, Position goal, Path path, char visited[height][width]) { (void)path; /* I think it flickers less when we do that */ wnoutrefresh(stdscr); @@ -183,7 +183,10 @@ void draw_map(Map map, size_t width, size_t height, int offset_x, int offset_y, int color_pair = 0; /* The color pair of the current char */ switch (map[i][j]) { case EMPTY: - color_pair = COLOR_PAIR(EMPTY_COLOR); + if (visited[i][j]) + color_pair = COLOR_PAIR(VISITED_COLOR); + else + color_pair = COLOR_PAIR(EMPTY_COLOR); c = EMPTY_CHAR; break; case WALL: -- cgit v1.2.3