From 88cd7098410c7ab80baecc6c2a4d5da99e10162f Mon Sep 17 00:00:00 2001 From: Rudy Bousset Date: Thu, 12 Mar 2020 17:48:43 +0100 Subject: kk --- src/ft_init_map.c | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) (limited to 'src/ft_init_map.c') diff --git a/src/ft_init_map.c b/src/ft_init_map.c index 867a5b0..1462ef3 100644 --- a/src/ft_init_map.c +++ b/src/ft_init_map.c @@ -23,7 +23,7 @@ static int8_t !(mlist->so_tex_path = (char*)ft_calloc(1, sizeof(char))) || !(mlist->ea_tex_path = (char*)ft_calloc(1, sizeof(char))) || !(mlist->we_tex_path = (char*)ft_calloc(1, sizeof(char))) || - !(mlist->sprite_path = (char*)ft_calloc(1, sizeof(char))) || + !(mlist->sprite_path = (char**)ft_calloc(9, sizeof(char*))) || !(mlist->nl_tex_path = (char*)ft_calloc(1, sizeof(char))) || !(mlist->fl_tex_path = (char*)ft_calloc(1, sizeof(char))) || !(mlist->ce_tex_path = (char*)ft_calloc(1, sizeof(char))) || @@ -41,6 +41,21 @@ static int8_t return (0); } +static int8_t + ft_calloc_sprites(t_map *mlist) +{ + uint8_t i; + + i = 0; + while (i < 9) + { + if (!(mlist->sprite_path[i] = (char*)ft_calloc(1, sizeof(char)))) + return (-1); + i++; + } + return (0); +} + int8_t ft_init_map(t_map *mlist) { @@ -68,5 +83,6 @@ int8_t mlist->scale = 0; mlist->nlx = 0; mlist->nly = 0; + ft_calloc_sprites(mlist); return (0); } -- cgit v1.2.3