feat: made sprites be placed in map file

This commit is contained in:
Theo Champion 2025-08-12 15:41:42 +02:00
parent 04705fe9e5
commit 09ff569a31
3 changed files with 64 additions and 5 deletions

View file

@ -6,7 +6,7 @@
/* By: tchampio <tchampio@student.42lehavre.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/08/11 12:04:26 by tchampio #+# #+# */
/* Updated: 2025/08/12 13:44:52 by tchampio ### ########.fr */
/* Updated: 2025/08/12 15:39:30 by tchampio ### ########.fr */
/* */
/* ************************************************************************** */
@ -35,6 +35,11 @@ void destroy_sprites(t_cub3d_data *data)
int sprite;
sprite = 0;
while (sprite < MAX_SPRITES)
free(data->sprite_list[sprite++]);
while (data->sprite_list[sprite] && sprite < MAX_SPRITES)
{
mlx_destroy_image(data->mlx, data->sprite_list[sprite]->image->img);
free(data->sprite_list[sprite]->image);
free(data->sprite_list[sprite]);
sprite++;
}
}