aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
authorKirill Petrashin <kirill8201@yandex.ru>2026-04-14 22:41:56 +0300
committerKirill Petrashin <kirill8201@yandex.ru>2026-04-14 22:41:56 +0300
commitc9ac361e1282bfaa895a1456222bca2d86253a96 (patch)
tree4c2b5a90ad35d25b21224af80a519c9ae353b983 /main.c
parent768509d6bb91269abf1ee1d93c32d236b146e98a (diff)
downloadastar-c9ac361e1282bfaa895a1456222bca2d86253a96.tar.xz
Implement live pathfinding in map editor
Diffstat (limited to 'main.c')
-rw-r--r--main.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/main.c b/main.c
index c909633..9706875 100644
--- a/main.c
+++ b/main.c
@@ -16,6 +16,8 @@
/* So, TODO for now:
- Allow maps to have costs
+ - Maybe make map editor the main thing
+ - More messages
- check ppq_insert() order
- more info in anim()
- save pathfinding to a series of BMPs
@@ -23,7 +25,6 @@
- MORE MAPS FOR THE MAP PEOPLE
- Clean up unused `#include`s
- keybinding help screen
- - live updating in map_editor()
- 'clean' rendering mode, without all the ugly shit
- Comments */
@@ -61,7 +62,6 @@ int main(int argc, char **argv) {
Position start_pos, end_pos;
size_t width, height;
Map map = NULL;
- Path (*path_func)(int, Map, size_t, size_t, Position, Position, char **, char) = &astar_path;
size_t mwidth = 20; /* Maze width */
size_t mheight = 10; /* Maze height */
@@ -145,6 +145,10 @@ int main(int argc, char **argv) {
exit(0);
}
+#ifdef PID_MESSAGE
+ set_message("PID: %i", getpid());
+#endif
+
while (1) {
draw_map(map, width, height, start_pos, end_pos, NULL, path, visited, NULL);
int c = getch();
@@ -253,7 +257,8 @@ int main(int argc, char **argv) {
visited_free(visited, height);
path_free(path, height);
- map_editor(&map, &width, &height, &start_pos, &end_pos);
+ map_editor(&map, &width, &height, &start_pos, &end_pos, dirs);
+ set_message("You've left the map editor"); print_message(height);
wrefresh(curscr);
visited = visited_new(width, height);