diff options
author | salaaad2 <arthudurant263@gmail.com> | 2020-03-10 17:46:21 +0100 |
---|---|---|
committer | salaaad2 <arthudurant263@gmail.com> | 2020-03-10 17:46:21 +0100 |
commit | b252f8d58790381d5fbece9748e188d42e769aa5 (patch) | |
tree | 7c677a5bade2d4060cb69e33982742818be68682 /src/ft_draw_sprite_extra.c | |
parent | merge master (diff) | |
download | 42-cub3d-b252f8d58790381d5fbece9748e188d42e769aa5.tar.gz 42-cub3d-b252f8d58790381d5fbece9748e188d42e769aa5.tar.bz2 42-cub3d-b252f8d58790381d5fbece9748e188d42e769aa5.tar.xz 42-cub3d-b252f8d58790381d5fbece9748e188d42e769aa5.tar.zst 42-cub3d-b252f8d58790381d5fbece9748e188d42e769aa5.zip |
2 sprites max ???
Diffstat (limited to '')
-rw-r--r-- | src/ft_draw_sprite_extra.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ft_draw_sprite_extra.c b/src/ft_draw_sprite_extra.c index f3cdf08..45f0dd5 100644 --- a/src/ft_draw_sprite_extra.c +++ b/src/ft_draw_sprite_extra.c @@ -13,6 +13,7 @@ #include <libft.h> #include <cub3d.h> #include <stdint.h> +#include <stdio.h> #include <stdlib.h> #include <math.h> @@ -49,11 +50,13 @@ void i = 0; j = 0; - while (j < cl->mlist.sprite_var) + while (j < 4) { while (i < cl->mlist.sprite_nbr) { sprite = cl->sprites[j][i]; + sprite.current_sprite = (j == 0) ? 4 : j + 7; + printf("%d\n", j); sprite.spritey = sprite.s_pos_x - (cl->plist.pos_x - 0.5); sprite.spritex = sprite.s_pos_y - (cl->plist.pos_y - 0.5); sprite.invdet = 1.0 / (cl->plist.plane_x * cl->plist.dir_y |