v1 of parsing finished

This commit is contained in:
B.Goulard 2024-11-27 12:01:31 +01:00
parent d586acba8f
commit 8211ff19ea
9 changed files with 121 additions and 37 deletions

View file

@ -6,7 +6,7 @@
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/30 16:30:26 by rparodi #+# #+# */
/* Updated: 2024/11/13 06:56:05 by bgoulard ### ########.fr */
/* Updated: 2024/11/27 11:56:07 by bgoulard ### ########.fr */
/* */
/* ************************************************************************** */
@ -30,7 +30,7 @@ void cleanup_info(t_info *info);
int c3_options(t_info *info, int argc, char *argv[]);
void c3_perror(t_info *info);
void print_error(const char *msg);
void print_error(const char *msg, int errno_state);
void parse_map(t_info *info);
void parse_args(char *arg, t_info *inf);

View file

@ -6,13 +6,14 @@
/* By: bgoulard <bgoulard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/11/09 01:15:15 by bgoulard #+# #+# */
/* Updated: 2024/11/11 21:34:02 by rparodi ### ########.fr */
/* Updated: 2024/11/27 11:35:39 by bgoulard ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef CUB3D_OPTIONS_H
# define CUB3D_OPTIONS_H
void c3_set_parse_excl(void *usr_control_struct);
void c3_set_file(void *usr_control_struct, const char *arg);
void c3_set_debug(void *usr_control_struct);
void c3_set_save(void *usr_control_struct);

View file

@ -6,7 +6,7 @@
/* By: bgoulard <bgoulard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/11/08 23:55:29 by bgoulard #+# #+# */
/* Updated: 2024/11/18 17:07:15 by bgoulard ### ########.fr */
/* Updated: 2024/11/27 11:50:14 by bgoulard ### ########.fr */
/* */
/* ************************************************************************** */
@ -62,9 +62,19 @@ typedef struct s_dpoint
typedef enum e_tile
{
EMPTY,
WALL
} t_tile;
EMPTY = 0,
WALL = 1,
} t_tile_type;
typedef union u_tile
{
int raw_tile;
struct {
unsigned int tile_visited: 1; // parsing
unsigned int other: 27; // disponible
unsigned int tile_type: 4; // 16 tile types possible
};
} t_tile;
typedef struct s_map
{
@ -94,6 +104,7 @@ typedef struct s_cli
char *file;
bool save;
bool help;
bool no_graphics;
} t_cli;
// -- error utils
@ -120,6 +131,7 @@ typedef enum e_error
typedef struct s_info
{
t_error last_error;
int errno_state;
t_xvar *mlx_ptr;
t_win_list *win_ptr;

View file

@ -6,7 +6,7 @@
/* By: rparodi <rparodi@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/10/30 16:43:20 by rparodi #+# #+# */
/* Updated: 2024/11/09 00:42:02 by bgoulard ### ########.fr */
/* Updated: 2024/11/27 11:57:28 by bgoulard ### ########.fr */
/* */
/* ************************************************************************** */
@ -19,5 +19,7 @@
# define RED "\x1b[31m"
# define BOLD_RED "\033[1;31m"
# define YELLOW "\x1b[33m"
# define BOLD_YELLOW "\033[1;33m"
# define RESET "\x1b[K\x1b[0m"
#endif