From 1842a21f7187f32982f9f19623affbc48b4f4573 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Sun, 8 Mar 2020 00:26:09 +0100 Subject: I gotta figure out --- inc/cub3d.h | 10 ++++++++-- inc/cub3d_structs.h | 13 ++++++++++++- 2 files changed, 20 insertions(+), 3 deletions(-) (limited to 'inc') diff --git a/inc/cub3d.h b/inc/cub3d.h index 063b06f..4151daa 100644 --- a/inc/cub3d.h +++ b/inc/cub3d.h @@ -115,6 +115,14 @@ uint8_t ft_check_map_arg(int argc, const char *argv[]); uint8_t ft_use_args(int argc, const char *argv[], char *const envp[], t_cub *clist); +/* +** ====== RAYCAST ====== +*/ + +void ft_castray(t_cub *cl); +void ft_floor_cast(t_cub *cl); +void ft_detect(t_cub *cl); + /* ** ====== OTHER ====== */ @@ -122,8 +130,6 @@ uint8_t ft_use_args(int argc, const char *argv[], void ft_set_minimap_scale(t_cub *clist); void ft_enable_music(t_cub *cl); void ft_music_fork(char **mcmd_words, char *const envp[]); -void ft_detect(t_cub *cl); -void ft_castray(t_cub *cl); int8_t ft_save_to_bmp(t_cub *cl); int ft_error(uint8_t retval, const char *errmsg, t_cub *clist); uint8_t ft_free_words(char **words); diff --git a/inc/cub3d_structs.h b/inc/cub3d_structs.h index d392f0c..ecbbaf3 100644 --- a/inc/cub3d_structs.h +++ b/inc/cub3d_structs.h @@ -16,7 +16,7 @@ #include #include #include -#include +#include typedef struct s_win { @@ -108,6 +108,7 @@ typedef struct s_player { float pos_x; float pos_y; + float pos_z; float start_x; float start_y; float dir_x; @@ -125,10 +126,18 @@ typedef struct s_ray float y_ray_pos; float x_ray_dir; float y_ray_dir; + float x_ray_dir_bis; + float y_ray_dir_bis; float x_side_dist; float y_side_dist; float x_delta_dist; float y_delta_dist; + float floor_x; + float floor_y; + int16_t ceil_x; + int16_t ceil_y; + float row_dist; + float ceil_dist; int16_t wall_t; int16_t wall_b; uint8_t side; @@ -156,6 +165,8 @@ typedef struct s_map char **mcmd_words; int8_t x_step; int8_t y_step; + int8_t x_floor_step; + int8_t y_floor_step; size_t map_w; size_t map_h; size_t mapl_len; -- cgit v1.2.3