aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_draw_sprite_extra.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-03-29 17:38:46 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-03-29 17:38:46 +0200
commita07392fc219afc45000201d2f495694ad9b82763 (patch)
tree0eb3f2b9003ad7ceae4692242e46de56e55053b0 /src/ft_draw_sprite_extra.c
parentRemoved skybox shit (diff)
parentNorm (diff)
download42-cub3d-a07392fc219afc45000201d2f495694ad9b82763.tar.gz
42-cub3d-a07392fc219afc45000201d2f495694ad9b82763.tar.bz2
42-cub3d-a07392fc219afc45000201d2f495694ad9b82763.tar.xz
42-cub3d-a07392fc219afc45000201d2f495694ad9b82763.tar.zst
42-cub3d-a07392fc219afc45000201d2f495694ad9b82763.zip
Merge branch 'fix-details'
Diffstat (limited to 'src/ft_draw_sprite_extra.c')
-rw-r--r--src/ft_draw_sprite_extra.c25
1 files changed, 10 insertions, 15 deletions
diff --git a/src/ft_draw_sprite_extra.c b/src/ft_draw_sprite_extra.c
index 0830d2c..c201566 100644
--- a/src/ft_draw_sprite_extra.c
+++ b/src/ft_draw_sprite_extra.c
@@ -51,26 +51,21 @@ void
ft_calc_sprite(t_cub *cl)
{
t_sprite sprite;
- int32_t i;
- int32_t j;
+ int16_t i;
+ int8_t j;
i = -1;
j = -1;
ft_sort_sprites(cl, -1, -1);
- while (++j < cl->mlist.sprite_var)
+ while (++j < cl->big_t_val)
{
- while (++i < cl->mlist.sprite_nbr[j])
- {
- sprite = cl->sprites[cl->mlist.st_o[j]][cl->mlist.sprite_order[cl->mlist
- .st_o[j]][i]];
- sprite.current_sprite = (cl->mlist.st_o[j] == 0) ?
- 4 : cl->mlist.st_o[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);
- ft_init_sprite(cl, &sprite);
- ft_sprite_h_w(cl, &sprite);
- ft_draw_sprite(cl, &sprite);
- }
+ sprite = cl->sprites[(int8_t)cl->big_t[j][2]][(int32_t)cl->big_t[j][3]];
+ sprite.current_sprite = (int8_t)cl->big_t[j][1];
+ sprite.spritey = sprite.s_pos_x - (cl->plist.pos_x - 0.5);
+ sprite.spritex = sprite.s_pos_y - (cl->plist.pos_y - 0.5);
+ ft_init_sprite(cl, &sprite);
+ ft_sprite_h_w(cl, &sprite);
+ ft_draw_sprite(cl, &sprite);
i = -1;
}
}