diff options
Diffstat (limited to 'src/ft_warp_level.c')
-rw-r--r-- | src/ft_warp_level.c | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/src/ft_warp_level.c b/src/ft_warp_level.c index cfacd81..9a61484 100644 --- a/src/ft_warp_level.c +++ b/src/ft_warp_level.c @@ -27,6 +27,7 @@ static void ft_memdel((void**)&ml->sprite_path); ft_memdel((void**)&ml->nl_tex_path); ft_memdel((void**)&ml->nlevel_path); + ft_memdel((void**)&ml->music_path); ft_memdel((void**)&ml->mapl); ft_free_words(ml->map); ft_memdel((void**)&ml); @@ -35,6 +36,8 @@ static void static void ft_del_some(t_cub *cl) { + uint8_t i; + cl->plist->pos_x = 0; cl->plist->pos_y = 0; cl->plist->start_x = 0; @@ -47,18 +50,13 @@ static void cl->f_rgb = ft_init_rgb(); cl->c_rgb = ft_init_rgb(); cl->rlist = ft_init_s_ray(); - mlx_destroy_image(cl->wlist->wlx, cl->tlist[0].img); - mlx_destroy_image(cl->wlist->wlx, cl->tlist[1].img); - mlx_destroy_image(cl->wlist->wlx, cl->tlist[2].img); - mlx_destroy_image(cl->wlist->wlx, cl->tlist[3].img); - mlx_destroy_image(cl->wlist->wlx, cl->tlist[4].img); - mlx_destroy_image(cl->wlist->wlx, cl->tlist[5].img); - cl->tlist[0].img = NULL; - cl->tlist[1].img = NULL; - cl->tlist[2].img = NULL; - cl->tlist[3].img = NULL; - cl->tlist[4].img = NULL; - cl->tlist[5].img = NULL; + i = 0; + while (i < 5) + { + mlx_destroy_image(cl->wlist->wlx, cl->tlist[i].img); + cl->tlist[i].img = NULL; + i++; + } } int8_t |