aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--map/lvl_one.cub4
-rw-r--r--src/ft_exit.c2
-rw-r--r--src/ft_warp_level.c10
3 files changed, 13 insertions, 3 deletions
diff --git a/map/lvl_one.cub b/map/lvl_one.cub
index ecc6955..8ded9bd 100644
--- a/map/lvl_one.cub
+++ b/map/lvl_one.cub
@@ -13,7 +13,7 @@ L ./map/lvl_two.cub
LT ./media/img/crapaud.xpm
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
+1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 L 0 0 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1
-1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 0 0 1
-1 E 0 0 0 L 0 0 0 0 0 0 0 0 0 0 0 0 1
+1 E 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 1
1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1 1
diff --git a/src/ft_exit.c b/src/ft_exit.c
index 83e4b2e..6457191 100644
--- a/src/ft_exit.c
+++ b/src/ft_exit.c
@@ -48,6 +48,8 @@ int
mlx_destroy_image(clist->wlist->wlx, clist->tlist[2].img);
mlx_destroy_image(clist->wlist->wlx, clist->tlist[3].img);
mlx_destroy_image(clist->wlist->wlx, clist->tlist[4].img);
+ if (clist->mlist->isnlvl)
+ mlx_destroy_image(clist->wlist->wlx, clist->tlist[5].img);
mlx_destroy_window(clist->wlist->wlx, clist->wlist->winptr);
}
ft_free_lists(clist);
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);