[Scummvm-cvs-logs] CVS: scummvm/scumm charset.cpp,2.134,2.135 charset.h,2.40,2.41 gfx.cpp,2.428,2.429 saveload.cpp,1.201,1.202

Torbjörn Andersson eriktorbjorn at users.sourceforge.net
Tue Apr 5 00:54:32 CEST 2005


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

Modified Files:
	charset.cpp charset.h gfx.cpp saveload.cpp 
Log Message:
Clear the text surface when loading a saved game, otherwise any text that
was displayed before loading the game will remain.

I hope this is the correct fix.


Index: charset.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/charset.cpp,v
retrieving revision 2.134
retrieving revision 2.135
diff -u -d -r2.134 -r2.135
--- charset.cpp	25 Mar 2005 01:52:19 -0000	2.134
+++ charset.cpp	5 Apr 2005 07:53:44 -0000	2.135
@@ -208,11 +208,11 @@
 
 	const int size = _vm->_screenWidth * _vm->_screenHeight;
 	_textSurface.pixels = malloc(size);
-	memset(_textSurface.pixels, CHARSET_MASK_TRANSPARENCY, size);
 	_textSurface.w = _vm->_screenWidth;
 	_textSurface.h = _vm->_screenHeight;
 	_textSurface.pitch = _vm->_screenWidth;
 	_textSurface.bytesPerPixel = 1;
+	clearTextSurface();
 }
 
 CharsetRenderer::~CharsetRenderer() {

Index: charset.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/charset.h,v
retrieving revision 2.40
retrieving revision 2.41
diff -u -d -r2.40 -r2.41
--- charset.h	25 Mar 2005 01:52:20 -0000	2.40
+++ charset.h	5 Apr 2005 07:53:45 -0000	2.41
@@ -92,6 +92,7 @@
 
 	void restoreCharsetBg();
 	void clearCharsetMask();
+	void clearTextSurface();
 
 	virtual void printChar(int chr) = 0;
 	virtual void drawChar(int chr, const Graphics::Surface &s, int x, int y) {}

Index: gfx.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/gfx.cpp,v
retrieving revision 2.428
retrieving revision 2.429
diff -u -d -r2.428 -r2.429
--- gfx.cpp	2 Apr 2005 14:24:24 -0000	2.428
+++ gfx.cpp	5 Apr 2005 07:53:45 -0000	2.429
@@ -887,7 +887,7 @@
 
 		if (vs->hasTwoBuffers) {
 			// Clean out the charset mask
-			memset(_textSurface.pixels, CHARSET_MASK_TRANSPARENCY, _textSurface.pitch * _textSurface.h);
+			clearTextSurface();
 		}
 	}
 }
@@ -896,6 +896,10 @@
 	memset(_vm->getResourceAddress(rtBuffer, 9), 0, _vm->gdi._imgBufOffs[1]);
 }
 
+void CharsetRenderer::clearTextSurface() {
+	memset(_textSurface.pixels, CHARSET_MASK_TRANSPARENCY, _textSurface.pitch * _textSurface.h);
+}
+
 byte *ScummEngine::getMaskBuffer(int x, int y, int z) {
 	return gdi.getMaskBuffer((x + virtscr[0].xstart) / 8, y, z);
 }

Index: saveload.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/saveload.cpp,v
retrieving revision 1.201
retrieving revision 1.202
diff -u -d -r1.201 -r1.202
--- saveload.cpp	31 Mar 2005 21:38:35 -0000	1.201
+++ saveload.cpp	5 Apr 2005 07:53:46 -0000	1.202
@@ -311,6 +311,7 @@
 
 	// Reset charset mask
 	_charset->_hasMask = false;
+	_charset->clearTextSurface();
 
 	_lastCodePtr = NULL;
 	_drawObjectQueNr = 0;





More information about the Scummvm-git-logs mailing list