diff options
| author | Kirill Petrashin <kirill8201@yandex.ru> | 2026-03-22 11:25:36 +0300 |
|---|---|---|
| committer | Kirill Petrashin <kirill8201@yandex.ru> | 2026-03-22 11:25:36 +0300 |
| commit | b0b6aecd5cb3a9a02376ec071699f827feee6934 (patch) | |
| tree | cc4463ef81a5f376ca3cc1b4164f5d0a6aa71303 /map.c | |
| parent | 596eeed9dd378a8994778e03319b538206672bec (diff) | |
Add rendering of visited tiles
Diffstat (limited to 'map.c')
| -rw-r--r-- | map.c | 7 |
1 files changed, 5 insertions, 2 deletions
@@ -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: |
