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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user