diff options
Diffstat (limited to 'inc')
-rw-r--r-- | inc/cub3d.h | 5 | ||||
-rw-r--r-- | inc/cub3d_structs.h | 23 |
2 files changed, 28 insertions, 0 deletions
diff --git a/inc/cub3d.h b/inc/cub3d.h index 777360b..f0dbf61 100644 --- a/inc/cub3d.h +++ b/inc/cub3d.h @@ -85,5 +85,10 @@ int ft_init_winlx(t_cub *clist); void ft_drawmap(t_cub *clist); void ft_print_list(t_cub *clist); uint32_t ft_rgb_to_hex(t_rgb rgb); +t_ray ft_init_s_ray(void); +void ft_detect(t_cub *cl); +int8_t ft_draw_verline(t_cub *cl, int32_t x, int32_t y1, + int32_t y2, int32_t color); +void ft_castray(t_cub *cl); # endif diff --git a/inc/cub3d_structs.h b/inc/cub3d_structs.h index cc5d805..0c3cb7c 100644 --- a/inc/cub3d_structs.h +++ b/inc/cub3d_structs.h @@ -41,6 +41,11 @@ typedef struct s_player float pos_x; float pos_y; float view_side; + float dir_x; + float dir_y; + float cam_x; + float plane_x; + float plane_y; } t_player; /* typedef struct s_ray */ @@ -61,6 +66,21 @@ typedef struct s_player typedef struct s_ray { uint16_t line_h; + float wall_dist; + float x_ray_pos; + float y_ray_pos; + float x_ray_dir; + float y_ray_dir; + float x_side_dist; + float y_side_dist; + float x_delta_dist; + float y_delta_dist; + int16_t wall_t; + int16_t wall_b; + uint8_t side; + size_t sqx; + size_t sqy; + uint8_t hit; } t_ray; typedef struct s_cub @@ -72,6 +92,8 @@ typedef struct s_cub char *sprite_path; char *mapl; char **map; + int8_t x_step; + int8_t y_step; size_t map_w; size_t map_h; size_t line_chk; @@ -80,6 +102,7 @@ typedef struct s_cub uint8_t scale; struct s_win *wlist; struct s_player *plist; + struct s_ray rlist; struct s_img img; struct s_rgb f_rgb; struct s_rgb c_rgb; |