diff options
author | Paul Gilbert | 2018-12-14 20:37:22 -0800 |
---|---|---|
committer | Paul Gilbert | 2018-12-14 20:37:22 -0800 |
commit | 1d12eb4c11d2ae89c4b06d86d6af98b5ef02f8fe (patch) | |
tree | 7f4313d57b241cf141f0d6388a590d87012637b7 | |
parent | 3546f77995f2a0f066e4cb618264621665b4ec4a (diff) | |
download | scummvm-rg350-1d12eb4c11d2ae89c4b06d86d6af98b5ef02f8fe.tar.gz scummvm-rg350-1d12eb4c11d2ae89c4b06d86d6af98b5ef02f8fe.tar.bz2 scummvm-rg350-1d12eb4c11d2ae89c4b06d86d6af98b5ef02f8fe.zip |
GLK: FROTZ: Fix sound looping
-rw-r--r-- | engines/glk/frotz/glk_interface.cpp | 3 | ||||
-rw-r--r-- | engines/glk/sound.cpp | 4 |
2 files changed, 4 insertions, 3 deletions
diff --git a/engines/glk/frotz/glk_interface.cpp b/engines/glk/frotz/glk_interface.cpp index 200adbb9fe..b78a067c89 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 1012c2040f..7a93b772f9 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); |