tilesets
[vrlugburz] / src / level.h
1 #ifndef LEVEL_H_
2 #define LEVEL_H_
3
4 #include "scenefile.h"
5
6 enum {
7         TILE_STRAIGHT,
8         TILE_CORNER,
9         TILE_DOOR
10 };
11
12 enum {
13         CELL_SOLID,
14         CELL_WALK,
15         CELL_BLOCKED
16 };
17
18 struct tile {
19         char *name;
20         int type;
21         struct scenefile scn;
22         struct tile *next;
23 };
24
25 struct cell {
26         int type;
27         int wall[4];
28         int floor, ceil;
29
30         struct meshgroup mgrp;
31 };
32
33 struct level {
34         char *fname, *dirname;
35
36         int width, height;
37         struct cell *cells;
38
39         struct tile *tiles;
40 };
41
42
43 int init_level(struct level *lvl, int xsz, int ysz);
44 void destroy_level(struct level *lvl);
45
46 int load_level(struct level *lvl, const char *fname);
47 int save_level(struct level *lvl, const char *fname);
48
49 int gen_level_geom(struct level *lvl);
50
51 #endif  /* LEVEL_H_ */