aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_raycasting.c
diff options
context:
space:
mode:
authorsalaaad2 <arthudurant263@gmail.com>2020-02-20 18:08:30 +0100
committersalaaad2 <arthudurant263@gmail.com>2020-02-20 18:08:30 +0100
commit375321cf6cdbcf1e062a0ada0efc4c94119141cb (patch)
treef5b94eeb0f25c0a661ebf242b16d064baad2b8f2 /src/ft_raycasting.c
parentFixed HEAD conflicts, pretty bav (diff)
download42-cub3d-375321cf6cdbcf1e062a0ada0efc4c94119141cb.tar.gz
42-cub3d-375321cf6cdbcf1e062a0ada0efc4c94119141cb.tar.bz2
42-cub3d-375321cf6cdbcf1e062a0ada0efc4c94119141cb.tar.xz
42-cub3d-375321cf6cdbcf1e062a0ada0efc4c94119141cb.tar.zst
42-cub3d-375321cf6cdbcf1e062a0ada0efc4c94119141cb.zip
new map, play the game !!!!!
Diffstat (limited to '')
-rw-r--r--src/ft_raycasting.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/ft_raycasting.c b/src/ft_raycasting.c
index 0c00a87..dd2be64 100644
--- a/src/ft_raycasting.c
+++ b/src/ft_raycasting.c
@@ -19,10 +19,10 @@ void
ft_calc_tex(t_cub *clist)
{
if (clist->rlist.side == 0)
- clist->rlist.wall_hit_x = (clist->plist->pos_x - clist->plist->start_x) +
+ clist->rlist.wall_hit_x = (clist->plist->pos_x) +
clist->rlist.wall_dist * clist->rlist.y_ray_dir;
else
- clist->rlist.wall_hit_x = (clist->plist->pos_y - clist->plist->start_y) +
+ clist->rlist.wall_hit_x = (clist->plist->pos_y) +
clist->rlist.wall_dist * clist->rlist.x_ray_dir;
clist->rlist.wall_hit_x -= floor(clist->rlist.wall_hit_x);
clist->tlist[clist->w_side].tex_x = (int)(clist->rlist.wall_hit_x *