diff options
Diffstat (limited to 'src/ft_init_winlx.c')
-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); } |