diff options
author | Paul Gilbert | 2019-08-04 10:59:39 -0700 |
---|---|---|
committer | Paul Gilbert | 2019-08-04 10:59:49 -0700 |
commit | 0448f5608fda54ef92d9826728af537450bc339d (patch) | |
tree | 4d2dbffc80434f361959a3f61c23a22fe582956a /engines/glk/frotz | |
parent | d765440c1ae138d2c92b89cd9313cac52cd2af4a (diff) | |
download | scummvm-rg350-0448f5608fda54ef92d9826728af537450bc339d.tar.gz scummvm-rg350-0448f5608fda54ef92d9826728af537450bc339d.tar.bz2 scummvm-rg350-0448f5608fda54ef92d9826728af537450bc339d.zip |
GLK: FROTZ: V6 window creation so Arthur intro now progresses further
Diffstat (limited to 'engines/glk/frotz')
-rw-r--r-- | engines/glk/frotz/processor_screen.cpp | 2 | ||||
-rw-r--r-- | engines/glk/frotz/windows.cpp | 13 | ||||
-rw-r--r-- | engines/glk/frotz/windows.h | 5 |
3 files changed, 20 insertions, 0 deletions
diff --git a/engines/glk/frotz/processor_screen.cpp b/engines/glk/frotz/processor_screen.cpp index f6eb16ac20..78c884de3a 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 6e279193bd..7e647ea06c 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 8043a103ba..785fb10d8f 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); |