Refactored the Registry::ReadFileCallback, WriteFileCallback and ReaderWriter::Options to they are now defined in their own header and in the osgDB namespace.
Introduced a new FindFileCallback to Registry to compliement the existing ReadFileCallback and WriteFileCallback. Added support for assign Find, Read and WriteFileCallbacks to osdDB::Options to enable plugins/applications to override the callbacks just for that read/write call and any nested file operations
This commit is contained in:
@@ -24,7 +24,7 @@
|
||||
using namespace osg;
|
||||
using namespace osgDB;
|
||||
|
||||
bool osgDB::writeObjectFile(const Object& object,const std::string& filename, const ReaderWriter::Options* options )
|
||||
bool osgDB::writeObjectFile(const Object& object,const std::string& filename, const Options* options )
|
||||
{
|
||||
ReaderWriter::WriteResult wr = Registry::instance()->writeObject( object, filename, options );
|
||||
if (wr.error()) notify(WARN) << "Error writing file " << filename << ": " << wr.message() << std::endl;
|
||||
@@ -32,7 +32,7 @@ bool osgDB::writeObjectFile(const Object& object,const std::string& filename, co
|
||||
}
|
||||
|
||||
|
||||
bool osgDB::writeImageFile(const Image& image,const std::string& filename, const ReaderWriter::Options* options )
|
||||
bool osgDB::writeImageFile(const Image& image,const std::string& filename, const Options* options )
|
||||
{
|
||||
ReaderWriter::WriteResult wr = Registry::instance()->writeImage( image, filename, options );
|
||||
if (wr.error()) notify(WARN) << "Error writing file " << filename << ": " << wr.message() << std::endl;
|
||||
@@ -40,21 +40,21 @@ bool osgDB::writeImageFile(const Image& image,const std::string& filename, const
|
||||
}
|
||||
|
||||
|
||||
bool osgDB::writeHeightFieldFile(const HeightField& HeightField,const std::string& filename, const ReaderWriter::Options* options )
|
||||
bool osgDB::writeHeightFieldFile(const HeightField& HeightField,const std::string& filename, const Options* options )
|
||||
{
|
||||
ReaderWriter::WriteResult wr = Registry::instance()->writeHeightField( HeightField, filename, options );
|
||||
if (wr.error()) notify(WARN) << "Error writing file " << filename << ": " << wr.message() << std::endl;
|
||||
return wr.success();
|
||||
}
|
||||
|
||||
bool osgDB::writeNodeFile(const Node& node,const std::string& filename, const ReaderWriter::Options* options )
|
||||
bool osgDB::writeNodeFile(const Node& node,const std::string& filename, const Options* options )
|
||||
{
|
||||
ReaderWriter::WriteResult wr = Registry::instance()->writeNode( node, filename, options );
|
||||
if (wr.error()) notify(WARN) << "Error writing file " << filename << ": " << wr.message() << std::endl;
|
||||
return wr.success();
|
||||
}
|
||||
|
||||
bool osgDB::writeShaderFile(const Shader& shader,const std::string& filename, const ReaderWriter::Options* options )
|
||||
bool osgDB::writeShaderFile(const Shader& shader,const std::string& filename, const Options* options )
|
||||
{
|
||||
ReaderWriter::WriteResult wr = Registry::instance()->writeShader( shader, filename, options );
|
||||
if (wr.error()) notify(WARN) << "Error writing file " << filename << ": " << wr.message() << std::endl;
|
||||
|
||||
Reference in New Issue
Block a user