Merge branch 'fastandloose' into 'master'

Drop support for --fs-strict

Closes #7394

See merge request OpenMW/openmw!3093
This commit is contained in:
psi29a 2023-07-02 19:24:14 +00:00
commit 6601b0cb15
47 changed files with 161 additions and 258 deletions

View file

@ -296,12 +296,12 @@ void CSMDoc::Document::createBase()
CSMDoc::Document::Document(const Files::ConfigurationManager& configuration, std::vector<std::filesystem::path> files,
bool new_, const std::filesystem::path& savePath, const std::filesystem::path& resDir, ToUTF8::FromType encoding,
const std::vector<std::string>& blacklistedScripts, bool fsStrict, const Files::PathContainer& dataPaths,
const std::vector<std::string>& blacklistedScripts, const Files::PathContainer& dataPaths,
const std::vector<std::string>& archives)
: mSavePath(savePath)
, mContentFiles(std::move(files))
, mNew(new_)
, mData(encoding, fsStrict, dataPaths, archives, resDir)
, mData(encoding, dataPaths, archives, resDir)
, mTools(*this, encoding)
, mProjectPath((configuration.getUserDataPath() / "projects") / (savePath.filename().u8string() + u8".project"))
, mSavingOperation(*this, mProjectPath, encoding)

View file

@ -95,7 +95,7 @@ namespace CSMDoc
public:
Document(const Files::ConfigurationManager& configuration, std::vector<std::filesystem::path> files, bool new_,
const std::filesystem::path& savePath, const std::filesystem::path& resDir, ToUTF8::FromType encoding,
const std::vector<std::string>& blacklistedScripts, bool fsStrict, const Files::PathContainer& dataPaths,
const std::vector<std::string>& blacklistedScripts, const Files::PathContainer& dataPaths,
const std::vector<std::string>& archives);
~Document() override = default;

View file

@ -17,7 +17,6 @@
CSMDoc::DocumentManager::DocumentManager(const Files::ConfigurationManager& configuration)
: mConfiguration(configuration)
, mEncoding(ToUTF8::WINDOWS_1252)
, mFsStrict(false)
{
std::filesystem::path projectPath = configuration.getUserDataPath() / "projects";
@ -62,8 +61,8 @@ void CSMDoc::DocumentManager::addDocument(
CSMDoc::Document* CSMDoc::DocumentManager::makeDocument(
const std::vector<std::filesystem::path>& files, const std::filesystem::path& savePath, bool new_)
{
return new Document(mConfiguration, files, new_, savePath, mResDir, mEncoding, mBlacklistedScripts, mFsStrict,
mDataPaths, mArchives);
return new Document(
mConfiguration, files, new_, savePath, mResDir, mEncoding, mBlacklistedScripts, mDataPaths, mArchives);
}
void CSMDoc::DocumentManager::insertDocument(CSMDoc::Document* document)
@ -123,9 +122,8 @@ void CSMDoc::DocumentManager::documentNotLoaded(Document* document, const std::s
}
void CSMDoc::DocumentManager::setFileData(
bool strict, const Files::PathContainer& dataPaths, const std::vector<std::string>& archives)
const Files::PathContainer& dataPaths, const std::vector<std::string>& archives)
{
mFsStrict = strict;
mDataPaths = dataPaths;
mArchives = archives;
}

View file

@ -35,7 +35,6 @@ namespace CSMDoc
std::filesystem::path mResDir;
bool mFsStrict;
Files::PathContainer mDataPaths;
std::vector<std::string> mArchives;
@ -68,7 +67,7 @@ namespace CSMDoc
void setBlacklistedScripts(const std::vector<std::string>& scriptIds);
/// Sets the file data that gets passed to newly created documents.
void setFileData(bool strict, const Files::PathContainer& dataPaths, const std::vector<std::string>& archives);
void setFileData(const Files::PathContainer& dataPaths, const std::vector<std::string>& archives);
bool isEmpty();

View file

@ -132,7 +132,7 @@ int CSMWorld::Data::count(RecordBase::State state, const CollectionBase& collect
return number;
}
CSMWorld::Data::Data(ToUTF8::FromType encoding, bool fsStrict, const Files::PathContainer& dataPaths,
CSMWorld::Data::Data(ToUTF8::FromType encoding, const Files::PathContainer& dataPaths,
const std::vector<std::string>& archives, const std::filesystem::path& resDir)
: mEncoder(encoding)
, mPathgrids(mCells)
@ -140,12 +140,11 @@ CSMWorld::Data::Data(ToUTF8::FromType encoding, bool fsStrict, const Files::Path
, mReader(nullptr)
, mDialogue(nullptr)
, mReaderIndex(1)
, mFsStrict(fsStrict)
, mDataPaths(dataPaths)
, mArchives(archives)
{
mVFS = std::make_unique<VFS::Manager>(mFsStrict);
VFS::registerArchives(mVFS.get(), Files::Collections(mDataPaths, !mFsStrict), mArchives, true);
mVFS = std::make_unique<VFS::Manager>();
VFS::registerArchives(mVFS.get(), Files::Collections(mDataPaths), mArchives, true);
mResourcesManager.setVFS(mVFS.get());
mResourceSystem = std::make_unique<Resource::ResourceSystem>(mVFS.get());
@ -1444,7 +1443,7 @@ std::vector<ESM::RefId> CSMWorld::Data::getIds(bool listDeleted) const
void CSMWorld::Data::assetsChanged()
{
mVFS.get()->reset();
VFS::registerArchives(mVFS.get(), Files::Collections(mDataPaths, !mFsStrict), mArchives, true);
VFS::registerArchives(mVFS.get(), Files::Collections(mDataPaths), mArchives, true);
const UniversalId assetTableIds[] = { UniversalId::Type_Meshes, UniversalId::Type_Icons, UniversalId::Type_Musics,
UniversalId::Type_SoundsRes, UniversalId::Type_Textures, UniversalId::Type_Videos };

View file

@ -127,7 +127,6 @@ namespace CSMWorld
std::map<ESM::RefId, std::map<unsigned int, unsigned int>> mRefLoadCache;
int mReaderIndex;
bool mFsStrict;
Files::PathContainer mDataPaths;
std::vector<std::string> mArchives;
std::unique_ptr<VFS::Manager> mVFS;
@ -153,8 +152,8 @@ namespace CSMWorld
void loadFallbackEntries();
public:
Data(ToUTF8::FromType encoding, bool fsStrict, const Files::PathContainer& dataPaths,
const std::vector<std::string>& archives, const std::filesystem::path& resDir);
Data(ToUTF8::FromType encoding, const Files::PathContainer& dataPaths, const std::vector<std::string>& archives,
const std::filesystem::path& resDir);
~Data() override;