diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-16 18:08:41 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-16 18:08:41 +0100 |
commit | 32d43e18475c967a263b5b20ad1fff728a33804a (patch) | |
tree | ff1004856b6efe5a95237731f42f8ede73431843 /src | |
parent | On the way (diff) | |
download | 42-cub3d-32d43e18475c967a263b5b20ad1fff728a33804a.tar.gz 42-cub3d-32d43e18475c967a263b5b20ad1fff728a33804a.tar.bz2 42-cub3d-32d43e18475c967a263b5b20ad1fff728a33804a.tar.xz 42-cub3d-32d43e18475c967a263b5b20ad1fff728a33804a.tar.zst 42-cub3d-32d43e18475c967a263b5b20ad1fff728a33804a.zip |
in progress
Diffstat (limited to 'src')
-rw-r--r-- | src/ft_exit.c | 2 | ||||
-rw-r--r-- | src/ft_warp_level.c | 11 |
2 files changed, 9 insertions, 4 deletions
diff --git a/src/ft_exit.c b/src/ft_exit.c index d135433..4551e2f 100644 --- a/src/ft_exit.c +++ b/src/ft_exit.c @@ -21,7 +21,7 @@ #include <stdint.h> static void -ft_free_some_extras(t_cub *clist) + ft_free_some_extras(t_cub *clist) { uint8_t i; diff --git a/src/ft_warp_level.c b/src/ft_warp_level.c index 56d4d67..7259275 100644 --- a/src/ft_warp_level.c +++ b/src/ft_warp_level.c @@ -51,12 +51,11 @@ static void cl->f_rgb = ft_init_rgb(); cl->c_rgb = ft_init_rgb(); cl->rlist = ft_init_s_ray(); - i = 0; - while (i < 5) + i = -1; + while (++i < 5) { mlx_destroy_image(cl->wlist.wlx, cl->tlist[i].img); cl->tlist[i].ptr = NULL; - i++; } if (cl->mlist.isnlvl && cl->tlist[5].img) mlx_destroy_image(cl->wlist.wlx, cl->tlist[5].img); @@ -67,6 +66,10 @@ static void if (cl->mlist.istraps && cl->tlist[15].img) mlx_destroy_image(cl->wlist.wlx, cl->tlist[15].img); ft_del_extra_sprites(cl); + i = -1; + while (++i < 8) + ft_memdel((void**)&cl->sprites[i]); + ft_memdel((void**)&cl->sprites); } static void @@ -104,6 +107,8 @@ int8_t tmp_mup = ft_strdup(cl->mlist.music_path); ft_del_some(cl); ft_del_map(&cl->mlist); + if (!(cl->sprites = ft_init_sprites())) + return (-1); if (ft_init_map(&cl->mlist) < 0) return (-1); ft_parse_map(next_path, cl); |