DIRECTOR: don't clear bbox when render trailed channel.

This commit is contained in:
ysj1173886760 2021-08-12 17:02:39 +08:00
parent 2dcf31f18c
commit 15c0c68b1c
3 changed files with 18 additions and 3 deletions

View File

@ -556,6 +556,10 @@ bool Channel::updateWidget() {
return false;
}
bool Channel::isTrail() {
return _sprite->_trails;
}
void Channel::addRegistrationOffset(Common::Point &pos, bool subtract) {
if (!_sprite->_cast)
return;

View File

@ -66,6 +66,8 @@ public:
bool updateWidget();
void updateTextCast();
bool isTrail();
void updateGlobalAttr();
void addDelta(Common::Point pos);

View File

@ -39,7 +39,6 @@
#include "director/sound.h"
#include "director/sprite.h"
#include "director/util.h"
#include "director/sound.h"
namespace Director {
@ -139,9 +138,19 @@ bool Window::render(bool forceRedraw, Graphics::ManagedSurface *blitTo) {
for (Common::List<Common::Rect>::iterator i = _dirtyRects.begin(); i != _dirtyRects.end(); i++) {
const Common::Rect &r = *i;
blitTo->fillRect(r, _stageColor);
_dirtyChannels = _currentMovie->getScore()->getSpriteIntersections(r);
bool shouldClear = true;
for (Common::List<Channel *>::iterator j = _dirtyChannels.begin(); j != _dirtyChannels.end(); j++) {
if ((*j)->_visible && r == (*j)->getBbox() && (*j)->isTrail()) {
shouldClear = false;
break;
}
}
if (shouldClear)
blitTo->fillRect(r, _stageColor);
for (int pass = 0; pass < 2; pass++) {
for (Common::List<Channel *>::iterator j = _dirtyChannels.begin(); j != _dirtyChannels.end(); j++) {
if ((*j)->isActiveVideo() && (*j)->isVideoDirectToStage()) {