Show
Ignore:
Timestamp:
05/12/11 14:28:43 (3 years ago)
Author:
robert
Message:

From Wang Rui, "A Chinese engineer (named Beilei Geng) reports a possible bug in the
osg2cpp application to me today. The conversion result may become
incorrect if there are quotation marks ( " ) in the shader file, which
will mostly appear in comment lines.

Replace all " into \" before writing to cpp files will solve the
problem, as the attached file shows."

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • OpenSceneGraph/trunk/examples/osg2cpp/osg2cpp.cpp

    r12292 r12398  
    2929    searchAndReplace(shaderSource, "\r\n", "\n"); 
    3030    searchAndReplace(shaderSource, "\r", "\n"); 
    31  
     31    searchAndReplace(shaderSource, "\"", "\\\""); 
     32  
    3233    std::string variableString = std::string("char ")+variableName+std::string("[] = "); 
    3334