diff options
author | salaaad2 <arthurdurant263@gmail.com> | 2020-03-12 15:08:06 +0100 |
---|---|---|
committer | salaaad2 <arthurdurant263@gmail.com> | 2020-03-12 15:08:06 +0100 |
commit | 176c86dde0c19ffed0d4845003dbcace3f00b9d2 (patch) | |
tree | 516524a2d00ec35f223de73a6c1c852a53ee858d /src/ft_get_sprite.c | |
parent | gang_gang (diff) | |
download | 42-cub3d-176c86dde0c19ffed0d4845003dbcace3f00b9d2.tar.gz 42-cub3d-176c86dde0c19ffed0d4845003dbcace3f00b9d2.tar.bz2 42-cub3d-176c86dde0c19ffed0d4845003dbcace3f00b9d2.tar.xz 42-cub3d-176c86dde0c19ffed0d4845003dbcace3f00b9d2.tar.zst 42-cub3d-176c86dde0c19ffed0d4845003dbcace3f00b9d2.zip |
3 sprites but gns needs work :^)
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++; } |