mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-05 10:45:35 +00:00
Merge remote-tracking branch 'sergeyshambir/BBfix'
This commit is contained in:
commit
70b6b68005
1 changed files with 12 additions and 1 deletions
|
@ -602,7 +602,7 @@ static Ogre::String getMaterial(const Nif::NiTriShape *shape, const Ogre::String
|
||||||
Nif::NiSourceTexture *st = t->textures[0].texture.getPtr();
|
Nif::NiSourceTexture *st = t->textures[0].texture.getPtr();
|
||||||
if (st->external)
|
if (st->external)
|
||||||
{
|
{
|
||||||
/* Bethesda at some at some point converted all their BSA
|
/* Bethesda at some point converted all their BSA
|
||||||
* textures from tga to dds for increased load speed, but all
|
* textures from tga to dds for increased load speed, but all
|
||||||
* texture file name references were kept as .tga.
|
* texture file name references were kept as .tga.
|
||||||
*/
|
*/
|
||||||
|
@ -621,6 +621,17 @@ static Ogre::String getMaterial(const Nif::NiTriShape *shape, const Ogre::String
|
||||||
if(!Ogre::ResourceGroupManager::getSingleton().resourceExistsInAnyGroup(texName))
|
if(!Ogre::ResourceGroupManager::getSingleton().resourceExistsInAnyGroup(texName))
|
||||||
texName = path + st->filename;
|
texName = path + st->filename;
|
||||||
}
|
}
|
||||||
|
else if (!Ogre::ResourceGroupManager::getSingleton().resourceExistsInAnyGroup(texName))
|
||||||
|
{
|
||||||
|
// workaround for Better Heads addon
|
||||||
|
size_t lastSlash = st->filename.rfind('\\');
|
||||||
|
if (lastSlash != std::string::npos && lastSlash + 1 != st->filename.size()) {
|
||||||
|
texName = path + st->filename.substr(lastSlash + 1);
|
||||||
|
// workaround for Better Bodies addon
|
||||||
|
if (!Ogre::ResourceGroupManager::getSingleton().resourceExistsInAnyGroup(texName))
|
||||||
|
texName = st->filename;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else warn("Found internal texture, ignoring.");
|
else warn("Found internal texture, ignoring.");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue