From 553bb74f8c380ee31fb771c6619dad8e83fed8ce Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Sun, 16 Jun 2019 13:29:15 -0700 Subject: GLK: Further changeover of sub-engines to use new savegame code --- engines/glk/hugo/hugo.cpp | 75 +++++++++++++++++++++-------------------------- engines/glk/hugo/hugo.h | 9 +++--- 2 files changed, 39 insertions(+), 45 deletions(-) (limited to 'engines/glk/hugo') diff --git a/engines/glk/hugo/hugo.cpp b/engines/glk/hugo/hugo.cpp index cd4660d0ef..72db1a2489 100644 --- a/engines/glk/hugo/hugo.cpp +++ b/engines/glk/hugo/hugo.cpp @@ -152,7 +152,7 @@ void Hugo::runGame() { hugo_closefiles(); } -Common::Error Hugo::loadGameData(strid_t save) { +Common::Error Hugo::readSaveData(Common::SeekableReadStream *rs) { char testid[3], testserial[9]; int lbyte, hbyte; int j; @@ -160,18 +160,18 @@ Common::Error Hugo::loadGameData(strid_t save) { long i; /* Check ID */ - testid[0] = (char)hugo_fgetc(save); - testid[1] = (char)hugo_fgetc(save); + testid[0] = (char)hugo_fgetc(rs); + testid[1] = (char)hugo_fgetc(rs); testid[2] = '\0'; - if (hugo_ferror(save)) goto RestoreError; + if (hugo_ferror(rs)) goto RestoreError; if (strcmp(testid, id)) { - GUIErrorMessage("Incorrect save file."); + GUIErrorMessage("Incorrect rs file."); goto RestoreError; } /* Check serial number */ - if (!hugo_fgets(testserial, 9, save)) goto RestoreError; + if (!hugo_fgets(testserial, 9, rs)) goto RestoreError; if (strcmp(testserial, serial)) { GUIErrorMessage("Save file created by different version."); @@ -181,7 +181,7 @@ Common::Error Hugo::loadGameData(strid_t save) { /* Restore variables */ for (k=0; k