[Scummvm-git-logs] scummvm master -> 02a9a605c318ef4832c5bfde858cdc8d36d9f88a

dreammaster paulfgilbert at gmail.com
Wed Aug 26 02:43:56 UTC 2020


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:
02a9a605c3 GLK: GLULX: Fix startup crashes for some games


Commit: 02a9a605c318ef4832c5bfde858cdc8d36d9f88a
    https://github.com/scummvm/scummvm/commit/02a9a605c318ef4832c5bfde858cdc8d36d9f88a
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2020-08-25T19:43:29-07:00

Commit Message:
GLK: GLULX: Fix startup crashes for some games

Changed paths:
    engines/glk/glk_api.cpp
    engines/glk/glulx/glulx.cpp
    engines/glk/windows.cpp


diff --git a/engines/glk/glk_api.cpp b/engines/glk/glk_api.cpp
index 9d597a4a10..51557db0a5 100644
--- a/engines/glk/glk_api.cpp
+++ b/engines/glk/glk_api.cpp
@@ -377,7 +377,11 @@ strid_t GlkAPI::glk_stream_get_current(void) {
 }
 
 void GlkAPI::glk_put_char(unsigned char ch) {
-	_streams->getCurrent()->putChar(ch);
+	Stream *str = _streams->getCurrent();
+	if (str)
+		str->putChar(ch);
+	else
+		warning("glk_put_char: no stream set");
 }
 
 void GlkAPI::glk_put_char_stream(strid_t str, unsigned char ch) {
@@ -783,7 +787,11 @@ uint GlkAPI::glk_buffer_to_title_case_uni(uint32 *buf, uint len,
 }
 
 void GlkAPI::glk_put_char_uni(uint32 ch) {
-	_streams->getCurrent()->putCharUni(ch);
+	Stream *str = _streams->getCurrent();
+	if (str)
+		str->putCharUni(ch);
+	else
+		warning("glk_put_char_uni: no stream set");
 }
 
 void GlkAPI::glk_put_string_uni(const uint32 *s) {
diff --git a/engines/glk/glulx/glulx.cpp b/engines/glk/glulx/glulx.cpp
index 22630c5dbf..ca471c9a98 100644
--- a/engines/glk/glulx/glulx.cpp
+++ b/engines/glk/glulx/glulx.cpp
@@ -56,7 +56,10 @@ void Glulx::runGame() {
 	if (!is_gamefile_valid())
 		return;
 
+	gamefile_start = 0;
+	gamefile_len = _gameFile.size();
 	setup_vm();
+
 	if (!init_dispatch())
 		return;
 
diff --git a/engines/glk/windows.cpp b/engines/glk/windows.cpp
index e405271b80..b418b56b4f 100644
--- a/engines/glk/windows.cpp
+++ b/engines/glk/windows.cpp
@@ -108,17 +108,10 @@ Window *Windows::windowOpen(Window *splitwin, uint method, uint size,
 			return nullptr;
 		}
 
-		if (splitwin->_type == wintype_Pair) {
-			if ((method & winmethod_DirMask) != winmethod_Arbitrary) {
-				warning("window_open: Can only add windows to a Pair window in arbitrary mode");
-				return nullptr;
-			}
-		} else {
-			oldparent = splitwin->_parent;
-			if (oldparent && oldparent->_type != wintype_Pair) {
-				warning("window_open: parent window is not Pair");
-				return nullptr;
-			}
+		oldparent = splitwin->_parent;
+		if (oldparent && oldparent->_type != wintype_Pair) {
+			warning("window_open: parent window is not Pair");
+			return nullptr;
 		}
 	}
 




More information about the Scummvm-git-logs mailing list