|
|
@ -12,6 +12,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
#include <components/resource/scenemanager.hpp>
|
|
|
|
#include <components/resource/scenemanager.hpp>
|
|
|
|
#include <components/vfs/manager.hpp>
|
|
|
|
#include <components/vfs/manager.hpp>
|
|
|
|
|
|
|
|
#include <components/vfs/registerarchives.hpp>
|
|
|
|
|
|
|
|
|
|
|
|
#include "idtable.hpp"
|
|
|
|
#include "idtable.hpp"
|
|
|
|
#include "idtree.hpp"
|
|
|
|
#include "idtree.hpp"
|
|
|
@ -62,11 +63,18 @@ int CSMWorld::Data::count (RecordBase::State state, const CollectionBase& collec
|
|
|
|
return number;
|
|
|
|
return number;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
CSMWorld::Data::Data (ToUTF8::FromType encoding, VFS::Manager* vfs, ResourcesManager& resourcesManager, const Fallback::Map* fallback, const boost::filesystem::path& resDir)
|
|
|
|
CSMWorld::Data::Data (ToUTF8::FromType encoding, bool fsStrict, const Files::PathContainer& dataPaths,
|
|
|
|
|
|
|
|
const std::vector<std::string>& archives, const Fallback::Map* fallback, const boost::filesystem::path& resDir)
|
|
|
|
: mEncoder (encoding), mPathgrids (mCells), mRefs (mCells),
|
|
|
|
: mEncoder (encoding), mPathgrids (mCells), mRefs (mCells),
|
|
|
|
mVFS(vfs), mResourcesManager (resourcesManager), mFallbackMap(fallback),
|
|
|
|
mFallbackMap(fallback), mReader (0), mDialogue (0), mReaderIndex(1),
|
|
|
|
mReader (0), mDialogue (0), mReaderIndex(1), mResourceSystem(new Resource::ResourceSystem(resourcesManager.getVFS()))
|
|
|
|
mFsStrict(fsStrict), mDataPaths(dataPaths), mArchives(archives)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
|
|
|
|
mVFS.reset(new VFS::Manager(mFsStrict));
|
|
|
|
|
|
|
|
VFS::registerArchives(mVFS.get(), Files::Collections(mDataPaths, !mFsStrict), mArchives, true);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
mResourcesManager.setVFS(mVFS.get());
|
|
|
|
|
|
|
|
mResourceSystem.reset(new Resource::ResourceSystem(mVFS.get()));
|
|
|
|
|
|
|
|
|
|
|
|
mResourceSystem->getSceneManager()->setShaderPath((resDir / "shaders").string());
|
|
|
|
mResourceSystem->getSceneManager()->setShaderPath((resDir / "shaders").string());
|
|
|
|
|
|
|
|
|
|
|
|
int index = 0;
|
|
|
|
int index = 0;
|
|
|
@ -1218,7 +1226,8 @@ std::vector<std::string> CSMWorld::Data::getIds (bool listDeleted) const
|
|
|
|
|
|
|
|
|
|
|
|
void CSMWorld::Data::assetsChanged()
|
|
|
|
void CSMWorld::Data::assetsChanged()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
mVFS->rebuildIndex();
|
|
|
|
mVFS.get()->reset();
|
|
|
|
|
|
|
|
VFS::registerArchives(mVFS.get(), Files::Collections(mDataPaths, !mFsStrict), mArchives, true);
|
|
|
|
|
|
|
|
|
|
|
|
const UniversalId assetTableIds[] = {
|
|
|
|
const UniversalId assetTableIds[] = {
|
|
|
|
UniversalId::Type_Meshes,
|
|
|
|
UniversalId::Type_Meshes,
|
|
|
@ -1265,7 +1274,7 @@ void CSMWorld::Data::rowsChanged (const QModelIndex& parent, int start, int end)
|
|
|
|
|
|
|
|
|
|
|
|
const VFS::Manager* CSMWorld::Data::getVFS() const
|
|
|
|
const VFS::Manager* CSMWorld::Data::getVFS() const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return mVFS;
|
|
|
|
return mVFS.get();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const Fallback::Map* CSMWorld::Data::getFallbackMap() const
|
|
|
|
const Fallback::Map* CSMWorld::Data::getFallbackMap() const
|
|
|
|