feat: advancement on map parse

This commit is contained in:
B.Goulard 2024-11-18 17:25:27 +01:00
parent 7321db26d9
commit d586acba8f
11 changed files with 257 additions and 123 deletions

View file

@ -6,7 +6,7 @@
/* By: bgoulard <bgoulard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/11/09 01:11:01 by bgoulard #+# #+# */
/* Updated: 2024/11/12 11:06:44 by bgoulard ### ########.fr */
/* Updated: 2024/11/18 17:14:06 by bgoulard ### ########.fr */
/* */
/* ************************************************************************** */
@ -26,16 +26,25 @@ static void cleanup_map(t_map *map)
(close(map->fd), map->fd = 0);
if (map->fraw)
(ft_free_2d((void **)map->fraw), map->fraw = NULL);
if (map->map)
ft_free((void **)&map->map);
}
static void cleanup_mlx(t_info *info)
{
if (info->mlx_ptr && info->win_ptr)
if (!info->mlx_ptr)
return ;
if (info->win_ptr)
mlx_destroy_window(info->mlx_ptr, info->win_ptr);
if (info->mlx_ptr)
mlx_destroy_display(info->mlx_ptr);
if (info->mlx_ptr)
ft_free((void **)&info->mlx_ptr);
for (int i = 0; i < 4; i++)
{
if (info->map.texture[i].img)
mlx_destroy_image(info->mlx_ptr, info->map.texture[i].img);
if (info->map.texture[i].path)
ft_free((void **)&info->map.texture[i].path);
}
mlx_destroy_display(info->mlx_ptr);
ft_free((void **)&info->mlx_ptr);
}
void cleanup_info(t_info *info)