[Scummvm-git-logs] scummvm master -> a7f16ffbe10ba45bdaa33f8fe14610e88915cdbe
sev-
sev at scummvm.org
Sun Jun 6 16:15:21 UTC 2021
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
a7f16ffbe1 DIRECTOR: allow setting of video casts to castNum
Commit: a7f16ffbe10ba45bdaa33f8fe14610e88915cdbe
https://github.com/scummvm/scummvm/commit/a7f16ffbe10ba45bdaa33f8fe14610e88915cdbe
Author: Roland van Laar (roland at rolandvanlaar.nl)
Date: 2021-06-06T18:15:18+02:00
Commit Message:
DIRECTOR: allow setting of video casts to castNum
The game Majestic dynamically sets the castNum to video casts and expects them to play directly.
Videos were also stopped erroneously. Video stoppage is assumed when
movieRate is 0. The comment als indicated that it was probably broken
for D4.
The corresponding lingo code is, where anim is a cast label.
set the castNum of sprite 48 to cast(anim)
updateStage()
set the movieRate of sprite 48 to 1
repeat while the movieRate of sprite 48
updateStage()
end repeat
Changed paths:
engines/director/channel.cpp
engines/director/lingo/lingo-the.cpp
engines/director/window.cpp
diff --git a/engines/director/channel.cpp b/engines/director/channel.cpp
index be97f6c61a..062d04f4d4 100644
--- a/engines/director/channel.cpp
+++ b/engines/director/channel.cpp
@@ -291,16 +291,6 @@ void Channel::setClean(Sprite *nextSprite, int spriteId, bool partial) {
}
}
- // If the previous sprite in this channel was a video, but the new sprite is different,
- // stop the playback.
- // TODO: In D4 *any* channels playing the same cast member across a frame change seems
- // to be enough to keep the same playback going, but the behaviour seems too glitchy
- // to be reliable? Hopefully nothing relies on this.
- if (_sprite && _sprite->_cast && _sprite->_cast->_type == kCastDigitalVideo &&
- _sprite->_castId != nextSprite->_castId) {
- ((DigitalVideoCastMember *)_sprite->_cast)->stopVideo(this);
- }
-
if (_sprite->_puppet || partial) {
// Updating scripts, etc. does not require a full re-render
_sprite->_scriptId = nextSprite->_scriptId;
diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp
index 7a63676237..a05e115270 100644
--- a/engines/director/lingo/lingo-the.cpp
+++ b/engines/director/lingo/lingo-the.cpp
@@ -1278,6 +1278,20 @@ void Lingo::setTheSprite(Datum &id1, int field, Datum &d) {
case kTheCastNum:
{
int castId = d.asCastId();
+ CastMember *castMember = g_director->getCurrentMovie()->getCastMember(castId);
+
+ if (castMember && castMember->_type == kCastDigitalVideo) {
+ Common::String path = castMember->getCast()->getVideoPath(castId);
+ if (!path.empty()) {
+ ((DigitalVideoCastMember *)castMember)->loadVideo(pathMakeRelative(path));
+ ((DigitalVideoCastMember *)castMember)->startVideo(channel);
+ // b_updateStage needs to have _videoPlayback set to render video
+ // in the regular case Score::renderSprites sets it.
+ // However Score::renderSprites is not in the current code path.
+ g_director->getCurrentMovie()->_videoPlayback = true;
+ }
+ }
+
if (castId != sprite->_castId) {
g_director->getCurrentWindow()->addDirtyRect(channel->getBbox());
channel->setCast(castId);
diff --git a/engines/director/window.cpp b/engines/director/window.cpp
index cd177dd366..0346657252 100644
--- a/engines/director/window.cpp
+++ b/engines/director/window.cpp
@@ -105,7 +105,7 @@ bool Window::render(bool forceRedraw, Graphics::ManagedSurface *blitTo) {
blitTo->clear(_stageColor);
markAllDirty();
} else {
- if (_dirtyRects.size() == 0)
+ if (_dirtyRects.size() == 0 && _currentMovie->_videoPlayback == false)
return false;
mergeDirtyRects();
More information about the Scummvm-git-logs
mailing list