[Scummvm-cvs-logs] CVS: scummvm/scumm gfx.cpp,2.482,2.483

Max Horn fingolfin at users.sourceforge.net
Mon Jan 2 15:37:02 CET 2006


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8689

Modified Files:
	gfx.cpp 
Log Message:
V7/V8 games do not use the text masking anymore at all, so we can optimize drawStripToScreen for them (this should improve CoMI speed a bit)

Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 2.482
retrieving revision 2.483
diff -u -d -r2.482 -r2.483
--- gfx.cpp	1 Jan 2006 09:55:56 -0000	2.482
+++ gfx.cpp	2 Jan 2006 23:36:33 -0000	2.483
@@ -535,19 +535,26 @@
 	// Compute screen etc. buffer pointers
 	const byte *src = vs->getPixels(x, top);
 	byte *dst = _compositeBuf + x + y * _screenWidth;
-	const byte *text = (byte *)_charset->_textSurface.pixels + x + y * _charset->_textSurface.pitch;
 
-	// Compose the text over the game graphics
-	for (int h = 0; h < height; ++h) {
-		for (int w = 0; w < width; ++w) {
-			if (text[w] == CHARSET_MASK_TRANSPARENCY)
-				dst[w] = src[w];
-			else
-				dst[w] = text[w];
+	if (_version < 7) {
+		// Handle the text mask in older games; newer (V7/V8) games do not use it anymore.
+		const byte *text = (byte *)_charset->_textSurface.pixels + x + y * _charset->_textSurface.pitch;
+	
+		// Compose the text over the game graphics
+		for (int h = 0; h < height; ++h) {
+			for (int w = 0; w < width; ++w) {
+				if (text[w] == CHARSET_MASK_TRANSPARENCY)
+					dst[w] = src[w];
+				else
+					dst[w] = text[w];
+			}
+			src += vs->pitch;
+			dst += _screenWidth;
+			text += _charset->_textSurface.pitch;
 		}
-		src += vs->pitch;
-		dst += _screenWidth;
-		text += _charset->_textSurface.pitch;
+	} else {
+		// Just do a simple blit in V7/V8 games.
+		blit(dst, _screenWidth, src, vs->pitch, width, height);
 	}
 
 	if (_renderMode == Common::kRenderCGA)





More information about the Scummvm-git-logs mailing list