From 23a0f5318c50cdf3dce19e4de0c98fb5ae1c2618 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Sun, 7 Aug 2011 11:39:54 +0200 Subject: JANITORIAL: Remove trailing empty lines. --- graphics/thumbnail.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'graphics/thumbnail.cpp') diff --git a/graphics/thumbnail.cpp b/graphics/thumbnail.cpp index 5fad25967e..e9576efe7a 100644 --- a/graphics/thumbnail.cpp +++ b/graphics/thumbnail.cpp @@ -166,4 +166,3 @@ bool saveThumbnail(Common::WriteStream &out, const Graphics::Surface &thumb) { } } // End of namespace Graphics - -- cgit v1.2.3 From e35b4f20c1041b13361aa2ebc4e758873bb1cee3 Mon Sep 17 00:00:00 2001 From: Christoph Mallon Date: Sun, 7 Aug 2011 14:35:01 +0200 Subject: GRAPHICS: Simplify the interface of Graphics::loadThumbnail(). Now it returns the Surface, so the caller does not need to create one and pass it. --- graphics/thumbnail.cpp | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) (limited to 'graphics/thumbnail.cpp') diff --git a/graphics/thumbnail.cpp b/graphics/thumbnail.cpp index e9576efe7a..3684974117 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 >(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) { -- cgit v1.2.3 From 28004ac8d961b94384f50c5f961ff3352c4289ef Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 7 Aug 2011 15:30:37 +0200 Subject: GRAPHICS: Slight formatting fix. --- graphics/thumbnail.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'graphics/thumbnail.cpp') diff --git a/graphics/thumbnail.cpp b/graphics/thumbnail.cpp index 3684974117..db61d828d2 100644 --- a/graphics/thumbnail.cpp +++ b/graphics/thumbnail.cpp @@ -94,7 +94,7 @@ bool skipThumbnail(Common::SeekableReadStream &in) { return true; } -Graphics::Surface* loadThumbnail(Common::SeekableReadStream &in) { +Graphics::Surface *loadThumbnail(Common::SeekableReadStream &in) { ThumbnailHeader header; if (!loadHeader(in, header, true)) -- cgit v1.2.3