mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-30 16:15:31 +00:00
Search only in the niffilemanager for nif files
This commit is contained in:
parent
3618eabaf0
commit
813b8ee0d1
1 changed files with 4 additions and 6 deletions
|
@ -378,7 +378,7 @@ namespace Resource
|
|||
Resource::ImageManager* mImageManager;
|
||||
};
|
||||
|
||||
osg::ref_ptr<osg::Node> load (Files::IStreamPtr file, const std::string& normalizedFilename, Resource::ImageManager* imageManager, Resource::NifFileManager* nifFileManager)
|
||||
osg::ref_ptr<osg::Node> load (const std::string& normalizedFilename, const VFS::Manager* vfs, Resource::ImageManager* imageManager, Resource::NifFileManager* nifFileManager)
|
||||
{
|
||||
std::string ext = Resource::getFileExtension(normalizedFilename);
|
||||
if (ext == "nif")
|
||||
|
@ -400,7 +400,7 @@ namespace Resource
|
|||
options->setReadFileCallback(new ImageReadCallback(imageManager));
|
||||
if (ext == "dae") options->setOptionString("daeUseSequencedTextureUnits");
|
||||
|
||||
osgDB::ReaderWriter::ReadResult result = reader->readNode(*file, options);
|
||||
osgDB::ReaderWriter::ReadResult result = reader->readNode(*vfs->get(normalizedFilename), options);
|
||||
if (!result.success())
|
||||
{
|
||||
std::stringstream errormsg;
|
||||
|
@ -527,9 +527,7 @@ namespace Resource
|
|||
osg::ref_ptr<osg::Node> loaded;
|
||||
try
|
||||
{
|
||||
Files::IStreamPtr file = mVFS->get(normalized);
|
||||
|
||||
loaded = load(file, normalized, mImageManager, mNifFileManager);
|
||||
loaded = load(normalized, mVFS, mImageManager, mNifFileManager);
|
||||
}
|
||||
catch (std::exception& e)
|
||||
{
|
||||
|
@ -542,7 +540,7 @@ namespace Resource
|
|||
{
|
||||
Log(Debug::Error) << "Failed to load '" << name << "': " << e.what() << ", using marker_error." << sMeshTypes[i] << " instead";
|
||||
Files::IStreamPtr file = mVFS->get(normalized);
|
||||
loaded = load(file, normalized, mImageManager, mNifFileManager);
|
||||
loaded = load(normalized, mVFS, mImageManager, mNifFileManager);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue