diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-03-28 17:20:19 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-03-28 17:20:19 +0300 |
commit | 9c289c7cc0e5fdf89eed1e28200166714789c92f (patch) | |
tree | d669909a1b3ce26d82f6b71c83ebb9938a832f7f /src | |
parent | 6ff6d6928328ff2110f028a374ade49415d5a0ba (diff) | |
download | manaplus-9c289c7cc0e5fdf89eed1e28200166714789c92f.tar.gz manaplus-9c289c7cc0e5fdf89eed1e28200166714789c92f.tar.bz2 manaplus-9c289c7cc0e5fdf89eed1e28200166714789c92f.tar.xz manaplus-9c289c7cc0e5fdf89eed1e28200166714789c92f.zip |
Rename some left functions from physfs to virtfs.
Diffstat (limited to 'src')
-rw-r--r-- | src/configuration.cpp | 2 | ||||
-rw-r--r-- | src/fs/files.cpp | 12 | ||||
-rw-r--r-- | src/fs/files.h | 4 | ||||
-rw-r--r-- | src/integrity_unittest.cc | 8 |
4 files changed, 9 insertions, 17 deletions
diff --git a/src/configuration.cpp b/src/configuration.cpp index 397c1a848..ef2442d3c 100644 --- a/src/configuration.cpp +++ b/src/configuration.cpp @@ -756,7 +756,7 @@ void Configuration::init(const std::string &filename, if (useResManager == UseVirtFs_true) { - mConfigPath = "PhysFS://" + filename; + mConfigPath = "virtfs://" + filename; mDirectory.clear(); } else diff --git a/src/fs/files.cpp b/src/fs/files.cpp index b525b2c59..dca24aec1 100644 --- a/src/fs/files.cpp +++ b/src/fs/files.cpp @@ -60,7 +60,7 @@ void Files::extractLocale() const std::string localFile = localDir + moFile; const std::string localDir2 = localDir + dir + "/LC_MESSAGES"; mkdir_r(localDir2.c_str()); - copyPhysFsFile(moFile, localFile); + copyVirtFsFile(moFile, localFile); } } } @@ -86,7 +86,7 @@ void Files::setCopyCallBack(Files::CopyFileCallbackPtr callback) mCallbackPtr = callback; } -void Files::copyPhysFsFile(const std::string &restrict inFile, +void Files::copyVirtFsFile(const std::string &restrict inFile, const std::string &restrict outFile) { int size = 0; @@ -104,7 +104,7 @@ void Files::copyPhysFsFile(const std::string &restrict inFile, #endif // ANDROID } -void Files::copyPhysFsDir(const std::string &restrict inDir, +void Files::copyVirtFsDir(const std::string &restrict inDir, const std::string &restrict outDir) { mkdir_r(outDir.c_str()); @@ -114,9 +114,9 @@ void Files::copyPhysFsDir(const std::string &restrict inDir, const std::string file = std::string(inDir).append("/").append(*i); const std::string outDir2 = std::string(outDir).append("/").append(*i); if (VirtFs::isDirectory(file)) - copyPhysFsDir(file, outDir2); + copyVirtFsDir(file, outDir2); else - copyPhysFsFile(file, outDir2); + copyVirtFsFile(file, outDir2); } VirtFs::freeList(files); } @@ -126,7 +126,7 @@ void Files::extractZip(const std::string &restrict zipName, const std::string &restrict outDir) { VirtFs::mountZip(zipName, Append_false); - copyPhysFsDir(inDir, outDir); + copyVirtFsDir(inDir, outDir); VirtFs::unmountZip(zipName); remove(zipName.c_str()); } diff --git a/src/fs/files.h b/src/fs/files.h index 65b2f6325..4b55292de 100644 --- a/src/fs/files.h +++ b/src/fs/files.h @@ -36,10 +36,10 @@ namespace Files void setCopyCallBack(CopyFileCallbackPtr callback); - void copyPhysFsFile(const std::string &restrict inFile, + void copyVirtFsFile(const std::string &restrict inFile, const std::string &restrict outFile); - void copyPhysFsDir(const std::string &restrict inDir, + void copyVirtFsDir(const std::string &restrict inDir, const std::string &restrict outDir); void extractZip(const std::string &restrict zipName, diff --git a/src/integrity_unittest.cc b/src/integrity_unittest.cc index 2d8a57a04..7da06c4c1 100644 --- a/src/integrity_unittest.cc +++ b/src/integrity_unittest.cc @@ -237,8 +237,6 @@ TEST_CASE("integrity tests", "integrity") VirtFs::mountZip(prefix + "data/test/test.zip", Append_false); SDL_RWops *const rw = VirtFs::RWopsOpenRead(name1); - if (!rw) - logger->log("Physfs error: %s", VirtFs::getLastError()); REQUIRE(rw != nullptr); unsigned char buf[size1]; const size_t sz = SDL_RWread(rw, buf, 1, size1); @@ -257,8 +255,6 @@ TEST_CASE("integrity tests", "integrity") VirtFs::mountZip(prefix + "data/test/test.zip", Append_false); SDL_RWops *const rw = VirtFs::RWopsOpenRead(name1); - if (!rw) - logger->log("Physfs error: %s", VirtFs::getLastError()); REQUIRE(rw != nullptr); int64_t seek = SDL_RWseek(rw, 0, RW_SEEK_END); if (seek == -1) @@ -294,8 +290,6 @@ TEST_CASE("integrity tests", "integrity") VirtFs::mountZip(prefix + "data/test/test.zip", Append_false); SDL_RWops *const rw = VirtFs::RWopsOpenRead(name1); - if (!rw) - logger->log("Physfs error: %s", VirtFs::getLastError()); REQUIRE(rw != nullptr); if (IMG_isPNG(rw) == false) { @@ -314,8 +308,6 @@ TEST_CASE("integrity tests", "integrity") VirtFs::mountZip(prefix + "data/test/test.zip", Append_false); SDL_RWops *const rw = VirtFs::RWopsOpenRead(name1); - if (!rw) - logger->log("Physfs error: %s", VirtFs::getLastError()); REQUIRE(rw != nullptr); Resource *const res = imageHelper->load(rw); VirtFs::unmountZip(prefix + "data/test/test.zip"); |