From fa5ebf2feed1d0dccebf2c7da4e0d0e1765e8c02 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Fri, 12 Jun 2020 17:40:08 -0700 Subject: [PATCH] GLK: COMPREHEND: Extra blank lines in full-screen text mode --- engines/glk/comprehend/comprehend.h | 6 +++--- engines/glk/comprehend/game.cpp | 9 +++++++-- engines/glk/comprehend/game_data.cpp | 2 +- 3 files changed, 11 insertions(+), 6 deletions(-) diff --git a/engines/glk/comprehend/comprehend.h b/engines/glk/comprehend/comprehend.h index adb4210c1af..d2af626429b 100644 --- a/engines/glk/comprehend/comprehend.h +++ b/engines/glk/comprehend/comprehend.h @@ -49,13 +49,13 @@ struct GameStrings { class Comprehend : public GlkAPI { private: int _saveSlot; ///< Save slot when loading savegame from launcher + bool _graphicsEnabled; public: GraphicsWindow *_topWindow; TextBufferWindow *_bottomWindow; DrawSurface *_drawSurface; ComprehendGame *_game; Pics *_pics; - bool _graphicsEnabled; uint _drawFlags; private: @@ -156,9 +156,9 @@ public: void togglePictureVisibility(); /** - * Returns true if the picture area is visible + * Returns true if the graphics area is visible */ - bool isPictureVisible() const { + bool isGraphicsEnabled() const { return _graphicsEnabled; } }; diff --git a/engines/glk/comprehend/game.cpp b/engines/glk/comprehend/game.cpp index f226fb6710a..bc2a756554f 100644 --- a/engines/glk/comprehend/game.cpp +++ b/engines/glk/comprehend/game.cpp @@ -330,7 +330,7 @@ void ComprehendGame::update_graphics() { int type; uint i; - if (!g_comprehend->_graphicsEnabled) + if (!g_comprehend->isGraphicsEnabled()) return; type = roomIsSpecial(_currentRoom, NULL); @@ -1176,7 +1176,6 @@ void ComprehendGame::doBeforeTurn() { } void ComprehendGame::doAfterTurn() { - // Do post turn game specific bits afterTurn(); } @@ -1185,9 +1184,15 @@ void ComprehendGame::read_input() { char *line = NULL, buffer[1024]; bool handled; + beforePrompt(); doBeforeTurn(); + // If we're in full screen text, we can afford a blank row between + // any game response and the next line of text + if (!g_comprehend->isGraphicsEnabled()) + g_comprehend->print("\n"); + for (;;) { g_comprehend->print("> "); g_comprehend->readLine(buffer, sizeof(buffer)); diff --git a/engines/glk/comprehend/game_data.cpp b/engines/glk/comprehend/game_data.cpp index d8cc643fb05..0de5ebc00ae 100644 --- a/engines/glk/comprehend/game_data.cpp +++ b/engines/glk/comprehend/game_data.cpp @@ -960,7 +960,7 @@ void GameData::loadGame() { /* Load the main game data file */ loadGameData(); - if (g_comprehend->_graphicsEnabled) { + if (g_comprehend->isGraphicsEnabled()) { // Set up the picture archive g_comprehend->_pics->load(_locationGraphicFiles, _itemGraphicFiles, _titleGraphicFile);