diff options
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | src/resources/resourcemanager.cpp | 8 | ||||
-rw-r--r-- | src/resources/resourcemanager.h | 4 |
3 files changed, 11 insertions, 3 deletions
@@ -2,6 +2,8 @@ * src/gui/shoplistbox.cpp: Fixed shop list box not to scroll up when the selection is removed. + * src/resources/resourcemanager.h, src/resources/resourcemanager.cpp: + Added logging of error on PHYSFS_addToSearchPath. 2007-12-19 Philipp Sehmisch <tmw@crushnet.org> 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 diff --git a/src/resources/resourcemanager.h b/src/resources/resourcemanager.h index c52248b1..1adb8446 100644 --- a/src/resources/resourcemanager.h +++ b/src/resources/resourcemanager.h @@ -68,8 +68,10 @@ class ResourceManager * Adds a directory or archive to the search path. If append is true * then the directory is added to the end of the search path, otherwise * it is added at the front. + * + * @return <code>true</code> on success, <code>false</code> otherwise. */ - void + bool addToSearchPath(const std::string &path, bool append); /** |