From 3c09671866ff5131bcbb044b0df6326ff891fee6 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Sun, 17 Feb 2013 03:13:14 -0500 Subject: Give each use of a tileset a unique firstgid. --- (limited to 'src/resources/map.h') 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 -- cgit v0.9.1