1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-03-29 15:06:42 +00:00

Merge pull request #2634 from akortunov/textures

Make TextureProperty warnings more informative
This commit is contained in:
Alexei Dobrohotov 2019-12-15 16:28:10 +03:00 committed by GitHub
commit c3073f3225
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1410,7 +1410,7 @@ namespace NifOsg
return image; return image;
} }
void handleTextureProperty(const Nif::NiTexturingProperty* texprop, osg::StateSet* stateset, SceneUtil::CompositeStateSetUpdater* composite, Resource::ImageManager* imageManager, std::vector<unsigned int>& boundTextures, int animflags) void handleTextureProperty(const Nif::NiTexturingProperty* texprop, const std::string& nodeName, osg::StateSet* stateset, SceneUtil::CompositeStateSetUpdater* composite, Resource::ImageManager* imageManager, std::vector<unsigned int>& boundTextures, int animflags)
{ {
if (!boundTextures.empty()) if (!boundTextures.empty())
{ {
@ -1444,7 +1444,7 @@ namespace NifOsg
} }
default: default:
{ {
Log(Debug::Info) << "Unhandled texture stage " << i << " in " << mFilename; Log(Debug::Info) << "Unhandled texture stage " << i << " on shape \"" << nodeName << "\" in " << mFilename;
continue; continue;
} }
} }
@ -1452,7 +1452,8 @@ namespace NifOsg
const Nif::NiTexturingProperty::Texture& tex = texprop->textures[i]; const Nif::NiTexturingProperty::Texture& tex = texprop->textures[i];
if(tex.texture.empty() && texprop->controller.empty()) if(tex.texture.empty() && texprop->controller.empty())
{ {
Log(Debug::Verbose) << "Texture layer " << i << " is in use but empty in " << mFilename; if (i == 0)
Log(Debug::Warning) << "Base texture is in use but empty on shape \"" << nodeName << "\" in " << mFilename;
continue; continue;
} }
@ -1640,7 +1641,7 @@ namespace NifOsg
{ {
const Nif::NiTexturingProperty* texprop = static_cast<const Nif::NiTexturingProperty*>(property); const Nif::NiTexturingProperty* texprop = static_cast<const Nif::NiTexturingProperty*>(property);
osg::StateSet* stateset = node->getOrCreateStateSet(); osg::StateSet* stateset = node->getOrCreateStateSet();
handleTextureProperty(texprop, stateset, composite, imageManager, boundTextures, animflags); handleTextureProperty(texprop, node->getName(), stateset, composite, imageManager, boundTextures, animflags);
break; break;
} }
// unused by mw // unused by mw