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
This commit is contained in:
Gregory Montoir 2005-11-23 19:11:33 +00:00
parent d7351092a9
commit fe9def0ac0
7 changed files with 22 additions and 5 deletions

View file

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