diff options
author | Paul Gilbert | 2012-11-11 19:28:28 +1100 |
---|---|---|
committer | Paul Gilbert | 2012-11-11 19:28:28 +1100 |
commit | 29a8d2aa95b2c3c137e313cf2d8efd2cfa685c08 (patch) | |
tree | 2607023f504b80e4eee73ae93a01f70f7b93fcbf | |
parent | 3f86ca2c7947b983c911080e6aeba7f3fdd37fb4 (diff) | |
download | scummvm-rg350-29a8d2aa95b2c3c137e313cf2d8efd2cfa685c08.tar.gz scummvm-rg350-29a8d2aa95b2c3c137e313cf2d8efd2cfa685c08.tar.bz2 scummvm-rg350-29a8d2aa95b2c3c137e313cf2d8efd2cfa685c08.zip |
HOPKINS: Bugfix to make music playback loop
-rw-r--r-- | engines/hopkins/sound.cpp | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/engines/hopkins/sound.cpp b/engines/hopkins/sound.cpp index 4fc20540f5..ffb19a9aa2 100644 --- a/engines/hopkins/sound.cpp +++ b/engines/hopkins/sound.cpp @@ -357,12 +357,16 @@ void SoundManager::checkMusic() { return; mwavIndex = Music._mwavIndexes[Music._currentIndex]; - if (mwavIndex != -1) { - int volume = MUSICVOL * 255 / 16; + if (mwavIndex == -1) { + Music._currentIndex = 0; + mwavIndex = Music._mwavIndexes[Music._currentIndex]; + } - _vm->_mixer->playStream(Audio::Mixer::kSFXSoundType, &Mwav[mwavIndex]._soundHandle, - Mwav[mwavIndex]._audioStream, -1, volume, 0, DisposeAfterUse::NO); - } + int volume = MUSICVOL * 255 / 16; + + Mwav[mwavIndex]._audioStream->rewind(); + _vm->_mixer->playStream(Audio::Mixer::kSFXSoundType, &Mwav[mwavIndex]._soundHandle, + Mwav[mwavIndex]._audioStream, -1, volume, 0, DisposeAfterUse::NO); } } |