From 8571843f1405e676142e7bb289f9879d10a888ed Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Tue, 12 Mar 2013 13:32:49 +0300 Subject: add walkmaps support. Fast detecting between two targets is they in same walkable area. --- src/resources/mapreader.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/resources/mapreader.cpp') diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp index 6a149c6fd..464680620 100644 --- a/src/resources/mapreader.cpp +++ b/src/resources/mapreader.cpp @@ -279,13 +279,15 @@ Map *MapReader::readMap(XmlNodePtr node, const std::string &path) const std::string fileName = path.substr(path.rfind("/") + 1); map->setProperty("shortName", fileName); + ResourceManager *const resman = ResourceManager::getInstance(); + #ifdef USE_OPENGL if (graphicsManager.getUseAtlases()) { const MapDB::MapInfo *const info = MapDB::getMapAtlas(fileName); if (info) { - map->setAtlas(ResourceManager::getInstance()->getAtlas( + map->setAtlas(resman->getAtlas( info->atlas, *info->files)); } } @@ -393,6 +395,7 @@ Map *MapReader::readMap(XmlNodePtr node, const std::string &path) map->clearIndexedTilesets(); map->setActorsFix(0, atoi(map->getProperty("actorsfix").c_str())); map->reduce(); + map->setWalkLayer(resman->getWalkLayer(fileName, map)); return map; } -- cgit v1.2.3-70-g09d2