diff options
author | Andrei Karas <akaras@inbox.ru> | 2013-03-12 13:32:49 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2013-03-17 14:53:41 +0300 |
commit | 8571843f1405e676142e7bb289f9879d10a888ed (patch) | |
tree | e414c90b31979372220fa5c78f9ebb6cc05cd024 /src/resources/mapreader.cpp | |
parent | 3d8682618f0b46a334f9db5dd0c780f671e7f072 (diff) | |
download | manaplus-8571843f1405e676142e7bb289f9879d10a888ed.tar.gz manaplus-8571843f1405e676142e7bb289f9879d10a888ed.tar.bz2 manaplus-8571843f1405e676142e7bb289f9879d10a888ed.tar.xz manaplus-8571843f1405e676142e7bb289f9879d10a888ed.zip |
add walkmaps support.
Fast detecting between two targets is they in same walkable area.
Diffstat (limited to 'src/resources/mapreader.cpp')
-rw-r--r-- | src/resources/mapreader.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
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; } |