Fix: removed the t_img texture and left the t_texture instead.

This commit is contained in:
B.Goulard 2024-12-17 17:28:51 +01:00
parent eda859f200
commit 7f1091b721
9 changed files with 35 additions and 40 deletions

View file

@ -6,7 +6,7 @@
/* By: bgoulard <bgoulard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/11/09 01:11:01 by bgoulard #+# #+# */
/* Updated: 2024/12/01 17:24:54 by bgoulard ### ########.fr */
/* Updated: 2024/12/17 17:23:25 by bgoulard ### ########.fr */
/* */
/* ************************************************************************** */
@ -39,17 +39,14 @@ static void cleanup_mlx(t_info *info)
return ;
if (info->win_ptr)
mlx_destroy_window(info->mlx_ptr, info->win_ptr);
while (i < sizeof(info->map.texture_) / sizeof(info->map.texture_[0]))
while (i < sizeof(info->map.texture) / sizeof(info->map.texture[0]))
{
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 - 1].path);
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 - 1].path);
}
i = 0;
while (i < sizeof(info->map.texture) / sizeof(info->map.texture[0]))
if (info->map.texture[i++])
mlx_destroy_image(info->mlx_ptr, info->map.texture[i - 1]);
if (info->camera.screen_buff)
mlx_destroy_image(info->mlx_ptr, info->camera.screen_buff);
mlx_destroy_display(info->mlx_ptr);

View file

@ -6,7 +6,7 @@
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/30 16:30:03 by rparodi #+# #+# */
/* Updated: 2024/12/17 16:55:25 by bgoulard ### ########.fr */
/* Updated: 2024/12/17 17:17:12 by bgoulard ### ########.fr */
/* */
/* ************************************************************************** */
@ -37,9 +37,12 @@ void check_err(t_info *info)
void run_cub3d(t_info *info)
{
info->mlx_ptr = mlx_init();
if (!info->mlx_ptr)
return (sv_errno(info, ERROR_MLX), (void)0);
parse_map(info);
if (init_mlx_env(info) != NO_ERROR)
return (c3_perror(info));
parse_map(info);
if (info->cli_ctx.debug)
ft_putstr_fd("no debug mod on production run", STDERR_FILENO);
if (info->last_error != NO_ERROR)