aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_draw_sprite_extra.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/ft_draw_sprite_extra.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/ft_draw_sprite_extra.c b/src/ft_draw_sprite_extra.c
index c9b8b16..d85540d 100644
--- a/src/ft_draw_sprite_extra.c
+++ b/src/ft_draw_sprite_extra.c
@@ -52,21 +52,21 @@ void
ft_calc_sprite(t_cub *cl)
{
t_sprite sprite;
- int16_t i;
- int8_t j;
+ int8_t i;
i = -1;
- j = -1;
ft_sort_sprites(cl, -1, -1);
- while (++j < cl->big_t_val)
+ while (++i < cl->big_t_val)
{
- sprite = cl->sprites[(int8_t)cl->big_t[j][2]][(int32_t)cl->big_t[j][3]];
- sprite.current_sprite = (int8_t)cl->big_t[j][1];
- sprite.spritey = sprite.s_pos_x - (cl->plist.pos_x - 0.5);
- sprite.spritex = sprite.s_pos_y - (cl->plist.pos_y - 0.5);
- ft_init_sprite(cl, &sprite);
- ft_sprite_h_w(cl, &sprite);
- ft_draw_sprite(cl, &sprite);
- i = -1;
+ sprite = cl->sprites[(int8_t)cl->big_t[i][2]][(int32_t)cl->big_t[i][3]];
+ if (sprite.s_pos_x != 0)
+ {
+ sprite.current_sprite = (int8_t)cl->big_t[i][1];
+ sprite.spritey = sprite.s_pos_x - (cl->plist.pos_x - 0.5);
+ sprite.spritex = sprite.s_pos_y - (cl->plist.pos_y - 0.5);
+ ft_init_sprite(cl, &sprite);
+ ft_sprite_h_w(cl, &sprite);
+ ft_draw_sprite(cl, &sprite);
+ }
}
}