diff options
Diffstat (limited to '')
-rw-r--r-- | map/lvl_one.cub | 4 | ||||
-rw-r--r-- | src/ft_exit.c | 2 | ||||
-rw-r--r-- | src/ft_warp_level.c | 11 |
3 files changed, 11 insertions, 6 deletions
diff --git a/map/lvl_one.cub b/map/lvl_one.cub index 688f216..e9c51ca 100644 --- a/map/lvl_one.cub +++ b/map/lvl_one.cub @@ -17,8 +17,8 @@ LT ./media/img/crapaud.xpm MU ./media/sound/BITURE-ET-MELANCOLIE.wav 1111111 -111111111111L00001 +111111111111LW0001 120000000211111101 -1E0000000000000001 +100000000000000001 120000000211T10011 111111111111111111 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); |