[Scummvm-cvs-logs] CVS: scummvm/common gameDetector.cpp,1.88,1.89 scaler.cpp,1.11,1.12 scaler.h,1.7,1.8

Max Horn fingolfin at users.sourceforge.net
Fri May 9 15:45:07 CEST 2003


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

Modified Files:
	gameDetector.cpp scaler.cpp scaler.h 
Log Message:
Patch #735294: AdvMame3x scaler

Index: gameDetector.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/gameDetector.cpp,v
retrieving revision 1.88
retrieving revision 1.89
diff -u -d -r1.88 -r1.89
--- gameDetector.cpp	30 Apr 2003 12:43:54 -0000	1.88
+++ gameDetector.cpp	9 May 2003 22:44:16 -0000	1.89
@@ -90,6 +90,7 @@
 	{"super2xsai", "Super2xSAI", GFX_SUPER2XSAI},
 	{"supereagle", "SuperEagle", GFX_SUPEREAGLE},
 	{"advmame2x", "AdvMAME2x", GFX_ADVMAME2X},
+	{"advmame3x", "AdvMAME3x", GFX_ADVMAME3X},
 	{"tv2x", "TV2x", GFX_TV2X},
 	{"dotmatrix", "DotMatrix", GFX_DOTMATRIX},
 #else

Index: scaler.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/scaler.cpp,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- scaler.cpp	25 Apr 2003 20:02:57 -0000	1.11
+++ scaler.cpp	9 May 2003 22:44:16 -0000	1.12
@@ -746,6 +746,44 @@
 	}
 }
 
+void AdvMame3x(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch,
+							 int width, int height) {
+	unsigned int nextlineSrc = srcPitch / sizeof(uint16);
+	uint16 *p = (uint16 *)srcPtr;
+
+	unsigned int nextlineDst = dstPitch / sizeof(uint16);
+	uint16 *q = (uint16 *)dstPtr;
+	
+	uint16 A, B, C;
+	uint16 D, E, F;
+	uint16 G, H, I;
+
+	while (height--) {
+		B = C = *(p - nextlineSrc);
+		E = F = *(p);
+		H = I = *(p + nextlineSrc);
+		for (int i = 0; i < width; ++i) {
+			p++;
+			A = B; B = C; C = *(p - nextlineSrc);
+			D = E; E = F; F = *(p);
+			G = H; H = I; I = *(p + nextlineSrc);
+
+			*(q) = D == B && B != F && D != H ? D : E;
+			*(q + 1) = E;
+			*(q + 2) = B == F && B != D && F != H ? F : E;
+			*(q + nextlineDst) = E;
+			*(q + nextlineDst + 1) = E;
+			*(q + nextlineDst + 2) = E;
+			*(q + 2 * nextlineDst) = D == H && D != B && H != F ? D : E;
+			*(q + 2 * nextlineDst + 1) = E;
+			*(q + 2 * nextlineDst + 2) = H == F && D != H && B != F ? F : E;
+			q += 3;
+		}
+		p += nextlineSrc - width;
+		q += (nextlineDst - width) * 3;
+	}
+}
+
 void Normal1x(uint8 *srcPtr, uint32 srcPitch, uint8 *dstPtr, uint32 dstPitch,
 							int width, int height) {
 	while (height--) {

Index: scaler.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/scaler.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- scaler.h	2 May 2003 09:08:18 -0000	1.7
+++ scaler.h	9 May 2003 22:44:16 -0000	1.8
@@ -31,6 +31,7 @@
 DECLARE_SCALER(Super2xSaI);
 DECLARE_SCALER(SuperEagle);
 DECLARE_SCALER(AdvMame2x);
+DECLARE_SCALER(AdvMame3x);
 DECLARE_SCALER(Normal1x);
 DECLARE_SCALER(Normal2x);
 DECLARE_SCALER(Normal3x);
@@ -46,8 +47,9 @@
 	GFX_SUPER2XSAI = 4,
 	GFX_SUPEREAGLE = 5,
 	GFX_ADVMAME2X = 6,
-	GFX_TV2X = 7,
-	GFX_DOTMATRIX = 8,
+	GFX_ADVMAME3X = 7,
+	GFX_TV2X = 8,
+	GFX_DOTMATRIX = 9,
 	
 	GFX_FLIPPING = 100,	// Palmos
 	GFX_DOUBLEBUFFER = 101	// Palmos





More information about the Scummvm-git-logs mailing list