From Colin McDonald, fixed image size calculation in getTotalSizeInBytesIncludingMipmaps(),
added checks on success of opening files for writing in the .ive plugin.
This commit is contained in:
@@ -82,6 +82,8 @@ class IVEReaderWriter : public ReaderWriter
|
||||
local_opt->setDatabasePath(osgDB::getFilePath(fileName));
|
||||
|
||||
std::ofstream fout(fileName.c_str(), std::ios::out | std::ios::binary);
|
||||
if (!fout) return WriteResult::ERROR_IN_WRITING_FILE;
|
||||
|
||||
WriteResult result = writeNode(node, fout, local_opt.get());
|
||||
fout.close();
|
||||
return result;
|
||||
@@ -103,6 +105,9 @@ class IVEReaderWriter : public ReaderWriter
|
||||
out.setOptions(options);
|
||||
|
||||
out.writeNode(const_cast<osg::Node*>(&node));
|
||||
|
||||
if ( fout.fail() ) return WriteResult::ERROR_IN_WRITING_FILE;
|
||||
|
||||
return WriteResult::FILE_SAVED;
|
||||
}
|
||||
catch(ive::Exception e)
|
||||
|
||||
Reference in New Issue
Block a user