Added osg::Image::set/getWriteHint() that allows images themselves to control how
they are written to disk, either inline or as an external file. Added support for this in the .ive plugin. Default of WriteHint is NO_PREFERNCE, in which case it's up to the reader/writer to decide.
This commit is contained in:
@@ -48,7 +48,8 @@ class ReaderWriterIVE : public ReaderWriter
|
||||
|
||||
// code for setting up the database path so that internally referenced files are searched for on relative paths.
|
||||
osg::ref_ptr<Options> local_opt = options ? static_cast<Options*>(options->clone(osg::CopyOp::SHALLOW_COPY)) : new Options;
|
||||
local_opt->setDatabasePath(osgDB::getFilePath(fileName));
|
||||
local_opt->getDatabasePathList().push_front(osgDB::getFilePath(fileName));
|
||||
|
||||
std::ifstream istream(fileName.c_str(), std::ios::in | std::ios::binary);
|
||||
return readImage(istream, local_opt.get());
|
||||
}
|
||||
@@ -63,7 +64,7 @@ class ReaderWriterIVE : public ReaderWriter
|
||||
|
||||
// code for setting up the database path so that internally referenced file are searched for on relative paths.
|
||||
osg::ref_ptr<Options> local_opt = options ? static_cast<Options*>(options->clone(osg::CopyOp::SHALLOW_COPY)) : new Options;
|
||||
local_opt->setDatabasePath(osgDB::getFilePath(fileName));
|
||||
local_opt->getDatabasePathList().push_front(osgDB::getFilePath(fileName));
|
||||
|
||||
std::ifstream istream(fileName.c_str(), std::ios::in | std::ios::binary);
|
||||
return readNode(istream,local_opt.get());
|
||||
|
||||
Reference in New Issue
Block a user