From 539af2ea0ce3245c41b4a4be989da35788f7b992 Mon Sep 17 00:00:00 2001 From: Bjørn Lindeijer Date: Fri, 21 Dec 2007 12:37:17 +0000 Subject: Added logging of error on PHYSFS_addToSearchPath. --- src/resources/resourcemanager.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/resources/resourcemanager.cpp') diff --git a/src/resources/resourcemanager.cpp b/src/resources/resourcemanager.cpp index 3368d05b..658915d2 100644 --- a/src/resources/resourcemanager.cpp +++ b/src/resources/resourcemanager.cpp @@ -106,11 +106,15 @@ ResourceManager::setWriteDir(const std::string &path) return (bool) PHYSFS_setWriteDir(path.c_str()); } -void +bool ResourceManager::addToSearchPath(const std::string &path, bool append) { logger->log("Adding to PhysicsFS: %s", path.c_str()); - PHYSFS_addToSearchPath(path.c_str(), append ? 1 : 0); + if (!PHYSFS_addToSearchPath(path.c_str(), append ? 1 : 0)) { + logger->log("Error: %s", PHYSFS_getLastError()); + return false; + } + return true; } void -- cgit v1.2.3-70-g09d2