X-Git-Url: http://git.mutantstargoat.com/user/nuclear/?a=blobdiff_plain;f=src%2Flevel.h;h=6e6eed7c3110126b509d2c57d6512d50042f6ba6;hb=9089b4a32162a85cb3d244c915f31cc5adc3c389;hp=76006f358a79bab8bb9decd2df517a2ce7fa8150;hpb=fd7b604752c0ba03c347bc2ef3ee5a8c0759bff8;p=vrlugburz diff --git a/src/level.h b/src/level.h index 76006f3..6e6eed7 100644 --- a/src/level.h +++ b/src/level.h @@ -1,21 +1,57 @@ #ifndef LEVEL_H_ #define LEVEL_H_ +#include "scenefile.h" +#include "tileset.h" + +#define DEF_CELL_SIZE 3.0f + +enum { + TILE_OPEN, + TILE_STR, + TILE_CORNER, + TILE_TEE, + TILE_CROSS, + TILE_STR2OPEN +}; + enum { CELL_SOLID, CELL_WALK, CELL_BLOCKED }; +struct tile { + char *name; + int type; + struct tile *next; +}; + struct cell { int type; int wall[4]; int floor, ceil; + + 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 tileset *tset; + + /* meshes owned by the level, constructed during geometry generation or + * loaded, excluding meshes in tiles scenefiles + */ + struct mesh *meshlist; }; @@ -25,4 +61,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_ */