diff options
author | Paul Gilbert | 2019-08-18 15:18:48 -0700 |
---|---|---|
committer | Paul Gilbert | 2019-08-18 15:18:57 -0700 |
commit | 73a4f228f6c8c17db4ba9c25b343dc1cf5847cee (patch) | |
tree | e0b3c6fd56e1a4a68be8393087ef842d06debb26 /engines/xeen/events.cpp | |
parent | 1f38a8239f5fb5b6c9a89b299cd9de1694176df6 (diff) | |
download | scummvm-rg350-73a4f228f6c8c17db4ba9c25b343dc1cf5847cee.tar.gz scummvm-rg350-73a4f228f6c8c17db4ba9c25b343dc1cf5847cee.tar.bz2 scummvm-rg350-73a4f228f6c8c17db4ba9c25b343dc1cf5847cee.zip |
XEEN: Implement autosave support
Diffstat (limited to 'engines/xeen/events.cpp')
-rw-r--r-- | engines/xeen/events.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/engines/xeen/events.cpp b/engines/xeen/events.cpp index 17306a32fc..5243de630c 100644 --- a/engines/xeen/events.cpp +++ b/engines/xeen/events.cpp @@ -32,7 +32,7 @@ namespace Xeen { EventsManager::EventsManager(XeenEngine *vm) : _vm(vm), _playTime(0), _gameCounter(0), - _frameCounter(0), _priorFrameCounterTime(0), _priorScreenRefreshTime(0), + _frameCounter(0), _priorFrameCounterTime(0), _priorScreenRefreshTime(0), _lastAutosaveTime(0), _mousePressed(false), _sprites("mouse.icn") { Common::fill(&_gameCounters[0], &_gameCounters[6], 0); } @@ -69,12 +69,19 @@ void EventsManager::pollEvents() { _priorScreenRefreshTime = timer; g_vm->_screen->update(); } + if (timer >= (_priorFrameCounterTime + GAME_FRAME_TIME)) { // Time to build up next game frame _priorFrameCounterTime = timer; nextFrame(); } + // Handle auto saves + if (!_lastAutosaveTime) + _lastAutosaveTime = timer; + g_vm->autoSaveCheck(_lastAutosaveTime); + + // Event handling Common::Event event; while (g_system->getEventManager()->pollEvent(event)) { switch (event.type) { |