From 29ad6702ab90fc75fe9d0422609609fd15123fc3 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 26 Sep 2012 01:57:54 +0300 Subject: Some error fixes in atlases. Check if image already in cache and check for mapinfo before using it. --- src/resources/resourcemanager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/resources/resourcemanager.cpp') diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp index 5270e6f60..9beba49e7 100644 --- a/src/resources/resourcemanager.cpp +++ b/src/resources/resourcemanager.cpp @@ -399,6 +399,12 @@ Resource *ResourceManager::getFromCache(const std::string &filename, return getFromCache(ss.str()); } +bool ResourceManager::isInCache(const std::string &idPath) const +{ + const ResourceCIterator &resIter = mResources.find(idPath); + return (resIter != mResources.end() && resIter->second); +} + Resource *ResourceManager::getFromCache(const std::string &idPath) { // Check if the id exists, and return the value if it does. -- cgit v1.2.3-70-g09d2