aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-02-28 22:52:40 +0100
committerJozanLeClerc <bousset.rudy@gmail.com>2020-02-28 22:52:40 +0100
commit50f1133b795a6f353b8dc53cdbe90ae0441e1513 (patch)
treefea13753ab7c3fdcaac23b2b55ef7a347b7a959e /src
parentAdded useful comment (diff)
download42-cub3d-50f1133b795a6f353b8dc53cdbe90ae0441e1513.tar.gz
42-cub3d-50f1133b795a6f353b8dc53cdbe90ae0441e1513.tar.bz2
42-cub3d-50f1133b795a6f353b8dc53cdbe90ae0441e1513.tar.xz
42-cub3d-50f1133b795a6f353b8dc53cdbe90ae0441e1513.tar.zst
42-cub3d-50f1133b795a6f353b8dc53cdbe90ae0441e1513.zip
All works but one thing is not ok
Diffstat (limited to '')
-rw-r--r--src/ft_exit.c2
-rw-r--r--src/ft_warp_level.c10
2 files changed, 11 insertions, 1 deletions
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);