aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_floor_cast.c
diff options
context:
space:
mode:
authorRudy Bousset <rbousset@z2r4p1.le-101.fr>2020-03-08 19:14:51 +0100
committerRudy Bousset <rbousset@z2r4p1.le-101.fr>2020-03-08 19:14:51 +0100
commitab50e31ddbe77885bc2a517dfd239f88077ad77c (patch)
treee75334543161f6500e1d3d2ebe6ef3489fdcda44 /src/ft_floor_cast.c
parentJimi Hendrix would be proud (diff)
download42-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_floor_cast.c')
-rw-r--r--src/ft_floor_cast.c17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/ft_floor_cast.c b/src/ft_floor_cast.c
index fe2734a..3343fc3 100644
--- a/src/ft_floor_cast.c
+++ b/src/ft_floor_cast.c
@@ -13,6 +13,7 @@
#include <cub3d.h>
#include <stdint.h>
+#include <stdio.h>
void
ft_floor_cast(t_cub *cl)
{
@@ -23,22 +24,22 @@ void
rl = &cl->rlist;
if (rl->side == 0 && rl->x_ray_dir > 0)
{
- rl->floor_x_wall = (float)map_x;
- rl->floor_y_wall = (float)map_y + rl->wall_hit_x;
+ rl->floor_x_wall = map_x;
+ rl->floor_y_wall = map_y + rl->wall_hit_x;
}
else if (rl->side == 0 && rl->x_ray_dir < 0)
{
- rl->floor_x_wall = (float)map_x + 1.0;
- rl->floor_y_wall = (float)map_y + rl->wall_hit_x;
+ rl->floor_x_wall = map_x + 1.0;
+ rl->floor_y_wall = map_y + rl->wall_hit_x;
}
else if (rl->side == 1 && rl->y_ray_dir > 0)
{
- rl->floor_x_wall = (float)map_x + rl->wall_hit_x;
- rl->floor_y_wall = (float)map_y;
+ rl->floor_x_wall = map_x + rl->wall_hit_x;
+ rl->floor_y_wall = map_y;
}
else
{
- rl->floor_x_wall = (float)map_x + rl->wall_hit_x;
- rl->floor_y_wall = (float)map_y + 1.0;
+ rl->floor_x_wall = map_x + rl->wall_hit_x;
+ rl->floor_y_wall = map_y + 1.0;
}
}