From fc29c9bf10ebf471708caecdfed030ec78c915cb Mon Sep 17 00:00:00 2001 From: Kirill Petrashin Date: Sat, 28 Mar 2026 20:19:52 +0300 Subject: Add basic BMP output, not sure why --- main.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'main.c') 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); -- cgit v1.2.3