From 914e60a8723b0306daef7dd7d8b3839f4b84d84b Mon Sep 17 00:00:00 2001 From: Robert Osfield Date: Thu, 5 Apr 2018 14:14:49 +0100 Subject: [PATCH] Quietened down debug message output for osgText shader setup and Drawable::createVertexArrayStateImplementation --- include/osgDB/ReadFile | 8 +------- src/osg/Drawable.cpp | 2 +- src/osgDB/ReadFile.cpp | 14 ++++++++++++++ 3 files changed, 16 insertions(+), 8 deletions(-) diff --git a/include/osgDB/ReadFile b/include/osgDB/ReadFile index dfe87ae1b..c1a85583a 100644 --- a/include/osgDB/ReadFile +++ b/include/osgDB/ReadFile @@ -197,13 +197,7 @@ inline osg::ref_ptr readRefShaderFile(osg::Shader::Type type, const * The osgDB::Registry is used to load the appropriate ReaderWriter plugin * for the filename extension, and this plugin then handles the request * to read the specified file.*/ -inline osg::ref_ptr readRefShaderFileWithFallback(osg::Shader::Type type, const std::string& filename, const Options* options, const char* fallback) -{ - osg::ref_ptr shader = readRefShaderFile(filename, options); - if (shader.valid() && type != osg::Shader::UNDEFINED) shader->setType(type); - if (!shader) shader = new osg::Shader(type, fallback); - return shader; -} +osg::ref_ptr readRefShaderFileWithFallback(osg::Shader::Type type, const std::string& filename, const Options* options, const char* fallback); /** Read an osg::Shader from file and set to specified shader type, if a shader isn't loaded fallback to specific shader source. * The osgDB::Registry is used to load the appropriate ReaderWriter plugin diff --git a/src/osg/Drawable.cpp b/src/osg/Drawable.cpp index 6c382d85d..f37b094e3 100644 --- a/src/osg/Drawable.cpp +++ b/src/osg/Drawable.cpp @@ -693,7 +693,7 @@ void Drawable::draw(RenderInfo& renderInfo) const VertexArrayState* Drawable::createVertexArrayStateImplementation(RenderInfo& renderInfo) const { - OSG_NOTICE<<"VertexArrayState* Drawable::createVertexArrayStateImplementation(RenderInfo& renderInfo) const "<assignAllDispatchers(); return vos; diff --git a/src/osgDB/ReadFile.cpp b/src/osgDB/ReadFile.cpp index 700670ce6..ad86c441c 100644 --- a/src/osgDB/ReadFile.cpp +++ b/src/osgDB/ReadFile.cpp @@ -297,3 +297,17 @@ osg::ref_ptr osgDB::readRefNodeFiles(osg::ArgumentParser& arguments,const } } + +osg::ref_ptr osgDB::readRefShaderFileWithFallback(osg::Shader::Type type, const std::string& filename, const Options* options, const char* fallback) +{ + ReaderWriter::ReadResult rr = Registry::instance()->readShader(filename,options); + osg::ref_ptr shader = rr.getShader(); + if (!rr.success()) + { + OSG_INFO << "Error reading file " << filename << ": " << rr.statusMessage() << std::endl; + } + + if (shader.valid() && type != osg::Shader::UNDEFINED) shader->setType(type); + if (!shader) shader = new osg::Shader(type, fallback); + return shader; +}