[Scummvm-git-logs] scummvm master -> 0448f5608fda54ef92d9826728af537450bc339d

dreammaster paulfgilbert at gmail.com
Sun Aug 4 20:00:04 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:
0448f5608f GLK: FROTZ: V6 window creation so Arthur intro now progresses further


Commit: 0448f5608fda54ef92d9826728af537450bc339d
    https://github.com/scummvm/scummvm/commit/0448f5608fda54ef92d9826728af537450bc339d
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2019-08-04T10:59:49-07:00

Commit Message:
GLK: FROTZ: V6 window creation so Arthur intro now progresses further

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


diff --git a/engines/glk/frotz/processor_screen.cpp b/engines/glk/frotz/processor_screen.cpp
index f6eb16a..78c884d 100644
--- a/engines/glk/frotz/processor_screen.cpp
+++ b/engines/glk/frotz/processor_screen.cpp
@@ -104,6 +104,8 @@ uint32 Processor::zchar_to_unicode_rune(zchar c) {
 
 void Processor::screen_char(zchar c) {
 	Window &w = _wp.currWin();
+	w.ensureTextWindow();
+
 	if (gos_linepending && (w == gos_linewin)) {
 		gos_cancel_pending_line();
 		if (_wp.currWin() == _wp._upper) {
diff --git a/engines/glk/frotz/windows.cpp b/engines/glk/frotz/windows.cpp
index 6e27919..7e647ea 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"
 
@@ -123,6 +124,18 @@ Window &Window::operator=(winid_t win) {
 	return *this;
 }
 
+void Window::ensureTextWindow() {
+	if (_win) {
+		// There's a window present, so make sure it's a text grid or text buffer window
+		if (dynamic_cast<TextBufferWindow *>(_win) || dynamic_cast<TextGridWindow *>(_win))
+			return;
+
+		g_vm->glk_window_close(_win);
+		_win = nullptr;
+	}
+
+	createGlkWindow();
+}
 
 void Window::setSize(const Point &newSize) {
 	checkRepositionLower();
diff --git a/engines/glk/frotz/windows.h b/engines/glk/frotz/windows.h
index 8043a10..785fb10 100644
--- a/engines/glk/frotz/windows.h
+++ b/engines/glk/frotz/windows.h
@@ -154,6 +154,11 @@ public:
 	PropertyAccessor operator[](WindowProperty propType) { return PropertyAccessor(this, propType); }
 
 	/**
+	 * Ensures that the underlying window is a Glk text window
+	 */
+	void ensureTextWindow();
+
+	/**
 	 * Set the window size
 	 */
 	void setSize(const Point &newSize);





More information about the Scummvm-git-logs mailing list