aboutsummaryrefslogtreecommitdiff
path: root/engines/composer
diff options
context:
space:
mode:
authorupthorn2012-06-27 00:54:50 -0700
committerangstsmurf2016-10-18 02:12:19 +0200
commit483cad039efec6ba28962e0a93e1e6a417487bf4 (patch)
tree6d234cfc4c5ef2777511df6a2c57d0644c27cad0 /engines/composer
parent582006d1cf8cca321ffcd02bba86f828156c088a (diff)
downloadscummvm-rg350-483cad039efec6ba28962e0a93e1e6a417487bf4.tar.gz
scummvm-rg350-483cad039efec6ba28962e0a93e1e6a417487bf4.tar.bz2
scummvm-rg350-483cad039efec6ba28962e0a93e1e6a417487bf4.zip
COMPOSER: Enable autosaving.
Diffstat (limited to 'engines/composer')
-rw-r--r--engines/composer/composer.cpp3
-rw-r--r--engines/composer/composer.h2
-rw-r--r--engines/composer/saveload.cpp1
3 files changed, 5 insertions, 1 deletions
diff --git a/engines/composer/composer.cpp b/engines/composer/composer.cpp
index e5b42361eb..f3e5958304 100644
--- a/engines/composer/composer.cpp
+++ b/engines/composer/composer.cpp
@@ -120,6 +120,7 @@ Common::Error ComposerEngine::run() {
else
warning("FPS in book.ini is zero. Defaulting to 8...");
uint32 lastDrawTime = 0;
+ _lastSaveTime = _system->getMillis();
while (!shouldQuit()) {
for (uint i = 0; i < _pendingPageChanges.size(); i++) {
@@ -173,6 +174,8 @@ Common::Error ComposerEngine::run() {
loadGameState(ConfMan.getInt("save_slot"));
ConfMan.removeKey("save_slot", Common::ConfigManager::kTransientDomain);
}
+ if (shouldPerformAutoSave(_lastSaveTime))
+ saveGameState(0, "Autosave");
while (_eventMan->pollEvent(event)) {
switch (event.type) {
case Common::EVENT_LBUTTONDOWN:
diff --git a/engines/composer/composer.h b/engines/composer/composer.h
index 5b44bf346a..9ae1c1dfbe 100644
--- a/engines/composer/composer.h
+++ b/engines/composer/composer.h
@@ -189,7 +189,7 @@ private:
Audio::QueuingAudioStream *_audioStream;
uint16 _currSoundPriority;
- uint32 _currentTime, _lastTime, _timeDelta;
+ uint32 _currentTime, _lastTime, _timeDelta, _lastSaveTime;
bool _needsUpdate;
Common::Array<Common::Rect> _dirtyRects;
diff --git a/engines/composer/saveload.cpp b/engines/composer/saveload.cpp
index 3d62641c10..f0cf4210ac 100644
--- a/engines/composer/saveload.cpp
+++ b/engines/composer/saveload.cpp
@@ -372,6 +372,7 @@ Common::Error ComposerEngine::loadGameState(int slot) {
Common::Error ComposerEngine::saveGameState(int slot, const Common::String &desc) {
Common::String filename = makeSaveGameName(slot);
Common::OutSaveFile *out;
+ _lastSaveTime = _system->getMillis();
if (!(out = _saveFileMan->openForSaving(filename)))
return Common::kWritingFailed;