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:
@@ -11,10 +11,10 @@ static bool checkInitialBound( const osg::Drawable& drawable )
|
||||
static bool readInitialBound( osgDB::InputStream& is, osg::Drawable& drawable )
|
||||
{
|
||||
osg::Vec3d min, max;
|
||||
is >> osgDB::BEGIN_BRACKET;
|
||||
is >> osgDB::PROPERTY("Minimum") >> min;
|
||||
is >> osgDB::PROPERTY("Maximum") >> max;
|
||||
is >> osgDB::END_BRACKET;
|
||||
is >> is.BEGIN_BRACKET;
|
||||
is >> is.PROPERTY("Minimum") >> min;
|
||||
is >> is.PROPERTY("Maximum") >> max;
|
||||
is >> is.END_BRACKET;
|
||||
drawable.setInitialBound( osg::BoundingBox(min, max) );
|
||||
return true;
|
||||
}
|
||||
@@ -22,10 +22,10 @@ static bool readInitialBound( osgDB::InputStream& is, osg::Drawable& drawable )
|
||||
static bool writeInitialBound( osgDB::OutputStream& os, const osg::Drawable& drawable )
|
||||
{
|
||||
const osg::BoundingBox& bb = drawable.getInitialBound();
|
||||
os << osgDB::BEGIN_BRACKET << std::endl;
|
||||
os << osgDB::PROPERTY("Minimum") << osg::Vec3d(bb._min) << std::endl;
|
||||
os << osgDB::PROPERTY("Maximum") << osg::Vec3d(bb._max) << std::endl;
|
||||
os << osgDB::END_BRACKET;
|
||||
os << os.BEGIN_BRACKET << std::endl;
|
||||
os << os.PROPERTY("Minimum") << osg::Vec3d(bb._min) << std::endl;
|
||||
os << os.PROPERTY("Maximum") << osg::Vec3d(bb._max) << std::endl;
|
||||
os << os.END_BRACKET;
|
||||
os << std::endl;
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user