diff options
author | Eugene Sandulenko | 2009-05-19 21:09:43 +0000 |
---|---|---|
committer | Eugene Sandulenko | 2009-05-19 21:09:43 +0000 |
commit | 40dd214789ec627624a7703798907b7afbf50b8e (patch) | |
tree | 1c65aababcb8bb0c811c649e1a037c8f788624cb /engines/agi/text.cpp | |
parent | a1364e37f7182d3a88aea659e07fc9e9f196719b (diff) | |
download | scummvm-rg350-40dd214789ec627624a7703798907b7afbf50b8e.tar.gz scummvm-rg350-40dd214789ec627624a7703798907b7afbf50b8e.tar.bz2 scummvm-rg350-40dd214789ec627624a7703798907b7afbf50b8e.zip |
Start of fixing bug #2537054: "AGI: Using GMM to load causes graphics glitches"
The engine still crashes when load from GMM occured with a text box on screen.
svn-id: r40733
Diffstat (limited to 'engines/agi/text.cpp')
-rw-r--r-- | engines/agi/text.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/engines/agi/text.cpp b/engines/agi/text.cpp index bf16f926b2..189a48c804 100644 --- a/engines/agi/text.cpp +++ b/engines/agi/text.cpp @@ -299,6 +299,11 @@ char *AgiEngine::wordWrapString(const char *s, int *len) { */ void AgiEngine::closeWindow() { debugC(4, kDebugLevelText, "closeWindow()"); + + if (getflag(fRestoreJustRan)) { + forgetWindow(); + } + _sprites->eraseBoth(); eraseTextbox(); /* remove window, if any */ _sprites->blitBoth(); @@ -307,6 +312,18 @@ void AgiEngine::closeWindow() { } /** + * Remove existing window without restoring anything + */ +void AgiEngine::forgetWindow() { + debugC(4, kDebugLevelText, "forgetWindow()"); + + free(_game.window.buffer); + _game.window.buffer = 0; + _game.window.active = false; + _game.hasWindow = false; +} + +/** * Display a message box. * This function displays the specified message in a text box * centered in the screen and waits until a key is pressed. @@ -466,6 +483,9 @@ int AgiEngine::print(const char *p, int lin, int col, int len) { setvar(vKey, 0); do { + if (getflag(fRestoreJustRan)) + break; + mainCycle(); if (_game.keypress == KEY_ENTER) { debugC(4, kDebugLevelText, "KEY_ENTER"); |