[Scummvm-git-logs] scummvm master -> fda89a9f5997081f4ccb59cb052a81b3f9452d80

csnover csnover at users.noreply.github.com
Fri Nov 4 21:16:49 CET 2016


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

Summary:
44dfa4c49f SCI32: Treat %d as unsigned in kString
5a5945cbbb SCI32: Allow format strings with missing arguments
fda89a9f59 SCI32: Fix VMD playback stuttering when kEventFlagToFrame is used


Commit: 44dfa4c49fef7c6d3e92b8f1fc45259404ec56ee
    https://github.com/scummvm/scummvm/commit/44dfa4c49fef7c6d3e92b8f1fc45259404ec56ee
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-11-04T15:16:10-05:00

Commit Message:
SCI32: Treat %d as unsigned in kString

At least Shivers has VMDs with resource IDs above 2^15; treating %d
as signed means that the wrong filename gets created.

Changed paths:
    engines/sci/engine/kstring.cpp



diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp
index 6ec6134..bfabbcc 100644
--- a/engines/sci/engine/kstring.cpp
+++ b/engines/sci/engine/kstring.cpp
@@ -733,11 +733,12 @@ namespace {
 	}
 
 	bool isSignedType(const char type) {
-		return type == 'd' || type == 'i';
+		// For whatever reason, %d ends up being treated as unsigned in SSCI
+		return type == 'i';
 	}
 
 	bool isUnsignedType(const char type) {
-		return strchr("uxXoc", type);
+		return strchr("duxXoc", type);
 	}
 
 	bool isStringType(const char type) {


Commit: 5a5945cbbb37fb63f8bc592a30d91bad311bd554
    https://github.com/scummvm/scummvm/commit/5a5945cbbb37fb63f8bc592a30d91bad311bd554
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-11-04T15:16:10-05:00

Commit Message:
SCI32: Allow format strings with missing arguments

SSCI created a fake va_list and passed it to vsprintf, so extra
placeholders would just silently end up reading garbage memory.

Changed paths:
    engines/sci/engine/kstring.cpp



diff --git a/engines/sci/engine/kstring.cpp b/engines/sci/engine/kstring.cpp
index bfabbcc..74c1f99 100644
--- a/engines/sci/engine/kstring.cpp
+++ b/engines/sci/engine/kstring.cpp
@@ -806,8 +806,11 @@ Common::String format(const Common::String &source, int argc, const reg_t *argv)
 				continue;
 			}
 
-			assert(argIndex < argc);
-			out += readPlaceholder(in, argv[argIndex++]);
+			if (argIndex < argc) {
+				out += readPlaceholder(in, argv[argIndex++]);
+			} else {
+				out += readPlaceholder(in, NULL_REG);
+			}
 		} else {
 			out += *in++;
 		}


Commit: fda89a9f5997081f4ccb59cb052a81b3f9452d80
    https://github.com/scummvm/scummvm/commit/fda89a9f5997081f4ccb59cb052a81b3f9452d80
Author: Colin Snover (github.com at zetafleet.com)
Date: 2016-11-04T15:16:10-05:00

Commit Message:
SCI32: Fix VMD playback stuttering when kEventFlagToFrame is used

For example, Shivers room 932 when subtitles are enabled.

Changed paths:
    engines/sci/graphics/video32.cpp
    engines/sci/graphics/video32.h



diff --git a/engines/sci/graphics/video32.cpp b/engines/sci/graphics/video32.cpp
index 5f3a7a3..e44c159 100644
--- a/engines/sci/graphics/video32.cpp
+++ b/engines/sci/graphics/video32.cpp
@@ -487,6 +487,7 @@ VMDPlayer::VMDPlayer(SegManager *segMan, EventManager *eventMan) :
 
 	_isOpen(false),
 	_isInitialized(false),
+	_yieldFrame(0),
 	_yieldInterval(0),
 	_lastYieldedFrameNo(0),
 
@@ -612,12 +613,12 @@ VMDPlayer::VMDStatus VMDPlayer::getStatus() const {
 VMDPlayer::EventFlags VMDPlayer::kernelPlayUntilEvent(const EventFlags flags, const int16 lastFrameNo, const int16 yieldInterval) {
 	assert(lastFrameNo >= -1);
 
-	const int32 maxFrameNo = (int32)(_decoder->getFrameCount() - 1);
+	const int32 maxFrameNo = _decoder->getFrameCount() - 1;
 
-	if ((flags & kEventFlagToFrame) && lastFrameNo > 0) {
-		_decoder->setEndFrame(MIN<int32>(lastFrameNo, maxFrameNo));
+	if (flags & kEventFlagToFrame) {
+		_yieldFrame = MIN<int32>(lastFrameNo, maxFrameNo);
 	} else {
-		_decoder->setEndFrame(maxFrameNo);
+		_yieldFrame = maxFrameNo;
 	}
 
 	if (flags & kEventFlagYieldToVM) {
@@ -755,6 +756,11 @@ VMDPlayer::EventFlags VMDPlayer::playUntilEvent(const EventFlags flags) {
 
 		const int currentFrameNo = _decoder->getCurFrame();
 
+		if (currentFrameNo == _yieldFrame) {
+			stopFlag = kEventFlagEnd;
+			break;
+		}
+
 		if (_yieldInterval > 0 &&
 			currentFrameNo != _lastYieldedFrameNo &&
 			(currentFrameNo % _yieldInterval) == 0
diff --git a/engines/sci/graphics/video32.h b/engines/sci/graphics/video32.h
index 75b8fb2..c3ae891 100644
--- a/engines/sci/graphics/video32.h
+++ b/engines/sci/graphics/video32.h
@@ -326,6 +326,12 @@ private:
 	bool _isInitialized;
 
 	/**
+	 * For VMDs played with the `kEventFlagToFrame` flag,
+	 * the target frame for yielding back to the SCI VM.
+	 */
+	int32 _yieldFrame;
+
+	/**
 	 * For VMDs played with the `kEventFlagYieldToVM` flag,
 	 * the number of frames that should be rendered until
 	 * yielding back to the SCI VM.





More information about the Scummvm-git-logs mailing list