aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_shoot.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-04-01 19:37:00 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-04-01 19:37:00 +0200
commitc2fabd5bee8cc8a386d2012e6b08471955fbcaa8 (patch)
treedd59fd3f0c76d4ac79efc403908092e31cf91a1f /src/ft_shoot.c
parentok (diff)
download42-cub3d-c2fabd5bee8cc8a386d2012e6b08471955fbcaa8.tar.gz
42-cub3d-c2fabd5bee8cc8a386d2012e6b08471955fbcaa8.tar.bz2
42-cub3d-c2fabd5bee8cc8a386d2012e6b08471955fbcaa8.tar.xz
42-cub3d-c2fabd5bee8cc8a386d2012e6b08471955fbcaa8.tar.zst
42-cub3d-c2fabd5bee8cc8a386d2012e6b08471955fbcaa8.zip
Later
Diffstat (limited to 'src/ft_shoot.c')
-rw-r--r--src/ft_shoot.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/ft_shoot.c b/src/ft_shoot.c
index 01a96fd..1797b2d 100644
--- a/src/ft_shoot.c
+++ b/src/ft_shoot.c
@@ -95,22 +95,19 @@ static void
}
void
- ft_shoot(t_cub *cl, uint16_t i)
+ ft_shoot(t_cub *cl)
{
t_win *wl;
t_player *pl;
wl = &cl->wlist;
pl = &cl->plist;
- pl->cam_x = 2 * i / (float)(wl->x_size) - 1;
cl->rlist.x_ray_pos = pl->pos_y;
cl->rlist.y_ray_pos = pl->pos_x;
- cl->rlist.x_ray_dir = pl->dir_x + pl->plane_x *
- pl->cam_x;
- cl->rlist.y_ray_dir = pl->dir_y + pl->plane_y *
- pl->cam_x;
- cl->rlist.sqx = (int16_t)cl->rlist.x_ray_pos;
- cl->rlist.sqy = (int16_t)cl->rlist.y_ray_pos;
+ cl->rlist.x_ray_dir = pl->dir_x;
+ cl->rlist.y_ray_dir = pl->dir_y;
+ cl->rlist.sqx = (uint64_t)cl->rlist.x_ray_pos;
+ cl->rlist.sqy = (uint64_t)cl->rlist.y_ray_pos;
ft_detection_init_x(cl);
ft_detection_init_y(cl);
ft_hitscan(cl, 0);