From d6b41b59f3fa83275475517bb9810f8508c4e36d Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 13 Mar 2019 20:19:11 -0700 Subject: GLK: FROTZ: Move setReverseVideo into Window --- engines/glk/frotz/glk_interface.cpp | 7 ------- engines/glk/frotz/glk_interface.h | 5 ----- engines/glk/frotz/processor_screen.cpp | 2 +- engines/glk/frotz/windows.cpp | 19 +++++++++---------- engines/glk/frotz/windows.h | 5 +++++ 5 files changed, 15 insertions(+), 23 deletions(-) diff --git a/engines/glk/frotz/glk_interface.cpp b/engines/glk/frotz/glk_interface.cpp index f6e01db955..330c8be027 100644 --- a/engines/glk/frotz/glk_interface.cpp +++ b/engines/glk/frotz/glk_interface.cpp @@ -693,12 +693,5 @@ uint GlkInterface::roundDiv(uint x, uint y) { return quotient; } -void GlkInterface::os_set_reverse_video(bool flag) { -#ifdef GARGLK - _reverseVideo = flag; - garglk_set_reversevideo(flag); -#endif -} - } // End of namespace Frotz } // End of namespace Glk diff --git a/engines/glk/frotz/glk_interface.h b/engines/glk/frotz/glk_interface.h index df176afef5..67f0a86813 100644 --- a/engines/glk/frotz/glk_interface.h +++ b/engines/glk/frotz/glk_interface.h @@ -242,11 +242,6 @@ protected: * Waits for the user to type an input line */ zchar os_read_line(int max, zchar *buf, int timeout, int width, int continued); - - /** - * Set whether reverse video mode is active - */ - void os_set_reverse_video(bool flag); public: /** * Constructor diff --git a/engines/glk/frotz/processor_screen.cpp b/engines/glk/frotz/processor_screen.cpp index 1ce0f91099..f6eb16ac20 100644 --- a/engines/glk/frotz/processor_screen.cpp +++ b/engines/glk/frotz/processor_screen.cpp @@ -437,7 +437,7 @@ void Processor::z_show_status() { // Move to top of the status window, and print in reverse style. _wp.setWindow(1); - os_set_reverse_video(true); + _wp._upper.setReverseVideo(true); _wp._upper.setCursor(Point(1, 1)); // If the screen width is below 55 characters then we have to use diff --git a/engines/glk/frotz/windows.cpp b/engines/glk/frotz/windows.cpp index bacd6e3f2f..935c9a4098 100644 --- a/engines/glk/frotz/windows.cpp +++ b/engines/glk/frotz/windows.cpp @@ -257,14 +257,12 @@ void Window::setStyle(int style) { void Window::updateStyle() { uint style = _currStyle; - /* - if (style & REVERSE_STYLE) { - os_set_reverse_video(true); - }*/ - if (!_win) createGlkWindow(); + if (style & REVERSE_STYLE) + setReverseVideo(true); + if (style & FIXED_WIDTH_STYLE) { if (_currFont == GRAPHICS_FONT) _win->_stream->setStyle(style_User1); // character graphics @@ -287,11 +285,12 @@ void Window::updateStyle() { _win->_stream->setStyle(style_Normal); // propr } - /* - if (_currStyle == 0) { - os_set_reverse_video(false); - } - */ + if (_currStyle == 0) + setReverseVideo(false); +} + +void Window::setReverseVideo(bool reverse) { + _win->_stream->setReverseVideo(reverse); } void Window::createGlkWindow() { diff --git a/engines/glk/frotz/windows.h b/engines/glk/frotz/windows.h index 8b971cc9c4..fe59cc7e00 100644 --- a/engines/glk/frotz/windows.h +++ b/engines/glk/frotz/windows.h @@ -192,6 +192,11 @@ public: * Set the textstyle */ void setStyle(int style = -1); + + /** + * Set reverse video + */ + void setReverseVideo(bool reverse); }; /** -- cgit v1.2.3