aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/main.c b/main.c
index f578bf3..3ebc655 100644
--- a/main.c
+++ b/main.c
@@ -22,7 +22,6 @@
- more info in anim()
- save pathfinding to a series of BMPs
- less magical values
- - Algorithm hotswap
- MORE MAPS FOR THE MAP PEOPLE
- Clean up unused `#include`s
- Comments */
@@ -180,6 +179,13 @@ int main(int argc, char **argv) {
case 'a': anim = !anim; break;
+ case 'd':
+ if (path_func == astar_path) path_func = &dijkstra_path;
+ else path_func = &astar_path;
+ path_free(path, height);
+ path = path_func(dirs, map, width, height, start_pos, end_pos, visited, anim);
+ break;
+
case 'y':
case 'o':
case 'u':