From 36e4ca1eeffa78d57767fced53fd16df17d75373 Mon Sep 17 00:00:00 2001 From: Rudy Bousset Date: Fri, 28 Feb 2020 19:22:58 +0100 Subject: L is now crapaud and you can pass through :^) --- src/ft_draw_textures.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'src/ft_draw_textures.c') 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; + } } -- cgit v1.2.3