aboutsummaryrefslogtreecommitdiff
path: root/engines/composer/composer.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/composer/composer.cpp')
-rw-r--r--engines/composer/composer.cpp19
1 files changed, 11 insertions, 8 deletions
diff --git a/engines/composer/composer.cpp b/engines/composer/composer.cpp
index f070338978..13ba76191b 100644
--- a/engines/composer/composer.cpp
+++ b/engines/composer/composer.cpp
@@ -23,11 +23,8 @@
#include "common/config-manager.h"
#include "common/events.h"
-#include "common/file.h"
#include "common/random.h"
-#include "common/fs.h"
#include "common/keyboard.h"
-#include "common/substream.h"
#include "graphics/cursorman.h"
#include "graphics/surface.h"
@@ -35,9 +32,6 @@
#include "graphics/wincursor.h"
#include "engines/util.h"
-#include "engines/advancedDetector.h"
-
-#include "audio/audiostream.h"
#include "composer/composer.h"
#include "composer/graphics.h"
@@ -127,6 +121,9 @@ Common::Error ComposerEngine::run() {
else
warning("FPS in book.ini is zero. Defaulting to 8...");
uint32 lastDrawTime = 0;
+ _lastSaveTime = _system->getMillis();
+
+ bool loadFromLauncher = ConfMan.hasKey("save_slot");
while (!shouldQuit()) {
for (uint i = 0; i < _pendingPageChanges.size(); i++) {
@@ -176,7 +173,12 @@ Common::Error ComposerEngine::run() {
} else if (_needsUpdate) {
redraw();
}
-
+ if (loadFromLauncher) {
+ loadGameState(ConfMan.getInt("save_slot"));
+ loadFromLauncher = false;
+ }
+ if (shouldPerformAutoSave(_lastSaveTime))
+ saveGameState(0, "Autosave");
while (_eventMan->pollEvent(event)) {
switch (event.type) {
case Common::EVENT_LBUTTONDOWN:
@@ -385,7 +387,7 @@ void ComposerEngine::loadLibrary(uint id) {
}
Common::String filename;
-
+ Common::String oldGroup = _bookGroup;
if (getGameType() == GType_ComposerV1) {
if (!id || _bookGroup.empty())
filename = getStringFromConfig("Common", "StartPage");
@@ -419,6 +421,7 @@ void ComposerEngine::loadLibrary(uint id) {
Library library;
library._id = id;
+ library._group = oldGroup;
library._archive = new ComposerArchive();
if (!library._archive->openFile(filename))
error("failed to open '%s'", filename.c_str());