aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_tex_init.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_tex_init.c')
-rw-r--r--src/ft_tex_init.c27
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