[Scummvm-git-logs] scummvm master -> 4caea51387e0a389f15466d476da8fd6fb9449fe

npjg nathanael.gentrydb8 at gmail.com
Fri Jul 3 04:51:25 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:
4caea51387 DIRECTOR: Always finish drawing transition on quit event


Commit: 4caea51387e0a389f15466d476da8fd6fb9449fe
    https://github.com/scummvm/scummvm/commit/4caea51387e0a389f15466d476da8fd6fb9449fe
Author: Nathanael Gentry (nathanael.gentrydb8 at gmail.com)
Date: 2020-07-03T00:50:13-04:00

Commit Message:
DIRECTOR: Always finish drawing transition on quit event

This prevents an incomplete transition from messing up the display when, for
instance, you click to skip to the end of a transition.

Changed paths:
    engines/director/stage.h
    engines/director/transitions.cpp


diff --git a/engines/director/stage.h b/engines/director/stage.h
index 6465823dcb..1193a58ca0 100644
--- a/engines/director/stage.h
+++ b/engines/director/stage.h
@@ -50,6 +50,7 @@ class Stage : public Graphics::MacWindow {
 	void reset();
 
 	// transitions.cpp
+	void exitTransition(Graphics::ManagedSurface *nextFrame, Common::Rect clipRect);
 	void playTransition(uint16 transDuration, uint8 transArea, uint8 transChunkSize, TransitionType transType, uint frame);
 	void initTransParams(TransParams &t, Common::Rect &clipRect);
 	void dissolveTrans(TransParams &t, Common::Rect &clipRect, Graphics::ManagedSurface *tmpSurface);
diff --git a/engines/director/transitions.cpp b/engines/director/transitions.cpp
index b9aa6e95a1..ba86a91cd9 100644
--- a/engines/director/transitions.cpp
+++ b/engines/director/transitions.cpp
@@ -131,6 +131,11 @@ struct {
 	TRANS(kTransDissolveBits,			kTransAlgoDissolve,	kTransDirNone)
 };
 
+void Stage::exitTransition(Graphics::ManagedSurface *nextFrame, Common::Rect clipRect) {
+	_surface.blitFrom(*nextFrame, clipRect, Common::Point(clipRect.left, clipRect.top));
+	g_system->copyRectToScreen(_surface.getBasePtr(clipRect.left, clipRect.top), _surface.pitch, clipRect.left, clipRect.top, clipRect.width(), clipRect.height());
+}
+
 void Stage::playTransition(uint16 transDuration, uint8 transArea, uint8 transChunkSize, TransitionType transType, uint frame) {
 	// Play a transition and return the number of subframes rendered
 	TransParams t;
@@ -504,8 +509,10 @@ void Stage::playTransition(uint16 transDuration, uint8 transArea, uint8 transChu
 		_surface.blitFrom(*blitFrom, rfrom, Common::Point(rto.left, rto.top));
 
 		g_system->delayMillis(t.stepDuration);
-		if (processQuitEvent(true))
+		if (processQuitEvent(true)) {
+			exitTransition(nextFrame, clipRect);
 			break;
+		}
 
 		if (fullredraw) {
 			g_system->copyRectToScreen(_surface.getBasePtr(clipRect.left, clipRect.top), _surface.pitch, clipRect.left, clipRect.top, w, h);
@@ -702,8 +709,10 @@ void Stage::dissolveTrans(TransParams &t, Common::Rect &clipRect, Graphics::Mana
 
 		g_lingo->executePerFrameHook(t.frame, i + 1);
 
-		if (processQuitEvent(true))
+		if (processQuitEvent(true)) {
+			exitTransition(nextFrame, clipRect);
 			break;
+		}
 
 		g_system->delayMillis(t.stepDuration);
 	}
@@ -804,8 +813,10 @@ void Stage::dissolvePatternsTrans(TransParams &t, Common::Rect &clipRect, Graphi
 
 		g_lingo->executePerFrameHook(t.frame, i + 1);
 
-		if (processQuitEvent(true))
+		if (processQuitEvent(true)) {
+			exitTransition(nextFrame, clipRect);
 			break;
+		}
 
 		g_system->delayMillis(t.stepDuration);
 	}
@@ -978,8 +989,11 @@ void Stage::transMultiPass(TransParams &t, Common::Rect &clipRect, Graphics::Man
 		g_lingo->executePerFrameHook(t.frame, i);
 
 		g_system->delayMillis(t.stepDuration);
-		if (processQuitEvent(true))
+
+		if (processQuitEvent(true)) {
+			exitTransition(nextFrame, clipRect);
 			break;
+		}
 
 	}
 }
@@ -1025,8 +1039,11 @@ void Stage::transZoom(TransParams &t, Common::Rect &clipRect, Graphics::ManagedS
 		g_lingo->executePerFrameHook(t.frame, i);
 
 		g_system->delayMillis(t.stepDuration);
-		if (processQuitEvent(true))
+
+		if (processQuitEvent(true)) {
+			exitTransition(nextFrame, clipRect);
 			break;
+		}
 	}
 }
 




More information about the Scummvm-git-logs mailing list