diff options
Diffstat (limited to 'src/ft_draw_sprite_extra.c')
-rw-r--r-- | src/ft_draw_sprite_extra.c | 25 |
1 files changed, 10 insertions, 15 deletions
diff --git a/src/ft_draw_sprite_extra.c b/src/ft_draw_sprite_extra.c index 0830d2c..c201566 100644 --- a/src/ft_draw_sprite_extra.c +++ b/src/ft_draw_sprite_extra.c @@ -51,26 +51,21 @@ void ft_calc_sprite(t_cub *cl) { t_sprite sprite; - int32_t i; - int32_t j; + int16_t i; + int8_t j; i = -1; j = -1; ft_sort_sprites(cl, -1, -1); - while (++j < cl->mlist.sprite_var) + while (++j < cl->big_t_val) { - 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 = (cl->mlist.st_o[j] == 0) ? - 4 : cl->mlist.st_o[j] + 7; - 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); - } + 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; } } |