-
Notifications
You must be signed in to change notification settings - Fork 110
Description
What problem does this solve or what need does it fill?
I'm currently using rs-tiled to load in a tilemap. When I load it into the engine, I need to do some processing on the data of each tile in each tileset to import it into my engine. This processing is considered costly so doing it each time I spawn a tile would be not ideal, so I'd like to cache it at the time of loading by having some kind of map from Tile to processed Data and store it with my Tilemap. My request is to have some cheap way to uniquely identify a tile within a map.
What solution would you like?
In the tmx file itself the tile layer uses a Gid to identify which tile it is. This Gid would be great as a key for a HashMap<Gid, UserData>
, but it's currently discarded at the end of the loading process:
Lines 275 to 276 in 1ffab03
// We do not need first GIDs any more | |
let tilesets = tilesets.into_iter().map(|ts| ts.tileset).collect(); |
What alternative(s) have you considered?
#303 adds the source
path of each tileset, allowing you to create a HashMap<PathBuf, HashMap<TileId, UserData>>
, but this would not be as ideal as using the Gid since this is a much more expensive key with lots of indirection.