cub3d/includes/structs.h

80 lines
1.8 KiB
C
Raw Normal View History

2025-06-24 00:17:33 +02:00
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* structs.h :+: :+: :+: */
/* +:+ +:+ +:+ */
2025-07-15 10:33:25 +02:00
/* By: tchampio <tchampio@student.42lehavre. +#+ +:+ +#+ */
2025-06-24 00:17:33 +02:00
/* +#+#+#+#+#+ +#+ */
2025-07-15 10:33:25 +02:00
/* Created: 2025/07/15 10:32:57 by tchampio #+# #+# */
/* Updated: 2025/07/15 10:32:58 by tchampio ### ########.fr */
2025-06-24 00:17:33 +02:00
/* */
/* ************************************************************************** */
#ifndef STRUCTS_H
# define STRUCTS_H
2025-06-25 18:08:19 +02:00
# include <stdbool.h>
2025-06-24 00:17:33 +02:00
typedef struct s_mlx_data
{
void *img;
char *addr;
int bits_per_pixel;
int line_length;
int endian;
} t_mlx_data;
typedef enum e_direction
{
NORTH,
SOUTH,
EAST,
WEST
} t_direction;
2025-07-09 17:08:01 +02:00
typedef struct s_vec2
{
double x;
double y;
} t_vec2;
2025-06-24 00:17:33 +02:00
typedef struct s_mapdata
{
char *filename;
char *no_texture;
char *so_texture;
char *we_texture;
char *ea_texture;
int f_color;
int c_color;
int mapheight;
char **map;
char **mapflood;
int skipped_lines;
bool isvalid;
int startx;
int starty;
t_direction startdirection;
char error[1024];
} t_mapdata;
2025-07-07 14:40:37 +02:00
typedef struct s_player
{
2025-07-10 12:04:17 +02:00
double x;
double y;
2025-07-09 17:08:01 +02:00
double yaw;
int health;
t_vec2 movement;
2025-07-07 14:40:37 +02:00
} t_player;
typedef struct s_cub3d_data
{
void *mlx;
void *mlx_win;
t_mlx_data *mlx_data;
t_mapdata *map;
2025-07-07 14:40:37 +02:00
t_player player;
} t_cub3d_data;
2025-06-24 00:17:33 +02:00
#endif