diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-02-28 22:52:40 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-02-28 22:52:40 +0100 |
commit | 50f1133b795a6f353b8dc53cdbe90ae0441e1513 (patch) | |
tree | fea13753ab7c3fdcaac23b2b55ef7a347b7a959e | |
parent | Added useful comment (diff) | |
download | 42-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
-rw-r--r-- | map/lvl_one.cub | 4 | ||||
-rw-r--r-- | src/ft_exit.c | 2 | ||||
-rw-r--r-- | src/ft_warp_level.c | 10 |
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); |