[Scummvm-git-logs] scummvm master -> 1d12eb4c11d2ae89c4b06d86d6af98b5ef02f8fe

dreammaster paulfgilbert at gmail.com
Sat Dec 15 05:37:30 CET 2018


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:
1d12eb4c11 GLK: FROTZ: Fix sound looping


Commit: 1d12eb4c11d2ae89c4b06d86d6af98b5ef02f8fe
    https://github.com/scummvm/scummvm/commit/1d12eb4c11d2ae89c4b06d86d6af98b5ef02f8fe
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2018-12-14T20:37:22-08:00

Commit Message:
GLK: FROTZ: Fix sound looping

Changed paths:
    engines/glk/frotz/glk_interface.cpp
    engines/glk/sound.cpp


diff --git a/engines/glk/frotz/glk_interface.cpp b/engines/glk/frotz/glk_interface.cpp
index 200adbb..b78a067 100644
--- a/engines/glk/frotz/glk_interface.cpp
+++ b/engines/glk/frotz/glk_interface.cpp
@@ -266,8 +266,7 @@ void GlkInterface::os_start_sample(int number, int volume, int repeats, zword eo
 	default:  vol = 0x20000; break;
 	}
 
-	// we dont do repeating or eos-callback for now...
-	glk_schannel_play_ext(gos_channel, number, 1, 0);
+	glk_schannel_play_ext(gos_channel, number, repeats, eos);
 	glk_schannel_set_volume(gos_channel, vol);
 }
 
diff --git a/engines/glk/sound.cpp b/engines/glk/sound.cpp
index 1012c20..7a93b77 100644
--- a/engines/glk/sound.cpp
+++ b/engines/glk/sound.cpp
@@ -100,7 +100,9 @@ uint SoundChannel::play(uint soundNum, uint repeats, uint notify) {
 	if (f.exists(nameSnd) && f.open(nameSnd)) {
 		if (f.readUint16BE() != (f.size() - 2))
 			error("Invalid sound filesize");
-		repeats = f.readByte();
+		byte headerRepeats = f.readByte();
+		if (headerRepeats > 0)
+			repeats = headerRepeats;
 		f.skip(1);
 		uint freq = f.readUint16BE();
 		f.skip(2);





More information about the Scummvm-git-logs mailing list