aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_draw_sprite.c
diff options
context:
space:
mode:
authorsalaaad2 <arthudurant263@gmail.com>2020-03-18 21:59:03 +0100
committersalaaad2 <arthudurant263@gmail.com>2020-03-18 21:59:03 +0100
commit8c841c8fcacf3316676daf0aa63ebef408027b70 (patch)
treee7130694eeed7b852b65dbf3fa89bd588ba38e34 /src/ft_draw_sprite.c
parentcangelog (diff)
download42-cub3d-8c841c8fcacf3316676daf0aa63ebef408027b70.tar.gz
42-cub3d-8c841c8fcacf3316676daf0aa63ebef408027b70.tar.bz2
42-cub3d-8c841c8fcacf3316676daf0aa63ebef408027b70.tar.xz
42-cub3d-8c841c8fcacf3316676daf0aa63ebef408027b70.tar.zst
42-cub3d-8c841c8fcacf3316676daf0aa63ebef408027b70.zip
fatfingers 2
Diffstat (limited to 'src/ft_draw_sprite.c')
-rw-r--r--src/ft_draw_sprite.c24
1 files changed, 16 insertions, 8 deletions
diff --git a/src/ft_draw_sprite.c b/src/ft_draw_sprite.c
index 66d69e5..d0447f6 100644
--- a/src/ft_draw_sprite.c
+++ b/src/ft_draw_sprite.c
@@ -33,7 +33,7 @@ static void
tmp = cl->mlist.sprite_order[j][it];
cl->mlist.sprite_order[j][it] = cl->mlist.sprite_order[j][it + 1];
cl->mlist.sprite_order[j][it + 1] = tmp;
- it = 0;
+ *i = 0;
}
}
@@ -46,9 +46,9 @@ void
it = -1;
jt = -1;
- while (++jt < cl->mlist.sprite_var)
+ while (++jt <= cl->mlist.sprite_var)
{
- while (++it < cl->mlist.sprite_nbr)
+ while (++it <= cl->mlist.sprite_nbr)
{
dist_tab[jt][it] =
((cl->plist.pos_x - cl->sprites[jt][it].s_pos_x) *
@@ -59,11 +59,19 @@ void
}
it = -1;
}
- it = -1;
- jt = -1;
- while (++jt < cl->mlist.sprite_var)
- while (++it < cl->mlist.sprite_nbr)
- ft_sort_sprites_norme(dist_tab[jt], &it, jt, cl);
+ it = 0;
+ jt = 0;
+ while (jt < 3)
+ {
+ while (it < 6)
+ {
+ ft_sort_sprites_norme(dist_tab[jt], &it, jt, cl);
+ printf("%d\n", jt);
+ it++;
+ }
+ it = 0;
+ jt++;
+ }
}
static void