aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/main.c14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index 0e21668..c9a160d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -24,13 +24,13 @@ int
if (argc < 2)
{
ft_dprintf(STDERR_FILENO, "Error\n\033[1;31mNo map selected\n\033[0m");
- return (RET_NO_ARGV);
+ return (FT_RET_BAD_ARGV);
}
if (ft_init_cub3d(&clist) < 0)
- return (RET_FAILED_STRUCTS);
+ return (FT_RET_FAILED_STRUCTS);
ft_parse_map(argv[1], clist);
if (ft_init_winlx(clist) < 0)
- return (ft_exit(3, clist));
+ return (ft_exit(FT_RET_FAILED_MLX, clist));
ft_wall_tex_init(clist);
if (argc < 3)
{
@@ -38,6 +38,14 @@ int
ft_hooks_and_loops(clist->wlist, clist);
}
else if (argc == 3 && !ft_strncmp("--save", argv[2], 7))
+ {
ft_save_to_bmp();
+ return (ft_exit(FT_RET_FINE, clist));
+ }
+ else
+ {
+ ft_dprintf(STDERR_FILENO, "Error\n\033[1;31mBad arguments\n\033[0m");
+ return (ft_exit(FT_RET_BAD_ARGV, clist));
+ }
return (0);
}