diff options
Diffstat (limited to '')
-rw-r--r-- | src/ft_get_sprite.c | 22 |
1 files changed, 11 insertions, 11 deletions
diff --git a/src/ft_get_sprite.c b/src/ft_get_sprite.c index 68c4f75..8e22075 100644 --- a/src/ft_get_sprite.c +++ b/src/ft_get_sprite.c @@ -13,7 +13,7 @@ #include <libft.h> #include <cub3d.h> #include <stdint.h> - +#include <stdio.h> void ft_get_next_sprite(t_cub *clist, int s_n, char c) @@ -28,17 +28,17 @@ void while (clist->mlist.map[y]) { while (clist->mlist.map[y][x]) + { + if (clist->mlist.map[y][x] == c) { - if (clist->mlist.map[y][x] == c) - { - clist->mlist.sprite_nbr++; - clist->sprites[s_n][i].s_pos_x = x; - clist->sprites[s_n][i].s_pos_y = y; - i++; - ft_get_next_sprite(clist, s_n++, c + 1); - } - x++; + clist->mlist.sprite_nbr++; + clist->sprites[s_n][i].s_pos_x = x; + clist->sprites[s_n][i].s_pos_y = y; + i++; + ft_get_next_sprite(clist, s_n++, c + 1); } + x++; + } x = 1; y++; } @@ -65,7 +65,7 @@ void clist->sprites[0][i].s_pos_x = x; clist->sprites[0][i].s_pos_y = y; i++; - ft_get_next_sprite(clist, 1, '3'); + ft_get_next_sprite(clist, 1, '3'); } x++; } |