reorganizing tileset handling
[vrlugburz] / src / level.h
index 6a57dc2..3a31af6 100644 (file)
@@ -3,10 +3,15 @@
 
 #include "scenefile.h"
 
+#define DEF_CELL_SIZE  3.0f
+
 enum {
-       TILE_STRAIGHT,
+       TILE_OPEN,
+       TILE_STR,
        TILE_CORNER,
-       TILE_DOOR
+       TILE_TEE,
+       TILE_CROSS,
+       TILE_STR2OPEN
 };
 
 enum {
@@ -18,7 +23,6 @@ enum {
 struct tile {
        char *name;
        int type;
-       struct scenefile scn;
        struct tile *next;
 };
 
@@ -27,16 +31,26 @@ struct cell {
        int wall[4];
        int floor, ceil;
 
-       struct meshgroup mgrp;
+       struct meshgroup *mgrp;
+       int num_mgrp;
+
+       struct cell *next;
 };
 
 struct level {
        char *fname, *dirname;
 
        int width, height;
+       int px, py;                             /* player start position */
+       float cell_size;
        struct cell *cells;
 
-       struct tile *tiles;
+       struct tileset *tset;
+
+       /* meshes owned by the level, constructed during geometry generation or
+        * loaded, excluding meshes in tiles scenefiles
+        */
+       struct mesh *meshlist;
 };
 
 
@@ -46,6 +60,9 @@ void destroy_level(struct level *lvl);
 int load_level(struct level *lvl, const char *fname);
 int save_level(struct level *lvl, const char *fname);
 
+struct tile *find_level_tile(struct level *lvl, int type);
+
+int gen_cell_geom(struct level *lvl, struct cell *cell);
 int gen_level_geom(struct level *lvl);
 
 #endif /* LEVEL_H_ */