From 176c86dde0c19ffed0d4845003dbcace3f00b9d2 Mon Sep 17 00:00:00 2001 From: salaaad2 Date: Thu, 12 Mar 2020 15:08:06 +0100 Subject: 3 sprites but gns needs work :^) --- src/ft_get_sprite.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) (limited to 'src/ft_get_sprite.c') 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 #include #include - +#include 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++; } -- cgit v1.2.3