Improve some error messages

sceneinput
scrawl 9 years ago
parent 08325d14ca
commit af3b0cd883

@ -143,7 +143,7 @@ namespace ESSImport
osgDB::ReaderWriter::WriteResult result = readerwriter->writeImage(*image2, ostream); osgDB::ReaderWriter::WriteResult result = readerwriter->writeImage(*image2, ostream);
if (!result.success()) if (!result.success())
{ {
std::cerr << "can't write global map image: " << result.message() << std::endl; std::cerr << "can't write global map image: " << result.message() << " code " << result.status() << std::endl;
return; return;
} }

@ -425,7 +425,7 @@ void OMW::Engine::setWindowIcon()
} }
osgDB::ReaderWriter::ReadResult result = reader->readImage(windowIconStream); osgDB::ReaderWriter::ReadResult result = reader->readImage(windowIconStream);
if (!result.success()) if (!result.success())
std::cerr << "Failed to read " << windowIcon << ": " << result.message() << std::endl; std::cerr << "Failed to read " << windowIcon << ": " << result.message() << " code " << result.status() << std::endl;
else else
{ {
osg::ref_ptr<osg::Image> image = result.getImage(); osg::ref_ptr<osg::Image> image = result.getImage();
@ -602,7 +602,7 @@ public:
osgDB::ReaderWriter::WriteResult result = readerwriter->writeImage(image, outStream); osgDB::ReaderWriter::WriteResult result = readerwriter->writeImage(image, outStream);
if (!result.success()) if (!result.success())
{ {
std::cerr << "Can't write screenshot: " << result.message() << std::endl; std::cerr << "Can't write screenshot: " << result.message() << " code " << result.status() << std::endl;
} }
} }

@ -401,7 +401,7 @@ namespace MWGui
osgDB::ReaderWriter::ReadResult result = readerwriter->readImage(instream); osgDB::ReaderWriter::ReadResult result = readerwriter->readImage(instream);
if (!result.success()) if (!result.success())
{ {
std::cerr << "Failed to read savegame screenshot: " << result.message() << std::endl; std::cerr << "Failed to read savegame screenshot: " << result.message() << " code " << result.status() << std::endl;
return; return;
} }

@ -361,7 +361,7 @@ namespace MWRender
osgDB::ReaderWriter::WriteResult result = readerwriter->writeImage(*mOverlayImage, ostream); osgDB::ReaderWriter::WriteResult result = readerwriter->writeImage(*mOverlayImage, ostream);
if (!result.success()) if (!result.success())
{ {
std::cerr << "Can't write map overlay: " << result.message() << std::endl; std::cerr << "Can't write map overlay: " << result.message() << " code " << result.status() << std::endl;
return; return;
} }
@ -411,7 +411,7 @@ namespace MWRender
osgDB::ReaderWriter::ReadResult result = readerwriter->readImage(istream); osgDB::ReaderWriter::ReadResult result = readerwriter->readImage(istream);
if (!result.success()) if (!result.success())
{ {
std::cerr << "Can't read map overlay: " << result.message() << std::endl; std::cerr << "Can't read map overlay: " << result.message() << " code " << result.status() << std::endl;
return; return;
} }

@ -645,7 +645,7 @@ void LocalMap::MapSegment::loadFogOfWar(const ESM::FogTexture &esm)
osgDB::ReaderWriter::ReadResult result = readerwriter->readImage(in); osgDB::ReaderWriter::ReadResult result = readerwriter->readImage(in);
if (!result.success()) if (!result.success())
{ {
std::cerr << "Failed to read fog: " << result.message() << std::endl; std::cerr << "Failed to read fog: " << result.message() << " code " << result.status() << std::endl;
return; return;
} }
@ -677,7 +677,7 @@ void LocalMap::MapSegment::saveFogOfWar(ESM::FogTexture &fog) const
osgDB::ReaderWriter::WriteResult result = readerwriter->writeImage(*mFogOfWarImage, ostream); osgDB::ReaderWriter::WriteResult result = readerwriter->writeImage(*mFogOfWarImage, ostream);
if (!result.success()) if (!result.success())
{ {
std::cerr << "Unable to write fog: " << result.message() << std::endl; std::cerr << "Unable to write fog: " << result.message() << " code " << result.status() << std::endl;
return; return;
} }
mFogOfWarImage->flipVertical(); mFogOfWarImage->flipVertical();

@ -606,7 +606,7 @@ void MWState::StateManager::writeScreenshot(std::vector<char> &imageData) const
osgDB::ReaderWriter::WriteResult result = readerwriter->writeImage(*screenshot, ostream); osgDB::ReaderWriter::WriteResult result = readerwriter->writeImage(*screenshot, ostream);
if (!result.success()) if (!result.success())
{ {
std::cerr << "Unable to write screenshot: " << result.message() << std::endl; std::cerr << "Unable to write screenshot: " << result.message() << " code " << result.status() << std::endl;
return; return;
} }

@ -182,7 +182,7 @@ namespace Resource
osgDB::ReaderWriter::ReadResult result = reader->readImage(*stream, opts); osgDB::ReaderWriter::ReadResult result = reader->readImage(*stream, opts);
if (!result.success()) if (!result.success())
{ {
std::cerr << "Error loading " << filename << ": " << result.message() << std::endl; std::cerr << "Error loading " << filename << ": " << result.message() << " code " << result.status() << std::endl;
return mWarningTexture; return mWarningTexture;
} }

Loading…
Cancel
Save