You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

80 lines
1.9 KiB

/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* cub3d.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: narnaud <narnaud@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2022/05/21 19:24:12 by narnaud #+# #+# */
/* Updated: 2022/05/31 09:01:49 by narnaud ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef CUB3D_H
# define CUB3D_H
3 years ago
# ifndef DEBUG
# define DEBUG 0
# endif
# define WIN_X_SZ 900
# define WIN_Y_SZ 900
3 years ago
# define BUFFER_SIZE 4096
# define UNIT 200
# define WALL_HEIGHT 200
# define PLAYER_HEIGHT 170
# define SCREEN_DISTANCE 50
# include <unistd.h>
# include <stdio.h>
# include <fcntl.h>
# include <errno.h>
3 years ago
# include <string.h>
# include <math.h>
# include "../includes/libft.h"
# ifdef __linux__
# include "../includes/mlx.h"
# elif __APPLE__
# include <mlx.h>
# endif
# include "mlx_keycode.h"
typedef struct s_vector
{
int x;
int y;
} t_vec;
typedef struct s_vector_d
{
double x;
double y;
} t_vec_d;
typedef struct s_env
{
void *mlx;
3 years ago
void *win;
void *img;
int pixel_bits;
int line_bytes;
int endian;
int *buffer;
char *wallTexture[4];
int floorColor;
int ceilColor;
char **map;
int wide;
int deep;
t_vec_d playerPos;
t_vec_d playerDir;
} t_env;
3 years ago
int rgb_to_int(char **rgb);
void set_vec(t_vec_d *vec, int x, int y);
3 years ago
t_env *parse_envFile(char *filename);
char *get_next_line(int fd);
#endif