aboutsummaryrefslogtreecommitdiff
path: root/engines/agi
diff options
context:
space:
mode:
authorKostas Nakos2007-05-30 19:51:08 +0000
committerKostas Nakos2007-05-30 19:51:08 +0000
commit10764e965cb3fcd92e3f680e0e093ac5fa1867f3 (patch)
tree0883f4cc880902824a52e6afb44094292ab8f11f /engines/agi
parent346b12d701849e8987ddee930e44c67f8e824e26 (diff)
downloadscummvm-rg350-10764e965cb3fcd92e3f680e0e093ac5fa1867f3.tar.gz
scummvm-rg350-10764e965cb3fcd92e3f680e0e093ac5fa1867f3.tar.bz2
scummvm-rg350-10764e965cb3fcd92e3f680e0e093ac5fa1867f3.zip
fixed predictive dialog messing up state if another dialog was already shown
svn-id: r27023
Diffstat (limited to 'engines/agi')
-rw-r--r--engines/agi/predictive.cpp19
1 files changed, 17 insertions, 2 deletions
diff --git a/engines/agi/predictive.cpp b/engines/agi/predictive.cpp
index 731384b5c7..87849af906 100644
--- a/engines/agi/predictive.cpp
+++ b/engines/agi/predictive.cpp
@@ -114,7 +114,7 @@ bool AgiEngine::predictiveDialog(void) {
int bx[17], by[17];
String prefix = "";
char temp[MAXWORDLEN + 1];
-
+ AgiBlock tmpwindow;
// FIXME: Move this to a more appropriate place.
initAsciiToNumTable();
@@ -146,6 +146,11 @@ bool AgiEngine::predictiveDialog(void) {
return false;
}
+ // show the predictive dialog.
+ // if another window is already in display, save its state into tmpwindow
+ tmpwindow.active = false;
+ if (_game.window.active)
+ memcpy(&tmpwindow, &(_game.window), sizeof(AgiBlock));
drawWindow(50, 40, 269, 159);
_gfx->drawRectangle(62, 54, 249, 66, MSG_BOX_TEXT);
_gfx->flushBlock(62, 54, 249, 66);
@@ -310,7 +315,17 @@ bool AgiEngine::predictiveDialog(void) {
_predictiveResult[prefix.size() + _currentCode.size() + 1] = 0;
getout:
- closeWindow();
+ // if another window was shown, bring it up again
+ if (!tmpwindow.active)
+ closeWindow();
+ else {
+ _gfx->restoreBlock(_game.window.x1, _game.window.y1,
+ _game.window.x2, _game.window.y2, _game.window.buffer);
+
+ free(_game.window.buffer);
+ memcpy(&(_game.window), &tmpwindow, sizeof(AgiBlock));
+ _gfx->doUpdate();
+ }
return rc;
}