From de7d432e18f4363e73b11f23885d7afd002a99f0 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sun, 8 Mar 2020 02:47:01 +0100 Subject: I'm close af --- src/ft_raycasting.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src/ft_raycasting.c') diff --git a/src/ft_raycasting.c b/src/ft_raycasting.c index 50bdbf9..0a4b8b5 100644 --- a/src/ft_raycasting.c +++ b/src/ft_raycasting.c @@ -77,7 +77,7 @@ void } static void - ft_initray(t_cub *cl, uint16_t i) + ft_initray(uint16_t i, t_cub *cl) { t_win *wl; t_player *pl; @@ -100,8 +100,10 @@ static void (1 - cl->mlist.x_step) / 2) / cl->rlist.x_ray_dir; } else + { cl->rlist.wall_dist = (cl->rlist.sqy - cl->rlist.y_ray_pos + (1 - cl->mlist.y_step) / 2) / cl->rlist.y_ray_dir; + } } void @@ -114,7 +116,8 @@ void wl = &cl->wlist; while (i < wl->x_size) { - ft_initray(cl, i); + ft_initray(i, cl); + ft_floor_cast(cl); cl->rlist.line_h = (int16_t)(wl->y_size / cl->rlist.wall_dist); cl->rlist.wall_t = -cl->rlist.line_h / 2 + wl->y_size / 2; if (cl->rlist.wall_t < 0) -- cgit v1.2.3