diff options
author | salaaad2 <arthurdurant263@gmail.com> | 2020-02-17 16:27:35 +0100 |
---|---|---|
committer | salaaad2 <arthurdurant263@gmail.com> | 2020-02-17 16:27:35 +0100 |
commit | 8a89388d397b50f2c70cef05f8fa6cfa10cc213c (patch) | |
tree | e010e46998fd02717135f60a6f03ec97f9b47f8d /src/ft_draw_textures.c | |
parent | Merge branch 'master' of https://gitlab.com/JozanLeClerc/42-cub3d into tex_fmoen (diff) | |
download | 42-cub3d-8a89388d397b50f2c70cef05f8fa6cfa10cc213c.tar.gz 42-cub3d-8a89388d397b50f2c70cef05f8fa6cfa10cc213c.tar.bz2 42-cub3d-8a89388d397b50f2c70cef05f8fa6cfa10cc213c.tar.xz 42-cub3d-8a89388d397b50f2c70cef05f8fa6cfa10cc213c.tar.zst 42-cub3d-8a89388d397b50f2c70cef05f8fa6cfa10cc213c.zip |
small but important changes
Diffstat (limited to '')
-rw-r--r-- | src/ft_draw_textures.c | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/ft_draw_textures.c b/src/ft_draw_textures.c index 321fd18..bb5a6e4 100644 --- a/src/ft_draw_textures.c +++ b/src/ft_draw_textures.c @@ -13,14 +13,22 @@ #include <cub3d.h> #include <stdint.h> +/* + * 0 : no + * 1 : so + * 2 : ea + * 3 : we + * 4 : sprite + **/ + void ft_choose_tex(t_cub *clist) { - if (clist->rlist.side == 0 && clist->rlist.x_ray_direction > 0) + if (clist->rlist.side == 0 && clist->rlist.x_ray_dir < 0) clist->w_side = 0; - else if (clist->rlist.side == 0 && clist->rlist.x_ray_direction < 0) - clist->w_side = 3; - else if (clist->rlist.side == 1 && clist->rlist.y_ray_direction > 0) + else if (clist->rlist.side == 0 && clist->rlist.x_ray_dir > 0) clist->w_side = 1; - else (clist->rlist.side == 1 && clist->rlist.y_ray_direction < 0) + else if (clist->rlist.side == 1 && clist->rlist.y_ray_dir > 0) clist->w_side = 2; + else + clist->w_side = 3; } |