diff options
author | Rudy Bousset <rbousset@z2r5p2.le-101.fr> | 2020-03-12 17:48:43 +0100 |
---|---|---|
committer | Rudy Bousset <rbousset@z2r5p2.le-101.fr> | 2020-03-12 17:48:43 +0100 |
commit | 88cd7098410c7ab80baecc6c2a4d5da99e10162f (patch) | |
tree | 0090da4d5ca1e58466cf4c32a0c38ef0ee894287 /src/ft_init_map.c | |
parent | removed junk (diff) | |
download | 42-cub3d-88cd7098410c7ab80baecc6c2a4d5da99e10162f.tar.gz 42-cub3d-88cd7098410c7ab80baecc6c2a4d5da99e10162f.tar.bz2 42-cub3d-88cd7098410c7ab80baecc6c2a4d5da99e10162f.tar.xz 42-cub3d-88cd7098410c7ab80baecc6c2a4d5da99e10162f.tar.zst 42-cub3d-88cd7098410c7ab80baecc6c2a4d5da99e10162f.zip |
kk
Diffstat (limited to '')
-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); } |