From eab637f57db36a104815217a432416d852d141a6 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Mon, 6 Jun 2016 18:45:57 +0300 Subject: Report in map reader if loaded tilesets not included into atlases. --- src/resources/map/map.h | 3 +++ src/resources/mapreader.cpp | 16 ++++++++++++++-- 2 files changed, 17 insertions(+), 2 deletions(-) (limited to 'src/resources') diff --git a/src/resources/map/map.h b/src/resources/map/map.h index 99e5002a7..c658b9b30 100644 --- a/src/resources/map/map.h +++ b/src/resources/map/map.h @@ -375,6 +375,9 @@ class Map final : public Properties, std::string getCounterName() const override final { return mName; } + bool haveAtlas() const + { return mAtlas != nullptr; } + protected: friend class Actor; friend class Minimap; diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp index 1736c0cd5..67ce2f465 100644 --- a/src/resources/mapreader.cpp +++ b/src/resources/mapreader.cpp @@ -1063,9 +1063,21 @@ Tileset *MapReader::readTileset(XmlNodePtr node, if (tilebmp) { - set = new Tileset(tilebmp, tw, th, firstGid, margin, - spacing); + set = new Tileset(tilebmp, + tw, th, + firstGid, + margin, + spacing); tilebmp->decRef(); +#ifdef USE_OPENGL + if (tilebmp->getType() == ImageType::Image && + map->haveAtlas() == true && + graphicsManager.getUseAtlases()) + { + reportAlways("Error: image '%s' not present in atlas", + source.c_str()); + } +#endif } else { -- cgit v1.2.3-60-g2f50