[Scummvm-cvs-logs] CVS: scummvm/common gameDetector.cpp,1.62,1.63 scaler.cpp,1.3,1.4 scaler.h,1.1,1.2 system.h,1.15,1.16

Jonathan Gray khalek at users.sourceforge.net
Tue Jan 14 18:12:03 CET 2003


Update of /cvsroot/scummvm/scummvm/common
In directory sc8-pr-cvs1:/tmp/cvs-serv19718/common

Modified Files:
	gameDetector.cpp scaler.cpp scaler.h system.h 
Log Message:
add new tv scanlines graphics scaler from Gregory Montoir, use -g tv2x to try it

Index: gameDetector.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/gameDetector.cpp,v
retrieving revision 1.62
retrieving revision 1.63
diff -u -d -r1.62 -r1.63
--- gameDetector.cpp	14 Jan 2003 05:25:31 -0000	1.62
+++ gameDetector.cpp	15 Jan 2003 02:11:37 -0000	1.63
@@ -47,7 +47,7 @@
 	"\t-p<path>   - look for game in <path>\n"
 	"\t-x[<num>]  - load this savegame (default: 0 - autosave)\n"
 	"\t-f         - fullscreen mode\n"
-	"\t-g<mode>   - graphics mode (normal,2x,3x,2xsai,super2xsai,supereagle,advmame2x)\n"
+	"\t-g<mode>   - graphics mode (normal,2x,3x,2xsai,super2xsai,supereagle,advmame2x,tv2x)\n"
 	"\t-e<mode>   - set music engine (see README for details)\n"
 	"\t-a         - specify game is amiga version\n"
 	"\n"
@@ -182,6 +182,7 @@
 	{"super2xsai", "Super2xSAI", GFX_SUPER2XSAI},
 	{"supereagle", "SuperEagle", GFX_SUPEREAGLE},
 	{"advmame2x", "AdvMAME2x", GFX_ADVMAME2X},
+	{"tv2x", "TV2x", GFX_TV2X},
 	{0, 0}
 };
 

Index: scaler.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/scaler.cpp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -d -r1.3 -r1.4
--- scaler.cpp	19 Sep 2002 16:06:49 -0000	1.3
+++ scaler.cpp	15 Jan 2003 02:11:37 -0000	1.4
@@ -810,3 +810,28 @@
 		dstPtr += dstPitch3;
 	}
 }
+
+void TV2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null, uint8 *dstPtr, uint32 dstPitch, 
+            int width, int height)
+{
+	unsigned int nextlineSrc = srcPitch / sizeof(short);
+	short *p = (short *)srcPtr;
+
+	unsigned int nextlineDst = dstPitch / sizeof(short);
+	short *q = (short *)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);
+
+			*(q + j) = p1;
+			*(q + j + 1) = p1;
+			*(q + j + nextlineDst) = pi;
+			*(q + j + nextlineDst + 1) = pi;
+		}
+		p += nextlineSrc;
+		q += nextlineDst << 1;
+	}
+}

Index: scaler.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/scaler.h,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -d -r1.1 -r1.2
--- scaler.h	23 Aug 2002 06:43:06 -0000	1.1
+++ scaler.h	15 Jan 2003 02:11:37 -0000	1.2
@@ -36,5 +36,7 @@
 								uint8 *dstPtr, uint32 dstPitch, int width, int height);
 extern void Normal3x(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
 								uint8 *dstPtr, uint32 dstPitch, int width, int height);
+extern void TV2x(uint8 *srcPtr, uint32 srcPitch, uint8 *null,
+								uint8 *dstPtr, uint32 dstPitch, int width, int height);
 
 #endif

Index: system.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/system.h,v
retrieving revision 1.15
retrieving revision 1.16
diff -u -d -r1.15 -r1.16
--- system.h	9 Jan 2003 13:52:59 -0000	1.15
+++ system.h	15 Jan 2003 02:11:37 -0000	1.16
@@ -220,7 +220,8 @@
 	GFX_2XSAI = 3,
 	GFX_SUPER2XSAI = 4,
 	GFX_SUPEREAGLE = 5,
-	GFX_ADVMAME2X = 6
+	GFX_ADVMAME2X = 6,
+	GFX_TV2X = 7
 };
 
 





More information about the Scummvm-git-logs mailing list