[Scummvm-git-logs] scummvm master -> e8d9dfe62b5cf75cea63ac67059a159f89de4380

sev- sev at scummvm.org
Sun Aug 23 18:32: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:
e8d9dfe62b DIRECTOR: Proper implementation of 'directToStage'


Commit: e8d9dfe62b5cf75cea63ac67059a159f89de4380
    https://github.com/scummvm/scummvm/commit/e8d9dfe62b5cf75cea63ac67059a159f89de4380
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-08-23T20:31:48+02:00

Commit Message:
DIRECTOR: Proper implementation of 'directToStage'

Changed paths:
    engines/director/score.cpp
    engines/director/window.cpp


diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index 8ccfdf3161..f000849ccc 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -487,40 +487,30 @@ void Score::renderSprites(uint16 frameId, RenderMode mode) {
 
 	_movie->_videoPlayback = false;
 
-	for (int pass = 0; pass < 2; pass++) {
-		for (uint16 i = 0; i < _channels.size(); i++) {
-			Channel *channel = _channels[i];
-			Sprite *currentSprite = channel->_sprite;
-			Sprite *nextSprite = _frames[frameId]->_sprites[i];
-
-			if (channel->isActiveVideo() && channel->isVideoDirectToStage()) {
-				if (pass == 0)
-					continue;
-			} else {
-				if (pass == 1)
-					continue;
-			}
+	for (uint16 i = 0; i < _channels.size(); i++) {
+		Channel *channel = _channels[i];
+		Sprite *currentSprite = channel->_sprite;
+		Sprite *nextSprite = _frames[frameId]->_sprites[i];
 
-			// widget content has changed and needs a redraw.
-			// this doesn't include changes in dimension or position!
-			bool widgetRedrawn = channel->updateWidget();
+		// widget content has changed and needs a redraw.
+		// this doesn't include changes in dimension or position!
+		bool widgetRedrawn = channel->updateWidget();
 
-			if (channel->isActiveText())
-				_movie->_currentEditableTextChannel = i;
+		if (channel->isActiveText())
+			_movie->_currentEditableTextChannel = i;
 
-			if (channel->isActiveVideo())
-				_movie->_videoPlayback = true;
+		if (channel->isActiveVideo())
+			_movie->_videoPlayback = true;
 
-			if (channel->isDirty(nextSprite) || channel->isActiveVideo() || widgetRedrawn || mode == kRenderForceUpdate) {
-				if (!currentSprite->_trails)
-					_window->addDirtyRect(channel->getBbox());
-
-				channel->setClean(nextSprite, i);
+		if (channel->isDirty(nextSprite) || channel->isActiveVideo() || widgetRedrawn || mode == kRenderForceUpdate) {
+			if (!currentSprite->_trails)
 				_window->addDirtyRect(channel->getBbox());
-				debugC(2, kDebugImages, "Score::renderSprites(): CH: %-3d castId: %03d(%s) [ink: %d, puppet: %d, moveable: %d, visible: %d] [bbox: %d,%d,%d,%d] [type: %d fg: %d bg: %d] [script: %d]", i, currentSprite->_castId, numToCastNum(currentSprite->_castId), currentSprite->_ink, currentSprite->_puppet, currentSprite->_moveable, channel->_visible, PRINT_RECT(channel->getBbox()), currentSprite->_spriteType, currentSprite->_foreColor, currentSprite->_backColor, currentSprite->_scriptId);
-			} else {
-				channel->setClean(nextSprite, i, true);
-			}
+
+			channel->setClean(nextSprite, i);
+			_window->addDirtyRect(channel->getBbox());
+			debugC(2, kDebugImages, "Score::renderSprites(): CH: %-3d castId: %03d(%s) [ink: %d, puppet: %d, moveable: %d, visible: %d] [bbox: %d,%d,%d,%d] [type: %d fg: %d bg: %d] [script: %d]", i, currentSprite->_castId, numToCastNum(currentSprite->_castId), currentSprite->_ink, currentSprite->_puppet, currentSprite->_moveable, channel->_visible, PRINT_RECT(channel->getBbox()), currentSprite->_spriteType, currentSprite->_foreColor, currentSprite->_backColor, currentSprite->_scriptId);
+		} else {
+			channel->setClean(nextSprite, i, true);
 		}
 	}
 }
diff --git a/engines/director/window.cpp b/engines/director/window.cpp
index b4fb77e70d..4cab35bc74 100644
--- a/engines/director/window.cpp
+++ b/engines/director/window.cpp
@@ -119,9 +119,19 @@ bool Window::render(bool forceRedraw, Graphics::ManagedSurface *blitTo) {
 		blitTo->fillRect(r, _stageColor);
 
 		_dirtyChannels = _currentMovie->getScore()->getSpriteIntersections(r);
-		for (Common::List<Channel *>::iterator j = _dirtyChannels.begin(); j != _dirtyChannels.end(); j++) {
-			if ((*j)->_visible)
-				inkBlitFrom(*j, r, blitTo);
+		for (int pass = 0; pass < 2; pass++) {
+			for (Common::List<Channel *>::iterator j = _dirtyChannels.begin(); j != _dirtyChannels.end(); j++) {
+				if ((*j)->isActiveVideo() && (*j)->isVideoDirectToStage()) {
+					if (pass == 0)
+						continue;
+				} else {
+					if (pass == 1)
+						continue;
+				}
+
+				if ((*j)->_visible)
+					inkBlitFrom(*j, r, blitTo);
+			}
 		}
 	}
 




More information about the Scummvm-git-logs mailing list