aboutsummaryrefslogtreecommitdiff
path: root/graphics/scaler
diff options
context:
space:
mode:
authorMax Horn2009-01-22 04:45:19 +0000
committerMax Horn2009-01-22 04:45:19 +0000
commit17f5d4eeea9b22e833b4f9fb2f7f2670af27b4fa (patch)
treeb8073fd375a1c3233924a9ca079967c2c127e80d /graphics/scaler
parentabc06ca18e69c336d701707933b4dc490dd86e94 (diff)
downloadscummvm-rg350-17f5d4eeea9b22e833b4f9fb2f7f2670af27b4fa.tar.gz
scummvm-rg350-17f5d4eeea9b22e833b4f9fb2f7f2670af27b4fa.tar.bz2
scummvm-rg350-17f5d4eeea9b22e833b4f9fb2f7f2670af27b4fa.zip
Got rid of gBitFormat in thumbnail scaler code (and even simplified it in the process)
svn-id: r35994
Diffstat (limited to 'graphics/scaler')
-rw-r--r--graphics/scaler/thumbnail_intern.cpp15
1 files changed, 3 insertions, 12 deletions
diff --git a/graphics/scaler/thumbnail_intern.cpp b/graphics/scaler/thumbnail_intern.cpp
index 52547f47f1..a7389e3d8d 100644
--- a/graphics/scaler/thumbnail_intern.cpp
+++ b/graphics/scaler/thumbnail_intern.cpp
@@ -72,7 +72,7 @@ void createThumbnail_4(const uint8* src, uint32 srcPitch, uint8* dstPtr, uint32
}
}
-void createThumbnail(const uint8* src, uint32 srcPitch, uint8* dstPtr, uint32 dstPitch, int width, int height) {
+static void createThumbnail(const uint8* src, uint32 srcPitch, uint8* dstPtr, uint32 dstPitch, int width, int height) {
// only 1/2 and 1/4 downscale supported
if (width != 320 && width != 640)
return;
@@ -80,15 +80,9 @@ void createThumbnail(const uint8* src, uint32 srcPitch, uint8* dstPtr, uint32 ds
int downScaleMode = (width == 320) ? 2 : 4;
if (downScaleMode == 2) {
- if (gBitFormat == 565)
- createThumbnail_2<565>(src, srcPitch, dstPtr, dstPitch, width, height);
- else if (gBitFormat == 555)
- createThumbnail_2<555>(src, srcPitch, dstPtr, dstPitch, width, height);
+ createThumbnail_2<565>(src, srcPitch, dstPtr, dstPitch, width, height);
} else if (downScaleMode == 4) {
- if (gBitFormat == 565)
- createThumbnail_4<565>(src, srcPitch, dstPtr, dstPitch, width, height);
- else if (gBitFormat == 555)
- createThumbnail_4<555>(src, srcPitch, dstPtr, dstPitch, width, height);
+ createThumbnail_4<565>(src, srcPitch, dstPtr, dstPitch, width, height);
}
}
@@ -174,11 +168,8 @@ static bool createThumbnail(Graphics::Surface &out, Graphics::Surface &in) {
uint16 newHeight = !(inHeight % 240) ? kThumbnailHeight2 : kThumbnailHeight1;
- int gBitFormatBackUp = gBitFormat;
- gBitFormat = 565;
out.create(kThumbnailWidth, newHeight, sizeof(uint16));
createThumbnail((const uint8 *)in.pixels, width * sizeof(uint16), (uint8 *)out.pixels, out.pitch, width, inHeight);
- gBitFormat = gBitFormatBackUp;
in.free();