aboutsummaryrefslogtreecommitdiff
path: root/map.c
diff options
context:
space:
mode:
Diffstat (limited to 'map.c')
-rw-r--r--map.c7
1 files changed, 5 insertions, 2 deletions
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: