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/ft_init_winlx.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 '')
-rw-r--r-- | src/ft_init_winlx.c | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/src/ft_init_winlx.c b/src/ft_init_winlx.c index a4b7208..931e19b 100644 --- a/src/ft_init_winlx.c +++ b/src/ft_init_winlx.c @@ -4,17 +4,19 @@ #include <stdlib.h> int -ft_init_winlx(t_win *wlist) +ft_init_winlx(t_cub *clist) { - ft_memdel(wlist->wlx); - if (!(wlist->wlx = mlx_init())) + ft_memdel(clist->wlist->wlx); + if (!(clist->wlist->wlx = mlx_init())) return (-1); - ft_memdel(wlist->winptr); - if (!(wlist->winptr = (void*)malloc(wlist->x_size * wlist->y_size))) + ft_memdel(clist->wlist->winptr); + if (!(clist->wlist->winptr = malloc(clist->wlist->x_size + * clist->wlist->y_size))) return (-1); - if (!(wlist->winptr = mlx_new_window(wlist->wlx, wlist->x_size,\ - wlist->y_size, "Cub3D"))) + if (!(clist->wlist->winptr = mlx_new_window(clist->wlist->wlx, + clist->wlist->x_size, clist->wlist->y_size, "Cub3D"))) return (-1); - ft_printf("Created window of size %dx%d\n", wlist->x_size, wlist->y_size); + ft_printf("Created window of size %dx%d\n", + clist->wlist->x_size, clist->wlist->y_size); return (0); } |