aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_init_lists.c
diff options
context:
space:
mode:
authorRudy Bousset <rbousset@z2r5p2.le-101.fr>2020-01-29 16:41:06 +0100
committerRudy Bousset <rbousset@z2r5p2.le-101.fr>2020-01-29 16:41:06 +0100
commite51748b78bd082d3f781930ba9eba619f0342bf6 (patch)
tree81871b5c1b6325bc20a2999e3bbd80f418973688 /src/ft_init_lists.c
parentGot colors (diff)
download42-cub3d-e51748b78bd082d3f781930ba9eba619f0342bf6.tar.gz
42-cub3d-e51748b78bd082d3f781930ba9eba619f0342bf6.tar.bz2
42-cub3d-e51748b78bd082d3f781930ba9eba619f0342bf6.tar.xz
42-cub3d-e51748b78bd082d3f781930ba9eba619f0342bf6.tar.zst
42-cub3d-e51748b78bd082d3f781930ba9eba619f0342bf6.zip
Better error management
Diffstat (limited to 'src/ft_init_lists.c')
-rw-r--r--src/ft_init_lists.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/ft_init_lists.c b/src/ft_init_lists.c
index f9c5c6c..4fb5256 100644
--- a/src/ft_init_lists.c
+++ b/src/ft_init_lists.c
@@ -14,9 +14,11 @@ t_win
if (!(wlist->wlx = ft_calloc(1, 1)) ||
!(wlist->winptr = ft_calloc(1, 1)))
return (NULL);
+ wlist->wlx = NULL;
+ wlist->winptr = NULL;
wlist->inited = 0;
- wlist->x_size = 0;
- wlist->y_size = 0;
+ wlist->x_size = -1;
+ wlist->y_size = -1;
return (wlist);
}
@@ -33,8 +35,8 @@ t_cub
!(clist->we_tex_path = (char*)ft_calloc(1, sizeof(char))) ||
!(clist->sprite_path = (char*)ft_calloc(1, sizeof(char))))
return (NULL);
- clist->f_color = 0;
- clist->c_color = 0;
+ clist->f_color = -1;
+ clist->c_color = -1;
if (!(clist->map = (char**)ft_calloc(2, sizeof(char*))))
return (NULL);
if (!(clist->map[0] = (char*)ft_calloc(1, sizeof(char))))
@@ -42,5 +44,10 @@ t_cub
clist->map[1] = 0;
clist->map_w = 0;
clist->line_chk = 0;
+ clist->no_tex_path = NULL;
+ clist->so_tex_path = NULL;
+ clist->ea_tex_path = NULL;
+ clist->we_tex_path = NULL;
+ clist->sprite_path = NULL;
return (clist);
}