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_draw_sprite_extra.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/ft_draw_sprite_extra.c') diff --git a/src/ft_draw_sprite_extra.c b/src/ft_draw_sprite_extra.c index f3cdf08..45f0dd5 100644 --- a/src/ft_draw_sprite_extra.c +++ b/src/ft_draw_sprite_extra.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include @@ -49,11 +50,13 @@ void i = 0; j = 0; - while (j < cl->mlist.sprite_var) + while (j < 4) { while (i < cl->mlist.sprite_nbr) { sprite = cl->sprites[j][i]; + sprite.current_sprite = (j == 0) ? 4 : j + 7; + printf("%d\n", j); sprite.spritey = sprite.s_pos_x - (cl->plist.pos_x - 0.5); sprite.spritex = sprite.s_pos_y - (cl->plist.pos_y - 0.5); sprite.invdet = 1.0 / (cl->plist.plane_x * cl->plist.dir_y -- cgit v1.2.3