diff options
author | Steve Cotton <steve@s.cotton.clara.co.uk> | 2009-04-03 03:11:15 +0100 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-04-16 11:34:39 +0200 |
commit | bb216d7fb966156b8ea2ecb284b680309b92585b (patch) | |
tree | c418b5e455cb8e01eb30e091d040c7a0256d0dc6 /tools/tmxcopy/map.hpp | |
parent | 1d48fa06e9f1bdca6ca28b2b43c8a1bc01a96dca (diff) | |
download | mana-bb216d7fb966156b8ea2ecb284b680309b92585b.tar.gz mana-bb216d7fb966156b8ea2ecb284b680309b92585b.tar.bz2 mana-bb216d7fb966156b8ea2ecb284b680309b92585b.tar.xz mana-bb216d7fb966156b8ea2ecb284b680309b92585b.zip |
Collision layer generation tool
Diffstat (limited to 'tools/tmxcopy/map.hpp')
-rw-r--r-- | tools/tmxcopy/map.hpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tools/tmxcopy/map.hpp b/tools/tmxcopy/map.hpp index 4b0ab59a..d6cd3d1a 100644 --- a/tools/tmxcopy/map.hpp +++ b/tools/tmxcopy/map.hpp @@ -78,6 +78,17 @@ struct Tile { return (tileset == -1); } + + /* This is to allow std::map<Tile,Tile> */ + bool operator< (const Tile& b) const + { + return ((tileset < b.tileset) || (index < b.index)); + } + + bool operator!= (const Tile& b) const + { + return ((tileset != b.tileset) || (index != b.index)); + } }; typedef std::vector<Tile> LayerTiles; @@ -131,6 +142,13 @@ class Map int destX, int destY, int destWidth, int destHeight, const ConfigurationOptions& config); + /** + * Translates a layer - using the template, generates collision from visible layers (for example). + * TODO - avoid confusion with the math term "translate" + */ + bool translateAllLayers(Map* templateMap, const std::string& destLayerName, + const ConfigurationOptions& config); + int save(std::string filename); int getNumberOfLayers() { return mLayers.size(); } |