Fixed the readObject method so it could handle reading from a file contains any valid type of osg::Object
This commit is contained in:
parent
55749eda59
commit
e9cd13f120
@ -159,12 +159,15 @@ public:
|
|||||||
if ( !ii ) return ReadResult::FILE_NOT_HANDLED;
|
if ( !ii ) return ReadResult::FILE_NOT_HANDLED;
|
||||||
|
|
||||||
InputStream is( options );
|
InputStream is( options );
|
||||||
if ( is.start(ii.get())!=InputStream::READ_OBJECT )
|
|
||||||
|
osgDB::InputStream::ReadType readType = is.start(ii.get());
|
||||||
|
if ( readType==InputStream::READ_UNKNOWN )
|
||||||
{
|
{
|
||||||
CATCH_EXCEPTION(is);
|
CATCH_EXCEPTION(is);
|
||||||
return ReadResult::FILE_NOT_HANDLED;
|
return ReadResult::FILE_NOT_HANDLED;
|
||||||
}
|
}
|
||||||
is.decompress(); CATCH_EXCEPTION(is);
|
is.decompress(); CATCH_EXCEPTION(is);
|
||||||
|
|
||||||
osg::Object* obj = is.readObject(); CATCH_EXCEPTION(is);
|
osg::Object* obj = is.readObject(); CATCH_EXCEPTION(is);
|
||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user