diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-02-10 20:16:03 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-02-10 20:47:24 +0300 |
commit | 6c9c56b70db43f4100863d312835fce763698008 (patch) | |
tree | 4a182019f18677c1b71202a79d8f4faceebe05c9 /src/resources | |
parent | 5e7866bd7cc3bf850d9ba3e636d8eca88ac797c7 (diff) | |
download | mv-6c9c56b70db43f4100863d312835fce763698008.tar.gz mv-6c9c56b70db43f4100863d312835fce763698008.tar.bz2 mv-6c9c56b70db43f4100863d312835fce763698008.tar.xz mv-6c9c56b70db43f4100863d312835fce763698008.zip |
Rename physfstools into virtfs.
Diffstat (limited to 'src/resources')
-rw-r--r-- | src/resources/atlas/atlasmanager.cpp | 2 | ||||
-rw-r--r-- | src/resources/dye/dye_unittest.cc | 4 | ||||
-rw-r--r-- | src/resources/dye/dyepalette_unittest.cc | 4 | ||||
-rw-r--r-- | src/resources/loaders/imageloader.cpp | 2 | ||||
-rw-r--r-- | src/resources/loaders/musicloader.cpp | 2 | ||||
-rw-r--r-- | src/resources/loaders/soundloader.cpp | 2 | ||||
-rw-r--r-- | src/resources/map/map.cpp | 2 | ||||
-rw-r--r-- | src/resources/mapreader.cpp | 4 | ||||
-rw-r--r-- | src/resources/resourcemanager/resourcemanager.cpp | 22 | ||||
-rw-r--r-- | src/resources/resourcemanager/resourcemanager_unittest.cc | 4 | ||||
-rw-r--r-- | src/resources/sprite/animatedsprite_unittest.cc | 4 | ||||
-rw-r--r-- | src/resources/wallpaper.cpp | 14 |
12 files changed, 33 insertions, 33 deletions
diff --git a/src/resources/atlas/atlasmanager.cpp b/src/resources/atlas/atlasmanager.cpp index 90b72b4d6..7299e76d3 100644 --- a/src/resources/atlas/atlasmanager.cpp +++ b/src/resources/atlas/atlasmanager.cpp @@ -168,7 +168,7 @@ void AtlasManager::loadImages(const StringVect &files, } else { - reportAlways("Physfs error: %s", PhysFs::getLastError()); + reportAlways("Physfs error: %s", VirtFs::getLastError()); } delete d; } diff --git a/src/resources/dye/dye_unittest.cc b/src/resources/dye/dye_unittest.cc index 370800675..f3d4fe3ba 100644 --- a/src/resources/dye/dye_unittest.cc +++ b/src/resources/dye/dye_unittest.cc @@ -42,7 +42,7 @@ #include "utils/delete2.h" #include "utils/env.h" -#include "utils/physfstools.h" +#include "utils/virtfs.h" #ifndef USE_SDL2 #include <SDL.h> @@ -2391,5 +2391,5 @@ TEST_CASE("Dye real dye") dyeCheck("|A:#0000FFFF,FF000050", "arrow_up_A.png"); } delete2(client); -// PhysFs::deinit(); +// VirtFs::deinit(); } diff --git a/src/resources/dye/dyepalette_unittest.cc b/src/resources/dye/dyepalette_unittest.cc index 295a7cac9..42770e878 100644 --- a/src/resources/dye/dyepalette_unittest.cc +++ b/src/resources/dye/dyepalette_unittest.cc @@ -41,7 +41,7 @@ #include "utils/delete2.h" #include "utils/env.h" -#include "utils/physfstools.h" +#include "utils/virtfs.h" #ifndef USE_SDL2 #include <SDL.h> @@ -381,5 +381,5 @@ TEST_CASE("DyePalette tests") REQUIRE(palette.mColors[0].value[3] == 0x77); } delete2(client); -// PhysFs::deinit(); +// VirtFs::deinit(); } diff --git a/src/resources/loaders/imageloader.cpp b/src/resources/loaders/imageloader.cpp index 21e7479f4..4fada1f44 100644 --- a/src/resources/loaders/imageloader.cpp +++ b/src/resources/loaders/imageloader.cpp @@ -67,7 +67,7 @@ namespace { delete d; reportAlways("Image loading error: %s", path1.c_str()); - reportAlways("Physfs error: %s", PhysFs::getLastError()); + reportAlways("Physfs error: %s", VirtFs::getLastError()); BLOCK_END("DyedImageLoader::load") return nullptr; } diff --git a/src/resources/loaders/musicloader.cpp b/src/resources/loaders/musicloader.cpp index 4610911bb..7b0cda647 100644 --- a/src/resources/loaders/musicloader.cpp +++ b/src/resources/loaders/musicloader.cpp @@ -48,7 +48,7 @@ namespace SDL_RWops *const rw = MPHYSFSRWOPS_openRead(rl->path.c_str()); if (!rw) { - reportAlways("Physfs error: %s", PhysFs::getLastError()); + reportAlways("Physfs error: %s", VirtFs::getLastError()); reportAlways("Error loading resource: %s", rl->path.c_str()); return nullptr; diff --git a/src/resources/loaders/soundloader.cpp b/src/resources/loaders/soundloader.cpp index 0934c1852..569d2dfbe 100644 --- a/src/resources/loaders/soundloader.cpp +++ b/src/resources/loaders/soundloader.cpp @@ -48,7 +48,7 @@ namespace SDL_RWops *const rw = MPHYSFSRWOPS_openRead(rl->path.c_str()); if (!rw) { - reportAlways("Physfs error: %s", PhysFs::getLastError()); + reportAlways("Physfs error: %s", VirtFs::getLastError()); reportAlways("Error loading resource: %s", rl->path.c_str()); return nullptr; diff --git a/src/resources/map/map.cpp b/src/resources/map/map.cpp index 5cd8affb9..afc2bbffd 100644 --- a/src/resources/map/map.cpp +++ b/src/resources/map/map.cpp @@ -63,7 +63,7 @@ #include "utils/delete2.h" #include "utils/dtor.h" #include "utils/mkdir.h" -#include "utils/physfstools.h" +#include "utils/virtfs.h" #include "utils/timer.h" #include <queue> diff --git a/src/resources/mapreader.cpp b/src/resources/mapreader.cpp index 14adad5e2..414b87987 100644 --- a/src/resources/mapreader.cpp +++ b/src/resources/mapreader.cpp @@ -58,7 +58,7 @@ #include "utils/base64.h" #include "utils/checkutils.h" #include "utils/delete2.h" -#include "utils/physfstools.h" +#include "utils/virtfs.h" #include "utils/stringmap.h" #include "utils/translation/podict.h" @@ -1279,7 +1279,7 @@ void MapReader::updateMusic(Map *const map) if (p != std::string::npos) name = name.substr(0, p); name.append(".ogg"); - if (PhysFs::exists(paths.getStringValue("music").append(name).c_str())) + if (VirtFs::exists(paths.getStringValue("music").append(name).c_str())) map->setProperty("music", name); } diff --git a/src/resources/resourcemanager/resourcemanager.cpp b/src/resources/resourcemanager/resourcemanager.cpp index 0612fdbb4..8b51b1ec2 100644 --- a/src/resources/resourcemanager/resourcemanager.cpp +++ b/src/resources/resourcemanager/resourcemanager.cpp @@ -336,7 +336,7 @@ void ResourceManager::clearDeleted(const bool full) } bool ResourceManager::setWriteDir(const std::string &path) const { - return static_cast<bool>(PhysFs::setWriteDir(path.c_str())); + return static_cast<bool>(VirtFs::setWriteDir(path.c_str())); } bool ResourceManager::addToSearchPath(const std::string &path, @@ -344,12 +344,12 @@ bool ResourceManager::addToSearchPath(const std::string &path, { logger->log("Adding to PhysicsFS: %s (%s)", path.c_str(), append == Append_true ? "append" : "prepend"); - if (!PhysFs::addToSearchPath(path.c_str(), + if (!VirtFs::addToSearchPath(path.c_str(), append == Append_true ? 1 : 0)) { logger->log("Error: %s: addToSearchPath failed: %s", path.c_str(), - PhysFs::getLastError()); + VirtFs::getLastError()); return false; } return true; @@ -358,11 +358,11 @@ bool ResourceManager::addToSearchPath(const std::string &path, bool ResourceManager::removeFromSearchPath(const std::string &path) const { logger->log("Removing from PhysicsFS: %s", path.c_str()); - if (!PhysFs::removeFromSearchPath(path.c_str())) + if (!VirtFs::removeFromSearchPath(path.c_str())) { logger->log("Error: %s: removeFromSearchPath failed: %s", path.c_str(), - PhysFs::getLastError()); + VirtFs::getLastError()); return false; } return true; @@ -373,7 +373,7 @@ void ResourceManager::searchAndAddArchives(const std::string &restrict path, const Append append) const { const char *const dirSep = dirSeparator; - char **list = PhysFs::enumerateFiles(path.c_str()); + char **list = VirtFs::enumerateFiles(path.c_str()); for (char **i = list; *i; i++) { @@ -383,13 +383,13 @@ void ResourceManager::searchAndAddArchives(const std::string &restrict path, { const std::string file = path + (*i); const std::string realPath = std::string( - PhysFs::getRealDir(file.c_str())); + VirtFs::getRealDir(file.c_str())); addToSearchPath(std::string(realPath).append( dirSep).append(file), append); } } - PhysFs::freeList(list); + VirtFs::freeList(list); } void ResourceManager::searchAndRemoveArchives(const std::string &restrict path, @@ -397,7 +397,7 @@ void ResourceManager::searchAndRemoveArchives(const std::string &restrict path, const { const char *const dirSep = dirSeparator; - char **list = PhysFs::enumerateFiles(path.c_str()); + char **list = VirtFs::enumerateFiles(path.c_str()); for (char **i = list; *i; i++) { @@ -406,13 +406,13 @@ void ResourceManager::searchAndRemoveArchives(const std::string &restrict path, { const std::string file = path + (*i); const std::string realPath = std::string( - PhysFs::getRealDir(file.c_str())); + VirtFs::getRealDir(file.c_str())); removeFromSearchPath(std::string(realPath).append( dirSep).append(file)); } } - PhysFs::freeList(list); + VirtFs::freeList(list); } bool ResourceManager::addResource(const std::string &idPath, diff --git a/src/resources/resourcemanager/resourcemanager_unittest.cc b/src/resources/resourcemanager/resourcemanager_unittest.cc index 2019f20d8..684f2d839 100644 --- a/src/resources/resourcemanager/resourcemanager_unittest.cc +++ b/src/resources/resourcemanager/resourcemanager_unittest.cc @@ -30,7 +30,7 @@ #include "resources/resourcemanager/resourcemanager.h" #include "utils/env.h" -#include "utils/physfstools.h" +#include "utils/virtfs.h" #include <unistd.h> @@ -659,5 +659,5 @@ TEST_CASE("resourcemanager", "resourcemanager") resourceManager = safeResman; delete client; client = nullptr; -// PhysFs::deinit(); +// VirtFs::deinit(); } diff --git a/src/resources/sprite/animatedsprite_unittest.cc b/src/resources/sprite/animatedsprite_unittest.cc index a46fad9b0..17746f65c 100644 --- a/src/resources/sprite/animatedsprite_unittest.cc +++ b/src/resources/sprite/animatedsprite_unittest.cc @@ -41,7 +41,7 @@ #include "utils/env.h" #include "utils/mrand.h" -#include "utils/physfstools.h" +#include "utils/virtfs.h" #ifndef USE_SDL2 #include <SDL.h> @@ -181,5 +181,5 @@ TEST_CASE("AnimatedSprite tests", "animatedsprite") delete client; client = nullptr; -// PhysFs::deinit(); +// VirtFs::deinit(); } diff --git a/src/resources/wallpaper.cpp b/src/resources/wallpaper.cpp index 0dadb9737..b98b9eb67 100644 --- a/src/resources/wallpaper.cpp +++ b/src/resources/wallpaper.cpp @@ -26,7 +26,7 @@ #include "resources/wallpaperdata.h" -#include "utils/physfstools.h" +#include "utils/virtfs.h" #include <algorithm> @@ -54,21 +54,21 @@ static void initDefaultWallpaperPaths() // Init the path wallpaperPath = branding.getStringValue("wallpapersPath"); - if (wallpaperPath.empty() || !PhysFs::isDirectory(wallpaperPath.c_str())) + if (wallpaperPath.empty() || !VirtFs::isDirectory(wallpaperPath.c_str())) wallpaperPath = paths.getValue("wallpapers", ""); - if (wallpaperPath.empty() || !PhysFs::isDirectory(wallpaperPath.c_str())) + if (wallpaperPath.empty() || !VirtFs::isDirectory(wallpaperPath.c_str())) wallpaperPath = "graphics/images/"; // Init the default file wallpaperFile = branding.getStringValue("wallpaperFile"); - if (!wallpaperFile.empty() && !PhysFs::isDirectory(wallpaperFile.c_str())) + if (!wallpaperFile.empty() && !VirtFs::isDirectory(wallpaperFile.c_str())) return; else wallpaperFile = paths.getValue("wallpaperFile", ""); - if (wallpaperFile.empty() || PhysFs::isDirectory(wallpaperFile.c_str())) + if (wallpaperFile.empty() || VirtFs::isDirectory(wallpaperFile.c_str())) wallpaperFile = "login_wallpaper.png"; } @@ -84,7 +84,7 @@ void Wallpaper::loadWallpapers() { wallpaperData.clear(); initDefaultWallpaperPaths(); - char **const imgs = PhysFs::enumerateFiles(wallpaperPath.c_str()); + char **const imgs = VirtFs::enumerateFiles(wallpaperPath.c_str()); for (char *const *i = imgs; *i; i++) { @@ -121,7 +121,7 @@ void Wallpaper::loadWallpapers() } } - PhysFs::freeList(imgs); + VirtFs::freeList(imgs); std::sort(wallpaperData.begin(), wallpaperData.end(), &wallpaperCompare); } |