[Scummvm-git-logs] scummvm master -> 01e26a091b6ac498a3626aabf700e86e111720a8

sev- sev at scummvm.org
Sat Mar 28 14:21:26 UTC 2020


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

Summary:
6267730bd5 DIRECTOR: Fix vertical transitions
01e26a091b DIRECTOR: Fix Dissolve transition dimensions


Commit: 6267730bd518112a20cf0ae426f0bc1748ea2b53
    https://github.com/scummvm/scummvm/commit/6267730bd518112a20cf0ae426f0bc1748ea2b53
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-03-28T15:08:48+01:00

Commit Message:
DIRECTOR: Fix vertical transitions

Changed paths:
    engines/director/transitions.cpp


diff --git a/engines/director/transitions.cpp b/engines/director/transitions.cpp
index d4da504c79..5c38476391 100644
--- a/engines/director/transitions.cpp
+++ b/engines/director/transitions.cpp
@@ -252,7 +252,6 @@ static void initTransParams(TransParams &t, Score *score, Common::Rect &clipRect
 	int w = clipRect.width();
 	int h = clipRect.height();
 	int m = MIN(w, h);
-	TransitionDirection d = transProps[t.type].dir;
 	TransitionAlgo a = transProps[t.type].algo;
 
 	if (a == kTransAlgoCenterOut || a == kTransAlgoEdgesIn) {
@@ -260,17 +259,33 @@ static void initTransParams(TransParams &t, Score *score, Common::Rect &clipRect
 		h = (h + 1) >> 1;
 	}
 
-	t.steps = m / t.chunkSize;
-	t.stepDuration = t.duration / t.steps;
+	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;
 
-	if (d == kTransDirHorizontal || d == kTransDirBoth) {
 		t.xStepSize = w / t.steps;
 		t.xpos = w % t.steps;
-	}
-	if (d == kTransDirVertical || d == kTransDirBoth) {
 		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) {


Commit: 01e26a091b6ac498a3626aabf700e86e111720a8
    https://github.com/scummvm/scummvm/commit/01e26a091b6ac498a3626aabf700e86e111720a8
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-03-28T15:21:03+01:00

Commit Message:
DIRECTOR: Fix Dissolve transition dimensions

Changed paths:
    engines/director/transitions.cpp


diff --git a/engines/director/transitions.cpp b/engines/director/transitions.cpp
index 5c38476391..6321e2e41f 100644
--- a/engines/director/transitions.cpp
+++ b/engines/director/transitions.cpp
@@ -326,6 +326,8 @@ static void dissolveTrans(TransParams &t, Score *score, Common::Rect &clipRect)
 	int hMask = (1L << hBits) - 1;
 	int vShift = hBits;
 
+	warning("w: %d h: %d  vBits: %d hBits: %d hMask: %x", w, h, vBits, hBits, hMask);
+
 	// Calculate steps
 	uint32 pixPerStepInit = 1;
 	t.steps = (1 << (hBits + vBits)) - 1;
@@ -336,13 +338,15 @@ static void dissolveTrans(TransParams &t, Score *score, Common::Rect &clipRect)
 	}
 	t.steps++;
 
+	t.stepDuration = t.duration / t.steps;
+
 	Common::Rect r(1, 1);
 
 	while (t.steps) {
 		uint32 pixPerStep = pixPerStepInit;
 		do {
-			uint32 x = rnd & hMask;
-			uint32 y = rnd >> vShift;
+			uint32 x = rnd >> vShift;
+			uint32 y = rnd & hMask;
 
 			if (x < w && y < h) {
 				r.moveTo(x, y);
@@ -361,7 +365,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, score->_backSurface->w, score->_backSurface->h);
+		g_system->copyRectToScreen(score->_backSurface->getPixels(), score->_backSurface->pitch, 0, 0, w, h);
 
 		g_system->delayMillis(t.stepDuration);
 		if (processQuitEvent(true))




More information about the Scummvm-git-logs mailing list