diff options
| author | Charles <sircharlesaze@gmail.com> | 2019-11-13 17:29:19 +0100 |
|---|---|---|
| committer | Charles <sircharlesaze@gmail.com> | 2019-11-13 17:29:19 +0100 |
| commit | b71e91e052a2884626c297cb014cbe2b63131c80 (patch) | |
| tree | 1a3c081fa637662553f292b6305390229bc2591e /cub3d.h | |
| parent | 2007f61ef09c0b538aca2a7f20428f81175f322f (diff) | |
| download | cub3d-b71e91e052a2884626c297cb014cbe2b63131c80.tar.gz cub3d-b71e91e052a2884626c297cb014cbe2b63131c80.tar.bz2 cub3d-b71e91e052a2884626c297cb014cbe2b63131c80.zip | |
Basic parsing structure, Added subject
Diffstat (limited to 'cub3d.h')
| -rw-r--r-- | cub3d.h | 67 |
1 files changed, 67 insertions, 0 deletions
@@ -0,0 +1,67 @@ +#ifndef CUB3D_H +# define CUB3D_H + +# include <stdlib.h> +# include "libft.h" + +# define TRUE 1 +# define FALSE 0 + +typedef int t_bool; + +typedef struct +{ + int x; + int y; +} t_point; + +typedef struct +{ + int r; + int g; + int b; +} t_color; + +typedef enum +{ + CELL_EMPTY, + CELL_WALL, + CELL_ITEM, + CELL_LOOK_NORTH, + CELL_LOOK_SOUTH, + CELL_LOOK_WEST, + CELL_LOOK_EAST +} t_cell; + +typedef t_cell** t_map; + +typedef struct +{ + int resolution_height; + int resolution_width; + char *north_texture_path; + char *south_texture_path; + char *west_texture_path; + char *east_texture_path; + char *sprite_texture_path; + t_color floor_color; + t_color ceilling_color; + t_map map; +} t_parsing; + +typedef t_bool (*func)(t_parsing *parsing, char *line) t_line_parser_func; + +typedef struct +{ + char *id; + t_line_parser_func func; +} t_line_parser; + +/* +** parse.c +*/ + +t_parsing *parse(char *filename); +t_bool parse_line(t_parsing *parsing, char *line); + +#endif |
