aboutsummaryrefslogtreecommitdiff
path: root/engines/titanic/sound
diff options
context:
space:
mode:
authorPaul Gilbert2017-07-15 21:05:15 -0400
committerPaul Gilbert2017-07-15 21:05:15 -0400
commit2032ca8ca1bf932ffbd4d6c1b2337caa4d585787 (patch)
treed5cefec97827986ec8cd09d7cc0af7e7ccf64d63 /engines/titanic/sound
parent6140305801defe005c9f545bf9ba7ed61c85f331 (diff)
downloadscummvm-rg350-2032ca8ca1bf932ffbd4d6c1b2337caa4d585787.tar.gz
scummvm-rg350-2032ca8ca1bf932ffbd4d6c1b2337caa4d585787.tar.bz2
scummvm-rg350-2032ca8ca1bf932ffbd4d6c1b2337caa4d585787.zip
TITANIC: Fix range for timed volume transitions
Diffstat (limited to 'engines/titanic/sound')
-rw-r--r--engines/titanic/sound/qmixer.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/engines/titanic/sound/qmixer.cpp b/engines/titanic/sound/qmixer.cpp
index 9ff6834efc..b33601d82e 100644
--- a/engines/titanic/sound/qmixer.cpp
+++ b/engines/titanic/sound/qmixer.cpp
@@ -22,6 +22,7 @@
#include "common/system.h"
#include "titanic/sound/qmixer.h"
+#include "titanic/titanic.h"
namespace Titanic {
@@ -88,10 +89,12 @@ void QMixer::qsWaveMixSetVolume(int iChannel, uint flags, uint volume) {
assert(volume <= 32767);
byte newVolume = (volume >= 32700) ? 255 : volume * 255 / 32767;
- channel._volumeStart = newVolume;
- channel._volumeEnd = volume * 255 / 100; // Convert from 0-100 (percent) to 0-255
+ channel._volumeStart = channel._volume;
+ channel._volumeEnd = newVolume;
channel._volumeChangeStart = g_system->getMillis();
channel._volumeChangeEnd = channel._volumeChangeStart + channel._panRate;
+ debugC(DEBUG_DETAILED, kDebugCore, "qsWaveMixSetPanRate vol=%d to %d, start=%u, end=%u",
+ channel._volumeStart, channel._volumeEnd, channel._volumeChangeStart, channel._volumeChangeEnd);
}
void QMixer::qsWaveMixSetSourcePosition(int iChannel, uint flags, const QSVECTOR &position) {
@@ -190,6 +193,9 @@ void QMixer::qsWaveMixPump() {
(int)(currentTicks - channel._volumeChangeStart) / (int)channel._panRate;
}
+ debugC(DEBUG_DETAILED, kDebugCore, "qsWaveMixPump time=%u vol=%d",
+ currentTicks, channel._volume);
+
if (channel._volume != oldVolume && !channel._sounds.empty()
&& channel._sounds.front()._started) {
_mixer->setChannelVolume(channel._sounds.front()._soundHandle,