diff options
Diffstat (limited to 'src/ft_raycasting.c')
-rw-r--r-- | src/ft_raycasting.c | 7 |
1 files changed, 5 insertions, 2 deletions
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) |