1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-02-20 19:39:41 +00:00

Make sure materials are built before trying to determine their transparency

This commit is contained in:
scrawl 2014-01-04 22:56:06 +01:00
parent c4e4a8fb57
commit 634a53211c
2 changed files with 3 additions and 0 deletions

View file

@ -185,6 +185,7 @@ public:
for(unsigned int i = 0;i < numsubs;++i)
{
Ogre::SubEntity* subEnt = entity->getSubEntity(i);
sh::Factory::getInstance()._ensureMaterial(subEnt->getMaterial()->getName(), "Default");
subEnt->setRenderQueueGroup(subEnt->getMaterial()->isTransparent() ? mTransQueue : mSolidQueue);
}
}
@ -1188,6 +1189,7 @@ public:
unsigned int numsubs = ent->getNumSubEntities();
for(unsigned int i = 0;i < numsubs;++i)
{
sh::Factory::getInstance()._ensureMaterial(ent->getSubEntity(i)->getMaterial()->getName(), "Default");
if(ent->getSubEntity(i)->getMaterial()->isTransparent())
return true;
}

View file

@ -750,6 +750,7 @@ void NpcAnimation::preRender(Ogre::Camera *camera)
void NpcAnimation::applyAlpha(float alpha, Ogre::Entity *ent, NifOgre::ObjectScenePtr scene)
{
sh::Factory::getInstance()._ensureMaterial(ent->getSubEntity(0)->getMaterial()->getName(), "Default");
ent->getSubEntity(0)->setRenderQueueGroup(alpha != 1.f || ent->getSubEntity(0)->getMaterial()->isTransparent()
? RQG_Alpha : RQG_Main);