From 85816c8a54d77423c6400e41da93f62fe1f948ff Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 2 Jan 2019 23:13:13 -0800 Subject: GLK: Make a _gameFile field in the base Glk engine --- engines/glk/glulxe/glulxe.cpp | 10 ++++------ engines/glk/glulxe/glulxe.h | 3 +-- 2 files changed, 5 insertions(+), 8 deletions(-) (limited to 'engines/glk/glulxe') diff --git a/engines/glk/glulxe/glulxe.cpp b/engines/glk/glulxe/glulxe.cpp index aaa63b6141..40f4bdde57 100644 --- a/engines/glk/glulxe/glulxe.cpp +++ b/engines/glk/glulxe/glulxe.cpp @@ -31,9 +31,7 @@ Glulxe::Glulxe(OSystem *syst, const GlkGameDescription &gameDesc) : GlkAPI(syst, vm_exited_cleanly(false) { } -void Glulxe::runGame(Common::SeekableReadStream *gameFile) { - _gameFile = gameFile; - +void Glulxe::runGame() { if (!is_gamefile_valid()) return; @@ -51,18 +49,18 @@ Common::Error Glulxe::saveGameData(strid_t file, const Common::String &desc) { } bool Glulxe::is_gamefile_valid() { - if (_gameFile->size() < 8) { + if (_gameFile.size() < 8) { GUIErrorMessage(_("This is too short to be a valid Glulx file.")); return false; } - if (_gameFile->readUint32BE() != MKTAG('G', 'l', 'u', 'l')) { + if (_gameFile.readUint32BE() != MKTAG('G', 'l', 'u', 'l')) { GUIErrorMessage(_("This is not a valid Glulx file.")); return false; } // We support version 2.0 through 3.1.* - uint version = _gameFile->readUint32BE(); + uint version = _gameFile.readUint32BE(); if (version < 0x20000) { GUIErrorMessage(_("This Glulx file is too old a version to execute.")); return false; diff --git a/engines/glk/glulxe/glulxe.h b/engines/glk/glulxe/glulxe.h index 3764ca4fe0..decdc298f7 100644 --- a/engines/glk/glulxe/glulxe.h +++ b/engines/glk/glulxe/glulxe.h @@ -34,7 +34,6 @@ namespace Glulxe { */ class Glulxe : public GlkAPI { public: - Common::SeekableReadStream *_gameFile; bool vm_exited_cleanly; private: /** @@ -50,7 +49,7 @@ public: /** * Run the game */ - void runGame(Common::SeekableReadStream *gameFile); + void runGame(); /** * Returns the running interpreter type -- cgit v1.2.3