aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_draw_sprite_extra.c
diff options
context:
space:
mode:
authorsalaaad2 <arthudurant263@gmail.com>2020-03-16 18:57:40 +0100
committersalaaad2 <arthudurant263@gmail.com>2020-03-16 18:57:40 +0100
commit575990647d8ee677ff9515ecb0c17da9fe66312f (patch)
tree786ae284e2d9a22499d1ac013b2b0377df9bfe23 /src/ft_draw_sprite_extra.c
parentSuppressed most valgrind errors, one remaining (diff)
download42-cub3d-575990647d8ee677ff9515ecb0c17da9fe66312f.tar.gz
42-cub3d-575990647d8ee677ff9515ecb0c17da9fe66312f.tar.bz2
42-cub3d-575990647d8ee677ff9515ecb0c17da9fe66312f.tar.xz
42-cub3d-575990647d8ee677ff9515ecb0c17da9fe66312f.tar.zst
42-cub3d-575990647d8ee677ff9515ecb0c17da9fe66312f.zip
fatfingered solution to the sprites problem, changes needed
Diffstat (limited to 'src/ft_draw_sprite_extra.c')
-rw-r--r--src/ft_draw_sprite_extra.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/ft_draw_sprite_extra.c b/src/ft_draw_sprite_extra.c
index 2545ec0..696bdff 100644
--- a/src/ft_draw_sprite_extra.c
+++ b/src/ft_draw_sprite_extra.c
@@ -63,11 +63,12 @@ void
i = 0;
j = 0;
+ ft_sort_sprites(cl);
while (j < cl->mlist.sprite_var)
{
while (i < cl->mlist.sprite_nbr)
{
- sprite = cl->sprites[j][i];
+ sprite = cl->sprites[j][cl->mlist.sprite_order[i]];
sprite.current_sprite = (j == 0) ? 4 : 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);