99 lines
3.1 KiB
C
99 lines
3.1 KiB
C
/* ************************************************************************** */
|
|
/* */
|
|
/* ::: :::::::: */
|
|
/* cub3d.h :+: :+: :+: */
|
|
/* +:+ +:+ +:+ */
|
|
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
|
|
/* +#+#+#+#+#+ +#+ */
|
|
/* Created: 2025/11/25 19:47:02 by aortigos #+# #+# */
|
|
/* Updated: 2025/12/09 18:40:30 by aortigos ### ########.fr */
|
|
/* */
|
|
/* ************************************************************************** */
|
|
|
|
#ifndef CUB3D_H
|
|
|
|
# define CUB3D_H
|
|
|
|
# include <unistd.h>
|
|
# include <stdlib.h>
|
|
# include <math.h>
|
|
# include "../lib/mlx/include/MLX42/MLX42.h"
|
|
# include "../lib/libft/libft.h"
|
|
# include "../lib/ft_printf/ft_printf.h"
|
|
# include "../lib/gnl/get_next_line.h"
|
|
|
|
# define S_W 800
|
|
# define S_H 600
|
|
# define FOV 60
|
|
# define PLAYER_SPEED 3
|
|
|
|
|
|
// Functions
|
|
|
|
// parsing.c
|
|
int read_map(char *av, t_data *map, int *count);
|
|
void get_x_y_player(t_data *data);
|
|
int check_extension_map(char *file);
|
|
int parsing(int ac, char **av, t_data *data);
|
|
|
|
// frees.c
|
|
void freetl(char *ture, char *line, int fd);
|
|
void free_map(t_data *data);
|
|
void free_m(t_mlx *mlx);
|
|
void freelist(t_turelist **txture);
|
|
|
|
// lst_textures.c
|
|
int get_index(char *line, int i);
|
|
t_turelist *new_texture(char *line);
|
|
void lst_back_ture(t_turelist **l_ture, t_turelist *new);
|
|
int lst_ture(t_data *m, t_turelist **l_ture);
|
|
|
|
// read_map.c
|
|
int is_surrounded(char *line);
|
|
int is_validmap(char *line, int *flag);
|
|
char *getmap(t_data *map);
|
|
int read_map_(t_data *map, int count);
|
|
void process_map(t_data *map, int *count);
|
|
|
|
// read_map_utils.c
|
|
int check_tures_space_tab(char **ture2d, int count);
|
|
int parse_rgb(char **ture2d);
|
|
int check_dup(t_data *m);
|
|
int check_first_last_line(char **map);
|
|
int surrounded_by_one(char **map);
|
|
|
|
// textures.c
|
|
int check_color_values(char **rgb);
|
|
void ft_process_rgb_color(t_turelist *tmp, t_data *m);
|
|
int color_ture(t_data *m, t_turelist *l_ture);
|
|
int check_color_textures(char *line);
|
|
int check_count_textures(t_data *m, int count);
|
|
|
|
// textures_utils.c
|
|
int is_valid_texture(char *line);
|
|
int count_comma(char *rgb);
|
|
int check_pos_cf(char *l);
|
|
int line_around_one(char *line);
|
|
char *getlastline(char **map);
|
|
|
|
//valid_map.c
|
|
int h_map(char **map);
|
|
int v_map(char **map);
|
|
char *fixline(char *line, int maxlen);
|
|
int getsize_line(char **map);
|
|
int valid_map(t_data *m);
|
|
|
|
// frees.c
|
|
void ft_delete_texture(t_texture *texture);
|
|
void ft_exit(t_mlx *mlx);
|
|
|
|
// movement.c
|
|
void rotate_player(t_mlx *mlx, int i);
|
|
void move_player(t_mlx *mlx, double move_x, double move_y);
|
|
void cub_hook(t_mlx *mlx, double move_x, double move_y);
|
|
void ft_reset_move(mlx_key_data_t keydata, t_mlx *mlx);
|
|
void key_press(mlx_key_data_t keydata, void *ml);
|
|
|
|
|
|
#endif
|