diff options
author | Gregory Montoir | 2005-11-23 19:11:33 +0000 |
---|---|---|
committer | Gregory Montoir | 2005-11-23 19:11:33 +0000 |
commit | fe9def0ac070252ee55e81236ba78674615d33bb (patch) | |
tree | 530f38c5f5cdb69e278dfcfb9d7a4d9cd52eef88 /base/engine.cpp | |
parent | d7351092a9fa50e6ba9e88947ed2dc6e1b0da0ff (diff) | |
download | scummvm-rg350-fe9def0ac070252ee55e81236ba78674615d33bb.tar.gz scummvm-rg350-fe9def0ac070252ee55e81236ba78674615d33bb.tar.bz2 scummvm-rg350-fe9def0ac070252ee55e81236ba78674615d33bb.zip |
Made the autosave period a configuration option and updated the engines using that feature (SCUMM, Queen and Sky). The value is supposed to be in seconds ; if it's set to 0 then autosaving is disabled. See also tracker item #1350187.
svn-id: r19700
Diffstat (limited to 'base/engine.cpp')
-rw-r--r-- | base/engine.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/base/engine.cpp b/base/engine.cpp index d508ef35f3..4ef1bb4b31 100644 --- a/base/engine.cpp +++ b/base/engine.cpp @@ -46,6 +46,8 @@ Engine::Engine(OSystem *syst) Common::File::addDefaultDirectory(_gameDataPath); _saveFileMan = _system->getSavefileManager(); + + _autosavePeriod = ConfMan.getInt("autosave_period"); } Engine::~Engine() { @@ -136,6 +138,11 @@ void Engine::checkCD() { #endif } +bool Engine::shouldPerformAutoSave(int lastSaveTime) { + const int diff = _system->getMillis() - lastSaveTime; + return _autosavePeriod != 0 && diff > _autosavePeriod * 1000; +} + const char *Engine::getGameDataPath() const { return _gameDataPath.c_str(); } |