[Scummvm-git-logs] scummvm master -> 7f6b56d3adcfc7da0e468d18b42ab4908e7305f3

sev- sev at scummvm.org
Sun Mar 29 23:10:05 UTC 2020


This automated email contains information about 3 new commits which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
8b71aa8f2d DIRECTOR: Implement kTransDissolvePixelsFast
609aa88174 DIRECTOR: Code formatting
7f6b56d3ad DIRECTOR: Implemented half of the kTransDissolveBits transition


Commit: 8b71aa8f2da7e134c31d2a116991a5f0dd8142a9
    https://github.com/scummvm/scummvm/commit/8b71aa8f2da7e134c31d2a116991a5f0dd8142a9
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-03-30T00:13:06+02:00

Commit Message:
DIRECTOR: Implement kTransDissolvePixelsFast

Changed paths:
    engines/director/transitions.cpp


diff --git a/engines/director/transitions.cpp b/engines/director/transitions.cpp
index f53b5400be..b08fdd9e5e 100644
--- a/engines/director/transitions.cpp
+++ b/engines/director/transitions.cpp
@@ -348,6 +348,10 @@ static void dissolveTrans(TransParams &t, Score *score, Common::Rect &clipRect)
 
 	t.stepDuration = t.duration / t.steps;
 
+	if (t.type == kTransDissolvePixelsFast ||
+			t.type == kTransDissolveBitsFast)
+		t.stepDuration = 0;						// No delay
+
 	Common::Rect r(1, 1);
 
 	while (t.steps) {


Commit: 609aa8817405bef6cd8395b1182edca67bceb579
    https://github.com/scummvm/scummvm/commit/609aa8817405bef6cd8395b1182edca67bceb579
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-03-30T00:13:39+02:00

Commit Message:
DIRECTOR: Code formatting

Changed paths:
    engines/director/transitions.cpp


diff --git a/engines/director/transitions.cpp b/engines/director/transitions.cpp
index b08fdd9e5e..6dbaf82f8b 100644
--- a/engines/director/transitions.cpp
+++ b/engines/director/transitions.cpp
@@ -72,7 +72,7 @@ struct {
 	TRANS(kTransCenterOutVertical,		kTransAlgoCenterOut,kTransDirVertical),
 	TRANS(kTransEdgesInVertical,		kTransAlgoEdgesIn,	kTransDirVertical),
 	TRANS(kTransCenterOutSquare,		kTransAlgoCenterOut,kTransDirBoth),
-	TRANS(kTransEdgesInSquare,			kTransAlgoEdgesIn,	kTransDirBoth),	// 10
+	TRANS(kTransEdgesInSquare,			kTransAlgoEdgesIn,	kTransDirBoth),			// 10
 	TRANS(kTransPushLeft,				kTransAlgoPush,		kTransDirHorizontal),
 	TRANS(kTransPushRight,				kTransAlgoPush,		kTransDirHorizontal),
 	TRANS(kTransPushDown,				kTransAlgoPush,		kTransDirVertical),
@@ -82,37 +82,37 @@ struct {
 	TRANS(kTransRevealRight,			kTransAlgoReveal,	kTransDirHorizontal),
 	TRANS(kTransRevealDownRight,		kTransAlgoReveal,	kTransDirBoth),
 	TRANS(kTransRevealDown,				kTransAlgoReveal,	kTransDirVertical),
-	TRANS(kTransRevealDownLeft,			kTransAlgoReveal,	kTransDirBoth),	// 20
+	TRANS(kTransRevealDownLeft,			kTransAlgoReveal,	kTransDirBoth),			// 20
 	TRANS(kTransRevealLeft,				kTransAlgoReveal,	kTransDirHorizontal),
 	TRANS(kTransRevealUpLeft,			kTransAlgoReveal,	kTransDirBoth),
 	TRANS(kTransDissolvePixelsFast,		kTransAlgoDissolve,	kTransDirNone),
 	TRANS(kTransDissolveBoxyRects,		kTransAlgoBoxy,		kTransDirBoth),
-	TRANS(kTransDissolveBoxySquares,	kTransAlgoBoxy,		kTransDirBoth),		// 25
+	TRANS(kTransDissolveBoxySquares,	kTransAlgoBoxy,		kTransDirBoth),			// 25
 	TRANS(kTransDissolvePatterns,		kTransAlgoDissolve,	kTransDirNone),
 	TRANS(kTransRandomRows,				kTransAlgoRandomLines,kTransDirHorizontal),
 	TRANS(kTransRandomColumns,			kTransAlgoRandomLines,kTransDirVertical),
 	TRANS(kTransCoverDown,				kTransAlgoCover,	kTransDirVertical),
-	TRANS(kTransCoverDownLeft,			kTransAlgoCover,	kTransDirBoth),	// 30
+	TRANS(kTransCoverDownLeft,			kTransAlgoCover,	kTransDirBoth),			// 30
 	TRANS(kTransCoverDownRight,			kTransAlgoCover,	kTransDirBoth),
 	TRANS(kTransCoverLeft,				kTransAlgoCover,	kTransDirHorizontal),
 	TRANS(kTransCoverRight,				kTransAlgoCover,	kTransDirHorizontal),
 	TRANS(kTransCoverUp,				kTransAlgoCover,	kTransDirVertical),
-	TRANS(kTransCoverUpLeft,			kTransAlgoCover,	kTransDirBoth),	// 35
+	TRANS(kTransCoverUpLeft,			kTransAlgoCover,	kTransDirBoth),			// 35
 	TRANS(kTransCoverUpRight,			kTransAlgoCover,	kTransDirBoth),
 	TRANS(kTransTypeVenitianBlind,		kTransAlgoBlinds,	kTransDirHorizontal),
 	TRANS(kTransTypeCheckerboard,		kTransAlgoCheckerBoard, kTransDirBoth),
 	TRANS(kTransTypeStripsBottomBuildLeft, kTransAlgoBuildStrips, kTransDirBoth),
-	TRANS(kTransTypeStripsBottomBuildRight, kTransAlgoBuildStrips, kTransDirBoth), // 40
+	TRANS(kTransTypeStripsBottomBuildRight, kTransAlgoBuildStrips, kTransDirBoth),	// 40
 	TRANS(kTransTypeStripsLeftBuildDown, kTransAlgoBuildStrips, kTransDirBoth),
 	TRANS(kTransTypeStripsLeftBuildUp, kTransAlgoBuildStrips, kTransDirBoth),
 	TRANS(kTransTypeStripsRightBuildDown, kTransAlgoBuildStrips, kTransDirBoth),
 	TRANS(kTransTypeStripsRightBuildUp, kTransAlgoBuildStrips, kTransDirBoth),
-	TRANS(kTransTypeStripsTopBuildLeft,	kTransAlgoBuildStrips, kTransDirBoth),// 45
+	TRANS(kTransTypeStripsTopBuildLeft,	kTransAlgoBuildStrips, kTransDirBoth),		// 45
 	TRANS(kTransTypeStripsTopBuildRight, kTransAlgoBuildStrips, kTransDirBoth),
 	TRANS(kTransZoomOpen,				kTransAlgoZoom,		kTransDirBoth),
 	TRANS(kTransZoomClose,				kTransAlgoZoom,		kTransDirBoth),
 	TRANS(kTransVerticalBinds,			kTransAlgoBlinds,	kTransDirBoth),
-	TRANS(kTransDissolveBitsFast,		kTransAlgoDissolve,	kTransDirNone),		// 50
+	TRANS(kTransDissolveBitsFast,		kTransAlgoDissolve,	kTransDirNone),			// 50
 	TRANS(kTransDissolvePixels,			kTransAlgoDissolve,	kTransDirNone),
 	TRANS(kTransDissolveBits,			kTransAlgoDissolve,	kTransDirNone)
 };
@@ -258,46 +258,6 @@ void Frame::playTransition(Score *score) {
 	}
 }
 
-static void initTransParams(TransParams &t, Score *score, Common::Rect &clipRect) {
-	int w = clipRect.width();
-	int h = clipRect.height();
-	int m = MIN(w, h);
-	TransitionAlgo a = transProps[t.type].algo;
-
-	if (a == kTransAlgoCenterOut || a == kTransAlgoEdgesIn) {
-		w = (w + 1) >> 1;	// round up
-		h = (h + 1) >> 1;
-	}
-
-	switch (transProps[t.type].dir) {
-	case kTransDirHorizontal:
-		t.steps = w / t.chunkSize;
-		t.xStepSize = w / t.steps;
-		t.xpos = w % t.steps;
-		break;
-
-	case kTransDirVertical:
-		t.steps = h / t.chunkSize;
-		t.yStepSize = h / t.steps;
-		t.ypos = h % t.steps;
-		break;
-
-	case kTransDirBoth:
-		t.steps = m / t.chunkSize;
-
-		t.xStepSize = w / t.steps;
-		t.xpos = w % t.steps;
-		t.yStepSize = h / t.steps;
-		t.ypos = h % t.steps;
-		break;
-
-	default:
-		t.steps = 1;
-	}
-
-	t.stepDuration = t.duration / t.steps;
-}
-
 static int getLog2(int n) {
 	int res;
 
@@ -389,4 +349,44 @@ static void dissolveTrans(TransParams &t, Score *score, Common::Rect &clipRect)
 	}
 }
 
+static void initTransParams(TransParams &t, Score *score, Common::Rect &clipRect) {
+	int w = clipRect.width();
+	int h = clipRect.height();
+	int m = MIN(w, h);
+	TransitionAlgo a = transProps[t.type].algo;
+
+	if (a == kTransAlgoCenterOut || a == kTransAlgoEdgesIn) {
+		w = (w + 1) >> 1;	// round up
+		h = (h + 1) >> 1;
+	}
+
+	switch (transProps[t.type].dir) {
+	case kTransDirHorizontal:
+		t.steps = w / t.chunkSize;
+		t.xStepSize = w / t.steps;
+		t.xpos = w % t.steps;
+		break;
+
+	case kTransDirVertical:
+		t.steps = h / t.chunkSize;
+		t.yStepSize = h / t.steps;
+		t.ypos = h % t.steps;
+		break;
+
+	case kTransDirBoth:
+		t.steps = m / t.chunkSize;
+
+		t.xStepSize = w / t.steps;
+		t.xpos = w % t.steps;
+		t.yStepSize = h / t.steps;
+		t.ypos = h % t.steps;
+		break;
+
+	default:
+		t.steps = 1;
+	}
+
+	t.stepDuration = t.duration / t.steps;
+}
+
 } // End of namespace Director


Commit: 7f6b56d3adcfc7da0e468d18b42ab4908e7305f3
    https://github.com/scummvm/scummvm/commit/7f6b56d3adcfc7da0e468d18b42ab4908e7305f3
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-03-30T01:09:34+02:00

