diff options
Diffstat (limited to 'src/ft_init_map.c')
-rw-r--r-- | src/ft_init_map.c | 18 |
1 files changed, 17 insertions, 1 deletions
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); } |