From cf054e742c57992cc3711f4d5a2e96703616e3d4 Mon Sep 17 00:00:00 2001
From: JozanLeClerc <bousset.rudy@gmail.com>
Date: Mon, 9 Mar 2020 01:26:16 +0100
Subject: Nigga my gun go off

---
 src/ft_floor_cast.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/ft_floor_cast.c b/src/ft_floor_cast.c
index 9b8ab59..6947403 100644
--- a/src/ft_floor_cast.c
+++ b/src/ft_floor_cast.c
@@ -33,10 +33,10 @@ static void
 {
 	rl->x_cell = (int32_t)(rl->x_floor);
 	rl->y_cell = (int32_t)(rl->y_floor);
-	cl->tlist[6].tex_x = (int32_t)(cl->tlist[6].img_w
-			* (rl->x_floor - rl->x_cell)) & (cl->tlist[6].img_w - 1);
-	cl->tlist[6].tex_y = (int32_t)(cl->tlist[6].img_h
-			* (rl->y_floor - rl->y_cell)) & (cl->tlist[6].img_h - 1);
+	cl->tlist[6].tex_y = (int32_t)(cl->tlist[6].img_w
+			* (rl->x_floor - rl->x_cell)) % (cl->tlist[6].img_w);
+	cl->tlist[6].tex_x = (int32_t)(cl->tlist[6].img_h
+			* (rl->y_floor - rl->y_cell)) % (cl->tlist[6].img_h);
 	rl->x_floor += cl->mlist.x_floor_step;
 	rl->y_floor += cl->mlist.y_floor_step;
 	ft_put_floor_tex(y, x, cl);
@@ -60,8 +60,8 @@ void
 		(rl->x_f_ray_dir_bis - rl->x_f_ray_dir) / cl->wlist.x_size;
 	cl->mlist.y_floor_step = rl->row_dist *
 		(rl->y_f_ray_dir_bis - rl->y_f_ray_dir) / cl->wlist.x_size;
-	rl->x_floor = cl->plist.pos_x + rl->row_dist * rl->x_f_ray_dir;
-	rl->y_floor = cl->plist.pos_y + rl->row_dist * rl->y_f_ray_dir;
+	rl->x_floor = cl->plist.pos_y + rl->row_dist * rl->x_f_ray_dir;
+	rl->y_floor = cl->plist.pos_x + rl->row_dist * rl->y_f_ray_dir;
 	x = 0;
 	while (++x < cl->wlist.x_size)
 	{
-- 
cgit v1.2.3