diff options
Diffstat (limited to '')
-rw-r--r-- | src/ft_get_sprite.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/ft_get_sprite.c b/src/ft_get_sprite.c index 8e22075..a158940 100644 --- a/src/ft_get_sprite.c +++ b/src/ft_get_sprite.c @@ -22,12 +22,12 @@ void size_t y; uint8_t i; - x = 1; - y = 1; + x = 0; + y = 0; i = 0; - while (clist->mlist.map[y]) + while (clist->mlist.map[++y]) { - while (clist->mlist.map[y][x]) + while (clist->mlist.map[y][++x]) { if (clist->mlist.map[y][x] == c) { @@ -35,14 +35,15 @@ void 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++; + x = 0; + } + if (clist->sprites[s_n][i - 1].s_pos_x != 0) + { + ft_get_next_sprite(clist, s_n + 1, c + 1); + clist->mlist.sprite_var++; } - clist->mlist.sprite_var += (clist->sprites[s_n][i].s_pos_x != 0); } void |