aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-01-24 17:57:20 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-01-24 17:57:20 +0100
commit6776a1f3491663c85480326e0d01f9a6c5455bbd (patch)
tree035435a20e933c43b192552a5b3f766fe55131e5 /src/main.c
parentft_split redone (diff)
download42-cub3d-6776a1f3491663c85480326e0d01f9a6c5455bbd.tar.gz
42-cub3d-6776a1f3491663c85480326e0d01f9a6c5455bbd.tar.bz2
42-cub3d-6776a1f3491663c85480326e0d01f9a6c5455bbd.tar.xz
42-cub3d-6776a1f3491663c85480326e0d01f9a6c5455bbd.tar.zst
42-cub3d-6776a1f3491663c85480326e0d01f9a6c5455bbd.zip
Tons of changes
Diffstat (limited to 'src/main.c')
-rw-r--r--src/main.c18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/main.c b/src/main.c
index c252bca..b47b36f 100644
--- a/src/main.c
+++ b/src/main.c
@@ -7,17 +7,19 @@ int
main(void)
{
t_win *wlist;
- t_cub *clist;
- if (!(wlist = ft_init_win())
- || !(clist = ft_init_cub()))
- return (ft_exit(4));
- ft_parse_map(wlist, clist, "map/map_one.cub");
+ if (!(wlist = ft_init_win()))
+ return (1);
+ if (!(wlist->clist = ft_init_cub()))
+ {
+ ft_memdel(wlist);
+ return (1);
+ }
+ ft_parse_map(wlist, "map/map_one.cub");
if (ft_init_winlx(wlist) < 0)
- return (ft_exit(3));
+ return (ft_exit(3, wlist));
mlx_key_hook(wlist->winptr, ft_key_event, wlist);
- ft_drawsquare(wlist, clist, 80, 80);
+ ft_drawsquare(wlist, 80, 80);
mlx_loop(wlist->wlx);
- ft_memdel(clist);
return (0);
}