diff options
Diffstat (limited to 'map.h')
| -rw-r--r-- | map.h | 12 |
1 files changed, 7 insertions, 5 deletions
@@ -3,16 +3,16 @@ #include <stddef.h> #include "structs.h" +#include "config.h" #include "path.h" #include "priority_queue.h" -/* Prints a message at the line right below the map. Multiline messages are undefined behaviour */ -#define message(height, ...) { \ - if (move((height) + map_offset_y + 1, map_offset_x - 2) != ERR) { clrtoeol(); /* Clear the line */\ - mvprintw((height) + map_offset_y + 1, map_offset_x - 2, __VA_ARGS__); }} - extern int map_offset_x; extern int map_offset_y; +extern char message[MESSAGE_MAX_SIZE]; + +#define set_message(...) snprintf(message, MESSAGE_MAX_SIZE, __VA_ARGS__); +#define clear_message() message[0] = 0; /* Returns an empty map of given size */ Map empty_map(size_t width, size_t height); @@ -53,6 +53,8 @@ void map_to_file_plaintext(char *filename, Map map, size_t width, size_t height, * path could be NULL to draw a map with no path. So can cursor, frontier and visited */ void draw_map(Map map, size_t width, size_t height, Position start, Position goal, Position *cursor, Path path, char **visited, PositionPQ *frontier); +void print_message(size_t height); + /* Frees all the memory reserved for the map */ void map_free(Map map, size_t height); |
