Another update to SFML Tiled map loader

After a couple of requests I've modified the MapObject class so that setting a new position or moving an object also updates the associated AABB and debug shape. This is not a feature I generally use myself (preferring to leave MapObjects static in favour of creating specially dynamic entities) so it's not thoroughly tested, but an improvement on what it was (just plain broken). I've also added a new feature to map rendering, in that individual layers of a map can now be drawn via their index, or by their rendering type. For example you can now use

ml.Draw(rt, 3u);

to draw the fourth layer or

ml.Draw(rt, MapLayer::Debug);

to draw the debug output. This also means that the debug parameter from the original Draw function has been removed. Simply calling


will just draw every layer of the map according to its visibility. I've added this feature to aid drawing map layers over the top of custom layers, such as ones which may contain dynamic entities / sprites. The minimum compiler requirement has also been changed so that VS10 is no longer supported as it doesn't provide the necessary C++11 features (range based for-loop). I've tested it to work with VS11 and GCC > 4.7 should still be compatible. This brings the current version of the map loader to 0.4.

Popular Posts