aboutsummaryrefslogtreecommitdiffstats
path: root/src/ft_floor_cast.c
diff options
context:
space:
mode:
authorRudy Bousset <rbousset@z2r4p1.le-101.fr>2020-03-08 17:43:14 +0100
committerRudy Bousset <rbousset@z2r4p1.le-101.fr>2020-03-08 17:43:14 +0100
commite11e26f5ab1653355b4a3bb265c485f977862037 (patch)
tree29d2be54f0ee2c4bd8850c0e1d892579e4022c31 /src/ft_floor_cast.c
parentRemoved sceret door bonus because it is no door (diff)
download42-cub3d-e11e26f5ab1653355b4a3bb265c485f977862037.tar.gz
42-cub3d-e11e26f5ab1653355b4a3bb265c485f977862037.tar.bz2
42-cub3d-e11e26f5ab1653355b4a3bb265c485f977862037.tar.xz
42-cub3d-e11e26f5ab1653355b4a3bb265c485f977862037.tar.zst
42-cub3d-e11e26f5ab1653355b4a3bb265c485f977862037.zip
Psychedelic
Diffstat (limited to '')
-rw-r--r--src/ft_floor_cast.c21
1 files changed, 11 insertions, 10 deletions
diff --git a/src/ft_floor_cast.c b/src/ft_floor_cast.c
index e7d3b0f..d9afa5a 100644
--- a/src/ft_floor_cast.c
+++ b/src/ft_floor_cast.c
@@ -13,32 +13,33 @@
#include <cub3d.h>
#include <stdint.h>
+#include <stdio.h>
void
ft_floor_cast(t_cub *cl)
{
t_ray *rl;
- const uint32_t map_x = (uint32_t)&cl->plist.pos_x;
- const uint32_t map_y = (uint32_t)&cl->plist.pos_y;
+ const uint32_t map_x = (uint32_t)cl->plist.pos_x;
+ const uint32_t map_y = (uint32_t)cl->plist.pos_y;
rl = &cl->rlist;
if (rl->side == 0 && rl->x_ray_dir > 0)
{
- rl->floor_x_wall = (double)map_x;
- rl->floor_y_wall = (double)map_y + rl->wall_hit_x;
+ rl->floor_x_wall = (float)map_x;
+ rl->floor_y_wall = (float)map_y + rl->wall_hit_x;
}
else if (rl->side == 0 && rl->x_ray_dir < 0)
{
- rl->floor_x_wall = (double)map_x + 1.0;
- rl->floor_y_wall = (double)map_y + rl->wall_hit_x;
+ rl->floor_x_wall = (float)map_x + 1.0;
+ rl->floor_y_wall = (float)map_y + rl->wall_hit_x;
}
else if (rl->side == 1 && rl->y_ray_dir > 0)
{
- rl->floor_x_wall = (double)map_x + rl->wall_hit_x;
- rl->floor_y_wall = (double)map_y;
+ rl->floor_x_wall = (float)map_x + rl->wall_hit_x;
+ rl->floor_y_wall = (float)map_y;
}
else
{
- rl->floor_x_wall = (double)map_x + rl->wall_hit_x;
- rl->floor_y_wall = (double)map_y + 1.0;
+ rl->floor_x_wall = (float)map_x + rl->wall_hit_x;
+ rl->floor_y_wall = (float)map_y + 1.0;
}
}