From 84b6ca845a07421b10b527f3c18a49eabd8fb2f9 Mon Sep 17 00:00:00 2001 From: salaaad2 Date: Mon, 17 Feb 2020 18:52:58 +0100 Subject: have correct width and hit zone, supposedly not much left --- src/ft_raycasting.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/ft_raycasting.c') diff --git a/src/ft_raycasting.c b/src/ft_raycasting.c index 7ce45d5..26a3ec9 100644 --- a/src/ft_raycasting.c +++ b/src/ft_raycasting.c @@ -26,7 +26,8 @@ void clist->rlist.wall_hit_x = clist->plist->pos_x + clist->rlist.wall_dist * clist->rlist.x_ray_dir; clist->rlist.wall_hit_x -= floor(clist->rlist.wall_hit_x); - /*clist->rlist.tex_x =(int)(clist->rlist.wall_hit_x * clist->tlist[clist->w_side].img_w);*/ + clist->rlist.tex_x = (clist->rlist.wall_hit_x * (double)clist->tlist[clist->w_side].img_w); + printf("wall_hit_x : %f\ntex_x : %d\nimg_w : %d\n", clist->rlist.wall_hit_x, clist->rlist.tex_x, clist->tlist[clist->w_side].img_w); } static void @@ -65,6 +66,7 @@ void i = 0; wl = cl->wlist; + ft_wall_tex_init(cl); while (i < wl->x_size) { ft_initray(cl, i); -- cgit v1.2.3