From Colin McDonald, two submissions merged from svn/trunk:

"The osgb file reader uses seek to position within the file.
But the nested stream implementation for osga archive files doesn't
support seeking.  So osgb files can't currently be used in an osga
archive e.g. if osgdem is used to output a osgb format database it
can't be packaged in an archive file, in the same manner that ive
files could.

I've added seek support to the osga nested stream implementation."


"The osgt/osgb file formats output a scenegraph node with the type
set to "SCENE" in the file header.  But if the file is stored and
then extracted again from an osga archive this header info is lost,
and the resulting file is just an "OBJECT".  Possibly other plugin
operations would have the same effect.  The osgt/osgb plugin won't
then return the scenegraph contents.

I have updated the osgt/osgb plugin to return a node from an "OBJECT"
file."
This commit is contained in:
Robert Osfield
2013-10-22 11:33:45 +00:00
parent 5c4800c774
commit 9af08d6715
2 changed files with 77 additions and 25 deletions

View File

@@ -242,7 +242,8 @@ public:
if ( !ii ) return ReadResult::FILE_NOT_HANDLED;
InputStream is( options );
if ( is.start(ii.get())!=InputStream::READ_SCENE )
osgDB::InputStream::ReadType readType = is.start(ii.get());
if ( readType!=InputStream::READ_SCENE && readType!=InputStream::READ_OBJECT )
{
CATCH_EXCEPTION(is);
return ReadResult::FILE_NOT_HANDLED;
@@ -250,6 +251,7 @@ public:
is.decompress(); CATCH_EXCEPTION(is);
osg::Node* node = dynamic_cast<osg::Node*>(is.readObject()); CATCH_EXCEPTION(is);
if ( !node ) return ReadResult::FILE_NOT_HANDLED;
return node;
}