diff options
author | Robert Göffringmann | 2003-07-31 01:57:05 +0000 |
---|---|---|
committer | Robert Göffringmann | 2003-07-31 01:57:05 +0000 |
commit | 847c7025009c3fb394d5177dda453d97aca13295 (patch) | |
tree | 7c4a5b84108359fccf24cae47da7a3caa619713f /sky | |
parent | f74197ce8b777422aabad0302292fc043b47e3d5 (diff) | |
download | scummvm-rg350-847c7025009c3fb394d5177dda453d97aca13295.tar.gz scummvm-rg350-847c7025009c3fb394d5177dda453d97aca13295.tar.bz2 scummvm-rg350-847c7025009c3fb394d5177dda453d97aca13295.zip |
deactivated loading/(auto-)saving at places where it's not allowed
svn-id: r9315
Diffstat (limited to 'sky')
-rw-r--r-- | sky/control.cpp | 18 | ||||
-rw-r--r-- | sky/control.h | 1 | ||||
-rw-r--r-- | sky/sky.cpp | 7 |
3 files changed, 20 insertions, 6 deletions
diff --git a/sky/control.cpp b/sky/control.cpp index d6b29b3e84..b63057551f 100644 --- a/sky/control.cpp +++ b/sky/control.cpp @@ -506,13 +506,13 @@ uint16 SkyControl::handleClick(SkyConResource *pButton) { return 0; case REST_GAME_PANEL: - if (SkyState::_systemVars.systemFlags & SF_CHOOSING) + if (!loadSaveAllowed()) return CANCEL_PRESSED; // can't save/restore while choosing animClick(pButton); return saveRestorePanel(false); // texts can't be edited case SAVE_GAME_PANEL: - if (SkyState::_systemVars.systemFlags & SF_CHOOSING) + if (!loadSaveAllowed()) return CANCEL_PRESSED; // can't save/restore while choosing animClick(pButton); return saveRestorePanel(true); // texts can be edited @@ -1037,6 +1037,20 @@ void SkyControl::loadDescriptions(uint8 *destBuf) { } } +bool SkyControl::loadSaveAllowed(void) { + + if (SkyState::_systemVars.systemFlags & SF_CHOOSING) + return false; // texts get lost during load/save, so don't allow it during choosing + if (SkyLogic::_scriptVariables[SCREEN] >= 101) + return false; // same problem with LINC terminals + if ((SkyLogic::_scriptVariables[SCREEN] >= 82) && + (SkyLogic::_scriptVariables[SCREEN] != 85) && + (SkyLogic::_scriptVariables[SCREEN] < 90)) + return false; // don't allow saving in final rooms + + return true; +} + void SkyControl::saveDescriptions(uint8 *srcBuf) { uint8 *tmpBuf = (uint8 *)malloc(MAX_SAVE_GAMES * MAX_TEXT_LEN); diff --git a/sky/control.h b/sky/control.h index 2b754e0a1c..e0b83983ee 100644 --- a/sky/control.h +++ b/sky/control.h @@ -174,6 +174,7 @@ public: void showGameQuitMsg(bool useScreen = true); void doAutoSave(void); uint16 quickXRestore(uint16 slot); + bool loadSaveAllowed(void); private: void initPanel(void); diff --git a/sky/sky.cpp b/sky/sky.cpp index ccf3b233d9..85d351329c 100644 --- a/sky/sky.cpp +++ b/sky/sky.cpp @@ -205,12 +205,11 @@ void SkyState::go() { delay(_systemVars.gameSpeed); if (_system->get_msecs() - _lastSaveTime > 5 * 60 * 1000) { - if (_systemVars.systemFlags & SF_CHOOSING) - _lastSaveTime += 30 * 1000; - else { + if (_skyControl->loadSaveAllowed()) { _lastSaveTime = _system->get_msecs(); _skyControl->doAutoSave(); - } + } else + _lastSaveTime += 30 * 1000; // try again in 30 secs } _skySound->checkFxQueue(); _skyMouse->mouseEngine((uint16)_sdl_mouse_x, (uint16)_sdl_mouse_y); |