[Scummvm-cvs-logs] SF.net SVN: scummvm:[35994] scummvm/trunk/graphics
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Thu Jan 22 05:45:20 CET 2009
Revision: 35994
http://scummvm.svn.sourceforge.net/scummvm/?rev=35994&view=rev
Author: fingolfin
Date: 2009-01-22 04:45:19 +0000 (Thu, 22 Jan 2009)
Log Message:
-----------
Got rid of gBitFormat in thumbnail scaler code (and even simplified it in the process)
Modified Paths:
--------------
scummvm/trunk/graphics/scaler/thumbnail_intern.cpp
scummvm/trunk/graphics/scaler.h
Modified: scummvm/trunk/graphics/scaler/thumbnail_intern.cpp
===================================================================
--- scummvm/trunk/graphics/scaler/thumbnail_intern.cpp 2009-01-22 04:35:10 UTC (rev 35993)
+++ scummvm/trunk/graphics/scaler/thumbnail_intern.cpp 2009-01-22 04:45:19 UTC (rev 35994)
@@ -72,7 +72,7 @@
}
}
-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 @@
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 @@
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();
Modified: scummvm/trunk/graphics/scaler.h
===================================================================
--- scummvm/trunk/graphics/scaler.h 2009-01-22 04:35:10 UTC (rev 35993)
+++ scummvm/trunk/graphics/scaler.h 2009-01-22 04:45:19 UTC (rev 35994)
@@ -75,7 +75,6 @@
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).
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list