aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_draw_textures.c
diff options
context:
space:
mode:
authorsalaaad2 <arthurdurant263@gmail.com>2020-02-15 20:29:43 +0100
committersalaaad2 <arthurdurant263@gmail.com>2020-02-15 20:29:43 +0100
commit2f819c87685e6ad60bcde0df7944e92f4694f2d2 (patch)
treee47be112e5e0af8f447d1fc27f905b2da6ba71f7 /src/ft_draw_textures.c
parentMerged (diff)
download42-cub3d-2f819c87685e6ad60bcde0df7944e92f4694f2d2.tar.gz
42-cub3d-2f819c87685e6ad60bcde0df7944e92f4694f2d2.tar.bz2
42-cub3d-2f819c87685e6ad60bcde0df7944e92f4694f2d2.tar.xz
42-cub3d-2f819c87685e6ad60bcde0df7944e92f4694f2d2.tar.zst
42-cub3d-2f819c87685e6ad60bcde0df7944e92f4694f2d2.zip
pepere :^) !
Diffstat (limited to 'src/ft_draw_textures.c')
-rw-r--r--src/ft_draw_textures.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/ft_draw_textures.c b/src/ft_draw_textures.c
index 36cc832..321fd18 100644
--- a/src/ft_draw_textures.c
+++ b/src/ft_draw_textures.c
@@ -13,13 +13,14 @@
#include <cub3d.h>
#include <stdint.h>
-void ft_draw_wall(t_cub *clist, int x, int draw_start, int draw_end)
+void ft_choose_tex(t_cub *clist)
{
- clist->img.ptr[/*calcul a la con*/x];
- /*
- * faire calcul wola
- *
- *
- *
- */
+ if (clist->rlist.side == 0 && clist->rlist.x_ray_direction > 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)
+ clist->w_side = 1;
+ else (clist->rlist.side == 1 && clist->rlist.y_ray_direction < 0)
+ clist->w_side = 2;
}