aboutsummaryrefslogtreecommitdiff
path: root/graphics/thumbnail.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2011-08-07 20:11:27 -0400
committerMatthew Hoops2011-08-07 20:11:27 -0400
commitc05c42ecc60c8f928628787272743f169a0d5903 (patch)
treef2b06be630676b7302a1fb62940099b2ec71442d /graphics/thumbnail.cpp
parente43a6671fc04f2c67b8efa2c0fdfdd6ec0ea1023 (diff)
parent45dc303159d5bbe77a351df31e6f2d2f97a3412d (diff)
downloadscummvm-rg350-c05c42ecc60c8f928628787272743f169a0d5903.tar.gz
scummvm-rg350-c05c42ecc60c8f928628787272743f169a0d5903.tar.bz2
scummvm-rg350-c05c42ecc60c8f928628787272743f169a0d5903.zip
Merge remote branch 'upstream/master' into soccer
Diffstat (limited to 'graphics/thumbnail.cpp')
-rw-r--r--graphics/thumbnail.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/graphics/thumbnail.cpp b/graphics/thumbnail.cpp
index 5fad25967e..db61d828d2 100644
--- a/graphics/thumbnail.cpp
+++ b/graphics/thumbnail.cpp
@@ -94,23 +94,24 @@ bool skipThumbnail(Common::SeekableReadStream &in) {
return true;
}
-bool loadThumbnail(Common::SeekableReadStream &in, Graphics::Surface &to) {
+Graphics::Surface *loadThumbnail(Common::SeekableReadStream &in) {
ThumbnailHeader header;
if (!loadHeader(in, header, true))
- return false;
+ return 0;
if (header.bpp != 2) {
warning("trying to load thumbnail with unsupported bit depth %d", header.bpp);
- return false;
+ return 0;
}
Graphics::PixelFormat format = g_system->getOverlayFormat();
- to.create(header.width, header.height, format);
+ Graphics::Surface *const to = new Graphics::Surface();
+ to->create(header.width, header.height, format);
- OverlayColor *pixels = (OverlayColor *)to.pixels;
- for (int y = 0; y < to.h; ++y) {
- for (int x = 0; x < to.w; ++x) {
+ OverlayColor *pixels = (OverlayColor *)to->pixels;
+ for (int y = 0; y < to->h; ++y) {
+ for (int x = 0; x < to->w; ++x) {
uint8 r, g, b;
colorToRGB<ColorMasks<565> >(in.readUint16BE(), r, g, b);
@@ -119,7 +120,7 @@ bool loadThumbnail(Common::SeekableReadStream &in, Graphics::Surface &to) {
}
}
- return true;
+ return to;
}
bool saveThumbnail(Common::WriteStream &out) {
@@ -166,4 +167,3 @@ bool saveThumbnail(Common::WriteStream &out, const Graphics::Surface &thumb) {
}
} // End of namespace Graphics
-