aboutsummaryrefslogtreecommitdiff
path: root/path.h
diff options
context:
space:
mode:
Diffstat (limited to 'path.h')
-rw-r--r--path.h8
1 files changed, 5 insertions, 3 deletions
diff --git a/path.h b/path.h
index f4f21e8..3b9672d 100644
--- a/path.h
+++ b/path.h
@@ -10,7 +10,7 @@ extern char *path_func_string;
/* Time it took to calculate a path */
extern double path_time;
-/* Controls whether walls should wrap around, only works in Dijkstra's */
+/* Controls whether walls should wrap around, only works in Dijkstra's due to A*'s heuristic */
extern char wraparound_enabled;
/* dirs can be 4 or 8 to disallow or allow diagonal movement */
@@ -18,8 +18,10 @@ extern char wraparound_enabled;
Path dijkstra_path(int dirs, Map map, size_t **cell_costs, size_t width, size_t height, Position start, Position end, char **visited, char should_anim);
Path astar_path(int dirs, Map map, size_t **cell_costs, size_t width, size_t height, Position start, Position end, char **visited, char should_anim);
-size_t manhattan_distance(Position a, Position b);
-size_t diagonal_distance(Position a, Position b);
+/* Heuristic functions. Calculate the distance from a to b */
+size_t manhattan_distance(Position a, Position b); /* Used for 4 dirs */
+size_t diagonal_distance(Position a, Position b); /* Used for 8 dirs */
+
Path path_new(size_t width, size_t height);
void path_free(Path path, size_t height);