Added checks to prevent crash when no imagery is applied

This commit is contained in:
Robert Osfield
2009-05-05 11:05:17 +00:00
parent ee3bfe94a3
commit e2f4e96416

View File

@@ -98,9 +98,25 @@ osg::Node* createCube(const osg::Vec3& center, float size, unsigned int numSlice
void FixedFunctionTechnique::init()
{
osg::notify(osg::NOTICE)<<"FixedFunctionTechnique::init()"<<std::endl;
osg::notify(osg::INFO)<<"FixedFunctionTechnique::init()"<<std::endl;
if (!_volumeTile) return;
if (!_volumeTile)
{
osg::notify(osg::NOTICE)<<"FixedFunctionTechnique::init(), error no volume tile assigned."<<std::endl;
return;
}
if (_volumeTile->getLayer()==0)
{
osg::notify(osg::NOTICE)<<"FixedFunctionTechnique::init(), error no layer assigend to volume tile."<<std::endl;
return;
}
if (_volumeTile->getLayer()->getImage()==0)
{
osg::notify(osg::NOTICE)<<"FixedFunctionTechnique::init(), error no image assigned to layer."<<std::endl;
return;
}
float alphaFuncValue = 0.1;