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:
Robert Osfield
2005-11-08 13:51:28 +00:00
parent 857b3e03c3
commit 6ed9cb40cc
3 changed files with 11 additions and 4 deletions

View File

@@ -27,7 +27,7 @@ using namespace osgDB;
bool osgDB::writeObjectFile(const Object& object,const std::string& filename)
{
ReaderWriter::WriteResult wr = Registry::instance()->writeObject(object,filename);
if (wr.error()) notify(WARN) << wr.message() << std::endl;
if (wr.error()) notify(WARN) << "Error writing file " << filename << ": " << wr.message() << std::endl;
return wr.success();
}
@@ -35,7 +35,7 @@ bool osgDB::writeObjectFile(const Object& object,const std::string& filename)
bool osgDB::writeImageFile(const Image& image,const std::string& filename)
{
ReaderWriter::WriteResult wr = Registry::instance()->writeImage(image,filename);
if (wr.error()) notify(WARN) << wr.message() << std::endl;
if (wr.error()) notify(WARN) << "Error writing file " << filename << ": " << wr.message() << std::endl;
return wr.success();
}
@@ -43,13 +43,13 @@ bool osgDB::writeImageFile(const Image& image,const std::string& filename)
bool osgDB::writeHeightFieldFile(const HeightField& HeightField,const std::string& filename)
{
ReaderWriter::WriteResult wr = Registry::instance()->writeHeightField(HeightField,filename);
if (wr.error()) notify(WARN) << wr.message() << std::endl;
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)
{
ReaderWriter::WriteResult wr = Registry::instance()->writeNode(node,filename);
if (wr.error()) notify(WARN) << wr.message() << std::endl;
if (wr.error()) notify(WARN) << "Error writing file " << filename << ": " << wr.message() << std::endl;
return wr.success();
}