diff options
author | Rudy Bousset <rbousset@z2r5p2.le-101.fr> | 2020-01-27 19:20:28 +0100 |
---|---|---|
committer | Rudy Bousset <rbousset@z2r5p2.le-101.fr> | 2020-01-27 19:20:28 +0100 |
commit | 0c2bb0f610c0af0680b46fc4566a207d59781e4d (patch) | |
tree | 986d6dd6a19416593c9b2c043312ffa5d4f0be73 /src/main.c | |
parent | in progress (diff) | |
download | 42-cub3d-0c2bb0f610c0af0680b46fc4566a207d59781e4d.tar.gz 42-cub3d-0c2bb0f610c0af0680b46fc4566a207d59781e4d.tar.bz2 42-cub3d-0c2bb0f610c0af0680b46fc4566a207d59781e4d.tar.xz 42-cub3d-0c2bb0f610c0af0680b46fc4566a207d59781e4d.tar.zst 42-cub3d-0c2bb0f610c0af0680b46fc4566a207d59781e4d.zip |
Switched lists entierly
Diffstat (limited to 'src/main.c')
-rw-r--r-- | src/main.c | 24 |
1 files changed, 14 insertions, 10 deletions
@@ -5,20 +5,24 @@ int main(void) { - t_win *wlist; + t_cub *clist; - if (!(wlist = ft_init_win())) + if (!(clist = ft_init_cub())) + { + ft_memdel(clist); return (1); - if (!(wlist->clist = ft_init_cub())) + } + if (!(clist->wlist = ft_init_win())) { - ft_memdel(wlist); + ft_memdel(clist->wlist); + ft_memdel(clist); return (1); } - ft_parse_map("map/map_one.cub", wlist); - if (ft_init_winlx(wlist) < 0) - return (ft_exit(3, wlist)); - mlx_key_hook(wlist->winptr, ft_key_event, wlist); - ft_drawsquare(80, 80, wlist->clist->f_color, wlist); - mlx_loop(wlist->wlx); + ft_parse_map("map/map_one.cub", clist); + if (ft_init_winlx(clist) < 0) + return (ft_exit(3, clist)); + mlx_key_hook(clist->wlist->winptr, ft_key_event, clist); + ft_drawsquare(80, 80, clist->f_color, clist); + mlx_loop(clist->wlist->wlx); return (0); } |