[Scummvm-git-logs] scummvm master -> c1070e692965f27e0865a4eeed0e025876502d1a
bgK
bastien.bouclet at gmail.com
Thu Oct 20 19:35:16 CEST 2016
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
c1070e6929 CLOUD: Don't error out when PNG support is not enabled
Commit: c1070e692965f27e0865a4eeed0e025876502d1a
https://github.com/scummvm/scummvm/commit/c1070e692965f27e0865a4eeed0e025876502d1a
Author: Bastien Bouclet (bastien.bouclet at gmail.com)
Date: 2016-10-20T19:21:56+02:00
Commit Message:
CLOUD: Don't error out when PNG support is not enabled
Changed paths:
backends/cloud/cloudicon.cpp
diff --git a/backends/cloud/cloudicon.cpp b/backends/cloud/cloudicon.cpp
index 972efae..2adc746 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) {
More information about the Scummvm-git-logs
mailing list