diff options
author | Rudy Bousset <rbousset@z2r6p3.le-101.fr> | 2020-03-08 20:44:41 +0100 |
---|---|---|
committer | Rudy Bousset <rbousset@z2r6p3.le-101.fr> | 2020-03-08 20:44:41 +0100 |
commit | 36c540d12683633b77f6acda658fe4517eb674a5 (patch) | |
tree | 09966fe9da82bea0aab8f219da7630147a2d9ff7 | |
parent | Nice and clean (diff) | |
download | 42-cub3d-36c540d12683633b77f6acda658fe4517eb674a5.tar.gz 42-cub3d-36c540d12683633b77f6acda658fe4517eb674a5.tar.bz2 42-cub3d-36c540d12683633b77f6acda658fe4517eb674a5.tar.xz 42-cub3d-36c540d12683633b77f6acda658fe4517eb674a5.tar.zst 42-cub3d-36c540d12683633b77f6acda658fe4517eb674a5.zip |
Clean af
Diffstat (limited to '')
-rw-r--r-- | inc/cub3d.h | 2 | ||||
-rw-r--r-- | inc/cub3d_structs.h | 2 | ||||
-rw-r--r-- | src/ft_floor_cast.c | 10 | ||||
-rw-r--r-- | src/ft_raycasting.c | 6 |
4 files changed, 11 insertions, 9 deletions
diff --git a/inc/cub3d.h b/inc/cub3d.h index 7014e51..77ade74 100644 --- a/inc/cub3d.h +++ b/inc/cub3d.h @@ -120,8 +120,8 @@ uint8_t ft_use_args(int argc, const char *argv[], */ void ft_castray(t_cub *cl); -void ft_floor_cast(t_cub *cl); void ft_detect(t_cub *cl); +void ft_floor_cast(uint16_t y, t_cub *cl); /* ** ====== OTHER ====== diff --git a/inc/cub3d_structs.h b/inc/cub3d_structs.h index 7072628..cf8b6fa 100644 --- a/inc/cub3d_structs.h +++ b/inc/cub3d_structs.h @@ -130,8 +130,6 @@ typedef struct s_ray float y_side_dist; float x_delta_dist; float y_delta_dist; - float floor_x_wall; - float floor_y_wall; int16_t wall_t; int16_t wall_b; uint8_t side; diff --git a/src/ft_floor_cast.c b/src/ft_floor_cast.c index ddc7bde..a0321d0 100644 --- a/src/ft_floor_cast.c +++ b/src/ft_floor_cast.c @@ -13,7 +13,9 @@ #include <cub3d.h> #include <stdint.h> -/* void */ -/* ft_floor_cast(t_cub *cl) */ -/* { */ -/* } */ +void + ft_floor_cast(uint16_t y, t_cub *cl) +{ + (void)y; + (void)cl; +} diff --git a/src/ft_raycasting.c b/src/ft_raycasting.c index 78c8bb4..1c5818a 100644 --- a/src/ft_raycasting.c +++ b/src/ft_raycasting.c @@ -112,12 +112,14 @@ void uint16_t i; t_win *wl; - i = 0; wl = &cl->wlist; + i = (wl->y_size / 2) + 1; + while (++i < wl->y_size) + ft_floor_cast(i, cl); + i = 0; while (i < wl->x_size) { ft_initray(i, cl); - /* ft_floor_cast(cl); */ cl->rlist.line_h = (int16_t)(wl->y_size / cl->rlist.wall_dist); cl->rlist.wall_t = -cl->rlist.line_h / 2 + wl->y_size / 2; if (cl->rlist.wall_t < 0) |