diff options
author | Sven Hesse | 2006-05-11 19:43:30 +0000 |
---|---|---|
committer | Sven Hesse | 2006-05-11 19:43:30 +0000 |
commit | 42e03bd70720643c0866abd7d6da50529d2c1f03 (patch) | |
tree | 80aff92316136cac1222ccf01782b5c58d4d7490 /engines/gob/sound.cpp | |
parent | d6af07989df23219293cf6117e6cd0ae6a63e2e9 (diff) | |
download | scummvm-rg350-42e03bd70720643c0866abd7d6da50529d2c1f03.tar.gz scummvm-rg350-42e03bd70720643c0866abd7d6da50529d2c1f03.tar.bz2 scummvm-rg350-42e03bd70720643c0866abd7d6da50529d2c1f03.zip |
- Sound! Still a bit glitchy, though:
- Negative frequences?!? Maybe "SFX"?
- No sound for a small part of the intro
(there aren't any sndKeys covering that part either)
- A rythm-instrument (hi-hat?) in the titlemusic isn't played as one
- More differences in the drawing functions fleshed out
- Some of the goblin handling functions written
- More unnamed functions and variables, wheeee...
svn-id: r22410
Diffstat (limited to 'engines/gob/sound.cpp')
-rw-r--r-- | engines/gob/sound.cpp | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/engines/gob/sound.cpp b/engines/gob/sound.cpp index 9bb0fc2de0..6a7446d63d 100644 --- a/engines/gob/sound.cpp +++ b/engines/gob/sound.cpp @@ -24,6 +24,8 @@ #include "gob/gob.h" #include "gob/global.h" #include "gob/sound.h" +#include "gob/game.h" +#include "gob/util.h" namespace Gob { @@ -93,7 +95,14 @@ void Snd::speakerOff(void) { } void Snd::playSample(Snd::SoundDesc *sndDesc, int16 repCount, int16 frequency) { - assert(frequency > 0); + if (frequency == 0) + frequency = sndDesc->frequency; + + if (frequency <= 0) { + warning("Attempted to play a sample with a frequency of %d", frequency); + return; + } +// assert(frequency > 0); if (!_vm->_mixer->isSoundHandleActive(sndDesc->handle)) { _vm->_mixer->playRaw(&sndDesc->handle, sndDesc->data, sndDesc->size, frequency, 0); |