diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-22 23:42:05 +0100 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-03-22 23:42:05 +0100 |
commit | 1e84a8792302f0446e8eb838f478b4a6564d1011 (patch) | |
tree | 1968ab8d402596dc710afa4cf70335687e64637b /src/ft_tex_sprites_extra_init.c | |
parent | Cleaner (diff) | |
download | 42-cub3d-1e84a8792302f0446e8eb838f478b4a6564d1011.tar.gz 42-cub3d-1e84a8792302f0446e8eb838f478b4a6564d1011.tar.bz2 42-cub3d-1e84a8792302f0446e8eb838f478b4a6564d1011.tar.xz 42-cub3d-1e84a8792302f0446e8eb838f478b4a6564d1011.tar.zst 42-cub3d-1e84a8792302f0446e8eb838f478b4a6564d1011.zip |
I think we good
Diffstat (limited to '')
-rw-r--r-- | src/ft_tex_sprites_extra_init.c | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/src/ft_tex_sprites_extra_init.c b/src/ft_tex_sprites_extra_init.c new file mode 100644 index 0000000..9ff7612 --- /dev/null +++ b/src/ft_tex_sprites_extra_init.c @@ -0,0 +1,35 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* ft_tex_sprites_extra_init.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: fmoenne- <marvin@42.fr> +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/14 17:43:55 by fmoenne- #+# #+# */ +/* Updated: 2020/02/14 17:43:56 by fmoenne- ### ########lyon.fr */ +/* */ +/* ************************************************************************** */ + +#include <libft.h> +#include <cub3d.h> +#include <stdint.h> +#include <mlx.h> + +void + ft_next_sprite_init(t_cub *cl) +{ + uint8_t i; + + i = 1; + while (cl->mlist.sprite_path[i][0]) + { + cl->tlist[i + 7].img = mlx_xpm_file_to_image(cl->wlist.wlx, + cl->mlist.sprite_path[i], &cl->tlist[i + 7].img_w, + &cl->tlist[i + 7].img_h); + cl->tlist[i + 7].ptr = mlx_get_data_addr(cl->tlist[i + 7].img, + &cl->tlist[i + 7].bpp, &cl->tlist[i + 7].sizeline, + &cl->tlist[i + 7].endian); + i++; + } + cl->mlist.topsp = i + 1; +} |