diff options
author | Rudy Bousset <rbousset@z2r5p2.le-101.fr> | 2020-02-28 19:22:58 +0100 |
---|---|---|
committer | Rudy Bousset <rbousset@z2r5p2.le-101.fr> | 2020-02-28 19:22:58 +0100 |
commit | 36e4ca1eeffa78d57767fced53fd16df17d75373 (patch) | |
tree | fcfc0dcfb5b39c7b026d577194f10f34fa3f3771 /src/ft_draw_textures.c | |
parent | Parsed (diff) | |
download | 42-cub3d-36e4ca1eeffa78d57767fced53fd16df17d75373.tar.gz 42-cub3d-36e4ca1eeffa78d57767fced53fd16df17d75373.tar.bz2 42-cub3d-36e4ca1eeffa78d57767fced53fd16df17d75373.tar.xz 42-cub3d-36e4ca1eeffa78d57767fced53fd16df17d75373.tar.zst 42-cub3d-36e4ca1eeffa78d57767fced53fd16df17d75373.zip |
L is now crapaud and you can pass through :^)
Diffstat (limited to 'src/ft_draw_textures.c')
-rw-r--r-- | src/ft_draw_textures.c | 21 |
1 files changed, 14 insertions, 7 deletions
diff --git a/src/ft_draw_textures.c b/src/ft_draw_textures.c index 598fd91..d632182 100644 --- a/src/ft_draw_textures.c +++ b/src/ft_draw_textures.c @@ -38,12 +38,19 @@ void ft_draw_texture(t_cub *cl, int x, int y, int tex_y) void ft_choose_tex(t_cub *clist) { - if (clist->rlist.side == 0 && clist->rlist.x_ray_dir < 0) - clist->w_side = 1; - else if (clist->rlist.side == 0 && clist->rlist.x_ray_dir > 0) - clist->w_side = 0; - else if (clist->rlist.side == 1 && clist->rlist.y_ray_dir > 0) - clist->w_side = 3; + if (clist->rlist.sqy == clist->mlist->nlx && clist->rlist.sqx == clist->mlist->nly ) + { + clist->w_side = 5; + } else - clist->w_side = 2; + { + if (clist->rlist.side == 0 && clist->rlist.x_ray_dir < 0) + clist->w_side = 1; + else if (clist->rlist.side == 0 && clist->rlist.x_ray_dir > 0) + clist->w_side = 0; + else if (clist->rlist.side == 1 && clist->rlist.y_ray_dir > 0) + clist->w_side = 3; + else + clist->w_side = 2; + } } |