aboutsummaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorTorbjörn Andersson2005-04-16 12:41:43 +0000
committerTorbjörn Andersson2005-04-16 12:41:43 +0000
commitff7c1086af432ff5125c109b7ecebe5ddb1ebd40 (patch)
treefd7c425ce1648f6a0bf594410a08d994d36bd009 /gui
parent7aebedcc148cb4ccb9a74eb19d9cfc25f0d85455 (diff)
downloadscummvm-rg350-ff7c1086af432ff5125c109b7ecebe5ddb1ebd40.tar.gz
scummvm-rg350-ff7c1086af432ff5125c109b7ecebe5ddb1ebd40.tar.bz2
scummvm-rg350-ff7c1086af432ff5125c109b7ecebe5ddb1ebd40.zip
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. svn-id: r17621
Diffstat (limited to 'gui')
-rw-r--r--gui/about.cpp13
-rw-r--r--gui/about.h1
2 files changed, 12 insertions, 2 deletions
diff --git a/gui/about.cpp b/gui/about.cpp
index d23ce9c0a4..a659392194 100644
--- a/gui/about.cpp
+++ b/gui/about.cpp
@@ -121,6 +121,7 @@ void AboutDialog::open() {
_modifiers = 0;
_willClose = false;
_canvas.pixels = NULL;
+ _screenHasChanged = false;
Dialog::open();
}
@@ -138,6 +139,7 @@ void AboutDialog::drawDialog() {
// 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::drawDialog() {
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::handleTickle() {
}
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) {
diff --git a/gui/about.h b/gui/about.h
index 65dbb49f40..89cb61df22 100644
--- a/gui/about.h
+++ b/gui/about.h
@@ -37,6 +37,7 @@ protected:
byte _modifiers;
bool _willClose;
Graphics::Surface _canvas;
+ bool _screenHasChanged;
public:
AboutDialog();