aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_warp_level.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/ft_warp_level.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ft_warp_level.c b/src/ft_warp_level.c
index 3d8a732..4e2a258 100644
--- a/src/ft_warp_level.c
+++ b/src/ft_warp_level.c
@@ -14,6 +14,7 @@
#include <cub3d.h>
#include <stdlib.h>
#include <stdint.h>
+#include <mlx.h>
static void
ft_del_map(t_map *ml)
@@ -46,6 +47,12 @@ static void
cl->plist->dir_y = 0;
cl->plist->plane_x = 0;
cl->plist->plane_y = 0.66666666;
+ 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);
}
int8_t
@@ -60,11 +67,12 @@ int8_t
cl->mlist->nlevel_path) + 1) * sizeof(char))))
return (-1);
ft_sprintf(next_path, "%s", cl->mlist->nlevel_path);
- ft_del_map(cl->mlist);
ft_del_some(cl);
+ ft_del_map(cl->mlist);
if (!(cl->mlist = ft_init_map()))
return (-1);
ft_parse_map(next_path, cl);
+ ft_wall_tex_init(cl);
ft_memdel((void**)&next_path);
}
return (0);