diff options
author | Paul Gilbert | 2019-08-16 22:08:35 -0700 |
---|---|---|
committer | Paul Gilbert | 2019-08-16 22:08:43 -0700 |
commit | c9811e279a6c5e88bb25ac7dbe4819f6386729ef (patch) | |
tree | ff77ce0bc5be7e250acd3397b97e92dbd38be087 /engines/glk | |
parent | d78459f8bc95bea82d5205c0dee07ecfb8425ea1 (diff) | |
download | scummvm-rg350-c9811e279a6c5e88bb25ac7dbe4819f6386729ef.tar.gz scummvm-rg350-c9811e279a6c5e88bb25ac7dbe4819f6386729ef.tar.bz2 scummvm-rg350-c9811e279a6c5e88bb25ac7dbe4819f6386729ef.zip |
GLK: FROTZ: Erase correct area when switching rooms in Arthur
Diffstat (limited to 'engines/glk')
-rw-r--r-- | engines/glk/frotz/windows.cpp | 15 | ||||
-rw-r--r-- | engines/glk/frotz/windows.h | 5 |
2 files changed, 19 insertions, 1 deletions
diff --git a/engines/glk/frotz/windows.cpp b/engines/glk/frotz/windows.cpp index 6fe67363be..bb5f8042c5 100644 --- a/engines/glk/frotz/windows.cpp +++ b/engines/glk/frotz/windows.cpp @@ -238,7 +238,7 @@ void Window::clear() { g_vm->glk_window_clear(_win); if (_windows->_background) { - Rect r = _windows->_background->_bbox; + Rect r = getBounds(); _windows->_background->fillRect(g_conf->_windowColor, r); } } @@ -358,6 +358,19 @@ void Window::updateStyle() { setReverseVideo(false); } +Rect Window::getBounds() const { + if (_win) + return _win->_bbox; + + if (g_vm->h_version < V5) + return Rect((_properties[X_POS] - 1) * g_vm->h_font_width, (_properties[Y_POS] - 1) * g_vm->h_font_height, + (_properties[X_POS] - 1 + _properties[X_SIZE]) * g_vm->h_font_width, + (_properties[Y_POS] - 1 + _properties[Y_SIZE]) * g_vm->h_font_height); + + return Rect(_properties[X_POS] - 1, _properties[Y_POS] - 1, _properties[X_POS] - 1 + _properties[X_SIZE], + _properties[Y_POS] - 1 + _properties[Y_SIZE]); +} + void Window::setReverseVideo(bool reverse) { _win->_stream->setReverseVideo(reverse); } diff --git a/engines/glk/frotz/windows.h b/engines/glk/frotz/windows.h index bd2cfd1c7f..6c8ce703ac 100644 --- a/engines/glk/frotz/windows.h +++ b/engines/glk/frotz/windows.h @@ -110,6 +110,11 @@ private: * Updates the current font/style */ void updateStyle(); + + /** + * Get the bounding area for the window + */ + Rect getBounds() const; public: int _currFont; int _prevFont; |