From e5e353d89c243623d4f0fa71c60b6f35e28a9b73 Mon Sep 17 00:00:00 2001 From: Gregory Montoir Date: Mon, 6 Aug 2007 20:24:05 +0000 Subject: fixed loading of savestates on startup svn-id: r28476 --- engines/touche/touche.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) (limited to 'engines/touche') diff --git a/engines/touche/touche.cpp b/engines/touche/touche.cpp index c67b1e9be3..f3d1f33dfd 100644 --- a/engines/touche/touche.cpp +++ b/engines/touche/touche.cpp @@ -148,10 +148,7 @@ void ToucheEngine::restart() { _waitingSetKeyCharNum3 = -1; _currentEpisodeNum = 0; - _newEpisodeNum = ConfMan.getInt("boot_param"); - if (_newEpisodeNum == 0) { - _newEpisodeNum = kStartupEpisode; - } + _newEpisodeNum = kStartupEpisode; _newMusicNum = 0; _currentMusicNum = 0; @@ -252,15 +249,22 @@ void ToucheEngine::mainLoop() { readConfigurationSettings(); + _inp_leftMouseButtonPressed = false; + _inp_rightMouseButtonPressed = false; + if (ConfMan.hasKey("save_slot")) { loadGameState(ConfMan.getInt("save_slot")); - _newEpisodeNum = _currentEpisodeNum; + _newEpisodeNum = 0; + resetSortedKeyCharsTable(); + showCursor(true); + } else { + _newEpisodeNum = ConfMan.getInt("boot_param"); + if (_newEpisodeNum == 0) { + _newEpisodeNum = kStartupEpisode; + } + showCursor(_newEpisodeNum != kStartupEpisode); } - _inp_leftMouseButtonPressed = false; - _inp_rightMouseButtonPressed = false; - showCursor(_newEpisodeNum != kStartupEpisode); - uint32 frameTimeStamp = _system->getMillis(); for (uint32 cycleCounter = 0; _flagsTable[611] == 0; ++cycleCounter) { if ((cycleCounter % 3) == 0) { -- cgit v1.2.3