diff options
author | Rudy Bousset <rbousset@z2r4p3.le-101.fr> | 2020-02-24 19:08:03 +0100 |
---|---|---|
committer | Rudy Bousset <rbousset@z2r4p3.le-101.fr> | 2020-02-24 19:08:03 +0100 |
commit | 7b7d5343c6042ce90ed213e967c34a07875e2e85 (patch) | |
tree | 0943f8592c6d480a85099750dbbd6b9b045e66eb /src/ft_get_sprite.c | |
parent | Bug fix, 1px bug is back (diff) | |
parent | oy (diff) | |
download | 42-cub3d-7b7d5343c6042ce90ed213e967c34a07875e2e85.tar.gz 42-cub3d-7b7d5343c6042ce90ed213e967c34a07875e2e85.tar.bz2 42-cub3d-7b7d5343c6042ce90ed213e967c34a07875e2e85.tar.xz 42-cub3d-7b7d5343c6042ce90ed213e967c34a07875e2e85.tar.zst 42-cub3d-7b7d5343c6042ce90ed213e967c34a07875e2e85.zip |
Merge branch 'sprites'
Diffstat (limited to '')
-rw-r--r-- | src/ft_get_sprite.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/src/ft_get_sprite.c b/src/ft_get_sprite.c index 43de290..806489f 100644 --- a/src/ft_get_sprite.c +++ b/src/ft_get_sprite.c @@ -17,8 +17,26 @@ void ft_get_sprite_spawn(t_cub *clist) { + size_t x; + size_t y; - (void)clist; + x = 1; + y = 1; + while (clist->mlist->map[y]) + { + while (clist->mlist->map[y][x]) + { + if (ft_ischarset("2", clist->mlist->map[y][x])) + { + clist->sp_list.s_pos_x = x + 0.5; + clist->sp_list.s_pos_y = y + 0.5; + return ; + } + x++; + } + x = 1; + y++; + } } int8_t |