Added readScript/writeScript methods to ReaderWriter

git-svn-id: http://svn.openscenegraph.org/osg/OpenSceneGraph/trunk@14366 16af8721-9629-0410-8352-f15c8da7e697
This commit is contained in:
Robert Osfield
2014-07-14 15:59:06 +00:00
parent 5a7a20d01e
commit 50e63ad3ee
14 changed files with 314 additions and 68 deletions

View File

@@ -250,6 +250,16 @@ Node* osgDB::readNodeFiles(osg::ArgumentParser& arguments,const Options* options
}
Script* osgDB::readScriptFile(const std::string& filename,const Options* options)
{
ReaderWriter::ReadResult rr = Registry::instance()->readScript(filename,options);
if (rr.validScript()) return rr.takeScript();
if (rr.error()) OSG_WARN << rr.message() << std::endl;
return NULL;
}
osg::ref_ptr<osg::Object> osgDB::readRefObjectFile(const std::string& filename,const Options* options)
{
ReaderWriter::ReadResult rr = Registry::instance()->readObject(filename,options);
@@ -289,3 +299,11 @@ osg::ref_ptr<osg::Node> osgDB::readRefNodeFile(const std::string& filename,const
if (rr.error()) OSG_WARN << rr.message() << std::endl;
return NULL;
}
osg::ref_ptr<osg::Script> osgDB::readRefScriptFile(const std::string& filename,const Options* options)
{
ReaderWriter::ReadResult rr = Registry::instance()->readScript(filename,options);
if (rr.validScript()) return osg::ref_ptr<osg::Script>(rr.getScript());
if (rr.error()) OSG_WARN << rr.message() << std::endl;
return NULL;
}