aboutsummaryrefslogtreecommitdiff
path: root/cub3d.h
blob: 78e5b846d186335999051976a0df7464de3bbc27 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
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