diff options
author | Max Horn | 2002-08-03 11:57:10 +0000 |
---|---|---|
committer | Max Horn | 2002-08-03 11:57:10 +0000 |
commit | cc04dccf2b97a0b880474a6992a5fdee1a7b8c6a (patch) | |
tree | 4589e659264a6160ad6a0cc26d3693f035b04ceb | |
parent | 41940a17327e08e21863d5c999eede5289ce609a (diff) | |
download | scummvm-rg350-cc04dccf2b97a0b880474a6992a5fdee1a7b8c6a.tar.gz scummvm-rg350-cc04dccf2b97a0b880474a6992a5fdee1a7b8c6a.tar.bz2 scummvm-rg350-cc04dccf2b97a0b880474a6992a5fdee1a7b8c6a.zip |
hopefully fixed #589746 (Clicking sounds)
svn-id: r4689
-rw-r--r-- | scumm.h | 4 | ||||
-rw-r--r-- | sound.cpp | 17 |
2 files changed, 8 insertions, 13 deletions
@@ -29,7 +29,7 @@ #include "bundle.h" #define SCUMMVM_VERSION "0.2.2 CVS" -#define SCUMMVM_CVS "2002-07-16" +#define SCUMMVM_CVS "2002-08-03" #define SWAP(a,b) do{int tmp=a; a=b; b=tmp; } while(0) #define ARRAYSIZE(x) (sizeof(x)/sizeof(x[0])) @@ -771,7 +771,7 @@ public: bool isSfxFinished(); void playBundleSound(char *sound); void decompressBundleSound(int index); - int playSfxSound(void *sound, uint32 size, uint rate); + int playSfxSound(void *sound, uint32 size, uint rate, bool isUnsigned = false); int playSfxSound_MP3(void *sound, uint32 size); void stopSfxSound(); @@ -678,16 +678,8 @@ int Scumm::startSfxSound(void *file, int file_size) error("startSfxSound: cannot read %d bytes", size); return -1; } - // FIXME - why is this code here? playSfxSound Already should do the conversion - for (i = 0; i < size; i++) { - // Fixme: From WinCE port - if (_sound_volume_sfx != 256) - data[i] = _sound_volume_sfx * data[i] / 256; - data[i] ^= 0x80; - } - - return playSfxSound(data, size, 1000000 / (256 - rate)); + return playSfxSound(data, size, 1000000 / (256 - rate), true); } @@ -837,11 +829,14 @@ void Scumm::playBundleSound(char *sound) _mixer->play_raw(NULL, final, size, rate, SoundMixer::FLAG_UNSIGNED | SoundMixer::FLAG_AUTOFREE); } -int Scumm::playSfxSound(void *sound, uint32 size, uint rate) +int Scumm::playSfxSound(void *sound, uint32 size, uint rate, bool isUnsigned) { if (_soundsPaused) return -1; - return _mixer->play_raw(NULL, sound, size, rate, SoundMixer::FLAG_AUTOFREE); + byte flags = SoundMixer::FLAG_AUTOFREE; + if (isUnsigned) + flags |= SoundMixer::FLAG_UNSIGNED; + return _mixer->play_raw(NULL, sound, size, rate, flags); } int Scumm::playSfxSound_MP3(void *sound, uint32 size) |