aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_draw_sprite_extra.c
diff options
context:
space:
mode:
authorsalad <salad@saladesk.desktop>2020-03-28 15:50:34 +0100
committersalad <salad@saladesk.desktop>2020-03-28 15:50:34 +0100
commit8fa58fb7a2a363534468ddbb0f0dafe6f577b3fd (patch)
treef0bcd656114d72f0a422c7e9411fad24bf561f3b /src/ft_draw_sprite_extra.c
parent8 still doesnt swap but its cool (diff)
download42-cub3d-8fa58fb7a2a363534468ddbb0f0dafe6f577b3fd.tar.gz
42-cub3d-8fa58fb7a2a363534468ddbb0f0dafe6f577b3fd.tar.bz2
42-cub3d-8fa58fb7a2a363534468ddbb0f0dafe6f577b3fd.tar.xz
42-cub3d-8fa58fb7a2a363534468ddbb0f0dafe6f577b3fd.tar.zst
42-cub3d-8fa58fb7a2a363534468ddbb0f0dafe6f577b3fd.zip
ez
Diffstat (limited to '')
-rw-r--r--src/ft_draw_sprite_extra.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/ft_draw_sprite_extra.c b/src/ft_draw_sprite_extra.c
index da7a37b..4599ff4 100644
--- a/src/ft_draw_sprite_extra.c
+++ b/src/ft_draw_sprite_extra.c
@@ -12,6 +12,7 @@
#include <cub3d.h>
#include <stdint.h>
+#include <stdio.h>
#include <stdlib.h>
void
@@ -71,10 +72,11 @@ void
i = -1;
j = -1;
ft_sort_sprites(cl, -1, -1);
- while (++j < FT_TOTAL_SPRT)
+ while (++j < 9)
{
- while (cl->mlist.st_o[j] != -1 && ++i < cl->mlist.sprite_nbr[j])
+ while (++i < cl->mlist.sprite_nbr[cl->mlist.st_o[j]] && cl->mlist.st_o[j] != -1 )
{
+ /* printf("j : %d tab : [%d]\n", j, cl->mlist.st_o[j]); */
sprite =
cl->sprites[cl->mlist.st_o[j]][cl->mlist.sprite_order[
cl->mlist.st_o[j]][i]];