diff options
Diffstat (limited to 'engines/titanic/sound/sound_manager.cpp')
-rw-r--r-- | engines/titanic/sound/sound_manager.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/engines/titanic/sound/sound_manager.cpp b/engines/titanic/sound/sound_manager.cpp index ae806feb52..81ec5bc475 100644 --- a/engines/titanic/sound/sound_manager.cpp +++ b/engines/titanic/sound/sound_manager.cpp @@ -171,7 +171,7 @@ int QSoundManager::playSound(CWaveFile &waveFile, CProximity &prox) { } } - if (channel >= 0 || (channel = resetChannel(prox._channel)) != -1) { + if (channel >= 0 || (channel = resetChannel(prox._channelMode)) != -1) { return playWave(&waveFile, channel, flags, prox); } @@ -272,6 +272,7 @@ void QSoundManager::setVolume(int handle, uint volume, uint seconds) { for (uint idx = 0; idx < _slots.size(); ++idx) { Slot &slot = _slots[idx]; if (slot._handle == handle) { + assert(slot._channel >= 0); _channelsVolume[slot._channel] = volume; updateVolume(slot._channel, seconds * 1000); @@ -376,6 +377,9 @@ int QSoundManager::playWave(CWaveFile *waveFile, int iChannel, uint flags, CProx if (slotIndex == -1) return -1; + // Set the volume + setChannelVolume(iChannel, prox._channelVolume, prox._channelMode); + switch (prox._positioningMode) { case POSMODE_POLAR: qsWaveMixSetPolarPosition(iChannel, 8, QSPOLAR(prox._azimuth, prox._range, prox._elevation)); @@ -426,7 +430,7 @@ void QSoundManager::soundFreed(Audio::SoundHandle &handle) { } void QSoundManager::updateVolume(int channel, uint panRate) { - uint volume = _channelsVolume[channel] * 327; + double volume = _channelsVolume[channel] * 327; switch (_channelsMode[channel]) { case 0: @@ -451,7 +455,7 @@ void QSoundManager::updateVolume(int channel, uint panRate) { volume = (_musicPercent * volume) / 100; qsWaveMixSetPanRate(channel, 0, panRate); - qsWaveMixSetVolume(channel, 0, volume); + qsWaveMixSetVolume(channel, 0, (uint)volume); } void QSoundManager::updateVolumes() { |