mirror of
https://github.com/OpenMW/openmw.git
synced 2025-02-05 22:45:33 +00:00
Do not crash ModVertexAlphaVisitor when there are no vertex colors
This commit is contained in:
parent
48f53e23bf
commit
fc6fe9acfb
1 changed files with 7 additions and 2 deletions
|
@ -373,10 +373,15 @@ public:
|
|||
else alpha = 1.f;
|
||||
}
|
||||
else if (mMeshType == 2)
|
||||
{
|
||||
if (geom->getColorArray())
|
||||
{
|
||||
osg::Vec4Array* origColors = static_cast<osg::Vec4Array*>(geom->getColorArray());
|
||||
alpha = ((*origColors)[i].x() == 1.f) ? 1.f : 0.f;
|
||||
}
|
||||
else
|
||||
alpha = 1.f;
|
||||
}
|
||||
|
||||
(*colors)[i] = osg::Vec4f(0.f, 0.f, 0.f, alpha);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue