mirror of
https://gitlab.com/OpenMW/openmw.git
synced 2025-09-08 03:41:11 -04:00
Do not crash ModVertexAlphaVisitor when there are no vertex colors
This commit is contained in:
parent
48f53e23bf
commit
fc6fe9acfb
@ -374,8 +374,13 @@ public:
|
|||||||
}
|
}
|
||||||
else if (mMeshType == 2)
|
else if (mMeshType == 2)
|
||||||
{
|
{
|
||||||
osg::Vec4Array* origColors = static_cast<osg::Vec4Array*>(geom->getColorArray());
|
if (geom->getColorArray())
|
||||||
alpha = ((*origColors)[i].x() == 1.f) ? 1.f : 0.f;
|
{
|
||||||
|
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);
|
(*colors)[i] = osg::Vec4f(0.f, 0.f, 0.f, alpha);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user