From 7ed8d7f573da40d19299f14d304491184fe221a8 Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Thu, 21 May 2009 21:51:50 +0000 Subject: Proper fix for bug #2537054: "AGI: Using GMM to load causes graphics glitches". Save/load via GMM is not allowed in certain situations now. svn-id: r40773 --- engines/agi/text.cpp | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) (limited to 'engines/agi/text.cpp') diff --git a/engines/agi/text.cpp b/engines/agi/text.cpp index 189a48c804..da7f34fc19 100644 --- a/engines/agi/text.cpp +++ b/engines/agi/text.cpp @@ -300,10 +300,6 @@ 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(); @@ -311,18 +307,6 @@ void AgiEngine::closeWindow() { _game.hasWindow = false; } -/** - * 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 @@ -356,6 +340,8 @@ int AgiEngine::selectionBox(const char *m, const char **b) { int rc = -1; int bx[5], by[5]; + setflag(fNoSaveLoadAllowed, true); + _sprites->eraseBoth(); blitTextbox(m, -1, -1, -1); @@ -440,6 +426,8 @@ getout: closeWindow(); debugC(2, kDebugLevelText, "selectionBox(): Result = %d", rc); + setflag(fNoSaveLoadAllowed, false); + return rc; } @@ -468,11 +456,16 @@ int AgiEngine::print(const char *p, int lin, int col, int len) { /* blocking */ + setflag(fNoSaveLoadAllowed, true); + if (_game.vars[vWindowReset] == 0) { int k; setvar(vKey, 0); k = waitKey(); closeWindow(); + + setflag(fNoSaveLoadAllowed, false); + return k; } @@ -499,6 +492,8 @@ int AgiEngine::print(const char *p, int lin, int col, int len) { closeWindow(); + setflag(fNoSaveLoadAllowed, false); + return 0; } -- cgit v1.2.3