summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/client.cpp2
-rw-r--r--src/dyetool/client.cpp2
-rw-r--r--src/dyetool/dyemain.cpp2
-rw-r--r--src/resources/resourcemanager/resourcemanager.cpp4
-rw-r--r--src/resources/resourcemanager/resourcemanager.h8
-rw-r--r--src/utils/virtfs.cpp4
-rw-r--r--src/utils/virtfs.h2
7 files changed, 6 insertions, 18 deletions
diff --git a/src/client.cpp b/src/client.cpp
index 38870b50f..29fdc971a 100644
--- a/src/client.cpp
+++ b/src/client.cpp
@@ -324,7 +324,7 @@ void Client::gameInit()
#endif // ANDROID
ResourceManager::init();
- if (!resourceManager->setWriteDir(settings.localDataDir))
+ if (!VirtFs::setWriteDir(settings.localDataDir))
{
logger->error(strprintf("%s couldn't be set as home directory! "
"Exiting.", settings.localDataDir.c_str()));
diff --git a/src/dyetool/client.cpp b/src/dyetool/client.cpp
index d2ace1a36..19ad331a3 100644
--- a/src/dyetool/client.cpp
+++ b/src/dyetool/client.cpp
@@ -182,7 +182,7 @@ void Client::gameInit()
#endif // ANDROID
ResourceManager::init();
- if (!resourceManager->setWriteDir(settings.localDataDir))
+ if (!VirtFs::setWriteDir(settings.localDataDir))
{
logger->error(strprintf("%s couldn't be set as home directory! "
"Exiting.", settings.localDataDir.c_str()));
diff --git a/src/dyetool/dyemain.cpp b/src/dyetool/dyemain.cpp
index 27b159a70..433233143 100644
--- a/src/dyetool/dyemain.cpp
+++ b/src/dyetool/dyemain.cpp
@@ -87,7 +87,7 @@ int main(int argc, char **argv)
#endif // USE_SDL2
ResourceManager::init();
- resourceManager->setWriteDir(".");
+ VirtFs::setWriteDir(".");
VirtFs::addDirToSearchPath(".", Append_false);
VirtFs::addDirToSearchPath("/", Append_false);
std::string src = argv[1];
diff --git a/src/resources/resourcemanager/resourcemanager.cpp b/src/resources/resourcemanager/resourcemanager.cpp
index 25fb904d2..530d45902 100644
--- a/src/resources/resourcemanager/resourcemanager.cpp
+++ b/src/resources/resourcemanager/resourcemanager.cpp
@@ -334,10 +334,6 @@ void ResourceManager::clearDeleted(const bool full)
}
}
}
-bool ResourceManager::setWriteDir(const std::string &path) const
-{
- return static_cast<bool>(VirtFs::setWriteDir(path.c_str()));
-}
void ResourceManager::searchAndAddArchives(const std::string &restrict path,
const std::string &restrict ext,
diff --git a/src/resources/resourcemanager/resourcemanager.h b/src/resources/resourcemanager/resourcemanager.h
index 6f6875361..b9732947f 100644
--- a/src/resources/resourcemanager/resourcemanager.h
+++ b/src/resources/resourcemanager/resourcemanager.h
@@ -60,14 +60,6 @@ class ResourceManager final : public MemoryCounter
~ResourceManager();
/**
- * Sets the write directory.
- *
- * @param path The path of the directory to be added.
- * @return <code>true</code> on success, <code>false</code> otherwise.
- */
- bool setWriteDir(const std::string &path) const;
-
- /**
* Searches for zip files and adds them to the search path.
*/
void searchAndAddArchives(const std::string &restrict path,
diff --git a/src/utils/virtfs.cpp b/src/utils/virtfs.cpp
index 831ff4e5d..0ab3b668f 100644
--- a/src/utils/virtfs.cpp
+++ b/src/utils/virtfs.cpp
@@ -130,9 +130,9 @@ namespace VirtFs
return file;
}
- bool setWriteDir(const char *const newDir)
+ bool setWriteDir(const std::string &newDir)
{
- return PHYSFS_setWriteDir(newDir);
+ return PHYSFS_setWriteDir(newDir.c_str());
}
bool addDirToSearchPath(const std::string &newDir,
diff --git a/src/utils/virtfs.h b/src/utils/virtfs.h
index 3bb98c046..f28354790 100644
--- a/src/utils/virtfs.h
+++ b/src/utils/virtfs.h
@@ -43,7 +43,7 @@ namespace VirtFs
VirtFile *openRead(const char *const filename);
VirtFile *openWrite(const char *const filename);
VirtFile *openAppend(const char *const filename);
- bool setWriteDir(const char *const newDir);
+ bool setWriteDir(const std::string &newDir);
bool addDirToSearchPath(const std::string &newDir,
const Append append);
bool removeDirFromSearchPath(const std::string &oldDir);