From 4a3f517b719d4ee07fab8f704d5884c52c0da4c1 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 23 Nov 2018 21:08:53 -0800 Subject: GLK: FROTZ: Prompt for exit when game quits --- engines/glk/frotz/frotz.cpp | 5 +++++ engines/glk/frotz/processor.h | 17 ++++++++++++----- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/engines/glk/frotz/frotz.cpp b/engines/glk/frotz/frotz.cpp index 95cdb22ee9..d3b0749649 100644 --- a/engines/glk/frotz/frotz.cpp +++ b/engines/glk/frotz/frotz.cpp @@ -44,6 +44,11 @@ void Frotz::runGame(Common::SeekableReadStream *gameFile) { // Game loop interpret(); + + if (!shouldQuit()) { + flush_buffer(); + glk_exit(); + } } void Frotz::initialize() { diff --git a/engines/glk/frotz/processor.h b/engines/glk/frotz/processor.h index 5f61a2e658..77a673df9d 100644 --- a/engines/glk/frotz/processor.h +++ b/engines/glk/frotz/processor.h @@ -169,11 +169,6 @@ private: * @{ */ - /** - * Copy the contents of the text buffer to the output streams. - */ - void flush_buffer(); - /** * High level output function. */ @@ -1545,6 +1540,18 @@ protected: void z_store(); /**@}*/ + + /** + * \defgroup Input support methods + * @{ + */ + + /** + * Copy the contents of the text buffer to the output streams. + */ + void flush_buffer(); + + /**@}*/ public: /** * Constructor -- cgit v1.2.3