summaryrefslogtreecommitdiff
path: root/src/resources/resourcemanager.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/resourcemanager.cpp')
-rw-r--r--src/resources/resourcemanager.cpp13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp
index e729ecfc..23a73497 100644
--- a/src/resources/resourcemanager.cpp
+++ b/src/resources/resourcemanager.cpp
@@ -73,7 +73,10 @@ void
ResourceManager::cleanUp(Resource *res)
{
logger->log("ResourceManager::~ResourceManager() cleaning up %d "
- "references to %s", res->mRefCount, res->mIdPath.c_str());
+ "reference%s to %s",
+ res->mRefCount,
+ (res->mRefCount == 1) ? "" : "s",
+ res->mIdPath.c_str());
delete res;
}
@@ -119,9 +122,13 @@ ResourceManager::get(const E_RESOURCE_TYPE &type, const std::string &idPath)
return resIter->second;
}
+ logger->log("ResourceManager::get(%s)", idPath.c_str());
+
int fileSize;
void *buffer = loadFile(idPath, fileSize);
+
if (!buffer) {
+ logger->log("Warning: resource doesn't exist!");
return NULL;
}
@@ -258,10 +265,6 @@ ResourceManager::loadFile(const std::string &fileName, int &fileSize)
return NULL;
}
- // Log the real dir of the file
- logger->log("Loaded %s/%s", PHYSFS_getRealDir(fileName.c_str()),
- fileName.c_str());
-
// Get the size of the file
fileSize = PHYSFS_fileLength(file);