aboutsummaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/main.c b/main.c
index 442e6eb..5684e14 100644
--- a/main.c
+++ b/main.c
@@ -12,9 +12,9 @@
#include "error.h"
#include "priority_queue.h"
#include "path.h"
+#include "bmp.h"
/* So, TODO for now:
- - Generate an image??
- Allow maps to have costs
- Implement greedy-best-first algorithm (4 and 8 dir)
- Implement Dijkstra algorithm (4 and 8 dir)
@@ -120,7 +120,7 @@ int main(int argc, char **argv) {
int offset_x = 0, offset_y = 0;
- draw_map(map, width, height, offset_x, offset_y, start_pos, end_pos, NULL, NULL, NULL, NULL);
+ //draw_map(map, width, height, offset_x, offset_y, start_pos, end_pos, NULL, NULL, NULL, NULL);
//print_map_out(map, width, height);
char **visited = visited_new(width, height);
@@ -162,6 +162,12 @@ int main(int argc, char **argv) {
path = breadth_first_search_path(dirs, map, width, height, start_pos, end_pos, visited, anim);
}
break;
+ case 's':
+ /* TODO: prompt for filename? or do a define idk */
+ map_to_bmp(map, width, height, start_pos, end_pos, path, visited, "out.bmp");
+ mvprintw(height + offset_y + DRAW_MAP_OFFSET_Y + 1, offset_x, "Saved to out.bmp");
+ getch();
+ break;
case 'n':
if (is_maze) {
map_free(map, height);