DIRECTOR: combine renderVideo and updateWidgets.

This commit is contained in:
ysj1173886760 2021-08-20 20:59:48 +08:00
parent d69144fa18
commit ecce34593e
3 changed files with 5 additions and 20 deletions

View File

@ -2291,10 +2291,7 @@ void LB::b_updateStage(int nargs) {
Score *score = movie->getScore();
score->updateWidget();
if (movie->_videoPlayback)
score->renderVideo();
score->updateWidgets(movie->_videoPlayback);
movie->getWindow()->render();
// play any puppet sounds that have been queued

View File

@ -335,7 +335,7 @@ void Score::update() {
if (keepWaiting) {
if (_movie->_videoPlayback) {
renderVideo();
updateWidgets(true);
_window->render();
}
return;
@ -619,22 +619,11 @@ void Score::renderCursor(Common::Point pos, bool forceUpdate) {
_currentCursor = _defaultCursor.getRef();
}
void Score::renderVideo() {
void Score::updateWidgets(bool hasVideoPlayback) {
for (uint16 i = 0; i < _channels.size(); i++) {
Channel *channel = _channels[i];
CastMember *cast = channel->_sprite->_cast;
if (cast && cast->_type == kCastDigitalVideo && cast->isModified()) {
channel->replaceWidget();
_window->addDirtyRect(channel->getBbox());
}
}
}
void Score::updateWidget() {
for (uint16 i = 0; i < _channels.size(); i++) {
Channel *channel = _channels[i];
CastMember *cast = channel->_sprite->_cast;
if (cast && cast->_type != kCastDigitalVideo && cast->isModified()) {
if (cast && (cast->_type != kCastDigitalVideo || hasVideoPlayback) && cast->isModified()) {
channel->replaceWidget();
_window->addDirtyRect(channel->getBbox());
}

View File

@ -113,8 +113,7 @@ public:
void renderFrame(uint16 frameId, RenderMode mode = kRenderModeNormal);
void renderSprites(uint16 frameId, RenderMode mode = kRenderModeNormal);
void renderCursor(Common::Point pos, bool forceUpdate = false);
void renderVideo();
void updateWidget();
void updateWidgets(bool hasVideoPlayback);
void playSoundChannel(uint16 frameId);