summaryrefslogtreecommitdiff
path: root/src/resources/resourcemanager/resourcemanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-02-11 19:08:11 +0300
committerAndrei Karas <akaras@inbox.ru>2017-02-11 19:19:38 +0300
commit245fb04a1e112cc8d0918a8660474299d5ce223c (patch)
treeeb5ab6266a4ff9551d2e08b9c14b61e353cd127f /src/resources/resourcemanager/resourcemanager.cpp
parentf978c1bed85961e102951340669ca873328bcef3 (diff)
downloadplus-245fb04a1e112cc8d0918a8660474299d5ce223c.tar.gz
plus-245fb04a1e112cc8d0918a8660474299d5ce223c.tar.bz2
plus-245fb04a1e112cc8d0918a8660474299d5ce223c.tar.xz
plus-245fb04a1e112cc8d0918a8660474299d5ce223c.zip
Split virtfs api for add directories and archives.
Also remove useless resourcemanager functions for add/remove virtfs entries.
Diffstat (limited to 'src/resources/resourcemanager/resourcemanager.cpp')
-rw-r--r--src/resources/resourcemanager/resourcemanager.cpp33
1 files changed, 2 insertions, 31 deletions
diff --git a/src/resources/resourcemanager/resourcemanager.cpp b/src/resources/resourcemanager/resourcemanager.cpp
index 322b119a1..86158776d 100644
--- a/src/resources/resourcemanager/resourcemanager.cpp
+++ b/src/resources/resourcemanager/resourcemanager.cpp
@@ -340,35 +340,6 @@ bool ResourceManager::setWriteDir(const std::string &path) const
return static_cast<bool>(VirtFs::setWriteDir(path.c_str()));
}
-bool ResourceManager::addToSearchPath(const std::string &path,
- const Append append) const
-{
- logger->log("Adding to PhysicsFS: %s (%s)", path.c_str(),
- append == Append_true ? "append" : "prepend");
- if (!VirtFs::addToSearchPath(path.c_str(),
- append == Append_true ? 1 : 0))
- {
- logger->log("Error: %s: addToSearchPath failed: %s",
- path.c_str(),
- VirtFs::getLastError());
- return false;
- }
- return true;
-}
-
-bool ResourceManager::removeFromSearchPath(const std::string &path) const
-{
- logger->log("Removing from PhysicsFS: %s", path.c_str());
- if (!VirtFs::removeFromSearchPath(path.c_str()))
- {
- logger->log("Error: %s: removeFromSearchPath failed: %s",
- path.c_str(),
- VirtFs::getLastError());
- return false;
- }
- return true;
-}
-
void ResourceManager::searchAndAddArchives(const std::string &restrict path,
const std::string &restrict ext,
const Append append) const
@@ -385,7 +356,7 @@ void ResourceManager::searchAndAddArchives(const std::string &restrict path,
const std::string file = path + (*i);
const std::string realPath = std::string(
VirtFs::getRealDir(file.c_str()));
- addToSearchPath(std::string(realPath).append(
+ VirtFs::addZipToSearchPath(std::string(realPath).append(
dirSep).append(file), append);
}
}
@@ -408,7 +379,7 @@ void ResourceManager::searchAndRemoveArchives(const std::string &restrict path,
const std::string file = path + (*i);
const std::string realPath = std::string(
VirtFs::getRealDir(file.c_str()));
- removeFromSearchPath(std::string(realPath).append(
+ VirtFs::removeZipFromSearchPath(std::string(realPath).append(
dirSep).append(file));
}
}