diff options
author | Paul Gilbert | 2018-11-09 21:21:21 -0800 |
---|---|---|
committer | Paul Gilbert | 2018-12-08 19:05:59 -0800 |
commit | 7cb69167de7a024f4d79df5f967397a0737bd574 (patch) | |
tree | 071f9c2aa59fe3e50f756e46c13a6026084d079e | |
parent | df8dec156efa70bb5bda1f6ef6d255c22688d952 (diff) | |
download | scummvm-rg350-7cb69167de7a024f4d79df5f967397a0737bd574.tar.gz scummvm-rg350-7cb69167de7a024f4d79df5f967397a0737bd574.tar.bz2 scummvm-rg350-7cb69167de7a024f4d79df5f967397a0737bd574.zip |
GLK: Add the garglk_set_reversevideo methods
-rw-r--r-- | engines/gargoyle/glk.cpp | 8 | ||||
-rw-r--r-- | engines/gargoyle/streams.cpp | 16 | ||||
-rw-r--r-- | engines/gargoyle/streams.h | 10 |
3 files changed, 32 insertions, 2 deletions
diff --git a/engines/gargoyle/glk.cpp b/engines/gargoyle/glk.cpp index 6022a86999..dc91d4cca1 100644 --- a/engines/gargoyle/glk.cpp +++ b/engines/gargoyle/glk.cpp @@ -1160,11 +1160,15 @@ void Glk::garglk_set_zcolors_stream(strid_t str, glui32 fg, glui32 bg) { } void Glk::garglk_set_reversevideo(glui32 reverse) { - // TODO + _streams->getCurrent()->setReverseVideo(reverse != 0); } void Glk::garglk_set_reversevideo_stream(strid_t str, glui32 reverse) { - // TODO + if (str) { + str->setReverseVideo(reverse != 0); + } else { + warning("set_reversevideo: Invalid ref"); + } } } // End of namespace Gargoyle diff --git a/engines/gargoyle/streams.cpp b/engines/gargoyle/streams.cpp index 9d257f2fa1..b3012720d5 100644 --- a/engines/gargoyle/streams.cpp +++ b/engines/gargoyle/streams.cpp @@ -68,6 +68,11 @@ void Stream::setZColors(glui32 fg, glui32 bg) { Windows::_forceRedraw = true; } +void Stream::setReverseVideo(bool reverse) { + if (_writable && g_conf->_styleHint) + Windows::_forceRedraw = true; +} + /*--------------------------------------------------------------------------*/ void WindowStream::close(StreamResult *result) { @@ -283,6 +288,17 @@ void WindowStream::setZColors(glui32 fg, glui32 bg) { _window->_echoStream->setZColors(fg, bg); } +void WindowStream::setReverseVideo(bool reverse) { + if (!_writable || !g_conf->_styleHint) + return; + + _window->_attr.reverse = reverse; + if (_window->_echoStream) + _window->_echoStream->setReverseVideo(reverse); + + Windows::_forceRedraw = true; +} + /*--------------------------------------------------------------------------*/ MemoryStream::MemoryStream(Streams *streams, void *buf, size_t buflen, FileMode mode, uint32 rock, bool unicode) : diff --git a/engines/gargoyle/streams.h b/engines/gargoyle/streams.h index ac2503220f..c8b69631a0 100644 --- a/engines/gargoyle/streams.h +++ b/engines/gargoyle/streams.h @@ -262,6 +262,11 @@ public: * Set the style colors */ virtual void setZColors(glui32 fg, glui32 bg); + + /** + * Set the reverse video style + */ + virtual void setReverseVideo(bool reverse); }; typedef Stream *strid_t; @@ -324,6 +329,11 @@ public: * Set the style colors */ virtual void setZColors(glui32 fg, glui32 bg) override; + + /** + * Set the reverse video style + */ + virtual void setReverseVideo(bool reverse) override; }; /** |