/* ************************************************************************** */ /* LE - / */ /* / */ /* cub3d.h .:: .:/ . .:: */ /* +:+:+ +: +: +:+:+ */ /* By: rbousset +:+ +: +: +:+ */ /* #+# #+ #+ #+# */ /* Created: 2020/02/02 17:19:43 by rbousset #+# ## ## #+# */ /* Updated: 2020/02/02 17:19:43 by rbousset ### #+. /#+ ###.fr */ /* / */ /* / */ /* ************************************************************************** */ # ifndef CUB3D_H # define CUB3D_H #include #include #include # ifndef FT_W_KEY # define FT_W_KEY 13 # endif # ifndef FT_A_KEY # define FT_A_KEY 0 # endif # ifndef FT_S_KEY # define FT_S_KEY 1 # endif # ifndef FT_D_KEY # define FT_D_KEY 2 # endif # ifndef FT_L_ARR_KEY # define FT_L_ARR_KEY 123 # endif # ifndef FT_R_ARR_KEY # define FT_R_ARR_KEY 124 # endif # ifndef FT_ESC_KEY # define FT_ESC_KEY 53 # endif # ifndef FT_F1_KEY # define FT_F1_KEY 122 # endif # ifndef FT_SCR_SIZE # define FT_SCR_SIZE "1920x1080" # endif /* ** ret vals: ** 1: no argv[1] ** 2: failed structs init ** 3: failed mlx init ** 4: map error ** 5: no map ** 6: not a .cub */ int8_t ft_init_cub3d(t_cub **clist); t_map *ft_init_map(void); void ft_hooks_and_loops(t_win *wl, t_cub *cl); int ft_key_event(int keycode, t_cub *clist); int ft_click_close(int keycode, t_cub *clist); int ft_exit(uint8_t exit_code, t_cub *clist); void ft_draw_square(int a, int b, int rgb, t_cub *clist); void ft_parse_map(const char *map_path, t_cub *clist); int8_t ft_select_get(char **words, t_cub *clist); int8_t ft_get_screen_size(t_win *wlist); int8_t ft_get_res(char **words, t_cub *clist); int8_t ft_get_tex_no(char **words, t_cub *clist); int8_t ft_get_tex_so(char **words, t_cub *clist); int8_t ft_get_tex_ea(char **words, t_cub *clist); int8_t ft_get_tex_we(char **words, t_cub *clist); int8_t ft_get_sprite(char **words, t_cub *clist); int8_t ft_get_f_color(char **words, t_cub *clist); int8_t ft_get_c_color(char **words, t_cub *clist); int ft_get_map_first_line(char *line, t_cub *clist); int ft_get_map_core(int fd, t_cub *clist); void ft_get_player_spawn(t_player *plist, t_cub *clist); void ft_set_minimap_scale(t_cub *clist); int ft_check_missing(t_cub *clist); int8_t ft_check_map_line(char *line, uint8_t l, t_cub *clist); size_t ft_get_line_len(char *line); int ft_missing_error(const char *err, t_cub *clist); uint8_t ft_free_words(char **words); int ft_map_error(t_cub *clist); int ft_init_winlx(t_cub *clist); void ft_draw_scene(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); void ft_draw_map(char **map, t_cub *clist); int8_t ft_f1_key(t_cub *clist); # endif