From Laurens Voerman, "like the "Bug in ProxyNode serializer" Farshid Lashkari found (svn submit 13754) the PagedLOD serializer attempts to read begin and and brackets.

Fix is identical (don't read brackets when num_chidren is zero) and applies both to trunk and 3.2 branch."
This commit is contained in:
Robert Osfield 2013-09-05 10:08:09 +00:00
parent 19f84b52e7
commit 94735a8364

View File

@ -96,13 +96,17 @@ static bool checkChildren( const osg::PagedLOD& node )
static bool readChildren( osgDB::InputStream& is, osg::PagedLOD& node ) static bool readChildren( osgDB::InputStream& is, osg::PagedLOD& node )
{ {
unsigned int size = 0; is >> size >> is.BEGIN_BRACKET; unsigned int size = 0; is >> size;
if (size > 0)
{
is >> is.BEGIN_BRACKET;
for ( unsigned int i=0; i<size; ++i ) for ( unsigned int i=0; i<size; ++i )
{ {
osg::Node* child = dynamic_cast<osg::Node*>( is.readObject() ); osg::Node* child = dynamic_cast<osg::Node*>( is.readObject() );
if ( child ) node.addChild( child ); if ( child ) node.addChild( child );
} }
is >> is.END_BRACKET; is >> is.END_BRACKET;
}
return true; return true;
} }