aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_detect.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-04-02 14:24:57 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-04-02 14:24:57 +0200
commit8a695d62dcb9b8783918263f962b986df20310f2 (patch)
tree37e3c4e286abcec481bbc8169c7297e1ec07b578 /src/ft_detect.c
parentLater (diff)
download42-cub3d-8a695d62dcb9b8783918263f962b986df20310f2.tar.gz
42-cub3d-8a695d62dcb9b8783918263f962b986df20310f2.tar.bz2
42-cub3d-8a695d62dcb9b8783918263f962b986df20310f2.tar.xz
42-cub3d-8a695d62dcb9b8783918263f962b986df20310f2.tar.zst
42-cub3d-8a695d62dcb9b8783918263f962b986df20310f2.zip
Correct dir_x dir_y sqy sqx
Diffstat (limited to '')
-rw-r--r--src/ft_detect.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/ft_detect.c b/src/ft_detect.c
index 0ef8831..44e5bb2 100644
--- a/src/ft_detect.c
+++ b/src/ft_detect.c
@@ -24,12 +24,12 @@ void
{
cl->mlist.y_step = -1;
cl->rlist.y_side_dist = (cl->rlist.y_ray_pos -
- cl->rlist.sqy) * cl->rlist.y_delta_dist;
+ cl->rlist.sqx) * cl->rlist.y_delta_dist;
}
else
{
cl->mlist.y_step = 1;
- cl->rlist.y_side_dist = (cl->rlist.sqy + 1.0 -
+ cl->rlist.y_side_dist = (cl->rlist.sqx + 1.0 -
cl->rlist.y_ray_pos) * cl->rlist.y_delta_dist;
}
}
@@ -44,12 +44,12 @@ void
{
cl->mlist.x_step = -1;
cl->rlist.x_side_dist = (cl->rlist.x_ray_pos -
- cl->rlist.sqx) * cl->rlist.x_delta_dist;
+ cl->rlist.sqy) * cl->rlist.x_delta_dist;
}
else
{
cl->mlist.x_step = 1;
- cl->rlist.x_side_dist = (cl->rlist.sqx + 1.0 -
+ cl->rlist.x_side_dist = (cl->rlist.sqy + 1.0 -
cl->rlist.x_ray_pos) * cl->rlist.x_delta_dist;
}
}
@@ -65,17 +65,17 @@ void
if (cl->rlist.x_side_dist < cl->rlist.y_side_dist)
{
cl->rlist.x_side_dist += cl->rlist.x_delta_dist;
- cl->rlist.sqx += cl->mlist.x_step;
+ cl->rlist.sqy += cl->mlist.x_step;
cl->rlist.side = 0;
}
else
{
cl->rlist.y_side_dist += cl->rlist.y_delta_dist;
- cl->rlist.sqy += cl->mlist.y_step;
+ cl->rlist.sqx += cl->mlist.y_step;
cl->rlist.side = 1;
}
if (ft_ischarset(FT_CHRST_DETECT,
- cl->mlist.map[cl->rlist.sqx][cl->rlist.sqy]))
+ cl->mlist.map[cl->rlist.sqy][cl->rlist.sqx]))
cl->rlist.hit = 1;
}
}