From Art Trevs, add support for saving external shader files.
From Robert Osfield, adding missing member variable initializes and Output::getShaderFileNameForOutput() implementation
This commit is contained in:
@@ -46,8 +46,13 @@ void Output::init()
|
||||
_indentStep = 2;
|
||||
_numIndicesPerLine = 10;
|
||||
_pathNameHint = AS_IS;
|
||||
|
||||
_outputTextureFiles = false;
|
||||
_textureFileNameNumber = 0;
|
||||
|
||||
_outputShaderFiles = false;
|
||||
_shaderFileNameNumber = 0;
|
||||
|
||||
_writeOutDefaultValues = false;
|
||||
|
||||
const char* env = getenv("OSG_WRITE_OUT_DEFAULT_VALUES");
|
||||
@@ -212,3 +217,19 @@ std::string Output::getTextureFileNameForOutput()
|
||||
return fileName;
|
||||
}
|
||||
|
||||
std::string Output::getShaderFileNameForOutput()
|
||||
{
|
||||
std::string fileName = osgDB::getNameLessExtension(_filename);
|
||||
if (_shaderFileNameNumber>0)
|
||||
{
|
||||
std::ostringstream o;
|
||||
o << '_' << _shaderFileNameNumber;
|
||||
fileName += o.str();
|
||||
}
|
||||
|
||||
fileName += ".glsl";
|
||||
++_shaderFileNameNumber;
|
||||
|
||||
return fileName;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user