summaryrefslogtreecommitdiffstats
path: root/src/resources/map.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/map.h')
-rw-r--r--src/resources/map.h15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/resources/map.h b/src/resources/map.h
index 673a01d..2926aa5 100644
--- a/src/resources/map.h
+++ b/src/resources/map.h
@@ -9,13 +9,15 @@
struct tileset {
struct resource res;
char *dirname;
- /* TODO: firstgid shouldn't apply to all uses of a tileset. */
- int firstgid;
char *name;
int tilewidth;
int tileheight;
struct image *image;
- struct tileset *next;
+};
+struct map_tileset {
+ struct tileset *tileset;
+ int firstgid;
+ struct map_tileset *next;
};
struct map {
struct resource res;
@@ -24,16 +26,17 @@ struct map {
int height;
int tilewidth;
int tileheight;
- struct tileset *tilesets_head;
- struct tileset *tilesets_tail;
+ struct map_tileset *tilesets_head;
+ struct map_tileset *tilesets_tail;
struct layer *layers_head;
struct layer *layers_tail;
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);
+void map_add_tileset(struct map *m, struct tileset *t, int firstgid);
#endif