aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_draw_textures.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ft_draw_textures.c')
-rw-r--r--src/ft_draw_textures.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/ft_draw_textures.c b/src/ft_draw_textures.c
index 36cc832..bb5a6e4 100644
--- a/src/ft_draw_textures.c
+++ b/src/ft_draw_textures.c
@@ -13,13 +13,22 @@
#include <cub3d.h>
#include <stdint.h>
-void ft_draw_wall(t_cub *clist, int x, int draw_start, int draw_end)
+/*
+ * 0 : no
+ * 1 : so
+ * 2 : ea
+ * 3 : we
+ * 4 : sprite
+ **/
+
+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_dir < 0)
+ clist->w_side = 0;
+ else if (clist->rlist.side == 0 && clist->rlist.x_ray_dir > 0)
+ clist->w_side = 1;
+ else if (clist->rlist.side == 1 && clist->rlist.y_ray_dir > 0)
+ clist->w_side = 2;
+ else
+ clist->w_side = 3;
}