[Scummvm-cvs-logs] CVS: scummvm/common scaler.cpp,1.5,1.6
Jonathan Gray
khalek at users.sourceforge.net
Sun Jan 19 14:29:06 CET 2003
Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1:/tmp/cvs-serv23022
Modified Files:
scaler.cpp
Log Message:
new patch from cyx to make scanlines in tv2x lighter
Index: scaler.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/scaler.cpp,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- scaler.cpp 18 Jan 2003 21:04:31 -0000 1.5
+++ scaler.cpp 19 Jan 2003 22:28:36 -0000 1.6
@@ -721,7 +721,7 @@
unsigned int nextlineSrc = srcPitch / sizeof(short);
short *p = (short *)srcPtr;
- unsigned nextlineDst = dstPitch / sizeof(short);
+ unsigned int nextlineDst = dstPitch / sizeof(short);
short *q = (short *)dstPtr;
while (height--) {
@@ -805,24 +805,26 @@
}
void TV2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch,
- int width, int height)
+ int width, int height)
{
- unsigned int nextlineSrc = srcPitch / sizeof(short);
- short *p = (short *)srcPtr;
+ unsigned int nextlineSrc = srcPitch / sizeof(uint16);
+ uint16 *p = (uint16 *)srcPtr;
- unsigned int nextlineDst = dstPitch / sizeof(short);
- short *q = (short *)dstPtr;
+ unsigned int nextlineDst = dstPitch / sizeof(uint16);
+ uint16 *q = (uint16 *)dstPtr;
while(height--) {
for (int i = 0, j = 0; i < width; ++i, j += 2) {
- unsigned short p1 = *(p + i);
- unsigned short p2 = *(p + i + nextlineSrc);
- unsigned short pi = (unsigned short)((INTERPOLATE(p1, p2) & colorMask) >> 1);
+ uint16 p1 = *(p + i);
+ uint32 pi;
+
+ pi = (((p1 & redblueMask) * 7) >> 3) & redblueMask;
+ pi |= (((p1 & greenMask) * 7) >> 3) & greenMask;
*(q + j) = p1;
*(q + j + 1) = p1;
- *(q + j + nextlineDst) = pi;
- *(q + j + nextlineDst + 1) = pi;
+ *(q + j + nextlineDst) = (uint16)pi;
+ *(q + j + nextlineDst + 1) = (uint16)pi;
}
p += nextlineSrc;
q += nextlineDst << 1;
More information about the Scummvm-git-logs
mailing list