summaryrefslogtreecommitdiffstats
path: root/src/resources/map.h
diff options
context:
space:
mode:
authorP. J. McDermott <pjm@nac.net>2013-02-17 04:50:18 (EST)
committer P. J. McDermott <pjm@nac.net>2013-02-17 04:50:18 (EST)
commit5a63b4c2710732f73caed6fa9fa08fcf1ca7fd44 (patch)
tree9f0690d206c1973296c9b65c31e24d7a6fc492ce /src/resources/map.h
parent3c09671866ff5131bcbb044b0df6326ff891fee6 (diff)
downloadoverworld-rpg-5a63b4c2710732f73caed6fa9fa08fcf1ca7fd44.zip
overworld-rpg-5a63b4c2710732f73caed6fa9fa08fcf1ca7fd44.tar.gz
overworld-rpg-5a63b4c2710732f73caed6fa9fa08fcf1ca7fd44.tar.bz2
Support layers in maps.
Diffstat (limited to 'src/resources/map.h')
-rw-r--r--src/resources/map.h23
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