diff options
author | salaaad2 <arthurdurant263@gmail.com> | 2020-02-17 18:52:58 +0100 |
---|---|---|
committer | salaaad2 <arthurdurant263@gmail.com> | 2020-02-17 18:52:58 +0100 |
commit | 84b6ca845a07421b10b527f3c18a49eabd8fb2f9 (patch) | |
tree | c136d58b09353c8efcad74a256f5f7db1c949c0a /src/ft_raycasting.c | |
parent | add shadows and beginning of wall coordinate hit detection (diff) | |
download | 42-cub3d-84b6ca845a07421b10b527f3c18a49eabd8fb2f9.tar.gz 42-cub3d-84b6ca845a07421b10b527f3c18a49eabd8fb2f9.tar.bz2 42-cub3d-84b6ca845a07421b10b527f3c18a49eabd8fb2f9.tar.xz 42-cub3d-84b6ca845a07421b10b527f3c18a49eabd8fb2f9.tar.zst 42-cub3d-84b6ca845a07421b10b527f3c18a49eabd8fb2f9.zip |
have correct width and hit zone, supposedly not much left
Diffstat (limited to '')
-rw-r--r-- | src/ft_raycasting.c | 4 |
1 files changed, 3 insertions, 1 deletions
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); |