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

athrxx athrxx at scummvm.org
Sat May 15 12:28:01 UTC 2021


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:
b3ade1fa5c KYRA: (EOBII) - improve playback of final credits
840ddb8dd7 KYRA: (EOBII/Amiga) - fix minor color glitch
4e5ca90efc KYRA: (EOB) - tweak explosion and vortex animations some more


Commit: b3ade1fa5cf3a7839402a5778cd7b0ef2fa2825b
    https://github.com/scummvm/scummvm/commit/b3ade1fa5cf3a7839402a5778cd7b0ef2fa2825b
Author: athrxx (athrxx at scummvm.org)
Date: 2021-05-15T13:55:56+02:00

Commit Message:
KYRA: (EOBII) - improve playback of final credits

This makes the playback a bit smoother. The original would scroll the text lines upwards by 2 pixels every 2 ticks. Now we just move them upwards by 1 pixel every 1 tick. Same speed, just smoother...

Changed paths:
    engines/kyra/sequence/sequences_darkmoon.cpp


diff --git a/engines/kyra/sequence/sequences_darkmoon.cpp b/engines/kyra/sequence/sequences_darkmoon.cpp
index 52f235e9cc..72ad9e5d6c 100644
--- a/engines/kyra/sequence/sequences_darkmoon.cpp
+++ b/engines/kyra/sequence/sequences_darkmoon.cpp
@@ -1035,7 +1035,7 @@ void DarkMoonEngine::seq_playCredits(DarkmoonSequenceHelper *sq, const uint8 *da
 			delay(MIN<uint32>(_tickLength, end - cur));
 		}
 
-		end = _system->getMillis() + speed * _tickLength;
+		end = _system->getMillis() + ((speed * _tickLength) >> 1);
 
 		for (; i < 35 && *pos; i++) {
 			int16 nextY = i ? items[i].y + items[i].size + (items[i].size >> 2) : dm->h;
@@ -1104,7 +1104,7 @@ void DarkMoonEngine::seq_playCredits(DarkmoonSequenceHelper *sq, const uint8 *da
 				}
 			}
 
-			items[h + 1].y -= 2;
+			items[h + 1].y -= MAX<int>(1, speed >> 1);
 		}
 
 		_screen->copyRegion(dm->sx << 3, dm->sy, dm->sx << 3, dm->sy, dm->w << 3, dm->h, tempPage, 0, Screen::CR_NO_P_CHECK);


Commit: 840ddb8dd7e7b2f2f4a0dcb465a5e1b58abc0757
    https://github.com/scummvm/scummvm/commit/840ddb8dd7e7b2f2f4a0dcb465a5e1b58abc0757
Author: athrxx (athrxx at scummvm.org)
Date: 2021-05-15T13:56:36+02:00

Commit Message:
KYRA: (EOBII/Amiga) - fix minor color glitch

When skipping the first part of the outro sequence via mouse click a dark green square could appear at the bottom of the screen.

Changed paths:
    engines/kyra/sequence/sequences_darkmoon.cpp


diff --git a/engines/kyra/sequence/sequences_darkmoon.cpp b/engines/kyra/sequence/sequences_darkmoon.cpp
index 72ad9e5d6c..9a1f337a29 100644
--- a/engines/kyra/sequence/sequences_darkmoon.cpp
+++ b/engines/kyra/sequence/sequences_darkmoon.cpp
@@ -833,6 +833,8 @@ void DarkMoonEngine::seq_playFinale() {
 	sq.printText(15, textColor1);           // The temple ceases to exist
 	if (_flags.platform != Common::kPlatformAmiga) {
 		sq.initDelayedPaletteFade(6, 1);
+	} else if (skipFlag()) {
+		_screen->fadeToBlack();
 	} else {
 		_screen->fadePalette(_screen->getPalette(5), 127);
 		sq.copyPalette(5, 0);


Commit: 4e5ca90efcfbb7e559bb1244a7d32dbb361816b5
    https://github.com/scummvm/scummvm/commit/4e5ca90efcfbb7e559bb1244a7d32dbb361816b5
Author: athrxx (athrxx at scummvm.org)
Date: 2021-05-15T13:59:17+02:00

Commit Message:
KYRA: (EOB) - tweak explosion and vortex animations some more

- make the animations a bit faster to reduce the amount of time for which the engine is blocked
- separate the display updates from the engine delays
- register user input during the animations

Changed paths:
    engines/kyra/graphics/screen_eob.cpp


diff --git a/engines/kyra/graphics/screen_eob.cpp b/engines/kyra/graphics/screen_eob.cpp
index ddcaec5381..666ac7adf6 100644
--- a/engines/kyra/graphics/screen_eob.cpp
+++ b/engines/kyra/graphics/screen_eob.cpp
@@ -39,6 +39,9 @@
 #include "graphics/palette.h"
 #include "graphics/sjis.h"
 
+#define EXPLOSION_ANIM_DURATION 750
+#define VORTEX_ANIM_DURATION 750
+
 namespace Kyra {
 
 Screen_EoB::Screen_EoB(EoBCoreEngine *vm, OSystem *system) : Screen(vm, system, _screenDimTable, _screenDimTableCount), _cursorColorKey16Bit(0x8000) {
@@ -1115,7 +1118,6 @@ void Screen_EoB::drawExplosion(int scale, int radius, int numElements, int stepS
 	if (numElements > 150)
 		numElements = 150;
 
-	uint32 incPerElement = (18 << 8) / numElements;
 
 	for (int i = 0; i < numElements; i++) {
 		ptr2[i] = ptr3[i] = 0;
@@ -1125,6 +1127,12 @@ void Screen_EoB::drawExplosion(int scale, int radius, int numElements, int stepS
 		ptr8[i] = scale << 8;
 	}
 
+	uint32 playSpeedDelay = ((EXPLOSION_ANIM_DURATION << 15) / numElements) >> 7;
+	uint32 frameDelay = (1000 << 8) / 60;
+	uint32 playSpeedTimer = 0;
+	uint32 frameTimer = frameDelay;
+	uint32 start = _system->getMillis();
+
 	for (int l = 2; l;) {
 		if (l != 2) {
 			for (int i = numElements - 1; i >= 0; i--) {
@@ -1138,12 +1146,18 @@ void Screen_EoB::drawExplosion(int scale, int radius, int numElements, int stepS
 					else
 						setPagePixel(0, px, py, ptr6[i]);
 				}
+
+				if (_system->getMillis() >= start + (frameTimer >> 8)) {
+					updateScreen();
+					frameTimer += frameDelay;
+				}
+				playSpeedTimer += playSpeedDelay;
+				if (_system->getMillis() < start + (playSpeedTimer >> 15))
+					_vm->delayUntil(start + (playSpeedTimer >> 15));
 			}
 		}
 
 		l = 0;
-		uint32 timer = 0;
-		uint32 start = _system->getMillis();
 
 		for (int i = 0; i < numElements; i++) {
 			if (ptr4[i] <= 0)
@@ -1171,25 +1185,23 @@ void Screen_EoB::drawExplosion(int scale, int radius, int numElements, int stepS
 				ptr6[i] = getPagePixel(0, px, py);
 			}
 
-			timer += incPerElement ;
-
 			assert((ptr8[i] >> 8) < colorTableSize);
 			int pxVal2 = colorTable[ptr8[i] >> 8];
 			if (pxVal2) {
 				l = 1;
-				if (pxVal1 == _gfxCol && posWithinRect(px, py, rX1, rY1, rX2, rY2)) {
+				if (pxVal1 == _gfxCol && posWithinRect(px, py, rX1, rY1, rX2, rY2))
 					setPagePixel(0, px, py, pxVal2);
-					uint32 cur = _system->getMillis();
-					if (cur < start + (timer >> 8))  {
-						updateScreen();
-						cur = _system->getMillis();
-						if (cur < start + (timer >> 8))
-							_system->delayMillis(start + (timer >> 8) - cur);
-					}
-				}
 			} else {
 				ptr7[i] = 0;
 			}
+
+			if (_system->getMillis() >= start + (frameTimer >> 8)) {
+				updateScreen();
+				frameTimer += frameDelay;
+			}
+			playSpeedTimer += playSpeedDelay;
+			if (_system->getMillis() < start + (playSpeedTimer >> 15))
+				_vm->delayUntil(start + (playSpeedTimer >> 15));
 		}
 	}
 
@@ -1217,8 +1229,10 @@ void Screen_EoB::drawVortex(int numElements, int radius, int stepSize, int, int
 	int cy = 48;
 	radius <<= 6;
 
-	uint32 incPerElement = (12 << 8) / numElements;
-	uint32 timer = 0;
+	uint32 playSpeedDelay = ((VORTEX_ANIM_DURATION << 16) / numElements) >> 8;
+	uint32 frameDelay = (1000 << 8) / 60;
+	uint32 playSpeedTimer = 0;
+	uint32 frameTimer = frameDelay;
 	uint32 start = _system->getMillis();
 
 	for (int i = 0; i < numElements; i++) {
@@ -1280,6 +1294,14 @@ void Screen_EoB::drawVortex(int numElements, int radius, int stepSize, int, int
 					setPagePixel16bit(0, px, py, pixBackup[ii]);
 				else
 					setPagePixel(0, px, py, pixBackup[ii]);
+
+				if (_system->getMillis() >= start + (frameTimer >> 8)) {
+					updateScreen();
+					frameTimer += frameDelay;
+				}
+				playSpeedTimer += playSpeedDelay;
+				if (_system->getMillis() < start + (playSpeedTimer >> 16))
+					_vm->delayUntil(start + (playSpeedTimer >> 16));
 			}
 		}
 
@@ -1316,23 +1338,21 @@ void Screen_EoB::drawVortex(int numElements, int radius, int stepSize, int, int
 			uint8 tblIndex = CLIP(colTableIndex[ii] >> 8, 0, colorTableSize - 1);
 			uint8 tc2 = colorTable[tblIndex];
 
-			timer += incPerElement;
-
 			if (tc2) {
 				i = 1;
-				if (tc1 == _gfxCol && !pixDelay[ii]) {
+				if (tc1 == _gfxCol && !pixDelay[ii])
 					setPagePixel(0, px, py, tc2);
-					uint32 cur = _system->getMillis();
-					if (cur < start + (timer >> 8)) {
-						updateScreen();
-						cur = _system->getMillis();
-						if (cur < start + (timer >> 8))
-							_system->delayMillis(start + (timer >> 8) - cur);
-					}
-				}
 			} else {
 				colTableStep[ii] = 0;
 			}
+
+			if (_system->getMillis() >= start + (frameTimer >> 8)) {
+				updateScreen();
+				frameTimer += frameDelay;
+			}
+			playSpeedTimer += playSpeedDelay;
+			if (_system->getMillis() < start + (playSpeedTimer >> 16))
+				_vm->delayUntil(start + (playSpeedTimer >> 16));
 		}
 		d++;
 	}
@@ -1777,6 +1797,9 @@ const uint8 Screen_EoB::_egaMatchTable[] = {
 	0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x3F, 0x3F, 0x3F
 };
 
+#undef EXPLOSION_ANIM_DURATION
+#undef VORTEX_ANIM_DURATION
+
 uint16 *OldDOSFont::_cgaDitheringTable = 0;
 int OldDOSFont::_numRef = 0;
 




More information about the Scummvm-git-logs mailing list