From b780107eb1fdf57b65d9bd664613de6835f9b962 Mon Sep 17 00:00:00 2001 From: salaaad2 Date: Mon, 9 Mar 2020 21:11:08 +0100 Subject: small changez, supposed to work, TODO --- src/ft_tex_init.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/ft_tex_init.c') diff --git a/src/ft_tex_init.c b/src/ft_tex_init.c index 38e4c77..9daa20d 100644 --- a/src/ft_tex_init.c +++ b/src/ft_tex_init.c @@ -51,6 +51,10 @@ static void cl->mlist.ce_tex_path, &cl->tlist[7].img_w, &cl->tlist[7].img_h); cl->tlist[7].ptr = mlx_get_data_addr(cl->tlist[7].img, &cl->tlist[7].bpp, &cl->tlist[7].sizeline, &cl->tlist[7].endian); + cl->tlist[8].img = mlx_xpm_file_to_image(cl->wlist.wlx, + cl->mlist.sprite_path, &cl->tlist[4].img_w, &cl->tlist[4].img_h); + cl->tlist[8].ptr = mlx_get_data_addr(cl->tlist[8].img, + &cl->tlist[8].bpp, &cl->tlist[8].sizeline, &cl->tlist[8].endian); } static void -- cgit v1.2.3 From b252f8d58790381d5fbece9748e188d42e769aa5 Mon Sep 17 00:00:00 2001 From: salaaad2 Date: Tue, 10 Mar 2020 17:46:21 +0100 Subject: 2 sprites max ??? --- src/ft_tex_init.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/ft_tex_init.c') diff --git a/src/ft_tex_init.c b/src/ft_tex_init.c index 6c9edce..e27ffbe 100644 --- a/src/ft_tex_init.c +++ b/src/ft_tex_init.c @@ -52,9 +52,13 @@ static void cl->tlist[7].ptr = mlx_get_data_addr(cl->tlist[7].img, &cl->tlist[7].bpp, &cl->tlist[7].sizeline, &cl->tlist[7].endian); cl->tlist[8].img = mlx_xpm_file_to_image(cl->wlist.wlx, - cl->mlist.sprite_path, &cl->tlist[4].img_w, &cl->tlist[4].img_h); + "./media/img/hey.xpm", &cl->tlist[8].img_w, &cl->tlist[8].img_h); cl->tlist[8].ptr = mlx_get_data_addr(cl->tlist[8].img, &cl->tlist[8].bpp, &cl->tlist[8].sizeline, &cl->tlist[8].endian); + cl->tlist[9].img = mlx_xpm_file_to_image(cl->wlist.wlx, + "./media/img/crapaud.xpm", &cl->tlist[9].img_w, &cl->tlist[9].img_h); + cl->tlist[9].ptr = mlx_get_data_addr(cl->tlist[9].img, + &cl->tlist[9].bpp, &cl->tlist[9].sizeline, &cl->tlist[9].endian); } static void -- cgit v1.2.3 From ca5b3689894013365f617cb5513372e6031e8ae7 Mon Sep 17 00:00:00 2001 From: salaaad2 Date: Wed, 11 Mar 2020 20:42:12 +0100 Subject: gang_gang --- src/ft_tex_init.c | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) (limited to 'src/ft_tex_init.c') 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 #include #include +#include #include /* @@ -34,6 +35,28 @@ ** 15 : trap */ +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) { @@ -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 -- cgit v1.2.3 From 176c86dde0c19ffed0d4845003dbcace3f00b9d2 Mon Sep 17 00:00:00 2001 From: salaaad2 Date: Thu, 12 Mar 2020 15:08:06 +0100 Subject: 3 sprites but gns needs work :^) --- src/ft_tex_init.c | 23 +++++++++-------------- 1 file changed, 9 insertions(+), 14 deletions(-) (limited to 'src/ft_tex_init.c') diff --git a/src/ft_tex_init.c b/src/ft_tex_init.c index 1a2ac76..0290a0c 100644 --- a/src/ft_tex_init.c +++ b/src/ft_tex_init.c @@ -41,20 +41,15 @@ static void 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++; - } + cl->tlist[i].img = mlx_xpm_file_to_image(cl->wlist.wlx, + "./media/img/larry.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++; + 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); } static void -- cgit v1.2.3