diff options
author | Sven Hesse | 2012-06-16 02:58:53 +0200 |
---|---|---|
committer | Sven Hesse | 2012-06-16 02:58:53 +0200 |
commit | a24cb57c9d4d4292da582fafc52be70103a1e369 (patch) | |
tree | 0ec1b2907a6336296c2e7ad107e8fa1a1f82c4b3 /engines/gob/sound/soundblaster.cpp | |
parent | f917db972e0ae7e4e82a6430010a155cbb3a92c0 (diff) | |
download | scummvm-rg350-a24cb57c9d4d4292da582fafc52be70103a1e369.tar.gz scummvm-rg350-a24cb57c9d4d4292da582fafc52be70103a1e369.tar.bz2 scummvm-rg350-a24cb57c9d4d4292da582fafc52be70103a1e369.zip |
GOB: Loop the Little Red title music
Diffstat (limited to 'engines/gob/sound/soundblaster.cpp')
-rw-r--r-- | engines/gob/sound/soundblaster.cpp | 24 |
1 files changed, 21 insertions, 3 deletions
diff --git a/engines/gob/sound/soundblaster.cpp b/engines/gob/sound/soundblaster.cpp index 4ff555b0e3..915d744494 100644 --- a/engines/gob/sound/soundblaster.cpp +++ b/engines/gob/sound/soundblaster.cpp @@ -31,6 +31,8 @@ SoundBlaster::SoundBlaster(Audio::Mixer &mixer) : SoundMixer(mixer, Audio::Mixer _compositionSamples = 0; _compositionSampleCount = 0; _compositionPos = -1; + + _compositionRepCount = 0; } SoundBlaster::~SoundBlaster() { @@ -79,6 +81,7 @@ void SoundBlaster::nextCompositionPos() { if (_compositionPos == 49) _compositionPos = -1; } + _compositionPos = -1; } @@ -98,6 +101,10 @@ void SoundBlaster::playComposition(int16 *composition, int16 freqVal, nextCompositionPos(); } +void SoundBlaster::repeatComposition(int32 repCount) { + _compositionRepCount = repCount; +} + void SoundBlaster::setSample(SoundDesc &sndDesc, int16 repCount, int16 frequency, int16 fadeLength) { @@ -106,10 +113,21 @@ void SoundBlaster::setSample(SoundDesc &sndDesc, int16 repCount, int16 frequency } void SoundBlaster::checkEndSample() { - if (_compositionPos != -1) + if (_compositionPos != -1) { + nextCompositionPos(); + return; + } + + if (_compositionRepCount != 0) { + if (_compositionRepCount > 0) + _compositionRepCount--; + nextCompositionPos(); - else - SoundMixer::checkEndSample(); + if (_compositionPos != -1) + return; + } + + SoundMixer::checkEndSample(); } void SoundBlaster::endFade() { |