[Scummvm-git-logs] scummvm master -> 4568e498cabd2c8523a5c0717e57c71d334f26e7

dreammaster paulfgilbert at gmail.com
Wed Jan 2 02:08:04 CET 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:
4568e498ca GLK: FROTZ: Fix #10843 Status bar disappearing when textbox is shown


Commit: 4568e498cabd2c8523a5c0717e57c71d334f26e7
    https://github.com/scummvm/scummvm/commit/4568e498cabd2c8523a5c0717e57c71d334f26e7
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2019-01-01T17:07:46-08:00

Commit Message:
GLK: FROTZ: Fix #10843 Status bar disappearing when textbox is shown

Changed paths:
    engines/glk/frotz/glk_interface.cpp
    engines/glk/window_text_grid.cpp


diff --git a/engines/glk/frotz/glk_interface.cpp b/engines/glk/frotz/glk_interface.cpp
index 88abbe3..4aa2ba4 100644
--- a/engines/glk/frotz/glk_interface.cpp
+++ b/engines/glk/frotz/glk_interface.cpp
@@ -591,6 +591,7 @@ zchar GlkInterface::os_read_line(int max, zchar *buf, int timeout, int width, in
 	glk_request_timer_events(0);
 	buf[ev.val1] = '\0';
 
+	// If the upper status line area was expanded to show a text box/quotation, restore it back
 	if (gos_upper && mach_status_ht < curr_status_ht)
 		reset_status_ht();
 	curr_status_ht = 0;
diff --git a/engines/glk/window_text_grid.cpp b/engines/glk/window_text_grid.cpp
index d1f26da..ee3921d 100644
--- a/engines/glk/window_text_grid.cpp
+++ b/engines/glk/window_text_grid.cpp
@@ -646,11 +646,14 @@ void TextGridWindow::getSize(uint *width, uint *height) const {
 /*--------------------------------------------------------------------------*/
 
 void TextGridWindow::TextGridRow::resize(size_t newSize) {
-	_chars.clear();
-	_attrs.clear();
-	_chars.resize(newSize);
-	_attrs.resize(newSize);
-	Common::fill(&_chars[0], &_chars[0] + newSize, ' ');
+	size_t oldSize = _chars.size();
+	if (newSize != oldSize) {
+		_chars.resize(newSize);
+		_attrs.resize(newSize);
+
+		if (newSize > oldSize)
+			Common::fill(&_chars[0] + oldSize, &_chars[0] + newSize, ' ');
+	}
 }
 
 } // End of namespace Glk





More information about the Scummvm-git-logs mailing list