Comments in header file

This commit is contained in:
Angel Ortigosa Perez
2026-01-25 14:31:07 +01:00
parent fc5ff31806
commit edc4144d38

View File

@@ -6,7 +6,7 @@
/* By: aortigos <aortigos@student.42malaga.com +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2025/11/25 19:47:02 by aortigos #+# #+# */
/* Updated: 2025/12/15 10:27:21 by aortigos ### ########.fr */
/* Updated: 2026/01/25 14:30:55 by aortigos ### ########.fr */
/* */
/* ************************************************************************** */
@@ -42,6 +42,7 @@
# define ERR_MAP_DUP "Error: duplicate map element\n"
# define ERR_MAP_RGB "Error: invalid color map [RGB]\n"
// Storage for textures that we will use
typedef struct s_tex
{
mlx_texture_t *no;
@@ -50,6 +51,9 @@ typedef struct s_tex
mlx_texture_t *ea;
} t_tex;
// Temporal storage for checking textures
// so we dont load it as real texture, in case
// of failing. First check, then load as texture.
typedef struct s_texture_list
{
char *name;
@@ -57,17 +61,19 @@ typedef struct s_texture_list
struct s_texture_list *next;
} t_texture_list;
// Storage for player data
typedef struct s_player
{
int plyr_x; // player x position in pixels
int plyr_y; // player y position in pixels
double angle; // player angle
float fov_rd; // field of view in radians
int rot; // rotation flag
int l_r; // left right flag
int u_d; // up down flag
int plyr_x;
int plyr_y;
double angle;
float fov_rd;
int rot;
int l_r;
int u_d;
} t_player;
// Storage for raycasting properties
typedef struct s_ray
{
int index;
@@ -80,12 +86,13 @@ typedef struct s_ray
int flag;
} t_ray;
// Map data
typedef struct s_data
{
int p_x; // player x position in the map
int p_y; // player y position in the map
int w_map; // map width
int h_map; // map height
int p_x;
int p_y;
int w_map;
int h_map;
int fd;
char *line;
char *ture;
@@ -98,20 +105,20 @@ typedef struct s_data
t_texture_list *t_list;
} t_data;
// All global data in one unique structure
typedef struct s_mlx
{
mlx_image_t *img; // the image
mlx_t *mlx_ptr; // the mlx pointer
t_ray *ray; // the ray structure
t_data *dt; // the data structure
t_player *ply; // the player structure
mlx_image_t *img;
mlx_t *mlx_ptr;
t_ray *ray;
t_data *dt;
t_player *ply;
t_tex *tex;
t_texture_list *l_ture;
} t_mlx;
// Functions
// parsing.c
int read_map(char *av, t_data *map, int *count);
void get_x_y_player(t_data *data);