From 40dd214789ec627624a7703798907b7afbf50b8e Mon Sep 17 00:00:00 2001 From: Eugene Sandulenko Date: Tue, 19 May 2009 21:09:43 +0000 Subject: 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 --- engines/agi/saveload.cpp | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) (limited to 'engines/agi/saveload.cpp') diff --git a/engines/agi/saveload.cpp b/engines/agi/saveload.cpp index 1b694e711c..bd0a0a5112 100644 --- a/engines/agi/saveload.cpp +++ b/engines/agi/saveload.cpp @@ -613,6 +613,16 @@ int AgiEngine::selectSlot() { _gfx->pollTimer(); /* msdos driver -> does nothing */ key = doPollKeyboard(); + + // It may happen that somebody will open GMM while + // this dialog is open, and load a game + // We are processing it here, effectively jumping + // out of the dead loop + if (getflag(fRestoreJustRan)) { + rc = -2; + goto getout; + } + switch (key) { case KEY_ENTER: rc = active; @@ -724,6 +734,7 @@ press: getout: closeWindow(); + return rc; } @@ -844,7 +855,9 @@ int AgiEngine::loadGameDialog() { slot = selectSlot(); if (slot < 0) { - messageBox("Game NOT restored."); + if (slot == -1) // slot = -2 when GMM was launched + messageBox("Game NOT restored."); + return errOK; } -- cgit v1.2.3