/* ************************************************************************** */ /* */ /* :::::::: */ /* cub3d.h :+: :+: */ /* +:+ */ /* By: houtworm +#+ */ /* +#+ */ /* Created: 2023/10/26 10:46:35 by houtworm #+# #+# */ /* Updated: 2023/11/05 08:22:47 by houtworm ######## odam.nl */ /* */ /* ************************************************************************** */ #ifndef CUB3D_H # define CUB3D_H # include # include # include # include "libft/libft.h" # include "getnextline/get_next_line.h" # include "mlx/include/MLX42/MLX42.h" # include typedef struct s_sprite { double distance; double x; double y; int type; } t_sprite; typedef struct s_varlist { mlx_t *mlx; mlx_image_t *img; mlx_image_t *fstat; mlx_image_t *tstat; mlx_image_t *kstat; mlx_texture_t *temptext; mlx_texture_t **walltext; mlx_texture_t **decotext; mlx_texture_t **picktext; mlx_texture_t **nazitext; t_sprite *sprite; int spritecount; int w; int h; char **map; double frametime; double posx; double posy; double dirx; double diry; double planex; double planey; int vaim; int jump; double run; double raydirx; double raydiry; double sidedistx; double sidedisty; double deltadistx; double deltadisty; double walldist; int lineheight; int side; double oldmouseposx; double oldmouseposy; int32_t fcolor; int32_t ccolor; int *distance; int treasure; int tottreasure; int enemies; int kills; int mgun; int ggun; } t_varlist; // MAIN t_varlist initgame(void); int ft_errorexit(char *reason, char *function, int code); void ft_printstats(t_varlist *vl); void ft_cleanup(t_varlist *vl); // PARSE t_varlist ft_parseconfigfile(t_varlist vl, char *filename); char **ft_getmap(t_varlist *vl, int fd); // INPUT void ft_processinput(t_varlist *vl); void ft_processturn(t_varlist *vl, double rotspeed); void ft_processmove(t_varlist *vl, double movespeed); void ft_processacro(t_varlist *vl, double movespeed); void ft_processguns(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); void cursorhook(double x, double y, void *param); // DRAW void ft_raycast(t_varlist *vl, int x, int mapx, int mapy); void ft_drawmap(t_varlist *vl); int ft_gettextx(t_varlist *vl); uint32_t ft_gettextcolor(t_varlist *vl, int texty, int textx); // SPRITE void ft_drawsprites(t_varlist *vl); void ft_pickup(t_varlist *vl); #endif