forked from teamnwah/openmw-tes3coop
added --fs-strict switch
This commit is contained in:
parent
ef1e986a87
commit
8829398bfc
3 changed files with 20 additions and 1 deletions
|
@ -218,6 +218,7 @@ OMW::Engine::Engine()
|
||||||
, mScriptManager (0)
|
, mScriptManager (0)
|
||||||
, mScriptContext (0)
|
, mScriptContext (0)
|
||||||
, mGuiManager (0)
|
, mGuiManager (0)
|
||||||
|
, mFSStrict (false)
|
||||||
{
|
{
|
||||||
MWClass::registerClasses();
|
MWClass::registerClasses();
|
||||||
}
|
}
|
||||||
|
@ -258,6 +259,11 @@ void OMW::Engine::addResourcesDirectory (const boost::filesystem::path& path)
|
||||||
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, true);
|
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void OMW::Engine::enableFSStrict()
|
||||||
|
{
|
||||||
|
mFSStrict = true;
|
||||||
|
}
|
||||||
|
|
||||||
// Set data dir
|
// Set data dir
|
||||||
|
|
||||||
void OMW::Engine::setDataDirs (const std::vector<boost::filesystem::path>& dataDirs)
|
void OMW::Engine::setDataDirs (const std::vector<boost::filesystem::path>& dataDirs)
|
||||||
|
@ -266,7 +272,7 @@ void OMW::Engine::setDataDirs (const std::vector<boost::filesystem::path>& dataD
|
||||||
assert (!dataDirs.empty());
|
assert (!dataDirs.empty());
|
||||||
mDataDir = dataDirs[0];
|
mDataDir = dataDirs[0];
|
||||||
|
|
||||||
mFileCollections = Files::Collections (dataDirs, true);
|
mFileCollections = Files::Collections (dataDirs, !mFSStrict);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Set resource dir
|
// Set resource dir
|
||||||
|
|
|
@ -84,6 +84,7 @@ namespace OMW
|
||||||
MWWorld::Ptr mIgnoreLocalPtr;
|
MWWorld::Ptr mIgnoreLocalPtr;
|
||||||
|
|
||||||
Files::Collections mFileCollections;
|
Files::Collections mFileCollections;
|
||||||
|
bool mFSStrict;
|
||||||
|
|
||||||
// not implemented
|
// not implemented
|
||||||
Engine (const Engine&);
|
Engine (const Engine&);
|
||||||
|
@ -109,6 +110,12 @@ namespace OMW
|
||||||
|
|
||||||
~Engine();
|
~Engine();
|
||||||
|
|
||||||
|
/// Enable strict filesystem mode (do not fold case)
|
||||||
|
///
|
||||||
|
/// \attention The strict mode must be specified before any path-related settings
|
||||||
|
/// are given to the engine.
|
||||||
|
void enableFSStrict();
|
||||||
|
|
||||||
/// Set data dirs
|
/// Set data dirs
|
||||||
void setDataDirs (const std::vector<boost::filesystem::path>& dataDirs);
|
void setDataDirs (const std::vector<boost::filesystem::path>& dataDirs);
|
||||||
|
|
||||||
|
|
|
@ -74,6 +74,9 @@ bool parseOptions (int argc, char**argv, OMW::Engine& engine)
|
||||||
( "script-all", boost::program_options::value<bool>()->
|
( "script-all", boost::program_options::value<bool>()->
|
||||||
implicit_value (true)->default_value (false),
|
implicit_value (true)->default_value (false),
|
||||||
"compile all scripts (excluding dialogue scripts) at startup")
|
"compile all scripts (excluding dialogue scripts) at startup")
|
||||||
|
( "fs-strict", boost::program_options::value<bool>()->
|
||||||
|
implicit_value (true)->default_value (false),
|
||||||
|
"strict file system handling (no case folding)")
|
||||||
;
|
;
|
||||||
|
|
||||||
bpo::variables_map variables;
|
bpo::variables_map variables;
|
||||||
|
@ -109,6 +112,9 @@ bool parseOptions (int argc, char**argv, OMW::Engine& engine)
|
||||||
}
|
}
|
||||||
|
|
||||||
// directory settings
|
// directory settings
|
||||||
|
if (variables["fs-strict"].as<bool>()==true)
|
||||||
|
engine.enableFSStrict();
|
||||||
|
|
||||||
std::vector<std::string> dataDirs = variables["data"].as<std::vector<std::string> >();
|
std::vector<std::string> dataDirs = variables["data"].as<std::vector<std::string> >();
|
||||||
std::vector<boost::filesystem::path> dataDirs2 (dataDirs.begin(), dataDirs.end());
|
std::vector<boost::filesystem::path> dataDirs2 (dataDirs.begin(), dataDirs.end());
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue