[Scummvm-git-logs] scummvm master -> 3c980c2e3e5ad25f07c43bc51f9a9553216bc82e
npjg
nathanael.gentrydb8 at gmail.com
Fri Jul 31 14:00:09 UTC 2020
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:
31e9d948e3 DIRECTOR: Fix stageColor rendering
3c980c2e3e DIRECTOR: Fix puppetSprite workaround condition
Commit: 31e9d948e3a3e14dffe3cf65f4067f67dc08c293
https://github.com/scummvm/scummvm/commit/31e9d948e3a3e14dffe3cf65f4067f67dc08c293
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-07-31T09:59:53-04:00
Commit Message:
DIRECTOR: Fix stageColor rendering
Now, when the stageColor is changed, the whole screen is marked dirty and it is
updated on the next call to Score::update, regardless of the next frame time.
Changed paths:
engines/director/lingo/lingo-the.cpp
engines/director/stage.cpp
engines/director/stage.h
diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp
index 8cb82bde4e..87cd8847c3 100644
--- a/engines/director/lingo/lingo-the.cpp
+++ b/engines/director/lingo/lingo-the.cpp
@@ -981,6 +981,10 @@ void Lingo::setTheEntity(int entity, Datum &id, int field, Datum &d) {
break;
case kTheStageColor:
g_director->getCurrentStage()->setStageColor(d.asInt());
+
+ // Queue an immediate update of the stage
+ if (! _vm->getCurrentMovie()->getScore()->getNextFrame())
+ _vm->getCurrentMovie()->getScore()->setCurrentFrame( _vm->getCurrentMovie()->getScore()->getCurrentFrame());
break;
case kTheSwitchColorDepth:
setTheEntitySTUB(kTheSwitchColorDepth);
diff --git a/engines/director/stage.cpp b/engines/director/stage.cpp
index 75d4c536d1..31348167f7 100644
--- a/engines/director/stage.cpp
+++ b/engines/director/stage.cpp
@@ -85,8 +85,7 @@ bool Stage::render(bool forceRedraw, Graphics::ManagedSurface *blitTo) {
if (forceRedraw) {
blitTo->clear(_stageColor);
- _dirtyRects.clear();
- _dirtyRects.push_back(Common::Rect(_composeSurface->w, _composeSurface->h));
+ markAllDirty();
} else {
if (_dirtyRects.size() == 0)
return false;
@@ -118,6 +117,7 @@ void Stage::setStageColor(uint stageColor) {
if (stageColor != _stageColor) {
_stageColor = stageColor;
reset();
+ markAllDirty();
}
}
@@ -137,6 +137,11 @@ void Stage::addDirtyRect(const Common::Rect &r) {
_dirtyRects.push_back(bounds);
}
+void Stage::markAllDirty() {
+ _dirtyRects.clear();
+ _dirtyRects.push_back(Common::Rect(_composeSurface->w, _composeSurface->h));
+}
+
void Stage::mergeDirtyRects() {
Common::List<Common::Rect>::iterator rOuter, rInner;
diff --git a/engines/director/stage.h b/engines/director/stage.h
index 5e42c3afec..8a434d688b 100644
--- a/engines/director/stage.h
+++ b/engines/director/stage.h
@@ -92,11 +92,14 @@ class Stage : public Graphics::MacWindow, public Object<Stage> {
~Stage();
bool render(bool forceRedraw = false, Graphics::ManagedSurface *blitTo = nullptr);
- bool needsAppliedColor(DirectorPlotData *pd);
-
void invertChannel(Channel *channel);
+
+ bool needsAppliedColor(DirectorPlotData *pd);
void setStageColor(uint stageColor);
+ int getStageColor() { return _stageColor; }
+
void addDirtyRect(const Common::Rect &r);
+ void markAllDirty();
void mergeDirtyRects();
void reset();
Commit: 3c980c2e3e5ad25f07c43bc51f9a9553216bc82e
https://github.com/scummvm/scummvm/commit/3c980c2e3e5ad25f07c43bc51f9a9553216bc82e
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-07-31T09:59:53-04:00
Commit Message:
DIRECTOR: Fix puppetSprite workaround condition
Only replace the sprite early if the sprite is not already a puppet. This fixes
a strange crash when clicking the storybook in Chop Suey.
Changed paths:
engines/director/lingo/lingo-builtins.cpp
diff --git a/engines/director/lingo/lingo-builtins.cpp b/engines/director/lingo/lingo-builtins.cpp
index 8dc485f908..498c4fed60 100644
--- a/engines/director/lingo/lingo-builtins.cpp
+++ b/engines/director/lingo/lingo-builtins.cpp
@@ -1811,8 +1811,10 @@ void LB::b_puppetSprite(int nargs) {
if (nargs == 2) {
Datum state = g_lingo->pop();
Datum sprite = g_lingo->pop();
+
+ Sprite *sp = sc->getSpriteById(sprite.asInt());
if ((uint)sprite.asInt() < sc->_channels.size()) {
- if (sc->getNextFrame()) {
+ if (sc->getNextFrame() && !sp->_puppet) {
// 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());
@@ -1821,7 +1823,7 @@ void LB::b_puppetSprite(int nargs) {
channel->_dirty = true;
}
- sc->getSpriteById(sprite.asInt())->_puppet = state.asInt();
+ sp->_puppet = state.asInt();
} else {
warning("b_puppetSprite: sprite index out of bounds");
}
More information about the Scummvm-git-logs
mailing list