diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-01-18 21:51:16 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-01-18 21:51:16 +0300 |
commit | 266773f838c6c0c6f857a7a7fbcbbe8d6333f03b (patch) | |
tree | 5d9b5a74d0faf7c6fc1b253593cc856de11bbb3c | |
parent | 07fa80d2c125df1cb716e9535e15aa7cc03761fb (diff) | |
download | manaplus-266773f838c6c0c6f857a7a7fbcbbe8d6333f03b.tar.gz manaplus-266773f838c6c0c6f857a7a7fbcbbe8d6333f03b.tar.bz2 manaplus-266773f838c6c0c6f857a7a7fbcbbe8d6333f03b.tar.xz manaplus-266773f838c6c0c6f857a7a7fbcbbe8d6333f03b.zip |
Replace left direct physfs functions calls into physfs namespace functions.
-rw-r--r-- | src/gui/theme.cpp | 4 | ||||
-rw-r--r-- | src/resources/resourcemanager/resourcemanager.cpp | 4 | ||||
-rw-r--r-- | src/utils/physfstools.cpp | 10 | ||||
-rw-r--r-- | src/utils/physfstools.h | 2 |
4 files changed, 16 insertions, 4 deletions
diff --git a/src/gui/theme.cpp b/src/gui/theme.cpp index a22f682e6..76a5d0a94 100644 --- a/src/gui/theme.cpp +++ b/src/gui/theme.cpp @@ -570,9 +570,9 @@ void Theme::fillSkinsList(StringVect &list) void Theme::fillFontsList(StringVect &list) { - PHYSFS_permitSymbolicLinks(1); + PhysFs::permitLinks(true); Files::getFiles(branding.getStringValue("fontsPath"), list); - PHYSFS_permitSymbolicLinks(0); + PhysFs::permitLinks(false); } void Theme::fillSoundsList(StringVect &list) diff --git a/src/resources/resourcemanager/resourcemanager.cpp b/src/resources/resourcemanager/resourcemanager.cpp index 04811510e..0612fdbb4 100644 --- a/src/resources/resourcemanager/resourcemanager.cpp +++ b/src/resources/resourcemanager/resourcemanager.cpp @@ -349,7 +349,7 @@ bool ResourceManager::addToSearchPath(const std::string &path, { logger->log("Error: %s: addToSearchPath failed: %s", path.c_str(), - PHYSFS_getLastError()); + PhysFs::getLastError()); return false; } return true; @@ -362,7 +362,7 @@ bool ResourceManager::removeFromSearchPath(const std::string &path) const { logger->log("Error: %s: removeFromSearchPath failed: %s", path.c_str(), - PHYSFS_getLastError()); + PhysFs::getLastError()); return false; } return true; diff --git a/src/utils/physfstools.cpp b/src/utils/physfstools.cpp index 1424bb2a2..cc17c09b3 100644 --- a/src/utils/physfstools.cpp +++ b/src/utils/physfstools.cpp @@ -171,4 +171,14 @@ namespace PhysFs } return true; } + + void permitLinks(const bool val) + { + PHYSFS_permitSymbolicLinks(val ? 1 : 0); + } + + const char *getLastError() + { + return PHYSFS_getLastError(); + } } // namespace PhysFs diff --git a/src/utils/physfstools.h b/src/utils/physfstools.h index e524dad64..dd91f18b1 100644 --- a/src/utils/physfstools.h +++ b/src/utils/physfstools.h @@ -45,6 +45,8 @@ namespace PhysFs bool mkdir(const char *const dirName); void *loadFile(const std::string &fileName, int &fileSize); bool deinit(); + void permitLinks(const bool val); + const char *getLastError(); } // namespace PhysFs extern const char *dirSeparator; |