[Scummvm-cvs-logs] CVS: scummvm/gui about.cpp,1.27,1.28 about.h,1.9,1.10

Torbjörn Andersson eriktorbjorn at users.sourceforge.net
Sat Apr 16 05:42:54 CEST 2005


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

Modified Files:
	about.cpp about.h 
Log Message:
When recreating the canvas, do a full redraw so that all the dialogs
behind the credits show. Until we have a new canvas, don't draw any credits
text, or it too will show up on the canvas.

The latter, at the very least, was a bug in my original patch.


Index: about.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/about.cpp,v
retrieving revision 1.27
retrieving revision 1.28
diff -u -d -r1.27 -r1.28
--- about.cpp	16 Apr 2005 11:40:07 -0000	1.27
+++ about.cpp	16 Apr 2005 12:41:43 -0000	1.28
@@ -121,6 +121,7 @@
 	_modifiers = 0;
 	_willClose = false;
 	_canvas.pixels = NULL;
+	_screenHasChanged = false;
 
 	Dialog::open();
 }
@@ -138,6 +139,7 @@
 		// static background for the remainder of the credits.
 		g_gui.blendRect(_x, _y, _w, _h, g_gui._bgcolor);
 		g_gui.copyToSurface(&_canvas, _x, _y, _w, _h);
+		_screenHasChanged = false;
 	}
 
 	g_gui.drawSurface(_canvas, _x, _y);
@@ -212,6 +214,11 @@
 
 
 void AboutDialog::handleTickle() {
+	// We're in the process of doing a full redraw. This will be used as
+	// background for the text, so we don't want any text on it.
+	if (_screenHasChanged)
+		return;
+
 	const uint32 t = getMillis();
 	int scrollOffset = ((int)t - (int)_scrollTime) / kScrollMillisPerPixel;
 	if (scrollOffset > 0) {
@@ -235,10 +242,12 @@
 }
 
 void AboutDialog::handleScreenChanged() {
-	// The screen has changed. Reset the canvas, to ensure it gets
-	// refreshed next time a redraw takes place.
+	// The screen has changed. Reset the canvas, and issue a full redraw.
+	// Until we have a new canvas, don't draw any credits text.
 	free(_canvas.pixels);
 	_canvas.pixels = NULL;
+	_screenHasChanged = true;
+	draw();
 }
 
 void AboutDialog::handleMouseUp(int x, int y, int button, int clickCount) {

Index: about.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/gui/about.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- about.h	16 Apr 2005 11:40:09 -0000	1.9
+++ about.h	16 Apr 2005 12:41:43 -0000	1.10
@@ -37,6 +37,7 @@
 	byte		_modifiers;
 	bool		_willClose;
 	Graphics::Surface	_canvas;
+	bool		_screenHasChanged;
 
 public:
 	AboutDialog();





More information about the Scummvm-git-logs mailing list