[Scummvm-git-logs] scummvm master -> c9811e279a6c5e88bb25ac7dbe4819f6386729ef

dreammaster paulfgilbert at gmail.com
Sat Aug 17 07:08:50 CEST 2019


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
c9811e279a GLK: FROTZ: Erase correct area when switching rooms in Arthur


Commit: c9811e279a6c5e88bb25ac7dbe4819f6386729ef
    https://github.com/scummvm/scummvm/commit/c9811e279a6c5e88bb25ac7dbe4819f6386729ef
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2019-08-16T22:08:43-07:00

Commit Message:
GLK: FROTZ: Erase correct area when switching rooms in Arthur

Changed paths:
    engines/glk/frotz/windows.cpp
    engines/glk/frotz/windows.h


diff --git a/engines/glk/frotz/windows.cpp b/engines/glk/frotz/windows.cpp
index 6fe6736..bb5f804 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 bd2cfd1..6c8ce70 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;





More information about the Scummvm-git-logs mailing list