diff options
author | salad <salad@saladesk.desktop> | 2020-03-25 16:38:34 +0100 |
---|---|---|
committer | salad <salad@saladesk.desktop> | 2020-03-25 16:38:34 +0100 |
commit | fb50b38dbffc812297b1d3980a19ecff070fda4a (patch) | |
tree | d69e99b39c1aaac0ddafd8c6f61ff8940fdea4ef /src/ft_draw_sprite_extra.c | |
parent | norme, TODO: liks (diff) | |
download | 42-cub3d-fb50b38dbffc812297b1d3980a19ecff070fda4a.tar.gz 42-cub3d-fb50b38dbffc812297b1d3980a19ecff070fda4a.tar.bz2 42-cub3d-fb50b38dbffc812297b1d3980a19ecff070fda4a.tar.xz 42-cub3d-fb50b38dbffc812297b1d3980a19ecff070fda4a.tar.zst 42-cub3d-fb50b38dbffc812297b1d3980a19ecff070fda4a.zip |
pourquoi se priver de stack
Diffstat (limited to 'src/ft_draw_sprite_extra.c')
-rw-r--r-- | src/ft_draw_sprite_extra.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/ft_draw_sprite_extra.c b/src/ft_draw_sprite_extra.c index 6503980..0830d2c 100644 --- a/src/ft_draw_sprite_extra.c +++ b/src/ft_draw_sprite_extra.c @@ -54,23 +54,23 @@ void int32_t i; int32_t j; - i = 0; - j = 0; + i = -1; + j = -1; ft_sort_sprites(cl, -1, -1); - while (j < cl->mlist.sprite_var) + while (++j < cl->mlist.sprite_var) { - while (i < cl->mlist.sprite_nbr[j]) + 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 = 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); - i++; } - i = 0; - j++; + i = -1; } } |