aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_get_sprite.c
diff options
context:
space:
mode:
authorsalaaad2 <arthudurant263@gmail.com>2020-03-06 18:40:56 +0100
committersalaaad2 <arthudurant263@gmail.com>2020-03-06 18:40:56 +0100
commit04658c5e9a019917c3f8ffeb84562c328da0a885 (patch)
tree5a57411c8968aa57f4827aade5f1640fb68124fe /src/ft_get_sprite.c
parentfuck (diff)
download42-cub3d-04658c5e9a019917c3f8ffeb84562c328da0a885.tar.gz
42-cub3d-04658c5e9a019917c3f8ffeb84562c328da0a885.tar.bz2
42-cub3d-04658c5e9a019917c3f8ffeb84562c328da0a885.tar.xz
42-cub3d-04658c5e9a019917c3f8ffeb84562c328da0a885.tar.zst
42-cub3d-04658c5e9a019917c3f8ffeb84562c328da0a885.zip
ils se cachent (mal)
Diffstat (limited to '')
-rw-r--r--src/ft_get_sprite.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/ft_get_sprite.c b/src/ft_get_sprite.c
index 5f9a0bc..84feeff 100644
--- a/src/ft_get_sprite.c
+++ b/src/ft_get_sprite.c
@@ -19,18 +19,21 @@ void
{
size_t x;
size_t y;
+ uint8_t i;
x = 1;
y = 1;
+ i = 0;
while (clist->mlist->map[y])
{
while (clist->mlist->map[y][x])
{
if (ft_ischarset("2", clist->mlist->map[y][x]))
{
- clist->sprites.spritex = x;
- clist->sprites.spritey = y;
- return ;
+ clist->mlist->sprite_nbr++;
+ clist->sprites[i].s_pos_x = x;
+ clist->sprites[i].s_pos_y = y;
+ i++;
}
x++;
}