diff options
author | Rudy Bousset <rbousset@z2r4p1.le-101.fr> | 2020-03-08 19:14:51 +0100 |
---|---|---|
committer | Rudy Bousset <rbousset@z2r4p1.le-101.fr> | 2020-03-08 19:14:51 +0100 |
commit | ab50e31ddbe77885bc2a517dfd239f88077ad77c (patch) | |
tree | e75334543161f6500e1d3d2ebe6ef3489fdcda44 /src/ft_draw_verline.c | |
parent | Jimi Hendrix would be proud (diff) | |
download | 42-cub3d-ab50e31ddbe77885bc2a517dfd239f88077ad77c.tar.gz 42-cub3d-ab50e31ddbe77885bc2a517dfd239f88077ad77c.tar.bz2 42-cub3d-ab50e31ddbe77885bc2a517dfd239f88077ad77c.tar.xz 42-cub3d-ab50e31ddbe77885bc2a517dfd239f88077ad77c.tar.zst 42-cub3d-ab50e31ddbe77885bc2a517dfd239f88077ad77c.zip |
Something wrong
Diffstat (limited to 'src/ft_draw_verline.c')
-rw-r--r-- | src/ft_draw_verline.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ft_draw_verline.c b/src/ft_draw_verline.c index 5368c4e..7f0fd1c 100644 --- a/src/ft_draw_verline.c +++ b/src/ft_draw_verline.c @@ -43,15 +43,15 @@ static void { curr_dist = cl->wlist.y_size / (2.0 * y - cl->wlist.y_size); weight = (curr_dist - dist_player) - / (cl->rlist.perp_wall_dist - dist_player); + / (cl->rlist.wall_dist - dist_player); curr_floor_x = weight * cl->rlist.floor_x_wall + (1.0 - weight) * cl->plist.pos_x; curr_floor_y = weight * cl->rlist.floor_y_wall + (1.0 - weight) * cl->plist.pos_y; - cl->tlist[6].tex_x = (int32_t)(curr_floor_x - * cl->tlist[6].img_w) % cl->tlist[6].img_w; - cl->tlist[6].tex_y = (int32_t)(curr_floor_y - * cl->tlist[6].img_h) % cl->tlist[6].img_h; + cl->tlist[6].tex_x = (int32_t)(curr_floor_x * cl->tlist[6].img_w) + % cl->tlist[6].img_w; + cl->tlist[6].tex_y = (int32_t)(curr_floor_y * cl->tlist[6].img_h) + % cl->tlist[6].img_h; /* cl->tlist[6].tex_x = (cl->tlist[6].tex_x > 0) */ /* ? (cl->tlist[6].tex_x) : (-cl->tlist[6].tex_x); */ /* cl->tlist[6].tex_y = (cl->tlist[6].tex_y > 0) */ |