aboutsummaryrefslogtreecommitdiff
path: root/map.h
diff options
context:
space:
mode:
authorKirill Petrashin <kirill8201@yandex.ru>2026-04-11 22:21:47 +0300
committerKirill Petrashin <kirill8201@yandex.ru>2026-04-11 22:21:47 +0300
commit6ea977db5faa9342c90a4feb81a19182b55ab574 (patch)
treeed675fddf40669cc36b682a6bee4f4c7dc745b46 /map.h
parentd676ac91b1906f5de8695facb6b96bf0509e6e1f (diff)
downloadastar-6ea977db5faa9342c90a4feb81a19182b55ab574.tar.xz
Add macro to print a message
Diffstat (limited to 'map.h')
-rw-r--r--map.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/map.h b/map.h
index fef684c..e9c5bc3 100644
--- a/map.h
+++ b/map.h
@@ -6,6 +6,11 @@
#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;