From Farshid Lashkari, "I've attached a fix for the Collada loader that prevents a crash with some files containing textures. I also converted an OSG_NOTICE to OSG_INFO to be consistent with other log messages within the loader."

This commit is contained in:
Robert Osfield
2014-01-08 10:32:58 +00:00
parent 574b3eb573
commit acdebc99bc

View File

@@ -1004,7 +1004,7 @@ osg::Texture2D* daeReader::processTexture(
domImage *dImg = NULL;
std::string target = std::string("./") + std::string(tex->getTexture());
OSG_NOTICE<<"processTexture("<<target<<")"<<std::endl;
OSG_INFO<<"processTexture("<<target<<")"<<std::endl;
daeSIDResolver res1( _currentEffect, target.c_str() );
daeElement *el = res1.getElement();
@@ -1039,6 +1039,12 @@ osg::Texture2D* daeReader::processTexture(
return NULL;
}
if (sampler->getSource() == NULL )
{
OSG_WARN << "Could not locate source for sampler2D" << std::endl;
return NULL;
}
//find the newparam for the surface based on the sampler2D->source value
target = std::string("./") + std::string( sampler->getSource()->getValue() );
daeSIDResolver res2( _currentEffect, target.c_str() );