aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute
diff options
context:
space:
mode:
authorEinar Johan Trøan Sømåen2012-07-22 22:31:02 +0200
committerEinar Johan Trøan Sømåen2012-07-22 22:31:02 +0200
commit30ada3c13f63ef35ccdd21ca76fb45aa9fb1dc3c (patch)
tree7987671c6058e1f16e9dc9089ea9c62fe43ed18a /engines/wintermute
parent803c4215534bdbdc545c8aa32418444e27d607f5 (diff)
downloadscummvm-rg350-30ada3c13f63ef35ccdd21ca76fb45aa9fb1dc3c.tar.gz
scummvm-rg350-30ada3c13f63ef35ccdd21ca76fb45aa9fb1dc3c.tar.bz2
scummvm-rg350-30ada3c13f63ef35ccdd21ca76fb45aa9fb1dc3c.zip
WINTERMUTE: Check for failure when decoding images.
Diffstat (limited to 'engines/wintermute')
-rw-r--r--engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp8
-rw-r--r--engines/wintermute/base/gfx/osystem/base_surface_osystem.h2
2 files changed, 7 insertions, 3 deletions
diff --git a/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp b/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp
index 0de31349fd..772f7c35ba 100644
--- a/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp
+++ b/engines/wintermute/base/gfx/osystem/base_surface_osystem.cpp
@@ -116,9 +116,11 @@ bool BaseSurfaceOSystem::create(const char *filename, bool defaultCK, byte ckRed
return STATUS_OK;
}
-void BaseSurfaceOSystem::finishLoad() {
+bool BaseSurfaceOSystem::finishLoad() {
BaseImage *image = new BaseImage(_gameRef);
- image->loadFile(_filename);
+ if (!image->loadFile(_filename)) {
+ return false;
+ }
_width = image->getSurface()->w;
_height = image->getSurface()->h;
@@ -188,6 +190,8 @@ void BaseSurfaceOSystem::finishLoad() {
delete image;
_loaded = true;
+
+ return true;
}
//////////////////////////////////////////////////////////////////////////
diff --git a/engines/wintermute/base/gfx/osystem/base_surface_osystem.h b/engines/wintermute/base/gfx/osystem/base_surface_osystem.h
index bece031fe7..3a8d64703f 100644
--- a/engines/wintermute/base/gfx/osystem/base_surface_osystem.h
+++ b/engines/wintermute/base/gfx/osystem/base_surface_osystem.h
@@ -85,7 +85,7 @@ public:
private:
Graphics::Surface *_surface;
bool _loaded;
- void finishLoad();
+ bool finishLoad();
bool drawSprite(int x, int y, Rect32 *rect, float zoomX, float zoomY, uint32 alpha, bool alphaDisable, TSpriteBlendMode blendMode, bool mirrorX, bool mirrorY, int offsetX = 0, int offsetY = 0);
void genAlphaMask(Graphics::Surface *surface);
uint32 getPixel(Graphics::Surface *surface, int x, int y);