260ed0abbe7bb9b66fa9201bc5b8e59c39de97b8
[raydungeon] / src / level.h
1 #ifndef LEVEL_H_
2 #define LEVEL_H_
3
4 enum { DIR_N, DIR_E, DIR_S, DIR_W };
5
6 enum { CELL_SOLID, CELL_OPEN };
7 #define CELL_WALK       0x0100
8
9 struct level_cell {
10         int type;
11         unsigned int wallflags[4];
12 };
13
14 struct level_span {
15         int start, len;
16 };
17
18 struct level {
19         int xsz, ysz;
20         struct level_cell *cells;
21
22         struct level_span *hspans, *vspans;     /* dynamic array */
23 };
24
25 void init_level(struct level *lvl);
26 void destroy_level(struct level *lvl);
27
28 int load_level(struct level *lvl, const char *fname);
29
30 #endif  /* LEVEL_H_ */