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

sev- noreply at scummvm.org
Mon Jan 8 01:54:18 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:
8b9d989c73 DIRECTOR: Re-add tracking of current tempo
cfd6c250cd DIRECTOR: Fix stop signaling for DigitalVideoCastMember


Commit: 8b9d989c73f7aab87bca3c1dd52dfd6d60cd6ac0
    https://github.com/scummvm/scummvm/commit/8b9d989c73f7aab87bca3c1dd52dfd6d60cd6ac0
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-08T02:54:14+01: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 a71483ec787..875d02bd110 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: cfd6c250cd13faf8822616b22efe8a0079069e7e
    https://github.com/scummvm/scummvm/commit/cfd6c250cd13faf8822616b22efe8a0079069e7e
Author: Scott Percival (code at moral.net.au)
Date: 2024-01-08T02:54:14+01: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 2b2a7108f8a..41db77943b3 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