[Scummvm-git-logs] scummvm master -> 03e99924c309d97709df477cac31e5f0df0002ad

dreammaster paulfgilbert at gmail.com
Fri Apr 5 03:57:55 CEST 2019


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

Summary:
10a5b70b0a GLK: FROTZ: Handle creating Glk window when switching to/from fixed width styles
03e99924c3 GLK: SCOTT: Fix game Id clash on Waxworks


Commit: 10a5b70b0af167c1f154a4c9dbe8829fe966fffa
    https://github.com/scummvm/scummvm/commit/10a5b70b0af167c1f154a4c9dbe8829fe966fffa
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2019-04-04T18:50:52-07:00

Commit Message:
GLK: FROTZ: Handle creating Glk window when switching to/from fixed width styles

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 8ebc263..0619030 100644
--- a/engines/glk/frotz/windows.cpp
+++ b/engines/glk/frotz/windows.cpp
@@ -23,6 +23,7 @@
 #include "glk/frotz/windows.h"
 #include "glk/frotz/frotz.h"
 #include "glk/window_pair.h"
+#include "glk/window_text_grid.h"
 #include "glk/window_text_buffer.h"
 #include "glk/conf.h"
 
@@ -143,6 +144,11 @@ void Window::setPosition(const Point &newPos) {
 void Window::setCursor(const Point &newPos) {
 	int x = newPos.x, y = newPos.y;
 
+	if (!(_currStyle & FIXED_WIDTH_STYLE)) {
+		_currStyle |= FIXED_WIDTH_STYLE;
+		ensureGlkWindow();
+	}
+
 	if (y < 0) {
 		// Cursor on/off
 		if (y == -2)
@@ -226,10 +232,10 @@ uint Window::setFont(uint font) {
 	return result;
 }
 
-void Window::setStyle(int style) {
+void Window::setStyle(uint style) {
 	if (style == 0)
 		_currStyle = 0;
-	else if (style != -1)
+	else if (style != 0xf000)
 		// not tickle time
 		_currStyle |= style;
 
@@ -247,8 +253,7 @@ void Window::setStyle(int style) {
 void Window::updateStyle() {
 	uint style = _currStyle;
 
-	if (!_win)
-		createGlkWindow();
+	ensureGlkWindow();
 
 	if (style & REVERSE_STYLE)
 		setReverseVideo(true);
@@ -289,9 +294,14 @@ void Window::setReverseVideo(bool reverse) {
 	_win->_stream->setReverseVideo(reverse);
 }
 
-void Window::createGlkWindow() {
+void Window::ensureGlkWindow() {
 	// Create a new window	
-	if (_index == 1) {
+	if (_win && (dynamic_cast<TextGridWindow *>(_win) != nullptr) != ((_currStyle & FIXED_WIDTH_STYLE) != 0)) {
+		g_vm->glk_window_close(_win);
+		_win = nullptr;
+	}
+
+	if (_currStyle & FIXED_WIDTH_STYLE) {
 		// Text grid window
 		_win = g_vm->glk_window_open(g_vm->glk_window_get_root(),
 			winmethod_Arbitrary | winmethod_Fixed, 0, wintype_TextGrid, 0);
diff --git a/engines/glk/frotz/windows.h b/engines/glk/frotz/windows.h
index fe59cc7..f12d9ee 100644
--- a/engines/glk/frotz/windows.h
+++ b/engines/glk/frotz/windows.h
@@ -102,9 +102,10 @@ private:
 	void update();
 
 	/**
-	 * Creates a new Glk window to attach to the window
+	 * Creates a new Glk window to attach to the window if not already present, or recreates the window
+	 * if the font style has changed to/from fixed width
 	 */
-	void createGlkWindow();
+	void ensureGlkWindow();
 
 	/**
 	 * Updates the current font/style
@@ -191,7 +192,7 @@ public:
 	/**
 	 * Set the textstyle
 	 */
-	void setStyle(int style = -1);
+	void setStyle(uint style = 0xf000);
 
 	/**
 	 * Set reverse video


Commit: 03e99924c309d97709df477cac31e5f0df0002ad
    https://github.com/scummvm/scummvm/commit/03e99924c309d97709df477cac31e5f0df0002ad
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2019-04-04T18:57:11-07:00

Commit Message:
GLK: SCOTT: Fix game Id clash on Waxworks

Changed paths:
    engines/glk/scott/detection_tables.h


diff --git a/engines/glk/scott/detection_tables.h b/engines/glk/scott/detection_tables.h
index f8c011a..7bf54ef 100644
--- a/engines/glk/scott/detection_tables.h
+++ b/engines/glk/scott/detection_tables.h
@@ -67,7 +67,7 @@ const PlainGameDescriptor SCOTT_GAME_LIST[] = {
 	{ "akyrz", "Mysterious Adventures 8: The Wizard of Akyrz" },
 	{ "perseus", "Mysterious Adventures 9: Perseus and Andromeda" },
 	{ "10indians", "Mysterious Adventures 10: Ten Little Indians" },
-	{ "waxworks", "Mysterious Adventures 11: Waxworks" },
+	{ "waxworks11", "Mysterious Adventures 11: Waxworks" },
 
 	// Other Games
 	{ "desert",            "Desert Adventure" },
@@ -130,7 +130,7 @@ const ScottGame SCOTT_GAMES[] = {
 	{ "645c089d6d66324472d939993793eb57", "akyrz", 16803 },
 	{ "2f5bb15b461fbdc000243acabd324c67", "perseus", 15080 },
 	{ "3bb85fd505b4d42bd1767c1a76347e2f", "10indians", 14215 },
-	{ "af134c32cc0d50329d6e7335639ded88", "waxworks", 16068 },
+	{ "af134c32cc0d50329d6e7335639ded88", "waxworks11", 16068 },
 	{ "028303fd062c39b59b28982cde75f085", "goldenbaton", 53374 },
 	{ "b2ff405412d92b06373d9a5efbb048d4", "timemachine", 54062 },
 	{ "f11f85802eff8aed9e212aef7f26ede1", "arrowofdeath1", 68150 },
@@ -141,7 +141,7 @@ const ScottGame SCOTT_GAMES[] = {
 	{ "3467e09eb247c474ae7e8a8d503968d0", "akyrz", 65008 },
 	{ "4d8389c0ea3425bd4d92492538f63b19", "perseus", 56914 },
 	{ "72e91da7590138b78d370a3cb1448f3c", "10indians", 64660 },
-	{ "4d4ee8aa1f24e1745ab1aa017590dcff", "waxworks", 54556 },
+	{ "4d4ee8aa1f24e1745ab1aa017590dcff", "waxworks11", 54556 },
 
 	// Other games
 	{ "c43e19228bae08eab74bc080e17bbe16", "desert", 12287 },





More information about the Scummvm-git-logs mailing list