Fixed warnings

This commit is contained in:
Robert Osfield 2020-01-14 16:29:07 +00:00
parent fbe4e1cf2f
commit b2b6ee952b
3 changed files with 6 additions and 7 deletions

View File

@ -1537,15 +1537,14 @@ convertShader(osg::Shader::Type osgShaderType,
return true;
// Create shader
osg::ref_ptr<osg::Shader> osgShader = new osg::Shader(osgShaderType);
osg::ref_ptr<osg::Shader> osgShader;
if (ivShader->sourceType.getValue() == SoShaderObject::FILENAME)
osgShader->loadShaderSourceFromFile(ivShader->sourceProgram.getValue().getString());
osgShader = osgDB::readRefShaderFile(osgShaderType, ivShader->sourceProgram.getValue().getString());
else
if (ivShader->sourceType.getValue() == SoShaderObject::GLSL_PROGRAM)
osgShader->setShaderSource(ivShader->sourceProgram.getValue().getString());
osgShader = new osg::Shader(osgShaderType, ivShader->sourceProgram.getValue().getString());
else {
OSG_WARN << NOTIFY_HEADER << "Can not convert "
<< "shader. Unsupported shader language." << std::endl;
OSG_WARN << NOTIFY_HEADER << "Can not convert shader. Unsupported shader language." << std::endl;
return false;
}

View File

@ -34,7 +34,7 @@ namespace deprecated_osg {
if (array->getBinding() == static_cast<osg::Array::Binding>(ab)) return; \
array->setBinding(static_cast<osg::Array::Binding>(ab));\
if (ab==3 /*osg::Geometry::BIND_PER_PRIMITIVE*/) _containsDeprecatedData = true; \
dirtyDisplayList();
dirtyGLObjects();
#define GET_BINDING(array) (array!=0 ? static_cast<AttributeBinding>(array->getBinding()) : BIND_OFF)

View File

@ -536,7 +536,7 @@ void OBJWriterNodeVisitor::processStateSet(osg::StateSet* ss)
if (mat || tex)
{
_materialMap.insert(std::make_pair(osg::ref_ptr<osg::StateSet>(ss), OBJMaterial(mat, tex, _outputTextureFiles, _options)));
_materialMap.insert(std::make_pair(osg::ref_ptr<osg::StateSet>(ss), OBJMaterial(mat, tex, _outputTextureFiles, _options.get())));
_fout << "usemtl " << _materialMap[ss].name << std::endl;
}