[Scummvm-git-logs] scummvm master -> ad540208440593889b8ababe4286b8813b7a8c9a
npjg
nathanael.gentrydb8 at gmail.com
Mon Jul 13 22:05:10 UTC 2020
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:
ad54020844 DIRECTOR: Don't set sprite dirty when unmodified
Commit: ad540208440593889b8ababe4286b8813b7a8c9a
https://github.com/scummvm/scummvm/commit/ad540208440593889b8ababe4286b8813b7a8c9a
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-07-13T18:04:49-04:00
Commit Message:
DIRECTOR: Don't set sprite dirty when unmodified
This is useful for games like Chop Suey, that implement their own cursor
management. We don't want to be undrawing and redrawing the cursor every time
updateStage is called, only when the cursor is actually moved.
Changed paths:
engines/director/lingo/lingo-the.cpp
diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp
index aea7f27050..da3cbf3c9f 100644
--- a/engines/director/lingo/lingo-the.cpp
+++ b/engines/director/lingo/lingo-the.cpp
@@ -1182,6 +1182,7 @@ void Lingo::setTheSprite(Datum &id1, int field, Datum &d) {
if (!sprite->_enabled)
sprite->_enabled = true;
+ channel->_dirty = true;
switch (field) {
case kTheBackColor:
sprite->_backColor = d.asInt();
@@ -1241,7 +1242,11 @@ void Lingo::setTheSprite(Datum &id1, int field, Datum &d) {
sprite->_moveable = true;
}
- channel->addDelta(Common::Point(d.asInt() - channel->_currentPoint.x, 0));
+ if (d.asInt() != channel->_currentPoint.x) {
+ channel->addDelta(Common::Point(d.asInt() - channel->_currentPoint.x, 0));
+ } else {
+ channel->_dirty = false;
+ }
break;
case kTheLocV:
if (!sprite->_moveable) {
@@ -1250,7 +1255,11 @@ void Lingo::setTheSprite(Datum &id1, int field, Datum &d) {
sprite->_moveable = true;
}
- channel->addDelta(Common::Point(0, d.asInt() - channel->_currentPoint.y));
+ if (d.asInt() != channel->_currentPoint.y) {
+ channel->addDelta(Common::Point(0, d.asInt() - channel->_currentPoint.y));
+ } else {
+ channel->_dirty = false;
+ }
break;
case kTheMoveableSprite:
sprite->_moveable = d.asInt();
@@ -1307,7 +1316,6 @@ void Lingo::setTheSprite(Datum &id1, int field, Datum &d) {
default:
warning("Lingo::setTheSprite(): Unprocessed setting field \"%s\" of sprite", field2str(field));
}
- channel->_dirty = true;
}
Datum Lingo::getTheCast(Datum &id1, int field) {
More information about the Scummvm-git-logs
mailing list