diff options
Diffstat (limited to '')
-rw-r--r-- | src/ft_save_to_bmp.c | 8 | ||||
-rw-r--r-- | src/main.c | 13 |
2 files changed, 17 insertions, 4 deletions
diff --git a/src/ft_save_to_bmp.c b/src/ft_save_to_bmp.c new file mode 100644 index 0000000..f8d1a6e --- /dev/null +++ b/src/ft_save_to_bmp.c @@ -0,0 +1,8 @@ +#include <libft.h> +#include <cub3d.h> + +void + ft_save_to_bmp(void) +{ + ft_printf("qwe\n"); +} @@ -24,15 +24,20 @@ int if (argc < 2) { ft_dprintf(STDERR_FILENO, "Error\n\033[1;31mNo map selected\n\033[0m"); - return (1); + return (RET_NO_ARGV); } if (ft_init_cub3d(&clist) < 0) - return (2); + return (RET_FAILED_STRUCTS); ft_parse_map(argv[1], clist); if (ft_init_winlx(clist) < 0) return (ft_exit(3, clist)); ft_wall_tex_init(clist); - ft_draw_scene(clist); - ft_hooks_and_loops(clist->wlist, clist); + if (argc < 3) + { + ft_draw_scene(clist); + ft_hooks_and_loops(clist->wlist, clist); + } + else if (argc == 3 && !ft_strncmp("--save", argv[2], 7)) + ft_save_to_bmp(); return (0); } |