Commit Message:
DIRECTOR: Implemented half of the kTransDissolveBits transition

Changed paths:
    engines/director/transitions.cpp


diff --git a/engines/director/transitions.cpp b/engines/director/transitions.cpp
index 6dbaf82f8b..c45c12af7c 100644
--- a/engines/director/transitions.cpp
+++ b/engines/director/transitions.cpp
@@ -280,8 +280,37 @@ uint32 randomSeed[33] = {
 };
 
 static void dissolveTrans(TransParams &t, Score *score, Common::Rect &clipRect) {
+	uint pixsize = 8;
+	uint numbytes = 1;
 	uint w = clipRect.width();
 	uint h = clipRect.height();
+	uint realw = w, realh = h;
+
+	if (t.type == kTransDissolveBitsFast ||
+			t.type == kTransDissolveBits) {
+
+		if (t.chunkSize >= 32) {
+			pixsize = 32;
+			w = (w + 3) >> 2;
+			numbytes = 4;
+		} else if (t.chunkSize >= 16) {
+			pixsize = 16;
+			w = (w + 1) >> 1;
+			numbytes = 2;
+		} else if (t.chunkSize >= 8) {
+			pixsize = 8;
+		} else if (t.chunkSize >= 4) {
+			pixsize = 4;
+			w <<= 1;
+		} else if (t.chunkSize >= 2) {
+			pixsize = 2;
+			w <<= 2;
+		} else {
+			pixsize = 1;
+			w <<= 3;
+		}
+	}
+
 	int vBits = getLog2(w);
 	int hBits = getLog2(h);
 	uint32 rnd, seed;
@@ -312,7 +341,7 @@ static void dissolveTrans(TransParams &t, Score *score, Common::Rect &clipRect)
 			t.type == kTransDissolveBitsFast)
 		t.stepDuration = 0;						// No delay
 
-	Common::Rect r(1, 1);
+	Common::Rect r(numbytes, 1);
 
 	while (t.steps) {
 		uint32 pixPerStep = pixPerStepInit;
@@ -321,6 +350,10 @@ static void dissolveTrans(TransParams &t, Score *score, Common::Rect &clipRect)
 			uint32 y = rnd & hMask;
 
 			if (x < w && y < h) {
+				if (numbytes > 1) {
+					x = MIN(x * numbytes, realw - numbytes);
+				}
+
 				r.moveTo(x, y);
 				score->_backSurface->copyRectToSurface(*score->_surface, x, y, r);
 			}
@@ -337,7 +370,7 @@ static void dissolveTrans(TransParams &t, Score *score, Common::Rect &clipRect)
 		r.moveTo(0, 0);
 		score->_backSurface->copyRectToSurface(*score->_surface, 0, 0, r);
 
-		g_system->copyRectToScreen(score->_backSurface->getPixels(), score->_backSurface->pitch, 0, 0, w, h);
+		g_system->copyRectToScreen(score->_backSurface->getPixels(), score->_backSurface->pitch, 0, 0, realw, realh);
 
 		g_system->delayMillis(t.stepDuration);
 		if (processQuitEvent(true))




More information about the Scummvm-git-logs mailing list