added scr_lvled, a bunch of libraries, and improved framework code
[raydungeon] / src / level.h
index 260ed0a..0a1a605 100644 (file)
@@ -9,22 +9,29 @@ enum { CELL_SOLID, CELL_OPEN };
 struct level_cell {
        int type;
        unsigned int wallflags[4];
+       int visited;
 };
 
-struct level_span {
-       int start, len;
+struct level_rect {
+       int x, y, w, h;
+       unsigned char dbgcol[4];
 };
 
 struct level {
        int xsz, ysz;
+       float scale;
        struct level_cell *cells;
+       int sx, sy;
 
-       struct level_span *hspans, *vspans;     /* dynamic array */
+       struct level_rect *rects;       /* darr, empty spaces */
 };
 
 void init_level(struct level *lvl);
 void destroy_level(struct level *lvl);
 
+void lvl_gen_rects(struct level *lvl);
+
+int save_level(const struct level *lvl, const char *fname);
 int load_level(struct level *lvl, const char *fname);
 
 #endif /* LEVEL_H_ */