Fixed handling of NULL entries in osg::Geometry TexCoordArrayList and VertexAttribArrayList.
git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14715 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
@@ -815,7 +815,14 @@ osg::Object* InputStream::readObject( osg::Object* existingObj )
|
||||
{
|
||||
std::string className;
|
||||
unsigned int id = 0;
|
||||
*this >> className >> BEGIN_BRACKET >> PROPERTY("UniqueID") >> id;
|
||||
*this >> className;
|
||||
|
||||
if (className=="NULL")
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
*this >> BEGIN_BRACKET >> PROPERTY("UniqueID") >> id;
|
||||
if ( getException() ) return NULL;
|
||||
|
||||
IdentifierMap::iterator itr = _identifierMap.find( id );
|
||||
|
||||
@@ -577,7 +577,11 @@ void OutputStream::writeImage( const osg::Image* img )
|
||||
|
||||
void OutputStream::writeObject( const osg::Object* obj )
|
||||
{
|
||||
if ( !obj ) return;
|
||||
if ( !obj )
|
||||
{
|
||||
*this << std::string("NULL") << std::endl; // Write NULL token.
|
||||
return;
|
||||
}
|
||||
|
||||
std::string name = obj->libraryName();
|
||||
name += std::string("::") + obj->className();
|
||||
|
||||
Reference in New Issue
Block a user