diff options
| author | Kirill Petrashin <kirill8201@yandex.ru> | 2026-04-14 17:57:09 +0300 |
|---|---|---|
| committer | Kirill Petrashin <kirill8201@yandex.ru> | 2026-04-14 17:57:09 +0300 |
| commit | c8d863b4b37a64f1df3cd4c25e6367949f2e6650 (patch) | |
| tree | 44d2faf6b00a6e60c715e9450ce6d8051db51bbb | |
| parent | a0eddde46fda0017384ad206f868651d84436427 (diff) | |
| download | astar-c8d863b4b37a64f1df3cd4c25e6367949f2e6650.tar.xz | |
Add ability to hotswap algorithms
| -rw-r--r-- | main.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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': |
