diff options
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; + } } |