|
|
|
@ -14,16 +14,19 @@ void CSMWorld::ResourcesManager::addResources (const Resources& resources)
|
|
|
|
|
resources));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CSMWorld::ResourcesManager::setVFS(VFS::Manager *vfs)
|
|
|
|
|
const char * const * CSMWorld::ResourcesManager::getMeshExtensions()
|
|
|
|
|
{
|
|
|
|
|
mVFS = vfs;
|
|
|
|
|
mResources.clear();
|
|
|
|
|
|
|
|
|
|
// maybe we could go over the osgDB::Registry to list all supported node formats
|
|
|
|
|
|
|
|
|
|
static const char * const sMeshTypes[] = { "nif", "osg", "osgt", "osgb", "osgx", "osg2", 0 };
|
|
|
|
|
return sMeshTypes;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
addResources (Resources (vfs, "meshes", UniversalId::Type_Mesh, sMeshTypes));
|
|
|
|
|
void CSMWorld::ResourcesManager::setVFS(const VFS::Manager *vfs)
|
|
|
|
|
{
|
|
|
|
|
mVFS = vfs;
|
|
|
|
|
mResources.clear();
|
|
|
|
|
|
|
|
|
|
addResources (Resources (vfs, "meshes", UniversalId::Type_Mesh, getMeshExtensions()));
|
|
|
|
|
addResources (Resources (vfs, "icons", UniversalId::Type_Icon));
|
|
|
|
|
addResources (Resources (vfs, "music", UniversalId::Type_Music));
|
|
|
|
|
addResources (Resources (vfs, "sound", UniversalId::Type_SoundRes));
|
|
|
|
@ -31,21 +34,18 @@ void CSMWorld::ResourcesManager::setVFS(VFS::Manager *vfs)
|
|
|
|
|
addResources (Resources (vfs, "videos", UniversalId::Type_Video));
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
VFS::Manager* CSMWorld::ResourcesManager::getVFS() const
|
|
|
|
|
const VFS::Manager* CSMWorld::ResourcesManager::getVFS() const
|
|
|
|
|
{
|
|
|
|
|
return mVFS;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void CSMWorld::ResourcesManager::recreateResources()
|
|
|
|
|
{
|
|
|
|
|
// TODO make this shared with setVFS function
|
|
|
|
|
static const char * const sMeshTypes[] = { "nif", "osg", "osgt", "osgb", "osgx", "osg2", 0 };
|
|
|
|
|
|
|
|
|
|
std::map<UniversalId::Type, Resources>::iterator it = mResources.begin();
|
|
|
|
|
for ( ; it != mResources.end(); ++it)
|
|
|
|
|
{
|
|
|
|
|
if (it->first == UniversalId::Type_Mesh)
|
|
|
|
|
it->second.recreate(mVFS, sMeshTypes);
|
|
|
|
|
it->second.recreate(mVFS, getMeshExtensions());
|
|
|
|
|
else
|
|
|
|
|
it->second.recreate(mVFS);
|
|
|
|
|
}
|
|
|
|
|