From bb216d7fb966156b8ea2ecb284b680309b92585b Mon Sep 17 00:00:00 2001 From: Steve Cotton Date: Fri, 3 Apr 2009 03:11:15 +0100 Subject: Collision layer generation tool --- tools/tmxcopy/map.hpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'tools/tmxcopy/map.hpp') 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 */ + 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 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(); } -- cgit v1.2.3-70-g09d2