aboutsummaryrefslogtreecommitdiff
path: root/gui/console.cpp
diff options
context:
space:
mode:
authorTorbjörn Andersson2005-07-14 06:58:06 +0000
committerTorbjörn Andersson2005-07-14 06:58:06 +0000
commit19e118324d8beb8d9758d0844a316c1667236c6c (patch)
tree32c955687246726471cf985321829e3f1f741581 /gui/console.cpp
parent983643bc5a87ef30d522613cc0a479392292d3a6 (diff)
downloadscummvm-rg350-19e118324d8beb8d9758d0844a316c1667236c6c.tar.gz
scummvm-rg350-19e118324d8beb8d9758d0844a316c1667236c6c.tar.bz2
scummvm-rg350-19e118324d8beb8d9758d0844a316c1667236c6c.zip
Don't count the time it takes to do the blending when timing the slide
action of the console. (I thought I could do this simpler by doing the blending in open(), but for some reason I couldn't get that to work, and I would still have had to blend in drawDialog() anyway, so maybe this is for the best...) svn-id: r18541
Diffstat (limited to 'gui/console.cpp')
-rw-r--r--gui/console.cpp13
1 files changed, 11 insertions, 2 deletions
diff --git a/gui/console.cpp b/gui/console.cpp
index 5ad73f4993..eaa201860a 100644
--- a/gui/console.cpp
+++ b/gui/console.cpp
@@ -121,7 +121,6 @@ void ConsoleDialog::open() {
// background in a separate "canvas", just like in the About dialog.
_canvas.pixels = NULL;
-
// Initiate sliding the console down. We do a very simple trick to achieve
// this effect: we simply move the console dialog just above (outside) the
// visible screen area, then shift it down in handleTickle() over a
@@ -145,9 +144,19 @@ void ConsoleDialog::close() {
void ConsoleDialog::drawDialog() {
if (!_canvas.pixels) {
- // Blend over the background
+ // Blend over the background. Don't count the time used for
+ // this when timing the slide action.
+
+ uint32 now = g_system->getMillis();
+ uint32 delta;
+
g_gui.blendRect(0, 0, _w, _h, g_gui._bgcolor, 2);
g_gui.copyToSurface(&_canvas, 0, 0, _w, _h);
+
+ delta = g_system->getMillis() - now;
+
+ if (_slideTime)
+ _slideTime += delta;
}
g_gui.drawSurface(_canvas, 0, 0);