X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Flevel.h;h=a5a2ae63ceb2d67d2c53e6cb071d77d10605ed07;hb=32010751a69440b52780a4e570682f20b4ef70b2;hp=6a57dc2540750be6c74790b1ad6f8b7b42709ba9;hpb=6066118fc6a58b379f52b9aaaf45200b136812b9;p=vrlugburz diff --git a/src/level.h b/src/level.h index 6a57dc2..a5a2ae6 100644 --- a/src/level.h +++ b/src/level.h @@ -2,11 +2,19 @@ #define LEVEL_H_ #include "scenefile.h" +#include "tileset.h" + +#define DEF_CELL_SIZE 3.0f enum { - TILE_STRAIGHT, + TILE_OPEN, + TILE_STR, TILE_CORNER, - TILE_DOOR + TILE_OPENCORNER, + TILE_TEE, + TILE_CROSS, + TILE_STR2OPEN, + TILE_STROPEN }; enum { @@ -18,25 +26,42 @@ enum { struct tile { char *name; int type; - struct scenefile scn; + + struct meshgroup mgrp; + struct tile *next; }; struct cell { + int x, y; int type; + int tiletype, tilerot; int wall[4]; int floor, ceil; - struct meshgroup mgrp; + struct tile *tile; + 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; + + int visdist; }; @@ -46,6 +71,11 @@ 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); +int get_cell_type(struct level *lvl, int x, int y); + #endif /* LEVEL_H_ */