aboutsummaryrefslogtreecommitdiff
path: root/engines/glk/quest
diff options
context:
space:
mode:
authorPaul Gilbert2019-09-30 19:05:48 -0700
committerPaul Gilbert2019-09-30 19:05:48 -0700
commitf4b12285d09dbf78c2e636483b0662c4ed400fad (patch)
tree109693809b9c4904f459ad95f2953f7d7c76de07 /engines/glk/quest
parent13de2f177135b8f243d373c1aaa5367aaa9b1845 (diff)
downloadscummvm-rg350-f4b12285d09dbf78c2e636483b0662c4ed400fad.tar.gz
scummvm-rg350-f4b12285d09dbf78c2e636483b0662c4ed400fad.tar.bz2
scummvm-rg350-f4b12285d09dbf78c2e636483b0662c4ed400fad.zip
GLK: QUEST: Support loading savegames from the launcher
Diffstat (limited to 'engines/glk/quest')
-rw-r--r--engines/glk/quest/geas_glk.cpp3
-rw-r--r--engines/glk/quest/quest.cpp13
-rw-r--r--engines/glk/quest/quest.h5
3 files changed, 20 insertions, 1 deletions
diff --git a/engines/glk/quest/geas_glk.cpp b/engines/glk/quest/geas_glk.cpp
index 6b5f8b1b3d..a6324fa197 100644
--- a/engines/glk/quest/geas_glk.cpp
+++ b/engines/glk/quest/geas_glk.cpp
@@ -63,7 +63,8 @@ void draw_banner() {
}
void glk_put_cstring(const char *s) {
- g_vm->glk_put_string(s);
+ if (!g_vm->loadingSavegame())
+ g_vm->glk_put_string(s);
}
GeasResult GeasGlkInterface::print_normal(const String &s) {
diff --git a/engines/glk/quest/quest.cpp b/engines/glk/quest/quest.cpp
index 839f58d0d1..06e4c96a65 100644
--- a/engines/glk/quest/quest.cpp
+++ b/engines/glk/quest/quest.cpp
@@ -55,7 +55,20 @@ void Quest::playGame() {
char cur_buf[1024];
char buf[200];
+ // Check for savegame to load immediate
+ _saveSlot = ConfMan.hasKey("save_slot") ? ConfMan.getInt("save_slot") : -1;
+
+ // Set initial game state
_runner->set_game(String(getFilename().c_str()));
+
+ if (_saveSlot != -1) {
+ int saveSlot = _saveSlot;
+ _saveSlot = -1;
+
+ if (loadGameState(saveSlot).getCode() == Common::kNoError)
+ _runner->run_command("look");
+ }
+
banner = _runner->get_banner();
draw_banner();
diff --git a/engines/glk/quest/quest.h b/engines/glk/quest/quest.h
index ed8d60eb5f..ab6e8b8d9d 100644
--- a/engines/glk/quest/quest.h
+++ b/engines/glk/quest/quest.h
@@ -95,6 +95,11 @@ public:
* Savegames aren't supported for Quest games
*/
virtual Common::Error writeGameData(Common::WriteStream *ws) override;
+
+ /**
+ * Returns true if a savegame is being loaded directly from the ScummVM launcher
+ */
+ bool loadingSavegame() const { return _saveSlot != -1; }
};
extern Quest *g_vm;