mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 06:08:35 +00:00
parent
41940a1732
commit
cc04dccf2b
4
scumm.h
4
scumm.h
@ -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();
|
||||
|
||||
|
17
sound.cpp
17
sound.cpp
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user