aboutsummaryrefslogtreecommitdiff
path: root/sword2/driver
diff options
context:
space:
mode:
authorTorbjörn Andersson2003-09-02 16:20:10 +0000
committerTorbjörn Andersson2003-09-02 16:20:10 +0000
commit124a84033f302b21751fc3cf8c5fea83acdd05fb (patch)
tree9bc8190266579c05c83ae53995b3298818af9223 /sword2/driver
parent145f17c4a97a1203e9588ebea2e0507468cb535f (diff)
downloadscummvm-rg350-124a84033f302b21751fc3cf8c5fea83acdd05fb.tar.gz
scummvm-rg350-124a84033f302b21751fc3cf8c5fea83acdd05fb.tar.bz2
scummvm-rg350-124a84033f302b21751fc3cf8c5fea83acdd05fb.zip
Unless I'm gravely mistaken, StreamCompMusic() should always create a new
stream, in which case the warning about the sound handle being 0 is bogus. svn-id: r9973
Diffstat (limited to 'sword2/driver')
-rw-r--r--sword2/driver/d_sound.cpp30
1 files changed, 10 insertions, 20 deletions
diff --git a/sword2/driver/d_sound.cpp b/sword2/driver/d_sound.cpp
index 395dff60cc..436e7e3897 100644
--- a/sword2/driver/d_sound.cpp
+++ b/sword2/driver/d_sound.cpp
@@ -1352,20 +1352,14 @@ int32 Sword2Sound::StreamCompMusic(const char *filename, uint32 musicId, int32 l
int8 pan;
if (v0 > v1) {
- volume = musicVolTable[v0];
- pan = (musicVolTable[v1 * 16 / v0] / 2) - 127;
-// IDirectSoundBuffer_SetVolume(lpDsbMus[primaryStream], musicVolTable[v0]);
-// IDirectSoundBuffer_SetPan(lpDsbMus[primaryStream], musicVolTable[v1*16/v0]);
+ volume = musicVolTable[v0];
+ pan = (musicVolTable[v1 * 16 / v0] / 2) - 127;
} else if (v1 > v0) {
- volume = musicVolTable[v1];
- pan = (musicVolTable[v0 * 16 / v1] / 2) + 127;
-// IDirectSoundBuffer_SetVolume(lpDsbMus[primaryStream], musicVolTable[v1]);
-// IDirectSoundBuffer_SetPan(lpDsbMus[primaryStream], -musicVolTable[v0*16/v1]);
+ volume = musicVolTable[v1];
+ pan = (musicVolTable[v0 * 16 / v1] / 2) + 127;
} else {
- volume = musicVolTable[v1];
- pan = 0;
-// IDirectSoundBuffer_SetVolume(lpDsbMus[primaryStream], musicVolTable[v1]);
-// IDirectSoundBuffer_SetPan(lpDsbMus[primaryStream], 0);
+ volume = musicVolTable[v1];
+ pan = 0;
}
// FIXME: Until the mixer supports LE samples natively, we need to
@@ -1374,14 +1368,10 @@ int32 Sword2Sound::StreamCompMusic(const char *filename, uint32 musicId, int32 l
data16[i] = TO_BE_16(data16[i]);
}
- if (soundHandleMusic[primaryStream] == 0) {
- warning("play music newStream(): this shouldn't happen");
-// assert(!soundHandleMusic[primaryStream]);
- g_engine->_mixer->newStream(&soundHandleMusic[primaryStream], data16, bufferSizeMusic, 22050,
- SoundMixer::FLAG_16BITS | SoundMixer::FLAG_AUTOFREE, 100000, volume, 0);
- } else {
- g_engine->_mixer->appendStream(soundHandleMusic[primaryStream], data16, bufferSizeMusic);
- }
+ g_engine->_mixer->newStream(&soundHandleMusic[primaryStream], data16,
+ bufferSizeMusic, 22050,
+ SoundMixer::FLAG_16BITS | SoundMixer::FLAG_AUTOFREE,
+ 100000, volume, pan);
// Recorder some last variables
musStreaming[primaryStream] = 1;