diff options
| author | Kirill Petrashin <kirill8201@yandex.ru> | 2026-03-28 20:19:52 +0300 |
|---|---|---|
| committer | Kirill Petrashin <kirill8201@yandex.ru> | 2026-03-28 20:19:52 +0300 |
| commit | fc29c9bf10ebf471708caecdfed030ec78c915cb (patch) | |
| tree | 9051000266f524c07f3ee97f3ea943130fc2cf16 /main.c | |
| parent | 1f0dd604952e39d030367b2bbf45b69f8c63cc5b (diff) | |
| download | astar-fc29c9bf10ebf471708caecdfed030ec78c915cb.tar.xz | |
Add basic BMP output, not sure why
Diffstat (limited to 'main.c')
| -rw-r--r-- | main.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -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); |
