mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-03-24 04:43:49 +00:00
added --fs-strict switch
This commit is contained in:
parent
ef1e986a87
commit
8829398bfc
@ -218,6 +218,7 @@ OMW::Engine::Engine()
|
||||
, mScriptManager (0)
|
||||
, mScriptContext (0)
|
||||
, mGuiManager (0)
|
||||
, mFSStrict (false)
|
||||
{
|
||||
MWClass::registerClasses();
|
||||
}
|
||||
@ -258,6 +259,11 @@ void OMW::Engine::addResourcesDirectory (const boost::filesystem::path& path)
|
||||
Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME, true);
|
||||
}
|
||||
|
||||
void OMW::Engine::enableFSStrict()
|
||||
{
|
||||
mFSStrict = true;
|
||||
}
|
||||
|
||||
// Set data dir
|
||||
|
||||
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());
|
||||
mDataDir = dataDirs[0];
|
||||
|
||||
mFileCollections = Files::Collections (dataDirs, true);
|
||||
mFileCollections = Files::Collections (dataDirs, !mFSStrict);
|
||||
}
|
||||
|
||||
// Set resource dir
|
||||
|
@ -84,6 +84,7 @@ namespace OMW
|
||||
MWWorld::Ptr mIgnoreLocalPtr;
|
||||
|
||||
Files::Collections mFileCollections;
|
||||
bool mFSStrict;
|
||||
|
||||
// not implemented
|
||||
Engine (const Engine&);
|
||||
@ -109,6 +110,12 @@ namespace OMW
|
||||
|
||||
~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
|
||||
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>()->
|
||||
implicit_value (true)->default_value (false),
|
||||
"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;
|
||||
@ -109,6 +112,9 @@ bool parseOptions (int argc, char**argv, OMW::Engine& engine)
|
||||
}
|
||||
|
||||
// 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<boost::filesystem::path> dataDirs2 (dataDirs.begin(), dataDirs.end());
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user