[Scummvm-git-logs] scummvm master -> adb725c223459d77099d22e5f29782eee30d4949
npjg
nathanael.gentrydb8 at gmail.com
Wed Jul 29 16:54:45 UTC 2020
This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
0da17f9ae1 DIRECTOR: Don't delay score update on goto
929cb91970 DIRECTOR: Split out Channel::setClean
adb725c223 DIRECTOR: Update frame before enabling puppet
Commit: 0da17f9ae1d1752be7d085f838d7b9c5e12ba9db
https://github.com/scummvm/scummvm/commit/0da17f9ae1d1752be7d085f838d7b9c5e12ba9db
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-07-29T12:53:53-04:00
Commit Message:
DIRECTOR: Don't delay score update on goto
Don't wait until the nextFrameTime. With this change, we are closer to original
behaviour.
Changed paths:
engines/director/score.cpp
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index b6f8d4ab1e..2bb2a29137 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -297,9 +297,8 @@ void Score::update() {
_activeFade = 0;
}
- if (g_system->getMillis() < _nextFrameTime && !debugChannelSet(-1, kDebugFast)) {
+ if (g_system->getMillis() < _nextFrameTime && !debugChannelSet(-1, kDebugFast) && !_nextFrame)
return;
- }
// For previous frame
if (_currentFrame > 0 && !_vm->_playbackPaused) {
Commit: 929cb91970b652049d172a09bc1476c8a45097ea
https://github.com/scummvm/scummvm/commit/929cb91970b652049d172a09bc1476c8a45097ea
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-07-29T12:54:42-04:00
Commit Message:
DIRECTOR: Split out Channel::setClean
Changed paths:
engines/director/channel.cpp
engines/director/channel.h
diff --git a/engines/director/channel.cpp b/engines/director/channel.cpp
index 7b5dfec58c..a275df316e 100644
--- a/engines/director/channel.cpp
+++ b/engines/director/channel.cpp
@@ -257,7 +257,6 @@ void Channel::setClean(Sprite *nextSprite, int spriteId, bool partial) {
if (!nextSprite)
return;
- bool newSprite = (_sprite->_spriteType == kInactiveSprite && nextSprite->_spriteType != kInactiveSprite);
bool replace = isDirty(nextSprite);
if (nextSprite) {
@@ -265,17 +264,7 @@ void Channel::setClean(Sprite *nextSprite, int spriteId, bool partial) {
// Updating scripts, etc. does not require a full re-render
_sprite->_scriptId = nextSprite->_scriptId;
} else {
- _sprite = nextSprite;
-
- // Sprites marked moveable are constrained to the same bounding box until
- // the moveable is disabled
- if (!_sprite->_moveable || newSprite)
- _currentPoint = _sprite->_startPoint;
-
- if (!_sprite->_stretch) {
- _width = _sprite->_width;
- _height = _sprite->_height;
- }
+ replaceSprite(nextSprite);
}
_currentPoint += _delta;
@@ -289,6 +278,25 @@ void Channel::setClean(Sprite *nextSprite, int spriteId, bool partial) {
_dirty = false;
}
+void Channel::replaceSprite(Sprite *nextSprite) {
+ if (!nextSprite)
+ return;
+
+ bool newSprite = (_sprite->_spriteType == kInactiveSprite && nextSprite->_spriteType != kInactiveSprite);
+ _sprite = nextSprite;
+
+ // Sprites marked moveable are constrained to the same bounding box until
+ // the moveable is disabled
+ if (!_sprite->_moveable || newSprite) {
+ _currentPoint = _sprite->_startPoint;
+
+ if (!_sprite->_stretch) {
+ _width = _sprite->_width;
+ _height = _sprite->_height;
+ }
+ }
+}
+
void Channel::setWidth(int w) {
if (_sprite->_puppet && _sprite->_stretch) {
_width = w;
diff --git a/engines/director/channel.h b/engines/director/channel.h
index 413006bd53..6f353061a8 100644
--- a/engines/director/channel.h
+++ b/engines/director/channel.h
@@ -56,6 +56,7 @@ public:
void setBbox(int l, int t, int r, int b);
void setCast(uint16 castId);
void setClean(Sprite *nextSprite, int spriteId, bool partial = false);
+ void replaceSprite(Sprite *nextSprite);
void replaceWidget();
bool updateWidget();
Commit: adb725c223459d77099d22e5f29782eee30d4949
https://github.com/scummvm/scummvm/commit/adb725c223459d77099d22e5f29782eee30d4949
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-07-29T12:54:42-04:00
Commit Message:
DIRECTOR: Update frame before enabling puppet
This is a workaround for Majestic's main menu, to get hovering over the text
options to show the proper highlighting. This just applies to the old
puppetSprite lingo syntax
Changed paths:
engines/director/lingo/lingo-builtins.cpp
engines/director/score.h
diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp
index 1a6ad4e5e7..8dc485f908 100644
--- a/engines/director/lingo/lingo-builtins.cpp
+++ b/engines/director/lingo/lingo-builtins.cpp
@@ -1812,6 +1812,15 @@ void LB::b_puppetSprite(int nargs) {
Datum state = g_lingo->pop();
Datum sprite = g_lingo->pop();
if ((uint)sprite.asInt() < sc->_channels.size()) {
+ if (sc->getNextFrame()) {
+ // WORKAROUND: If a frame update is queued, update the sprite to the
+ // sprite in new frame before setting puppet (Majestic).
+ Channel *channel = sc->getChannelById(sprite.asInt());
+
+ channel->replaceSprite(sc->_frames[sc->getNextFrame()]->_sprites[sprite.asInt()]);
+ channel->_dirty = true;
+ }
+
sc->getSpriteById(sprite.asInt())->_puppet = state.asInt();
} else {
warning("b_puppetSprite: sprite index out of bounds");
diff --git a/engines/director/score.h b/engines/director/score.h
index eb884ad496..a9cd771434 100644
--- a/engines/director/score.h
+++ b/engines/director/score.h
@@ -84,6 +84,8 @@ public:
void setCurrentFrame(uint16 frameId) { _nextFrame = frameId; }
uint16 getCurrentFrame() { return _currentFrame; }
+ int getNextFrame() { return _nextFrame; }
+
int getCurrentPalette();
int resolvePaletteId(int id);
More information about the Scummvm-git-logs
mailing list