1
0
Fork 1
mirror of https://github.com/TES3MP/openmw-tes3mp.git synced 2025-01-19 20:53:50 +00:00

Error handling fix

This commit is contained in:
scrawl 2015-06-05 02:57:31 +02:00
parent 403ce30a35
commit 700000cbca

View file

@ -411,6 +411,11 @@ void OMW::Engine::setWindowIcon()
if (windowIconStream.fail()) if (windowIconStream.fail())
std::cerr << "Failed to open " << windowIcon << std::endl; std::cerr << "Failed to open " << windowIcon << std::endl;
osgDB::ReaderWriter* reader = osgDB::Registry::instance()->getReaderWriterForExtension("png"); osgDB::ReaderWriter* reader = osgDB::Registry::instance()->getReaderWriterForExtension("png");
if (!reader)
{
std::cerr << "Failed to read window icon, no png readerwriter found" << std::endl;
return;
}
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() << std::endl;