[Scummvm-git-logs] scummvm master -> 1216106d8c6657a628c05cc02249b924ccf00366

rvanlaar roland at rolandvanlaar.nl
Fri Jul 3 20:30:21 UTC 2020


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:
1b3995bd3f DIRECTOR: stxt handle stream of size 0
1216106d8c DIRECTOR: Rename unk1 to offset


Commit: 1b3995bd3ffa39d2ee9dd2b37959c332ce110fa5
    https://github.com/scummvm/scummvm/commit/1b3995bd3ffa39d2ee9dd2b37959c332ce110fa5
Author: Roland van Laar (roland at rolandvanlaar.nl)
Date: 2020-07-03T22:29:58+02:00

Commit Message:
DIRECTOR: stxt handle stream of size 0

An stxt can have a stream size of 0, we skip handling those.

Changed paths:
    engines/director/stxt.cpp


diff --git a/engines/director/stxt.cpp b/engines/director/stxt.cpp
index 1226d95185..53c6627cf4 100644
--- a/engines/director/stxt.cpp
+++ b/engines/director/stxt.cpp
@@ -29,6 +29,11 @@ namespace Director {
 
 Stxt::Stxt(Common::SeekableSubReadStreamEndian &textStream) {
 	// TODO: Side effects on textStream make this a little hard to understand in context?
+
+	// D4+ variant
+	if (textStream.size() == 0)
+		return;
+
 	uint32 unk1 = textStream.readUint32();
 	uint32 strLen = textStream.readUint32();
 	uint32 dataLen = textStream.readUint32();


Commit: 1216106d8c6657a628c05cc02249b924ccf00366
    https://github.com/scummvm/scummvm/commit/1216106d8c6657a628c05cc02249b924ccf00366
Author: Roland van Laar (roland at rolandvanlaar.nl)
Date: 2020-07-03T22:29:58+02:00

Commit Message:
DIRECTOR: Rename unk1 to offset

unk1 is observed to be always 12, the offset at which
the stxt text is read.

Changed paths:
    engines/director/stxt.cpp


diff --git a/engines/director/stxt.cpp b/engines/director/stxt.cpp
index 53c6627cf4..d9413527df 100644
--- a/engines/director/stxt.cpp
+++ b/engines/director/stxt.cpp
@@ -34,7 +34,11 @@ Stxt::Stxt(Common::SeekableSubReadStreamEndian &textStream) {
 	if (textStream.size() == 0)
 		return;
 
-	uint32 unk1 = textStream.readUint32();
+	uint32 offset = textStream.readUint32();
+	if (offset != 12){
+		error("Stxt init: unhandlef offset");
+		return;
+	}
 	uint32 strLen = textStream.readUint32();
 	uint32 dataLen = textStream.readUint32();
 	Common::String text;
@@ -56,7 +60,7 @@ Stxt::Stxt(Common::SeekableSubReadStreamEndian &textStream) {
 		}
 		text += ch;
 	}
-	debugC(3, kDebugText, "Stxt init: unk1: %d strLen: %d dataLen: %d textlen: %u", unk1, strLen, dataLen, text.size());
+	debugC(3, kDebugText, "Stxt init: unk1: %d strLen: %d dataLen: %d textlen: %u", offset, strLen, dataLen, text.size());
 	if (strLen < 200)
 		debugC(3, kDebugText, "text: '%s'", Common::toPrintable(text).c_str());
 




More information about the Scummvm-git-logs mailing list