[Scummvm-cvs-logs] CVS: scummvm/scumm gfx.cpp,2.142,2.143

Pawel Kolodziejski aquadran at users.sourceforge.net
Thu Jun 5 11:48:18 CEST 2003


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1:/tmp/cvs-serv26264

Modified Files:
	gfx.cpp 
Log Message:
fixed my last commit

Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 2.142
retrieving revision 2.143
diff -u -d -r2.142 -r2.143
--- gfx.cpp	5 Jun 2003 17:22:13 -0000	2.142
+++ gfx.cpp	5 Jun 2003 18:30:29 -0000	2.143
@@ -66,7 +66,7 @@
 #ifdef __PALM_OS__
 static const TransitionEffect *transitionEffects;
 #else
-static const TransitionEffect transitionEffects[4] = {
+static const TransitionEffect transitionEffects[5] = {
 	// Iris effect (looks like an opening/closing camera iris)
 	{
 		13,		// Number of iterations
@@ -100,7 +100,23 @@
 		  255,  0,  0,  0
 		}
 	},
-	
+
+	// Inverse iris effect, specially tailored for V2 games
+	{
+		8,		// Number of iterations
+		{
+			-1, -1,  1, -1,
+			-1,  1,  1,  1,
+			-1, -1, -1,  1,
+			 1, -1,  1,  1
+		},
+		{
+			 7, 7, 32, 7,
+			 7, 8, 32, 8,
+			 7, 8,  7, 8,
+			32, 7, 32, 8
+		}
+	},
 	
 	// Box wipe (a box expands from the lower-right corner to the upper-left corner)
 	{
@@ -1153,7 +1169,7 @@
 
 		if (_vm->_features & GF_AFTER_V1) {
 			mask_ptr = _vm->getResourceAddress(rtBuffer, 9) + y * _numStrips + x + _imgBufOffs[1];
-//			drawStripC64Mask(mask_ptr, stripnr, height);
+			drawStripC64Mask(mask_ptr, stripnr, height);
 		} else if (_vm->_features & GF_AFTER_V2) {
 			// Do nothing here for V2 games - zplane was handled already.
 		} else if (flag & dbDrawMaskOnAll) {
@@ -1352,7 +1368,7 @@
 }
 
 void Gdi::drawStripC64Mask(byte *dst, int stripnr, int height) {
-	for(int y = 0; y < (height / 8); y++) {
+	for(int y = 0; y < (height >> 3); y++) {
 		for(int i = 0; i < 8; i++) {
 			for(int j = 7; j >= 0; j--) {
 				*(dst + (7 - j) + stripnr * 8 + (y * 8 + i) * _vm->_screenWidth) =
@@ -2129,7 +2145,15 @@
 	case 2:
 	case 3:
 	case 4:
-		transitionEffect(effect - 1);
+	case 5:
+					// Some of the transition effects won't work properly unless
+					// the screen is marked as clean first. At first I thought I
+					// could safely do this every time fadeIn() was called, but
+					// that broke the FOA intro. Probably other things as well.
+					//
+					// Hopefully it's safe to do it at this point, at least.
+		virtscr[0].setDirtyRange(0, 0);
+ 		transitionEffect(effect - 1);
 		break;
 	case 128:
 		unkScreenEffect6();
@@ -2173,6 +2197,7 @@
 		case 2:
 		case 3:
 		case 4:
+		case 5:
 			transitionEffect(effect - 1);
 			break;
 		case 128:
@@ -2246,7 +2271,9 @@
 					continue;
 				if (b > bottom)
 					b = bottom;
-				virtscr[0].tdirty[l] = t << 3;
+				if (t < 0)
+					t = 0;
+ 				virtscr[0].tdirty[l] = t << 3;
 				virtscr[0].bdirty[l] = (b + 1) << 3;
 			}
 			updateDirtyScreen(0);
@@ -2973,8 +3000,7 @@
 	}
 }
 
-static double value(double n1, double n2, double hue)
-{
+static double value(double n1, double n2, double hue) {
 	if (hue > 360.0)
 		hue = hue - 360.0;
 	else if (hue < 0.0)
@@ -2999,8 +3025,7 @@
  * 
  * @todo Rewrite desaturatePalette using integer arithmetics only?
  */
-void Scumm::desaturatePalette(int hueScale, int satScale, int lightScale, int startColor, int endColor)
-{
+void Scumm::desaturatePalette(int hueScale, int satScale, int lightScale, int startColor, int endColor) {
 
 	if (startColor <= endColor) {
 		const byte *cptr;





More information about the Scummvm-git-logs mailing list