aboutsummaryrefslogtreecommitdiff
path: root/graphics/scaler/thumbnail_intern.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2010-07-02 19:04:44 +0000
committerFilippos Karapetis2010-07-02 19:04:44 +0000
commite22a75de9981876aafc0b07946c23185d823b190 (patch)
tree09bfdc6cb1e42b6d905e0fb6fe89ef2e990b5588 /graphics/scaler/thumbnail_intern.cpp
parent1beff1a599064d90fd0f1a2accd627e7e780fd68 (diff)
downloadscummvm-rg350-e22a75de9981876aafc0b07946c23185d823b190.tar.gz
scummvm-rg350-e22a75de9981876aafc0b07946c23185d823b190.tar.bz2
scummvm-rg350-e22a75de9981876aafc0b07946c23185d823b190.zip
Rewrote the handling of thumbnail creation for KQ6 Windows in rev #50600, so that it recreates the screen buffer like the other workarounds above it (thanks to LordHoto for pointing this out)
svn-id: r50601
Diffstat (limited to 'graphics/scaler/thumbnail_intern.cpp')
-rw-r--r--graphics/scaler/thumbnail_intern.cpp28
1 files changed, 12 insertions, 16 deletions
diff --git a/graphics/scaler/thumbnail_intern.cpp b/graphics/scaler/thumbnail_intern.cpp
index a27b77ccbb..ad8f73305d 100644
--- a/graphics/scaler/thumbnail_intern.cpp
+++ b/graphics/scaler/thumbnail_intern.cpp
@@ -71,17 +71,6 @@ void createThumbnail_4(const uint8 *src, uint32 srcPitch, uint8 *dstPtr, uint32
dstPtr += (dstPitch - 2 * width / 4);
src += 4 * srcPitch;
}
-
- // Special case for KQ6 Windows, which runs at 640x440: fill the bottom
- // with zeroes (a black bar)
- if (width == 640 && height == 440) {
- for (int y = 440; y < 480; y += 4) {
- for (int x = 0; x < width; x += 4, dstPtr += 2)
- *((uint16*)dstPtr) = 0;
-
- dstPtr += (dstPitch - 2 * width / 4);
- }
- }
}
static void createThumbnail(const uint8 *src, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch, int width, int height) {
@@ -195,15 +184,22 @@ static bool createThumbnail(Graphics::Surface &out, Graphics::Surface &in) {
in.free();
in = newscreen;
+ } else if (width == 640 && inHeight == 440) {
+ // Special case to handle KQ6 Windows: resize the screen to 640x480,
+ // adding a black band in the bottom.
+ inHeight = 480;
+
+ Graphics::Surface newscreen;
+ newscreen.create(width, 480, in.bytesPerPixel);
+
+ memcpy(newscreen.getBasePtr(0, 0), in.getBasePtr(0, 0), width * 440 * in.bytesPerPixel);
+
+ in.free();
+ in = newscreen;
}
uint16 newHeight = !(inHeight % 240) ? kThumbnailHeight2 : kThumbnailHeight1;
- // Special case for KQ6 Windows, which runs at 640x440: expand the
- // thumbnail so that it fits
- if (width == 640 && inHeight == 440)
- newHeight = kThumbnailHeight2;
-
out.create(kThumbnailWidth, newHeight, sizeof(uint16));
createThumbnail((const uint8 *)in.pixels, width * sizeof(uint16), (uint8 *)out.pixels, out.pitch, width, inHeight);