[Scummvm-git-logs] scummvm master -> ae1af9c06ad0ce4be06c2afd096e530a88ad3294
npjg
nathanael.gentrydb8 at gmail.com
Wed Jul 22 03:15:27 UTC 2020
This automated email contains information about 4 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
697fae20db DIRECTOR: Keep track of failed matte creation
405f0bf1b9 DIRECTOR: Don't unnecessarily redraw puppets
c294d73955 DIRECTOR: Make sure dirty rects are valid
ae1af9c06a DIRECTOR: Fix matte intersection check
Commit: 697fae20db5080c14dc323791832a9808ae5f8e8
https://github.com/scummvm/scummvm/commit/697fae20db5080c14dc323791832a9808ae5f8e8
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-07-21T23:12:53-04:00
Commit Message:
DIRECTOR: Keep track of failed matte creation
This dramatically cuts down the number of matte warnings in Majestic.
Changed paths:
engines/director/castmember.cpp
engines/director/castmember.h
diff --git a/engines/director/castmember.cpp b/engines/director/castmember.cpp
index 96f1801536..bbee697bbb 100644
--- a/engines/director/castmember.cpp
+++ b/engines/director/castmember.cpp
@@ -54,6 +54,7 @@ BitmapCastMember::BitmapCastMember(Cast *cast, uint16 castId, Common::SeekableRe
_type = kCastBitmap;
_img = nullptr;
_matte = nullptr;
+ _noMatte = false;
_bytes = 0;
_pitch = 0;
_flags1 = 0;
@@ -204,6 +205,7 @@ void BitmapCastMember::createMatte() {
if (whiteColor == -1) {
debugC(1, kDebugImages, "BitmapCastMember::createMatte(): No white color for matte image");
+ _noMatte = true;
} else {
delete _matte;
@@ -220,6 +222,7 @@ void BitmapCastMember::createMatte() {
}
_matte->fillMask();
+ _noMatte = false;
}
tmp.free();
@@ -227,7 +230,7 @@ void BitmapCastMember::createMatte() {
Graphics::Surface *BitmapCastMember::getMatte() {
// Lazy loading of mattes
- if (!_matte) {
+ if (!_matte && !_noMatte) {
createMatte();
}
diff --git a/engines/director/castmember.h b/engines/director/castmember.h
index 153ae2110b..725cd9763f 100644
--- a/engines/director/castmember.h
+++ b/engines/director/castmember.h
@@ -110,6 +110,7 @@ public:
uint16 _bitsPerPixel;
uint32 _tag;
+ bool _noMatte;
};
class DigitalVideoCastMember : public CastMember {
Commit: 405f0bf1b974acc7bce744875797a050ef46ddce
https://github.com/scummvm/scummvm/commit/405f0bf1b974acc7bce744875797a050ef46ddce
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-07-21T23:12:53-04:00
Commit Message:
DIRECTOR: Don't unnecessarily redraw puppets
Changed paths:
engines/director/channel.cpp
diff --git a/engines/director/channel.cpp b/engines/director/channel.cpp
index 9289e5191c..e934710cd0 100644
--- a/engines/director/channel.cpp
+++ b/engines/director/channel.cpp
@@ -115,11 +115,13 @@ bool Channel::isDirty(Sprite *nextSprite) {
bool isDirty = _dirty ||
_delta != Common::Point(0, 0) ||
- _sprite->_castId != nextSprite->_castId ||
- _sprite->_ink != nextSprite->_ink ||
(_sprite->_cast && _sprite->_cast->isModified());
if (!_sprite->_puppet) {
+ // When puppet is set, the overall dirty flag should be set when sprite is
+ // modified.
+ isDirty |= _sprite->_castId != nextSprite->_castId ||
+ _sprite->_ink != nextSprite->_ink;
if (!_sprite->_moveable)
isDirty |= _currentPoint != nextSprite->_startPoint;
if (!_sprite->_stretch)
Commit: c294d739558a74996fabfd063a5ec42d9acf1e1f
https://github.com/scummvm/scummvm/commit/c294d739558a74996fabfd063a5ec42d9acf1e1f
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-07-21T23:12:54-04:00
Commit Message:
DIRECTOR: Make sure dirty rects are valid
This prevents a crash in the Stretch scene of The Apartment's More Puppets movie.
Changed paths:
engines/director/stage.cpp
diff --git a/engines/director/stage.cpp b/engines/director/stage.cpp
index 5ad4de606b..885cbf2fb3 100644
--- a/engines/director/stage.cpp
+++ b/engines/director/stage.cpp
@@ -126,6 +126,9 @@ void Stage::reset() {
}
void Stage::addDirtyRect(const Common::Rect &r) {
+ if (!r.isValidRect())
+ return;
+
Common::Rect bounds = r;
bounds.clip(Common::Rect(_innerDims.width(), _innerDims.height()));
Commit: ae1af9c06ad0ce4be06c2afd096e530a88ad3294
https://github.com/scummvm/scummvm/commit/ae1af9c06ad0ce4be06c2afd096e530a88ad3294
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-07-21T23:12:54-04:00
Commit Message:
DIRECTOR: Fix matte intersection check
Actually, it's not applied indiscriminately. It only take effect when there is
already a matte ink on the given sprite.
Changed paths:
engines/director/channel.cpp
engines/director/channel.h
engines/director/events.cpp
engines/director/score.cpp
engines/director/score.h
diff --git a/engines/director/channel.cpp b/engines/director/channel.cpp
index e934710cd0..4e1cf89171 100644
--- a/engines/director/channel.cpp
+++ b/engines/director/channel.cpp
@@ -150,13 +150,13 @@ bool Channel::isActiveText() {
return false;
}
-bool Channel::isMouseIn(const Common::Point &pos, bool onlyMatte) {
+bool Channel::isMouseIn(const Common::Point &pos) {
Common::Rect bbox = getBbox();
if (!bbox.contains(pos))
return false;
- if (onlyMatte) {
+ if (_sprite->_ink == kInkTypeMatte) {
if (_sprite->_cast && _sprite->_cast->_type == kCastBitmap) {
Graphics::Surface *matte = ((BitmapCastMember *)_sprite->_cast)->getMatte();
return matte ? !(*(byte *)(matte->getBasePtr(pos.x - bbox.left, pos.y - bbox.top))) : true;
diff --git a/engines/director/channel.h b/engines/director/channel.h
index 33e6a75bb0..5a72522c7d 100644
--- a/engines/director/channel.h
+++ b/engines/director/channel.h
@@ -45,7 +45,7 @@ public:
bool isDirty(Sprite *nextSprite = nullptr);
bool isEmpty();
bool isActiveText();
- bool isMouseIn(const Common::Point &pos, bool onlyMatte);
+ bool isMouseIn(const Common::Point &pos);
void setWidth(int w);
void setHeight(int h);
diff --git a/engines/director/events.cpp b/engines/director/events.cpp
index 7d8fedbc2e..c19e526b72 100644
--- a/engines/director/events.cpp
+++ b/engines/director/events.cpp
@@ -87,7 +87,7 @@ void DirectorEngine::processEvents(bool bufferLingoEvents) {
m->_lastEventTime = g_director->getMacTicks();
m->_lastRollTime = m->_lastEventTime;
- sc->renderCursor(sc->getSpriteIDFromPos(pos, false, true));
+ sc->renderCursor(sc->getSpriteIDFromPos(pos));
if (_currentDraggedChannel) {
if (_currentDraggedChannel->_sprite->_moveable) {
diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index b30cfb029a..d0117770ac 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -488,11 +488,11 @@ void Score::screenShot() {
newSurface->free();
}
-uint16 Score::getSpriteIDFromPos(Common::Point pos, bool firstActive, bool onlyMatte) {
+uint16 Score::getSpriteIDFromPos(Common::Point pos, bool firstActive) {
int unfocusableSprite = 0;
for (int i = _channels.size() - 1; i >= 0; i--)
- if (_channels[i]->isMouseIn(pos, onlyMatte)) {
+ if (_channels[i]->isMouseIn(pos)) {
if (!firstActive || _channels[i]->_sprite->isFocusable())
return i;
else if (unfocusableSprite == 0)
diff --git a/engines/director/score.h b/engines/director/score.h
index 40b26c7476..050651d1d5 100644
--- a/engines/director/score.h
+++ b/engines/director/score.h
@@ -90,7 +90,7 @@ public:
int getCurrentLabelNumber();
int getNextLabelNumber(int referenceFrame);
- uint16 getSpriteIDFromPos(Common::Point pos, bool firstActive = false, bool onlyMatte = false);
+ uint16 getSpriteIDFromPos(Common::Point pos, bool firstActive = false);
bool checkSpriteIntersection(uint16 spriteId, Common::Point pos);
Common::List<Channel *> getSpriteIntersections(const Common::Rect &r);
More information about the Scummvm-git-logs
mailing list