[Scummvm-git-logs] scummvm master -> 0053167dcbe370dfac2a37a20c33045de63618fb
sev-
noreply at scummvm.org
Wed Apr 22 08:47:58 UTC 2026
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .
Summary:
8b858b37a2 DIRECTOR: DT: Fix crash in getTextID due to incorrect MacText cast
fa78114c02 DIRECTOR: Filmloop uses scoreCache instead of _score->_channels
0053167dcb DIRECTOR: Fix filmloop castLib=-1 sprite lookup and frame advancement
Commit: 8b858b37a2360d6695e54ab4dd9a88c43bc3fe67
https://github.com/scummvm/scummvm/commit/8b858b37a2360d6695e54ab4dd9a88c43bc3fe67
Author: ramyak-sharma (ramyaksharma1 at gmail.com)
Date: 2026-04-22T10:47:53+02:00
Commit Message:
DIRECTOR: DT: Fix crash in getTextID due to incorrect MacText cast
Fix crash when opening cast window in the ImGui debugger.
getTextID() was incorrectly casting the MacWidget* returned by
createWidget() to Graphics::MacText* and calling getRawSurface(),
which is invalid when the widget is not a MacText.
Fixed by using MacWidget::getSurface() directly and adding a null guard.
Fix crash on opening cast window in Mission to Palnet X. But should
generalise to other games as well.
Changed paths:
engines/director/debugger/debugtools.cpp
diff --git a/engines/director/debugger/debugtools.cpp b/engines/director/debugger/debugtools.cpp
index 6d3cd7eb807..a5f297dc42f 100644
--- a/engines/director/debugger/debugtools.cpp
+++ b/engines/director/debugger/debugtools.cpp
@@ -421,9 +421,13 @@ ImGuiImage getTextID(CastMember *castMember) {
// Make a temporary channel to blit the shape from
Channel *channel = new Channel(nullptr, sprite);
- Graphics::MacText *widget = (Graphics::MacText *)castMember->createWidget(bbox, channel, kTextSprite);
+ Graphics::MacWidget *widget = castMember->createWidget(bbox, channel, kTextSprite);
Graphics::Surface surface;
- surface.copyFrom(*widget->getRawSurface());
+
+ if (!widget || !widget->getSurface() || !widget->getSurface()->getPixels())
+ return {};
+
+ surface.copyFrom(*widget->getSurface());
if (debugChannelSet(8, kDebugImages)) {
Common::String prepend = "text";
Commit: fa78114c02d49dd29b0dd8bf3fabfc9927e0b3b7
https://github.com/scummvm/scummvm/commit/fa78114c02d49dd29b0dd8bf3fabfc9927e0b3b7
Author: ramyak-sharma (ramyaksharma1 at gmail.com)
Date: 2026-04-22T10:47:53+02:00
Commit Message:
DIRECTOR: Filmloop uses scoreCache instead of _score->_channels
getSubChannels() was reading sprites from _score->_channels instead
of the pre-loaded frame data in _scoreCache. The _channels sprites
had null _cast pointers because they hadn't been activated through
the normal channel update pipeline.
Part of fixing filmloop animation in Mission to Planet X.
Changed paths:
engines/director/castmember/filmloop.cpp
diff --git a/engines/director/castmember/filmloop.cpp b/engines/director/castmember/filmloop.cpp
index cc4133c68f4..ca0e1754102 100644
--- a/engines/director/castmember/filmloop.cpp
+++ b/engines/director/castmember/filmloop.cpp
@@ -109,8 +109,8 @@ Common::Array<Channel> *FilmLoopCastMember::getSubChannels(Common::Rect &bbox, u
// get the list of sprite IDs for this frame
Common::Array<int> spriteIds;
- for (uint i = 0; i < _score->_channels.size(); ++i) {
- if (_score->_channels[i]->_sprite && !_score->_channels[i]->_sprite->_castId.isNull())
+ for (uint i = 0; i < _score->_scoreCache[frame]->_sprites.size(); ++i) {
+ if (_score->_scoreCache[frame]->_sprites[i] && !_score->_scoreCache[frame]->_sprites[i]->_castId.isNull())
spriteIds.push_back(i);
}
@@ -134,7 +134,7 @@ Common::Array<Channel> *FilmLoopCastMember::getSubChannels(Common::Rect &bbox, u
// copy the sprites in order to the list
for (auto &iter : spriteIds) {
- Sprite src = *_score->_channels[iter]->_sprite;
+ Sprite src = *_score->_scoreCache[frame]->_sprites[iter];
if (src._castId.isNull())
continue;
Commit: 0053167dcbe370dfac2a37a20c33045de63618fb
https://github.com/scummvm/scummvm/commit/0053167dcbe370dfac2a37a20c33045de63618fb
Author: ramyak-sharma (ramyaksharma1 at gmail.com)
Date: 2026-04-22T10:47:53+02:00
Commit Message:
DIRECTOR: Fix filmloop castLib=-1 sprite lookup and frame advancement
Sprites stored in the filmloop scoreCache have castLib=-1, meaning
they reference the enclosing movie's cast library. Resolve them
against the filmloop's own _cast pointer, which is that library.
incrementFilmLoops() was calling score->step() which is gated by
_nextFrameTime and has unsafe side effects (accessing the game's
movie stack, resetting video playback). Replace with a direct
_filmLoopFrame increment instead.
Fixes walking animation in Mission to Planet X.
Changed paths:
engines/director/castmember/filmloop.cpp
engines/director/score.cpp
diff --git a/engines/director/castmember/filmloop.cpp b/engines/director/castmember/filmloop.cpp
index ca0e1754102..1ca1764d6c3 100644
--- a/engines/director/castmember/filmloop.cpp
+++ b/engines/director/castmember/filmloop.cpp
@@ -138,6 +138,9 @@ Common::Array<Channel> *FilmLoopCastMember::getSubChannels(Common::Rect &bbox, u
if (src._castId.isNull())
continue;
+ if (src._cast == nullptr && _cast != nullptr)
+ src._cast = _cast->getCastMember(src._castId.member, true);
+
debugCN(5, kDebugImages, "FilmLoopCastMember::getSubChannels(): sprite: %d - cast: %s, orig: %d,%d %dx%d",
iter, src._castId.asString().c_str(),
src._startPoint.x, src._startPoint.y, src._width, src._height);
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 2323958784f..c23975d7126 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -930,21 +930,14 @@ void Score::incrementFilmLoops() {
if (it->_sprite->_cast && (it->_sprite->_cast->_type == kCastFilmLoop || it->_sprite->_cast->_type == kCastMovie)) {
FilmLoopCastMember *fl = ((FilmLoopCastMember *)it->_sprite->_cast);
if (!fl->_score->_scoreCache.empty()) {
- // increment the film loop counter
if (fl->_looping) {
- 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();
+ it->_filmLoopFrame += 1;
+ it->_filmLoopFrame %= fl->_score->_scoreCache.size();
+ } else if (it->_filmLoopFrame < (fl->_score->_scoreCache.size() - 1)) {
+ it->_filmLoopFrame += 1;
}
-
} else {
- warning("Score::updateFilmLoops(): invalid film loop in castId %s", it->_sprite->_castId.asString().c_str());
+ warning("Score::incrementFilmLoops(): invalid film loop in castId %s", it->_sprite->_castId.asString().c_str());
}
}
}
More information about the Scummvm-git-logs
mailing list