diff options
author | Steve Cotton <steve@s.cotton.clara.co.uk> | 2009-04-11 22:04:13 +0100 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-04-16 11:34:55 +0200 |
commit | d436967e4761b38714fd3410e4907fab829f925d (patch) | |
tree | 86f383f9993c01d99a2792fa15ff596a416d26d2 /tools/tmxcopy/map.hpp | |
parent | bb216d7fb966156b8ea2ecb284b680309b92585b (diff) | |
download | mana-d436967e4761b38714fd3410e4907fab829f925d.tar.gz mana-d436967e4761b38714fd3410e4907fab829f925d.tar.bz2 mana-d436967e4761b38714fd3410e4907fab829f925d.tar.xz mana-d436967e4761b38714fd3410e4907fab829f925d.zip |
TMXCollide wasn't handling tilesets right.
Wasn't using the translation table from template map's tilesets to
target map's tilesets.
Also WIP for tmx_random_fill: better control of number of objects added
Diffstat (limited to 'tools/tmxcopy/map.hpp')
-rw-r--r-- | tools/tmxcopy/map.hpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/tools/tmxcopy/map.hpp b/tools/tmxcopy/map.hpp index d6cd3d1a..3be932ab 100644 --- a/tools/tmxcopy/map.hpp +++ b/tools/tmxcopy/map.hpp @@ -69,6 +69,13 @@ struct Tileset }; +/** + * A tile in a layer of a map. + * + * With the exception of the emptyTile and empty() function, + * interpreting what this tile represents depends on the map it + * belongs to (specifically the ordering of that map's tilesets). + */ struct Tile { int tileset; // number of tileset @@ -82,7 +89,8 @@ struct Tile /* This is to allow std::map<Tile,Tile> */ bool operator< (const Tile& b) const { - return ((tileset < b.tileset) || (index < b.index)); + return ((tileset < b.tileset) || + ((tileset == b.tileset) && (index < b.index))); } bool operator!= (const Tile& b) const @@ -144,7 +152,7 @@ class Map /** * Translates a layer - using the template, generates collision from visible layers (for example). - * TODO - avoid confusion with the math term "translate" + * TODO - avoid confusion with the geometry term "translate" */ bool translateAllLayers(Map* templateMap, const std::string& destLayerName, const ConfigurationOptions& config); |