diff options
author | Bastien Bouclet | 2016-10-20 19:20:51 +0200 |
---|---|---|
committer | Bastien Bouclet | 2016-10-20 19:21:56 +0200 |
commit | c1070e692965f27e0865a4eeed0e025876502d1a (patch) | |
tree | d676dc97d55060814758c8c0222923832b34487c /backends/cloud | |
parent | c9ad2062db80fc9b6339bebdcd70f58269e38bf6 (diff) | |
download | scummvm-rg350-c1070e692965f27e0865a4eeed0e025876502d1a.tar.gz scummvm-rg350-c1070e692965f27e0865a4eeed0e025876502d1a.tar.bz2 scummvm-rg350-c1070e692965f27e0865a4eeed0e025876502d1a.zip |
CLOUD: Don't error out when PNG support is not enabled
Diffstat (limited to 'backends/cloud')
-rw-r--r-- | backends/cloud/cloudicon.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/backends/cloud/cloudicon.cpp b/backends/cloud/cloudicon.cpp index 972efae57b..2adc7460d2 100644 --- a/backends/cloud/cloudicon.cpp +++ b/backends/cloud/cloudicon.cpp @@ -118,6 +118,11 @@ void CloudIcon::update() { break; } + if (!_icon.getPixels() || !_disabledIcon.getPixels()) { + // Loading the icons failed. Don't try to draw them. + return; + } + if (_state != kHidden) { makeAlphaIcon((_type == kDisabled ? _disabledIcon : _icon), _currentAlpha); g_system->displayActivityIconOnOSD(&_alphaIcon); @@ -137,11 +142,13 @@ void CloudIcon::initIcons() { void CloudIcon::loadIcon(Graphics::Surface &icon, byte *data, uint32 size) { Image::PNGDecoder decoder; Common::MemoryReadStream stream(data, size); - if (!decoder.loadStream(stream)) - error("CloudIcon::loadIcon: error decoding PNG"); + if (!decoder.loadStream(stream)) { + warning("CloudIcon::loadIcon: error decoding PNG"); + return; + } const Graphics::Surface *s = decoder.getSurface(); - return icon.copyFrom(*s); + icon.copyFrom(*s); } void CloudIcon::makeAlphaIcon(const Graphics::Surface &icon, float alpha) { |