aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_init_map.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_init_map.c')
-rw-r--r--src/ft_init_map.c23
1 files changed, 16 insertions, 7 deletions
diff --git a/src/ft_init_map.c b/src/ft_init_map.c
index 8f6bb3d..813a795 100644
--- a/src/ft_init_map.c
+++ b/src/ft_init_map.c
@@ -57,12 +57,27 @@ static int8_t
}
int8_t
+ ft_init_map_norme(t_map *mlist)
+{
+ mlist->scale = 0;
+ mlist->nlx = 0;
+ mlist->nly = 0;
+ mlist->sprite_var = 0;
+ mlist->topsp = 0;
+ ft_bzero(mlist->sprite_order, 4096);
+ ft_bzero(mlist->traps_order, 512);
+ return (0);
+}
+
+int8_t
ft_init_map(t_map *mlist)
{
if (ft_init_map_callocs(mlist) < 0)
return (-1);
mlist->map[1] = 0;
mlist->mcmd_words[1] = 0;
+ if (ft_calloc_sprites(mlist) < 0)
+ return (-1);
mlist->map_w = 0;
mlist->map_h = 0;
mlist->mapl_len = 0;
@@ -80,11 +95,5 @@ int8_t
mlist->sprite_nbr = 0;
mlist->traps_nbr = 0;
mlist->darklvl = 0;
- mlist->scale = 0;
- mlist->nlx = 0;
- mlist->nly = 0;
- mlist->sprite_var = 0;
- ft_bzero(mlist->sprite_order, 4096);
- ft_bzero(mlist->traps_order, 512);
- return (ft_calloc_sprites(mlist));
+ return (ft_init_map_norme(mlist));
}