diff options
author | salaaad2 <arthurdurant263@gmail.com> | 2020-03-11 20:42:12 +0100 |
---|---|---|
committer | salaaad2 <arthurdurant263@gmail.com> | 2020-03-11 20:42:12 +0100 |
commit | ca5b3689894013365f617cb5513372e6031e8ae7 (patch) | |
tree | 76fcd88c754cb29aaab3597eacc68b68eec15343 /src/ft_tex_init.c | |
parent | get merged (diff) | |
download | 42-cub3d-ca5b3689894013365f617cb5513372e6031e8ae7.tar.gz 42-cub3d-ca5b3689894013365f617cb5513372e6031e8ae7.tar.bz2 42-cub3d-ca5b3689894013365f617cb5513372e6031e8ae7.tar.xz 42-cub3d-ca5b3689894013365f617cb5513372e6031e8ae7.tar.zst 42-cub3d-ca5b3689894013365f617cb5513372e6031e8ae7.zip |
gang_gang
Diffstat (limited to 'src/ft_tex_init.c')
-rw-r--r-- | src/ft_tex_init.c | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/ft_tex_init.c b/src/ft_tex_init.c index 30b738e..1a2ac76 100644 --- a/src/ft_tex_init.c +++ b/src/ft_tex_init.c @@ -13,6 +13,7 @@ #include <libft.h> #include <cub3d.h> #include <stdint.h> +#include <stdio.h> #include <mlx.h> /* @@ -35,6 +36,28 @@ */ static void + ft_next_sprite_init(t_cub *cl) +{ + uint16_t i; + + i = 8; + while (i < cl->mlist.sprite_var + 7) + { + cl->tlist[i].img = mlx_xpm_file_to_image(cl->wlist.wlx, + "./media/img/hey.xpm", &cl->tlist[i].img_w, &cl->tlist[i].img_h); + cl->tlist[i].ptr = mlx_get_data_addr(cl->tlist[i].img, + &cl->tlist[i].bpp, &cl->tlist[i].sizeline, &cl->tlist[i].endian); + i++; + printf("%d\n", i ); + cl->tlist[i].img = mlx_xpm_file_to_image(cl->wlist.wlx, + "./media/img/crapaud.xpm", &cl->tlist[i].img_w, &cl->tlist[i].img_h); + cl->tlist[i].ptr = mlx_get_data_addr(cl->tlist[i].img, + &cl->tlist[i].bpp, &cl->tlist[i].sizeline, &cl->tlist[i].endian); + i++; + } +} + +static void ft_wall_tex_init_norme_bis(t_cub *cl) { if (cl->mlist.isctex) @@ -52,6 +75,10 @@ static void &cl->tlist[7].bpp, &cl->tlist[7].sizeline, &cl->tlist[7].endian); } cl->walltexgood = 1; + if (cl->mlist.sprite_var > 1) + { + ft_next_sprite_init(cl); + } } static void |