diff options
author | salaaad2 <arthurdurant263@gmail.com> | 2020-03-12 16:26:46 +0100 |
---|---|---|
committer | salaaad2 <arthurdurant263@gmail.com> | 2020-03-12 16:26:46 +0100 |
commit | 71d55e5448007f90239a65279d8dbb07ee7b092a (patch) | |
tree | 74f7a60d4b44056424953ddce74fc2a5bbb6d509 /src/ft_get_sprite.c | |
parent | 3 sprites but gns needs work :^) (diff) | |
download | 42-cub3d-71d55e5448007f90239a65279d8dbb07ee7b092a.tar.gz 42-cub3d-71d55e5448007f90239a65279d8dbb07ee7b092a.tar.bz2 42-cub3d-71d55e5448007f90239a65279d8dbb07ee7b092a.tar.xz 42-cub3d-71d55e5448007f90239a65279d8dbb07ee7b092a.tar.zst 42-cub3d-71d55e5448007f90239a65279d8dbb07ee7b092a.zip |
NORMED AND FIXED .......!!!
Diffstat (limited to 'src/ft_get_sprite.c')
-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 |