1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-13 01:20:34 +02:00

- moved all system-specific handling of filesystem to VCMIDirs.cpp (new file)

- fixed #1128, artifact constituents are now stored as pointers
This commit is contained in:
Ivan Savenko
2013-03-02 18:41:25 +00:00
parent f306d7bb70
commit b5fcefe455
14 changed files with 173 additions and 142 deletions

View File

@ -321,16 +321,16 @@ void CResourceHandler::initialize()
initialLoader = new CResourceLoader;
resourceLoader = new CResourceLoader;
shared_ptr<ISimpleResourceLoader> rootDir(new CFilesystemLoader(GameConstants::DATA_DIR, 0, true));
shared_ptr<ISimpleResourceLoader> rootDir(new CFilesystemLoader(VCMIDirs::get().dataPath(), 0, true));
initialLoader->addLoader("GLOBAL/", rootDir, false);
initialLoader->addLoader("ALL/", rootDir, false);
auto userDir = rootDir;
//add local directory to "ALL" but only if it differs from root dir (true for linux)
if (GameConstants::DATA_DIR != GVCMIDirs.UserPath)
if (VCMIDirs::get().dataPath() != VCMIDirs::get().localPath())
{
userDir = shared_ptr<ISimpleResourceLoader>(new CFilesystemLoader(GVCMIDirs.UserPath, 0, true));
userDir = shared_ptr<ISimpleResourceLoader>(new CFilesystemLoader(VCMIDirs::get().localPath(), 0, true));
initialLoader->addLoader("ALL/", userDir, false);
}