mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-29 23:07:48 +02:00
basic subdirectory support
This commit is contained in:
@@ -85,6 +85,10 @@ bool CFilesystemLoader::createResource(std::string filename, bool update)
|
||||
|
||||
if (!update)
|
||||
{
|
||||
// create folders if not exists
|
||||
boost::filesystem::path p((baseDirectory / filename).c_str());
|
||||
boost::filesystem::create_directories(p.parent_path());
|
||||
|
||||
// create file, if not exists
|
||||
std::ofstream file((baseDirectory / filename).c_str(), std::ofstream::binary);
|
||||
|
||||
|
||||
@@ -147,7 +147,7 @@ ISimpleResourceLoader * CResourceHandler::createInitial()
|
||||
for (auto & path : VCMIDirs::get().dataPaths())
|
||||
{
|
||||
if (boost::filesystem::is_directory(path)) // some of system-provided paths may not exist
|
||||
initialLoader->addLoader(new CFilesystemLoader("", path, 0, true), false);
|
||||
initialLoader->addLoader(new CFilesystemLoader("", path, 1, true), false);
|
||||
}
|
||||
initialLoader->addLoader(new CFilesystemLoader("", VCMIDirs::get().userDataPath(), 0, true), false);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user