[Scummvm-git-logs] scummvm master -> 2cdd5d38d40da87e986ee477fc354f3e584f6988

sev- noreply at scummvm.org
Wed Apr 15 23:35:21 UTC 2026


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

Summary:
c06e2187e8 DIRECTOR: Fix flag parsing for filmloop castmembers
2cdd5d38d4 DIRECTOR: Properly process filmloop looping in score


Commit: c06e2187e8fc5df69a34e211c6a64401d3c3506d
    https://github.com/scummvm/scummvm/commit/c06e2187e8fc5df69a34e211c6a64401d3c3506d
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2026-04-16T01:32:02+02:00

Commit Message:
DIRECTOR: Fix flag parsing for filmloop castmembers

It seems that there is no difference in the _looping flag,
between versions, though more testing is required

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


diff --git a/engines/director/castmember/filmloop.cpp b/engines/director/castmember/filmloop.cpp
index fd851a4d44a..59956a7dd4e 100644
--- a/engines/director/castmember/filmloop.cpp
+++ b/engines/director/castmember/filmloop.cpp
@@ -49,25 +49,16 @@ FilmLoopCastMember::FilmLoopCastMember(Cast *cast, uint16 castId, Common::Seekab
 	_center = false;
 	_index = -1;
 
-	// We are ignoring some of the bits in the flags
-	if (cast->_version >= kFileVer400 && cast->_version < kFileVer500) {
+	if (cast->_version >= kFileVer400) {
 		_initialRect = Movie::readRect(stream);
 		uint32 flags = stream.readUint32BE();
 		uint16 unk1 = stream.readUint16BE();
-		debugC(5, kDebugLoading, "FilmLoopCastMember::FilmLoopCastMember(): flags: %d, unk1: %d", flags, unk1);
-		_looping = flags & 64 ? 0 : 1;
-		_enableSound = flags & 8 ? 1 : 0;
-		_crop = flags & 2 ? 0 : 1;
-		_center = flags & 1 ? 1 : 0;
-	} else if (cast->_version >= kFileVer500 && cast->_version < kFileVer600) {
-		_initialRect = Movie::readRect(stream);
-		uint32 flags = stream.readUint32BE();
-		uint16 unk1 = stream.readUint16BE();
-		debugC(5, kDebugLoading, "FilmLoopCastMember::FilmLoopCastMember(): flags: %d, unk1: %d", flags, unk1);
 		_looping = flags & 32 ? 0 : 1;
 		_enableSound = flags & 8 ? 1 : 0;
 		_crop = flags & 2 ? 0 : 1;
 		_center = flags & 1 ? 1 : 0;
+
+		debugC(5, kDebugLoading, "FilmLoopCastMember::FilmLoopCastMember(): flags: %d, unk1: %d, looping: %d, enableSound: %d, crop: %d, center: %d", flags, unk1, _looping, _enableSound, _crop, _center);
 	}
 }
 
@@ -284,12 +275,7 @@ void FilmLoopCastMember::writeCastData(Common::SeekableWriteStream *writeStream)
 	Movie::writeRect(writeStream, _initialRect);
 
 	uint32 flags = 0;
-	if (_cast->_version >= kFileVer400 && _cast->_version < kFileVer500) {
-		flags |= (_looping) ? 0 : 64;
-		flags |= (_enableSound) ? 8 : 0;
-		flags |= (_crop) ? 0 : 2;
-		flags |= (_center) ? 1 : 0;
-	} else if (_cast->_version >= kFileVer500 && _cast->_version < kFileVer600) {
+	if (_cast->_version >= kFileVer400) {
 		flags |= (_looping) ? 0 : 32;
 		flags |= (_enableSound) ? 8 : 0;
 		flags |= (_crop) ? 0 : 2;


Commit: 2cdd5d38d40da87e986ee477fc354f3e584f6988
    https://github.com/scummvm/scummvm/commit/2cdd5d38d40da87e986ee477fc354f3e584f6988
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2026-04-16T01:33:10+02:00

Commit Message:
DIRECTOR: Properly process filmloop looping in score

We were using frame number and total number of frames from the
main movie, and not asking filmloop to stop on end of playback

Fixes shotgal.dir in guscarn, when animal targets were looping
continously

Changed paths:
    engines/director/score.cpp


diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 9398a5ceb48..2323958784f 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -932,11 +932,17 @@ void Score::incrementFilmLoops() {
 			if (!fl->_score->_scoreCache.empty()) {
 				// increment the film loop counter
 				if (fl->_looping) {
-					if (_curFrameNumber + 1 > getFramesNum())
+					if (fl->_score->_curFrameNumber + 1 > fl->_score->getFramesNum())
 						fl->_score->setCurrentFrame(1);
+
+					fl->_score->step();
+				} else {
+					if (fl->_score->_curFrameNumber < fl->_score->getFramesNum() - 1)
+						fl->_score->step();
+					else
+						fl->_score->stopPlay();
 				}
 
-				fl->_score->step();
 			} else {
 				warning("Score::updateFilmLoops(): invalid film loop in castId %s", it->_sprite->_castId.asString().c_str());
 			}




More information about the Scummvm-git-logs mailing list