diff options
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(); } |