From b3f0eb8a9db27d3b0659eeb7ce53c69849342439 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 17 Apr 2011 16:31:49 +0200 Subject: SWORD25: Prefer Surface::create taking a PixelFormat over the one taking a byte depth. I am not 100% sure whether the surfaces all use the same format as the screen, but a quick test showed that it still works fine. In case this is wrong please set them up with the correct format. --- engines/sword25/gfx/screenshot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/sword25/gfx/screenshot.cpp') diff --git a/engines/sword25/gfx/screenshot.cpp b/engines/sword25/gfx/screenshot.cpp index 35e94976eb..e06ccb8051 100644 --- a/engines/sword25/gfx/screenshot.cpp +++ b/engines/sword25/gfx/screenshot.cpp @@ -134,7 +134,7 @@ Common::SeekableReadStream *Screenshot::createThumbnail(Graphics::Surface *data) // Buffer for the output thumbnail Graphics::Surface thumbnail; - thumbnail.create(200, 125, 4); + thumbnail.create(200, 125, g_system->getScreenFormat()); // Über das Zielbild iterieren und einen Pixel zur Zeit berechnen. uint x, y; -- cgit v1.2.3 From c3669443ece9e29d37ddfdce5614c628717a34b9 Mon Sep 17 00:00:00 2001 From: Johannes Schickel Date: Sun, 17 Apr 2011 17:29:37 +0200 Subject: SWORD25: Prefer Surface::format over Surface::bytesPerPixel. --- engines/sword25/gfx/screenshot.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'engines/sword25/gfx/screenshot.cpp') diff --git a/engines/sword25/gfx/screenshot.cpp b/engines/sword25/gfx/screenshot.cpp index e06ccb8051..5d25626727 100644 --- a/engines/sword25/gfx/screenshot.cpp +++ b/engines/sword25/gfx/screenshot.cpp @@ -127,7 +127,7 @@ Common::SeekableReadStream *Screenshot::createThumbnail(Graphics::Surface *data) // generates a pixel of the target image. Finally, the result as a PNG file is stored as a file. // The source image must be 800x600. - if (data->w != 800 || data->h != 600 || data->bytesPerPixel != 4) { + if (data->w != 800 || data->h != 600 || data->format.bytesPerPixel != 4) { error("The sreenshot dimensions have to be 800x600 in order to be saved as a thumbnail."); return false; } -- cgit v1.2.3 From 9414d7a6e287ff8abfb5746b564e92c8f0e6de58 Mon Sep 17 00:00:00 2001 From: Ori Avtalion Date: Sun, 24 Apr 2011 11:34:27 +0300 Subject: JANITORIAL: Reduce header dependencies in shared code Some backends may break as I only compiled SDL --- engines/sword25/gfx/screenshot.cpp | 1 + 1 file changed, 1 insertion(+) (limited to 'engines/sword25/gfx/screenshot.cpp') diff --git a/engines/sword25/gfx/screenshot.cpp b/engines/sword25/gfx/screenshot.cpp index 35e94976eb..ee664d6328 100644 --- a/engines/sword25/gfx/screenshot.cpp +++ b/engines/sword25/gfx/screenshot.cpp @@ -36,6 +36,7 @@ #define FORBIDDEN_SYMBOL_ALLOW_ALL #include "common/memstream.h" +#include "common/textconsole.h" #include "sword25/gfx/screenshot.h" #include "sword25/kernel/filesystemutil.h" #include -- cgit v1.2.3