diff options
author | salaaad2 <arthurdurant263@gmail.com> | 2020-03-12 15:08:06 +0100 |
---|---|---|
committer | salaaad2 <arthurdurant263@gmail.com> | 2020-03-12 15:08:06 +0100 |
commit | 176c86dde0c19ffed0d4845003dbcace3f00b9d2 (patch) | |
tree | 516524a2d00ec35f223de73a6c1c852a53ee858d /src/ft_draw_sprite.c | |
parent | gang_gang (diff) | |
download | 42-cub3d-176c86dde0c19ffed0d4845003dbcace3f00b9d2.tar.gz 42-cub3d-176c86dde0c19ffed0d4845003dbcace3f00b9d2.tar.bz2 42-cub3d-176c86dde0c19ffed0d4845003dbcace3f00b9d2.tar.xz 42-cub3d-176c86dde0c19ffed0d4845003dbcace3f00b9d2.tar.zst 42-cub3d-176c86dde0c19ffed0d4845003dbcace3f00b9d2.zip |
3 sprites but gns needs work :^)
Diffstat (limited to 'src/ft_draw_sprite.c')
-rw-r--r-- | src/ft_draw_sprite.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/ft_draw_sprite.c b/src/ft_draw_sprite.c index fbe7961..effaf78 100644 --- a/src/ft_draw_sprite.c +++ b/src/ft_draw_sprite.c @@ -43,20 +43,20 @@ void it = 0; jt = 0; - while (jt < cl->mlist.sprite_var) - { - while (it < cl->mlist.sprite_nbr) + while (jt < cl->mlist.sprite_var) { - dist_tab[it] = ((cl->plist.pos_x - cl->sprites[jt][it].s_pos_x) * - (cl->plist.pos_x - cl->sprites[jt][it].s_pos_x) + - (cl->plist.pos_y - cl->sprites[jt][it].s_pos_y) * - (cl->plist.pos_y - cl->sprites[jt][it].s_pos_y)); - cl->mlist.sprite_order[it] = it; - it++; + while (it < cl->mlist.sprite_nbr) + { + dist_tab[it] = ((cl->plist.pos_x - cl->sprites[jt][it].s_pos_x) * + (cl->plist.pos_x - cl->sprites[jt][it].s_pos_x) + + (cl->plist.pos_y - cl->sprites[jt][it].s_pos_y) * + (cl->plist.pos_y - cl->sprites[jt][it].s_pos_y)); + cl->mlist.sprite_order[it] = it; + it++; + } + it = 0; + jt++; } - it = 0; - jt++; - } it = 0; while (it < cl->mlist.sprite_nbr) { |