aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_draw_sprite.c
diff options
context:
space:
mode:
authorsalaaad2 <arthurdurant263@gmail.com>2020-03-09 21:03:16 +0100
committersalaaad2 <arthurdurant263@gmail.com>2020-03-09 21:03:16 +0100
commit02955219fd0a1bd42e3009f77911f5f258d59d34 (patch)
treef7e3921630702db9aa3465e17e7cb3837d3a38e4 /src/ft_draw_sprite.c
parentgang_2 (diff)
download42-cub3d-02955219fd0a1bd42e3009f77911f5f258d59d34.tar.gz
42-cub3d-02955219fd0a1bd42e3009f77911f5f258d59d34.tar.bz2
42-cub3d-02955219fd0a1bd42e3009f77911f5f258d59d34.tar.xz
42-cub3d-02955219fd0a1bd42e3009f77911f5f258d59d34.tar.zst
42-cub3d-02955219fd0a1bd42e3009f77911f5f258d59d34.zip
get next sprite
Diffstat (limited to 'src/ft_draw_sprite.c')
-rw-r--r--src/ft_draw_sprite.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/ft_draw_sprite.c b/src/ft_draw_sprite.c
index faeec2b..fcb2166 100644
--- a/src/ft_draw_sprite.c
+++ b/src/ft_draw_sprite.c
@@ -43,10 +43,10 @@ void
it = 0;
while (it < cl->mlist.sprite_nbr)
{
- dist_tab[it] = ((cl->plist.pos_x - cl->sprites[it].s_pos_x) *
- (cl->plist.pos_x - cl->sprites[it].s_pos_x) +
- (cl->plist.pos_y - cl->sprites[it].s_pos_y) *
- (cl->plist.pos_y - cl->sprites[it].s_pos_y));
+ dist_tab[it] = ((cl->plist.pos_x - cl->sprites[0][it].s_pos_x) *
+ (cl->plist.pos_x - cl->sprites[0][it].s_pos_x) +
+ (cl->plist.pos_y - cl->sprites[0][it].s_pos_y) *
+ (cl->plist.pos_y - cl->sprites[0][it].s_pos_y));
cl->mlist.sprite_order[it] = it;
it++;
}