GLK: QUEST: Support loading savegames from the launcher

This commit is contained in:
Paul Gilbert 2019-09-30 19:05:48 -07:00
parent 13de2f1771
commit f4b12285d0
3 changed files with 20 additions and 1 deletions

View File

@ -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) {

View File

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

View File

@ -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;