mirror of
https://github.com/scummvm/scummvm.git
synced 2026-06-20 05:45:29 +00:00
DIRECTOR: remove puppet checks when setting sprite properties
In original engine it is possible to set non-puppted sprite properties like position, backcolor etc and then call updatestage to update the screen according to property. This is undocumented behaviour which is not present depicted in any books however with rigorous testing it is found to be true. This change only persist for the current frame and once the playback head is moving the change is lost. `ATD\HD\bdDREAMA.DXR` of 'totaldistortion' used some of this quirk to display moving bullets.
This commit is contained in:
1 parent
f9cb46132d
commit
bcd4a82075
1 file changed
+13
-19
@@ -538,23 +538,19 @@ void Channel::replaceSprite(Sprite *nextSprite) {
|
||||
}
|
||||
|
||||
void Channel::setWidth(int w) {
|
||||
if (_sprite->_puppet) {
|
||||
if (!(_sprite->_cast && _sprite->_cast->_type == kCastShape) && !_sprite->_stretch)
|
||||
return;
|
||||
_width = MAX<int>(w, 0);
|
||||
}
|
||||
if (!(_sprite->_cast && _sprite->_cast->_type == kCastShape) && !_sprite->_stretch)
|
||||
return;
|
||||
_width = MAX<int>(w, 0);
|
||||
}
|
||||
|
||||
void Channel::setHeight(int h) {
|
||||
if (_sprite->_puppet) {
|
||||
if (!(_sprite->_cast && _sprite->_cast->_type == kCastShape) && !_sprite->_stretch)
|
||||
return;
|
||||
_height = MAX<int>(h, 0);
|
||||
}
|
||||
if (!(_sprite->_cast && _sprite->_cast->_type == kCastShape) && !_sprite->_stretch)
|
||||
return;
|
||||
_height = MAX<int>(h, 0);
|
||||
}
|
||||
|
||||
void Channel::setBbox(int l, int t, int r, int b) {
|
||||
if (_sprite->_puppet || _sprite->_stretch) {
|
||||
if (_sprite->_stretch) {
|
||||
if (!(_sprite->_cast && _sprite->_cast->_type == kCastShape) && !_sprite->_stretch)
|
||||
return;
|
||||
_width = r - l;
|
||||
@@ -573,15 +569,13 @@ void Channel::setBbox(int l, int t, int r, int b) {
|
||||
}
|
||||
|
||||
void Channel::setPosition(int x, int y, bool force) {
|
||||
if (_sprite->_puppet || force) {
|
||||
Common::Point newPos(x, y);
|
||||
if (_constraint > 0 && _score && _constraint <= _score->_channels.size()) {
|
||||
Common::Rect constraintBbox = _score->_channels[_constraint]->getBbox();
|
||||
newPos.x = MIN(constraintBbox.right, MAX(constraintBbox.left, newPos.x));
|
||||
newPos.y = MIN(constraintBbox.bottom, MAX(constraintBbox.top, newPos.y));
|
||||
}
|
||||
_currentPoint = newPos;
|
||||
Common::Point newPos(x, y);
|
||||
if (_constraint > 0 && _score && _constraint <= _score->_channels.size()) {
|
||||
Common::Rect constraintBbox = _score->_channels[_constraint]->getBbox();
|
||||
newPos.x = MIN(constraintBbox.right, MAX(constraintBbox.left, newPos.x));
|
||||
newPos.y = MIN(constraintBbox.bottom, MAX(constraintBbox.top, newPos.y));
|
||||
}
|
||||
_currentPoint = newPos;
|
||||
}
|
||||
|
||||
// here is the place for deciding whether the widget can be keep or not
|
||||
|
||||
Reference in new issue
Block a user