aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_init_lists.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-01-24 00:09:11 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-01-24 00:09:11 +0100
commitfbd69257b509d3374573282ee08f5d9fc9ed4095 (patch)
tree28b9ab225e910a8ae279623b08152e310431242c /src/ft_init_lists.c
parentNice and working (diff)
download42-cub3d-fbd69257b509d3374573282ee08f5d9fc9ed4095.tar.gz
42-cub3d-fbd69257b509d3374573282ee08f5d9fc9ed4095.tar.bz2
42-cub3d-fbd69257b509d3374573282ee08f5d9fc9ed4095.tar.xz
42-cub3d-fbd69257b509d3374573282ee08f5d9fc9ed4095.tar.zst
42-cub3d-fbd69257b509d3374573282ee08f5d9fc9ed4095.zip
It ain't much but it's honest work
Diffstat (limited to '')
-rw-r--r--src/ft_init_lists.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/ft_init_lists.c b/src/ft_init_lists.c
index 7a6eb79..126843c 100644
--- a/src/ft_init_lists.c
+++ b/src/ft_init_lists.c
@@ -1,6 +1,7 @@
#include <libft.h>
#include <mlx.h>
#include <cub3d.h>
+#include <stddef.h>
#include <stdlib.h>
t_win
@@ -8,13 +9,8 @@ t_win
{
t_win *wlist;
- wlist = (t_win*)malloc(sizeof(t_win));
- wlist->x_size = 800;
- wlist->y_size = 600;
- wlist->wlx = mlx_init();
- wlist->winptr = (void*)malloc(wlist->x_size * wlist->y_size);
- wlist->winptr = mlx_new_window(wlist->wlx, wlist->x_size, wlist->y_size, "Cub3D");
- ft_printf("Created window of size %dx%d\n", wlist->x_size, wlist->y_size);
+ if (!(wlist = (t_win*)malloc(sizeof(t_win))))
+ return (NULL);
return (wlist);
}
@@ -23,6 +19,7 @@ t_cub
{
t_cub *clist;
- clist = (t_cub*)malloc(sizeof(t_cub));
+ if (!(clist = (t_cub*)malloc(sizeof(t_cub))))
+ return (NULL);
return (clist);
}