diff options
Diffstat (limited to 'src/ft_draw_sprite_extra.c')
-rw-r--r-- | src/ft_draw_sprite_extra.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/ft_draw_sprite_extra.c b/src/ft_draw_sprite_extra.c index 287d46f..da7a37b 100644 --- a/src/ft_draw_sprite_extra.c +++ b/src/ft_draw_sprite_extra.c @@ -72,18 +72,18 @@ void j = -1; ft_sort_sprites(cl, -1, -1); while (++j < FT_TOTAL_SPRT) - { - while (++i < cl->mlist.sprite_nbr[j]) - { - sprite = - cl->sprites[cl->mlist.st_o[j]][cl->mlist.sprite_order[ - cl->mlist.st_o[j]][i]]; - sprite.current_sprite = ft_set_current_sprite(cl, 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); - ft_init_sprite(cl, &sprite); - ft_sprite_h_w(cl, &sprite); - ft_draw_sprite(cl, &sprite); + { + while (cl->mlist.st_o[j] != -1 && ++i < cl->mlist.sprite_nbr[j]) + { + sprite = + cl->sprites[cl->mlist.st_o[j]][cl->mlist.sprite_order[ + cl->mlist.st_o[j]][i]]; + sprite.current_sprite = ft_set_current_sprite(cl, 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); + ft_init_sprite(cl, &sprite); + ft_sprite_h_w(cl, &sprite); + ft_draw_sprite(cl, &sprite); } i = -1; } |