diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-01-24 18:52:32 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-01-24 18:52:32 +0100 |
commit | 0e55e163397f2b109321ad284d298e60ee3b97a7 (patch) | |
tree | f30aacccaefc5c063a2a6840f02d2e02bdef6b90 /src/ft_parse_map.c | |
parent | Correct (diff) | |
download | 42-cub3d-0e55e163397f2b109321ad284d298e60ee3b97a7.tar.gz 42-cub3d-0e55e163397f2b109321ad284d298e60ee3b97a7.tar.bz2 42-cub3d-0e55e163397f2b109321ad284d298e60ee3b97a7.tar.xz 42-cub3d-0e55e163397f2b109321ad284d298e60ee3b97a7.tar.zst 42-cub3d-0e55e163397f2b109321ad284d298e60ee3b97a7.zip |
cleaner frees
Diffstat (limited to 'src/ft_parse_map.c')
-rw-r--r-- | src/ft_parse_map.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/ft_parse_map.c b/src/ft_parse_map.c index 011dfcf..d078337 100644 --- a/src/ft_parse_map.c +++ b/src/ft_parse_map.c @@ -14,7 +14,7 @@ ft_check_cub(const char *map_path, t_win *wlist) { ft_dprintf(STDERR_FILENO, "Error\n"); ft_dprintf(STDERR_FILENO, "\033[31;1mMap is not a .cub\033[0m\n"); - ft_free_words(words); + ft_free_words(words, NULL); ft_exit(2, wlist); } i = 0; @@ -24,10 +24,10 @@ ft_check_cub(const char *map_path, t_win *wlist) { ft_dprintf(STDERR_FILENO, "Error\n"); ft_dprintf(STDERR_FILENO, "\033[31;1mMap is not a .cub\033[0m\n"); - ft_free_words(words); + ft_free_words(words, NULL); ft_exit(2, wlist); } - ft_free_words(words); + ft_free_words(words, NULL); } /* @@ -48,7 +48,14 @@ ft_parse_map(const char *map_path, t_win *wlist) ft_exit(2, wlist); } ft_get_res(fd, wlist); - if (ft_get_tex(fd, wlist) < 0 || - ft_get_sprite_tex(fd, wlist) < 0) + if (ft_get_tex(fd, wlist) < 0) return ; + ft_check_empty_line(fd, 6, wlist); + if (ft_get_sprite_tex(fd, wlist) < 0) + return ; + ft_printf("[%s]\n", wlist->clist->no_tex_path); + ft_printf("[%s]\n", wlist->clist->so_tex_path); + ft_printf("[%s]\n", wlist->clist->we_tex_path); + ft_printf("[%s]\n", wlist->clist->ea_tex_path); + ft_printf("[%s]\n", wlist->clist->sprite_path); } |