cub3d/inc/types.h
2025-04-25 10:46:34 +02:00

84 lines
1.8 KiB
C

/* ************************************************************************** */
/* */
/* :::::::: */
/* types.h :+: :+: */
/* +:+ */
/* By: qmennen <qmennen@student.codam.nl> +#+ */
/* +#+ */
/* Created: 2025/04/15 15:52:44 by qmennen #+# #+# */
/* Updated: 2025/04/25 10:01:28 by whaffman ######## odam.nl */
/* */
/* ************************************************************************** */
#ifndef TYPES_H
# define TYPES_H
# include "cub3d.h"
typedef enum TILE
{
TILE_VISITED = -2,
TILE_VOID = -1,
TILE_EMPTY = 0,
TILE_WALL = 1,
TILE_PLAYER = 2,
} t_tile;
typedef struct s_vec2
{
float x;
float y;
} t_vec2;
typedef struct s_vec2_line
{
t_vec2 support;
t_vec2 dir;
} t_vec2_line;
typedef struct s_player
{
t_vec2 pos;
t_vec2 dir;
t_vec2 camera;
float speed;
float fov;
} t_player;
typedef struct s_map
{
unsigned int width;
unsigned int height;
t_tile **grid;
char *NO_texture;
char *SO_texture;
char *WE_texture;
char *EA_texture;
int floor_color;
int ceiling_color;
} t_map;
typedef struct s_keyboard
{
int keys[NUM_KEYS];
int last_keys[NUM_KEYS];
} t_keyboard;
typedef struct s_screen
{
mlx_t *mlx;
mlx_image_t *img;
unsigned int width;
unsigned int height;
} t_screen;
typedef struct s_game
{
t_map *map;
t_player *player;
t_screen *screen;
t_keyboard *keyboard;
} t_game;
#endif