bjorn/tiled — pull request #258 by winniehell (2012-08-08 15:21:54+00:00)
Title: Use relative tag

I store my TMX files and the tile images at different locations, namely assets/gfx/tileset.png and assets/maps/name/map.tmx. When I set in map.tmx, the current behavior of libtiled is to search for assets/maps/name/gfx/tileset.png. I'd like to have this more flexible, so I introduced a "relative" attribute with the following values:

* "true": treat the source attribute as a relative path
* "false": treat the source attribute as an absolute path
* "auto": auto detect (which is the current behavior)

The "relative" attribute is optional and "auto" is the default value. For all unknown values (i.e. actually all besides "true" and "false) it falls back to "auto".

I have tested my patch for tiled and tmxviewer and it does what I expected it to do. I would be glad if this patch could make it into the library.

By the way, thank you a lot for this helpful tool and the awesome documentation and well written code. This made it incredibly simple to write the patch.