- Timestamp:
- 03/21/12 18:36:20 (14 months ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
OpenSceneGraph/trunk/src/osgWrappers/deprecated-dotosg/osg/Shader.cpp
r12936 r13041 43 43 iteratorAdvanced = true; 44 44 } 45 45 46 46 if (fr.matchSequence("file %w") || fr.matchSequence("file %s") ) 47 47 { … … 52 52 else 53 53 shader.loadShaderSourceFromFile( osgDB::findDataFile(fr[1].getStr()) ); 54 54 55 55 fr += 2; 56 56 iteratorAdvanced = true; … … 95 95 fileName = fw.getShaderFileNameForOutput(); 96 96 } 97 97 98 98 osgDB::writeShaderFile(shader, fileName); 99 99 100 100 if (!fileName.empty()) 101 { 101 { 102 102 fw.indent() << "file "<<fw.wrapString(fw.getFileNameForOutput(fileName))<< std::endl; 103 103 } 104 104 105 105 } 106 else // no need to write shaders to external files, hence embed it 106 else // no need to write shaders to external files, hence embed it 107 107 { 108 108 109 109 // split source text into individual lines 110 110 std::vector<std::string> lines; … … 117 117 fw.indent() << "code {\n"; 118 118 fw.moveIn(); 119 119 120 120 std::vector<std::string>::const_iterator j; 121 121 for (j=lines.begin(); j!=lines.end(); ++j) { 122 122 fw.indent() << fw.wrapString(*j) << "\n"; 123 123 } 124 124 125 125 fw.moveOut(); 126 126 fw.indent() << "}\n";
