From 2cff17cc2159f87009d2d4e41e4931155361dd11 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Mon, 6 Apr 2020 14:19:19 +0200 Subject: I think it's fixed --- src/ft_draw_sprite_extra.c | 5 +++++ 1 file changed, 5 insertions(+) (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 00e295e..81b299d 100644 --- a/src/ft_draw_sprite_extra.c +++ b/src/ft_draw_sprite_extra.c @@ -13,6 +13,7 @@ #include #include #include +#include void ft_sprite_h_w(t_cub *cl, t_sprite *sprite) @@ -49,6 +50,7 @@ static void (1 + sprite->transformx / sprite->transformy); } +#include void ft_calc_sprite(t_cub *cl) { @@ -60,6 +62,9 @@ void while (++i < cl->big_t_val) { sprite = cl->sprites[(int8_t)cl->big_t[i][2]][(int32_t)cl->big_t[i][3]]; + if (((cl->plist.pos_x > sprite.s_pos_x - 0.01 && cl->plist.pos_x < sprite.s_pos_x + 0.99) && + (cl->plist.pos_y > sprite.s_pos_y - 0.01 && cl->plist.pos_y < sprite.s_pos_y + 0.99))) + return ; if (sprite.s_pos_x != 0) { sprite.current_sprite = (int8_t)cl->big_t[i][1]; -- cgit v1.2.3