[Scummvm-cvs-logs] CVS: scummvm/common scaler.cpp,1.28,1.29 scaler.h,1.12,1.13

Torbj?rn Andersson eriktorbjorn at users.sourceforge.net
Sun Jun 22 08:00:05 CEST 2003


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

Modified Files:
	scaler.cpp scaler.h 
Log Message:
Fixed the last (?) glitches around the mouse cursor [*] in aspect-ratio
correction mode by making sure that dirty rects always start on a line
that won't have its colours changed by the stretching function. This was
probably only noticeable when using the 1x scaler.

[*] Actually, the glitches weren't specific to the mouse cursor, but it was
    useful for triggering them.


Index: scaler.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/scaler.cpp,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- scaler.cpp	22 Jun 2003 14:52:34 -0000	1.28
+++ scaler.cpp	22 Jun 2003 14:59:21 -0000	1.29
@@ -683,6 +683,18 @@
 #endif
 }
 
+void makeRectStretchable(int &x, int &y, int &w, int &h) {
+	int m = real2Aspect(y) % 6;
+
+	// Ensure that the rect will start on a line that won't have its
+	// colours changed by the stretching function.
+
+	if (m != 0 && m != 5) {
+		y -= m;
+		h += m;
+	}
+}
+
 /**
  * Stretch a 16bpp image vertically by factor 1.2. Used to correct the
  * aspect-ratio in games using 320x200 pixel graphics with non-qudratic

Index: scaler.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/common/scaler.h,v
retrieving revision 1.12
retrieving revision 1.13
diff -u -d -r1.12 -r1.13
--- scaler.h	22 Jun 2003 11:55:39 -0000	1.12
+++ scaler.h	22 Jun 2003 14:59:21 -0000	1.13
@@ -49,6 +49,8 @@
 	return (y * 5 + 3) / 6;
 }
 
+extern void makeRectStretchable(int &x, int &y, int &w, int &h);
+
 extern int stretch200To240(uint8 *buf, uint32 pitch, int width, int height, int srcX, int srcY, int origSrcY);
 
 enum {





More information about the Scummvm-git-logs mailing list