[Scummvm-git-logs] scummvm branch-2-8 -> 3af444ebbc171491bd52263bbdcbd38dd12cc90a

moralrecordings noreply at scummvm.org
Mon Jan 8 03:28:59 UTC 2024


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:
d09f00aaa6 DIRECTOR: Re-add tracking of current tempo
3af444ebbc DIRECTOR: Fix stop signaling for DigitalVideoCastMember


Commit: d09f00aaa68c58db629e52496f4a6250811845ed
    https://github.com/scummvm/scummvm/commit/d09f00aaa68c58db629e52496f4a6250811845ed
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-08T11:28:46+08:00

Commit Message:
DIRECTOR: Re-add tracking of current tempo

Re-adds the support removed in e13eba21629cc49d9aa3aa3029aa657843aa507c

Fixes the puppetTempo example in Lingo Dictionary.

Changed paths:
    engines/director/frame.cpp
    engines/director/score.cpp
    engines/director/score.h


diff --git a/engines/director/frame.cpp b/engines/director/frame.cpp
index 2b8e7716a00..97de843d10e 100644
--- a/engines/director/frame.cpp
+++ b/engines/director/frame.cpp
@@ -172,6 +172,8 @@ void Frame::readMainChannelsD2(Common::MemoryReadStreamEndian &stream, uint16 of
 			break;
 		case 4:
 			_mainChannels.tempo = stream.readByte();
+			if (_mainChannels.tempo && _mainChannels.tempo <= 120)
+				_mainChannels.scoreCachedTempo = _mainChannels.tempo;
 			break;
 		case 5:
 			_mainChannels.transType = static_cast<TransitionType>(stream.readByte());
@@ -418,6 +420,8 @@ void Frame::readMainChannelsD4(Common::MemoryReadStreamEndian &stream, uint16 of
 			break;
 		case 4:
 			_mainChannels.tempo = stream.readByte();
+			if (_mainChannels.tempo && _mainChannels.tempo <= 120)
+				_mainChannels.scoreCachedTempo = _mainChannels.tempo;
 			break;
 		case 5:
 			_mainChannels.transType = static_cast<TransitionType>(stream.readByte());
@@ -727,6 +731,8 @@ void Frame::readMainChannelsD5(Common::MemoryReadStreamEndian &stream, uint16 of
 			break;
 		case 21:
 			_mainChannels.tempo = stream.readByte();
+			if (_mainChannels.tempo && _mainChannels.tempo <= 120)
+				_mainChannels.scoreCachedTempo = _mainChannels.tempo;
 			break;
 		case 22:
 			stream.read(unk, 2);
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 9b436664487..46d0d9ef794 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -61,6 +61,7 @@ Score::Score(Movie *movie) {
 
 	_soundManager = _window->getSoundManager();
 
+	_puppetTempo = 0;
 	_puppetPalette = false;
 	_paletteTransitionIndex = 0;
 	memset(_paletteSnapshotBuffer, 0, 768);
@@ -107,7 +108,7 @@ Score::~Score() {
 }
 
 void Score::setPuppetTempo(int16 puppetTempo) {
-	_currentFrame->_mainChannels.tempo = puppetTempo;
+	_puppetTempo = puppetTempo;
 }
 
 CastMemberID Score::getCurrentPalette() {
@@ -446,7 +447,13 @@ void Score::update() {
 
 	loadFrame(_curFrameNumber, true);
 
-	byte tempo = _currentFrame->_mainChannels.tempo;
+	byte tempo = _currentFrame->_mainChannels.scoreCachedTempo;
+	// puppetTempo is overridden by changes in score tempo
+	if (_currentFrame->_mainChannels.tempo || tempo != _lastTempo) {
+		_puppetTempo = 0;
+	} else if (_puppetTempo) {
+		tempo = _puppetTempo;
+	}
 
 	if (tempo) {
 		const bool waitForClickOnly = _vm->getVersion() < 300;
diff --git a/engines/director/score.h b/engines/director/score.h
index 9f3f95b98c2..c988dec2289 100644
--- a/engines/director/score.h
+++ b/engines/director/score.h
@@ -167,6 +167,7 @@ public:
 	Common::MemoryReadStreamEndian *_framesStream;
 
 	byte _currentFrameRate;
+	byte _puppetTempo;
 
 	bool _puppetPalette;
 	int _paletteTransitionIndex;


Commit: 3af444ebbc171491bd52263bbdcbd38dd12cc90a
    https://github.com/scummvm/scummvm/commit/3af444ebbc171491bd52263bbdcbd38dd12cc90a
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-08T11:28:46+08:00

Commit Message:
DIRECTOR: Fix stop signaling for DigitalVideoCastMember

Moves the update for rewind/movieRate into isModified; having them in
createWidget means they are likely to be missed.

Fixes multiple stuck cutscenes in The Dark Eye.

Changed paths:
    engines/director/castmember/digitalvideo.cpp


diff --git a/engines/director/castmember/digitalvideo.cpp b/engines/director/castmember/digitalvideo.cpp
index 31cac08e901..8217f0a75fd 100644
--- a/engines/director/castmember/digitalvideo.cpp
+++ b/engines/director/castmember/digitalvideo.cpp
@@ -133,6 +133,17 @@ bool DigitalVideoCastMember::isModified() {
 	if (!_video || !_video->isVideoLoaded())
 		return true;
 
+	// Inelegant, but necessary. isModified will get called on
+	// every screen update, so use it to keep the playback
+	// status up to date.
+	if (_video->endOfVideo()) {
+		if (_looping) {
+			_video->rewind();
+		} else {
+			_channel->_movieRate = 0.0;
+		}
+	}
+
 	if (_getFirstFrame)
 		return true;
 
@@ -241,14 +252,6 @@ Graphics::MacWidget *DigitalVideoCastMember::createWidget(Common::Rect &bbox, Ch
 		_getFirstFrame = false;
 	}
 
-	if (_video->endOfVideo()) {
-		if (_looping) {
-			_video->rewind();
-		} else {
-			_channel->_movieRate = 0.0;
-		}
-	}
-
 	return widget;
 }
 




More information about the Scummvm-git-logs mailing list