From Wang Rui, "Sorry for my very slow response because of some personal issues. I found that new Geometry serializers can't work with old .osgb files. The modified FastPathHint serializer doesn't correctly read from the stream and thus jumbles following inputs. The file attached can be placed in osgWrappers/serializers/osg to fix that problem.
"
This commit is contained in:
@@ -124,15 +124,14 @@ struct GeometryFinishedObjectReadCallback : public osgDB::FinishedObjectReadCall
|
||||
static bool checkFastPathHint( const osg::Geometry& geom ) { return false; }
|
||||
static bool readFastPathHint( osgDB::InputStream& is, osg::Geometry& geom )
|
||||
{
|
||||
// Compatibility info:
|
||||
// Previous Geometry wrapper (before 3.1.8) require a bool fast-path serializer.
|
||||
// It saves "FastPathHint true" in ascii mode and a single [bool] in binary mode.
|
||||
// Becoming a user serializer, the serializer will first read the name "FastPathHint"
|
||||
// or a [bool] in the checking process, then call the reading function as here. So,
|
||||
// we will only need to read one more bool variable in ascii mode; otherwise do nothing
|
||||
bool value = false;
|
||||
if ( is.isBinary() )
|
||||
{
|
||||
is >> value;
|
||||
}
|
||||
else if ( is.matchString("FastPathHint") )
|
||||
{
|
||||
is >> value;
|
||||
}
|
||||
if ( !is.isBinary() ) is >> value;
|
||||
return true;
|
||||
}
|
||||
static bool writeFastPathHint( osgDB::OutputStream& os, const osg::Geometry& geom )
|
||||
|
||||
Reference in New Issue
Block a user