From Wang Rui, "I'd like to submit the changes that will put ObjectProperty and ObjectMark variables into the InputStream/OutputStream class instead of static ones. This should avoid the threading problem and won't repeatedly reallocate memory for the properties. Some of the wrappers will be slightly modified to use the property variable stored in the InputStream/OutputStream as well."
This commit is contained in:
@@ -32,24 +32,24 @@ static bool checkColorGradientCorners( const osgText::Text& text )
|
||||
static bool readColorGradientCorners( osgDB::InputStream& is, osgText::Text& text )
|
||||
{
|
||||
osg::Vec4d lt, lb, rb, rt;
|
||||
is >> osgDB::BEGIN_BRACKET;
|
||||
is >> osgDB::PROPERTY("TopLeft") >> lt;
|
||||
is >> osgDB::PROPERTY("BottomLeft") >> lb;
|
||||
is >> osgDB::PROPERTY("BottomRight") >> rb;
|
||||
is >> osgDB::PROPERTY("TopRight") >> rt;
|
||||
is >> osgDB::END_BRACKET;
|
||||
is >> is.BEGIN_BRACKET;
|
||||
is >> is.PROPERTY("TopLeft") >> lt;
|
||||
is >> is.PROPERTY("BottomLeft") >> lb;
|
||||
is >> is.PROPERTY("BottomRight") >> rb;
|
||||
is >> is.PROPERTY("TopRight") >> rt;
|
||||
is >> is.END_BRACKET;
|
||||
text.setColorGradientCorners( lt, lb, rb, rt );
|
||||
return true;
|
||||
}
|
||||
|
||||
static bool writeColorGradientCorners( osgDB::OutputStream& os, const osgText::Text& text )
|
||||
{
|
||||
os << osgDB::BEGIN_BRACKET << std::endl;
|
||||
os << osgDB::PROPERTY("TopLeft") << osg::Vec4d(text.getColorGradientTopLeft()) << std::endl;
|
||||
os << osgDB::PROPERTY("BottomLeft") << osg::Vec4d(text.getColorGradientBottomLeft()) << std::endl;
|
||||
os << osgDB::PROPERTY("BottomRight") << osg::Vec4d(text.getColorGradientBottomRight()) << std::endl;
|
||||
os << osgDB::PROPERTY("TopRight") << osg::Vec4d(text.getColorGradientTopRight()) << std::endl;
|
||||
os << osgDB::END_BRACKET << std::endl;
|
||||
os << os.BEGIN_BRACKET << std::endl;
|
||||
os << os.PROPERTY("TopLeft") << osg::Vec4d(text.getColorGradientTopLeft()) << std::endl;
|
||||
os << os.PROPERTY("BottomLeft") << osg::Vec4d(text.getColorGradientBottomLeft()) << std::endl;
|
||||
os << os.PROPERTY("BottomRight") << osg::Vec4d(text.getColorGradientBottomRight()) << std::endl;
|
||||
os << os.PROPERTY("TopRight") << osg::Vec4d(text.getColorGradientTopRight()) << std::endl;
|
||||
os << os.END_BRACKET << std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user