mirror of
https://codeberg.org/ACME-Corporation/cub3d.git
synced 2025-12-06 09:58:09 +01:00
feat: made sprites be placed in map file
This commit is contained in:
parent
04705fe9e5
commit
09ff569a31
3 changed files with 64 additions and 5 deletions
|
|
@ -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++;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue