[Scummvm-git-logs] scummvm branch-2-1 -> 521aaf66890e800d7843bea7239b4604b9063470

athrxx athrxx at scummvm.org
Sat Jan 11 20:35:54 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:
85a136b322 KYRA: (LOK) - fix possible invalid memory access
521aaf6689 KYRA: (HOF) - fix speech glitch (bug #11309)


Commit: 85a136b3222b63d057d92c6d8df609b4b0267ce3
    https://github.com/scummvm/scummvm/commit/85a136b3222b63d057d92c6d8df609b4b0267ce3
Author: athrxx (athrxx at scummvm.org)
Date: 2020-01-11T21:32:11+01:00

Commit Message:
KYRA: (LOK) - fix possible invalid memory access

It does not actually happen, but that's only due to the actual game script data...

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


diff --git a/engines/kyra/graphics/screen.cpp b/engines/kyra/graphics/screen.cpp
index 4d6e397..dfc52a0 100644
--- a/engines/kyra/graphics/screen.cpp
+++ b/engines/kyra/graphics/screen.cpp
@@ -3223,19 +3223,20 @@ void Screen::shakeScreen(int times) {
 	static const int8 _shakeParaPC[] = { 32, 0, -4, 32, 0, 0 };
 	static const int8 _shakeParaFMTOWNS[] = { 32, 0, -4, 48, 0, 4, 32, -4, 0, 32, 4, 0, 32, 0, 0 };
 
-	const int8 *data = _shakeParaPC;
+	const int8 *shakeData = _shakeParaPC;
 	int steps = ARRAYSIZE(_shakeParaPC) / 3;
 	
 	// The FM-TOWNS version has a slightly better shake animation
 	// TODO: check PC-98 version
 	if (_vm->gameFlags().platform == Common::kPlatformFMTowns) {
-		data = _shakeParaFMTOWNS;
+		shakeData = _shakeParaFMTOWNS;
 		steps = ARRAYSIZE(_shakeParaFMTOWNS) / 3;
 	}
 
 	Common::Event event;
 
 	while (times--) {
+		const int8 *data = shakeData;
 		for (int i = 0; i < steps; ++i) {
 			// The original PC version did not need an artificial delay, but we do or the shake will be
 			// too fast to be actually seen.


Commit: 521aaf66890e800d7843bea7239b4604b9063470
    https://github.com/scummvm/scummvm/commit/521aaf66890e800d7843bea7239b4604b9063470
Author: athrxx (athrxx at scummvm.org)
Date: 2020-01-11T21:32:11+01:00

Commit Message:
KYRA: (HOF) - fix speech glitch (bug #11309)

(the original does not cut off the current speech playback when starting a new voc file, but rather waits for it to finish)

Changed paths:
    engines/kyra/engine/kyra_hof.cpp


diff --git a/engines/kyra/engine/kyra_hof.cpp b/engines/kyra/engine/kyra_hof.cpp
index 2e5d091..6f303c1 100644
--- a/engines/kyra/engine/kyra_hof.cpp
+++ b/engines/kyra/engine/kyra_hof.cpp
@@ -1419,6 +1419,15 @@ void KyraEngine_HoF::snd_playVoiceFile(int id) {
 	assert(id >= 0 && id <= 9999999);
 	sprintf(vocFile, "%07d", id);
 	if (_sound->isVoicePresent(vocFile)) {
+		// Unlike the original I have added a timeout here. I have chosen a size that makes sure that it
+		// won't get triggered in any of the bug #11309 situations, but still avoids infinite hangups if
+		// something goes wrong.
+		uint32 end = _system->getMillis() + 2500;
+		while (snd_voiceIsPlaying() && _system->getMillis() < end && !skipFlag())
+			delay(10);
+		if (_system->getMillis() >= end && !skipFlag())
+			debugC(3, kDebugLevelSound, "KyraEngine_HoF::snd_playVoiceFile(): Speech finish wait timeout");
+
 		snd_stopVoice();
 
 		while (!_sound->voicePlay(vocFile, &_speechHandle)) {




More information about the Scummvm-git-logs mailing list