diff options
author | Rudy Bousset <rbousset@z2r5p2.le-101.fr> | 2020-02-19 16:57:39 +0100 |
---|---|---|
committer | Rudy Bousset <rbousset@z2r5p2.le-101.fr> | 2020-02-19 16:57:39 +0100 |
commit | 94b688c234660708edacf5d49df0e8bd3243cd6a (patch) | |
tree | 00debcda04429d9814de1789f08245355ec4e502 /src/ft_raycasting.c | |
parent | Tweaks (diff) | |
parent | yes :^) ! (diff) | |
download | 42-cub3d-94b688c234660708edacf5d49df0e8bd3243cd6a.tar.gz 42-cub3d-94b688c234660708edacf5d49df0e8bd3243cd6a.tar.bz2 42-cub3d-94b688c234660708edacf5d49df0e8bd3243cd6a.tar.xz 42-cub3d-94b688c234660708edacf5d49df0e8bd3243cd6a.tar.zst 42-cub3d-94b688c234660708edacf5d49df0e8bd3243cd6a.zip |
Merge branch 'textures'
Diffstat (limited to '')
-rw-r--r-- | src/ft_raycasting.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/src/ft_raycasting.c b/src/ft_raycasting.c index 9a89dc4..394d6dc 100644 --- a/src/ft_raycasting.c +++ b/src/ft_raycasting.c @@ -25,14 +25,14 @@ 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 * - (double)clist->tlist[clist->w_side].img_w); + clist->tlist[clist->w_side].tex_x = (int)(clist->rlist.wall_hit_x * + (double)clist->tlist[clist->w_side].img_w); if (clist->rlist.side == 0 && clist->rlist.x_ray_dir > 0) - clist->rlist.tex_x = clist->tlist[clist->w_side].img_w - - clist->rlist.tex_x - 1; + clist->tlist[clist->w_side].tex_x = clist->tlist[clist->w_side].img_w + - clist->tlist[clist->w_side].tex_x - 1; if (clist->rlist.side == 1 && clist->rlist.y_ray_dir < 0) - clist->rlist.tex_x = clist->tlist[clist->w_side].img_w - - clist->rlist.tex_x - 1; + clist->tlist[clist->w_side].tex_x = clist->tlist[clist->w_side].img_w + - clist->tlist[clist->w_side].tex_x - 1; } static void @@ -83,7 +83,7 @@ void cl->rlist.wall_b = wl->y_size - 1; ft_choose_tex(cl); ft_calc_tex(cl); - ft_draw_verline(cl, i, cl->rlist.wall_t - 1, cl->rlist.wall_b); + ft_draw_verline(cl, i, cl->rlist.wall_t, cl->rlist.wall_b); i++; } } |