diff options
Diffstat (limited to 'src/resources/map.h')
-rw-r--r-- | src/resources/map.h | 23 |
1 files changed, 19 insertions, 4 deletions
diff --git a/src/resources/map.h b/src/resources/map.h index 2926aa5..11ba808 100644 --- a/src/resources/map.h +++ b/src/resources/map.h @@ -4,8 +4,17 @@ #include <SDL_stdinc.h> #include "resource.h" #include "image.h" -#include "layer.h" +enum layer_id { + LAYER_GROUND = 0, + LAYER_OBJ_LOW, + LAYER_CHAR_BOT, + LAYER_OBJ_MID, + LAYER_CHAR_TOP, + LAYER_OBJ_HIGH, + LAYER_WEATHER, + LAYERS_MAX +}; struct tileset { struct resource res; char *dirname; @@ -19,6 +28,13 @@ struct map_tileset { int firstgid; struct map_tileset *next; }; +struct layer { + struct map *map; + Uint32 *tiles; + char *encoding; + char *compression; + char *raw_data; +}; struct map { struct resource res; char *dirname; @@ -28,15 +44,14 @@ struct map { int tileheight; struct map_tileset *tilesets_head; struct map_tileset *tilesets_tail; - struct layer *layers_head; - struct layer *layers_tail; + struct layer layers[LAYERS_MAX]; Uint8 *collision; int cur_ts_firstgid; }; struct map *map_get(const char *path); void map_free(struct map *map); -void map_add_layer(struct map *m, struct layer *l); void map_add_tileset(struct map *m, struct tileset *t, int firstgid); +struct layer *map_get_layer(struct map *m, const char *name); #endif |