2023-10-25 14:07:29 +02:00
|
|
|
/* ************************************************************************** */
|
|
|
|
/* */
|
2023-10-26 11:01:31 +02:00
|
|
|
/* :::::::: */
|
2023-10-26 10:45:19 +02:00
|
|
|
/* cub3d.h :+: :+: */
|
2023-10-26 11:01:31 +02:00
|
|
|
/* +:+ */
|
|
|
|
/* By: houtworm <codam@houtworm.net> +#+ */
|
|
|
|
/* +#+ */
|
|
|
|
/* Created: 2023/10/26 10:46:35 by houtworm #+# #+# */
|
2023-10-26 17:40:01 +02:00
|
|
|
/* Updated: 2023/10/26 17:25:30 by houtworm ######## odam.nl */
|
2023-10-25 14:07:29 +02:00
|
|
|
/* */
|
|
|
|
/* ************************************************************************** */
|
|
|
|
|
2023-10-26 10:45:19 +02:00
|
|
|
#ifndef CUB3D_H
|
|
|
|
# define CUB3D_H
|
2023-10-25 14:07:29 +02:00
|
|
|
|
|
|
|
# include <unistd.h>
|
|
|
|
# include <math.h>
|
2023-10-26 17:40:01 +02:00
|
|
|
# include <fcntl.h>
|
2023-10-25 14:07:29 +02:00
|
|
|
# include "libft/libft.h"
|
2023-10-26 17:40:01 +02:00
|
|
|
# include "getnextline/get_next_line.h"
|
2023-10-25 14:07:29 +02:00
|
|
|
# include "mlx/include/MLX42/MLX42.h"
|
|
|
|
|
|
|
|
typedef struct s_varlist
|
|
|
|
{
|
2023-10-26 16:57:23 +02:00
|
|
|
mlx_t *mlx;
|
|
|
|
mlx_image_t *img;
|
|
|
|
int w;
|
|
|
|
int h;
|
|
|
|
char **map;
|
|
|
|
int playerx;
|
|
|
|
int playery;
|
|
|
|
int playerd;
|
2023-10-25 14:07:29 +02:00
|
|
|
} t_varlist;
|
|
|
|
|
2023-10-26 16:57:23 +02:00
|
|
|
// init.c
|
|
|
|
t_varlist initvarlist(void);
|
|
|
|
// parse.c
|
|
|
|
char **ft_getmap(void);
|
2023-10-26 17:40:01 +02:00
|
|
|
t_varlist ft_parseconfigfile(t_varlist vl, char *filename);
|
2023-10-26 16:57:23 +02:00
|
|
|
// keys.c
|
|
|
|
void ft_movementkeys(t_varlist *vl);
|
|
|
|
void keyhook(mlx_key_data_t kd, void *param);
|
|
|
|
void scrollhook(double xdelta, double ydelta, void *param);
|
|
|
|
void resizehook(int x, int y, void *param);
|
|
|
|
// draw.c
|
|
|
|
void ft_drawnextframe(t_varlist *vl);
|
2023-10-26 17:40:01 +02:00
|
|
|
// error.c
|
|
|
|
int ft_errorexit(char *reason, char *function, int code);
|
2023-10-25 14:07:29 +02:00
|
|
|
#endif
|