diff options
author | Max Horn | 2009-01-22 04:45:19 +0000 |
---|---|---|
committer | Max Horn | 2009-01-22 04:45:19 +0000 |
commit | 17f5d4eeea9b22e833b4f9fb2f7f2670af27b4fa (patch) | |
tree | b8073fd375a1c3233924a9ca079967c2c127e80d /graphics | |
parent | abc06ca18e69c336d701707933b4dc490dd86e94 (diff) | |
download | scummvm-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')
-rw-r--r-- | graphics/scaler.h | 1 | ||||
-rw-r--r-- | graphics/scaler/thumbnail_intern.cpp | 15 |
2 files changed, 3 insertions, 13 deletions
diff --git a/graphics/scaler.h b/graphics/scaler.h index 95900de412..4cea9ee2fb 100644 --- a/graphics/scaler.h +++ b/graphics/scaler.h @@ -75,7 +75,6 @@ enum { kThumbnailHeight1 = 100, kThumbnailHeight2 = 120 }; -extern void createThumbnail(const uint8* src, uint32 srcPitch, uint8* dstPtr, uint32 dstPitch, int width, int height); /** * Creates a thumbnail from the current screen (without overlay). 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(); |