aboutsummaryrefslogtreecommitdiff
path: root/path.h
diff options
context:
space:
mode:
authorKirill Petrashin <kirill8201@yandex.ru>2026-03-28 19:33:49 +0300
committerKirill Petrashin <kirill8201@yandex.ru>2026-03-28 19:33:49 +0300
commit1f0dd604952e39d030367b2bbf45b69f8c63cc5b (patch)
treea1389804dbb9301a6691704e4c5c0eb829df4a4b /path.h
parent5b623c0a31d6732dd03ba8db80004e5468bc08c3 (diff)
downloadastar-1f0dd604952e39d030367b2bbf45b69f8c63cc5b.tar.xz
Allow resizing the map + some other stuff
Diffstat (limited to 'path.h')
-rw-r--r--path.h9
1 files changed, 7 insertions, 2 deletions
diff --git a/path.h b/path.h
index 330ea3d..f9c9c75 100644
--- a/path.h
+++ b/path.h
@@ -5,11 +5,16 @@
#include "map.h"
/* dirs can be 4 or 8 to disallow or allow diagonal movement */
-Path breadth_first_search_path(int dirs, Map map, size_t width, size_t height, Position start, Position end, char visited[height][width], char should_anim);
-Path dijkstra_path(int dirs, Map map, size_t width, size_t height, Position start, Position end, char visited[height][width], char should_anim);
+Path breadth_first_search_path(int dirs, Map map, size_t width, size_t height, Position start, Position end, char **visited, char should_anim);
+Path dijkstra_path(int dirs, Map map, size_t width, size_t height, Position start, Position end, char **visited, char should_anim);
size_t manhattan_distance(Position a, Position b);
void path_free(Path path, size_t height);
+/* Helper funcs for the visited array */
+char **visited_new(size_t width, size_t height);
+void visited_clear(char **visited, size_t width, size_t height);
+void visited_free(char **visited, size_t height);
+
#endif /* ASTAR_H_ */