[Scummvm-git-logs] scummvm master -> 0849ba906804aa73f500175fe6f8d4746edc9de8
bluegr
bluegr at gmail.com
Sun Aug 30 20:35:00 UTC 2020
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
0849ba9068 ZVISION: Fix bug #7176 (Nemesis - missing temple fountain SFX)
Commit: 0849ba906804aa73f500175fe6f8d4746edc9de8
https://github.com/scummvm/scummvm/commit/0849ba906804aa73f500175fe6f8d4746edc9de8
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2020-08-30T23:34:36+03:00
Commit Message:
ZVISION: Fix bug #7176 (Nemesis - missing temple fountain SFX)
This reverts commit 0bc61d3c2130981e06199b60fe553b2095af287a.
The volume mapping does not match what the original is doing. In the
case of this bug, a volume of 127 for the fountain sound would be
mapped to 2/255 when standing right in front of it, which is too quiet.
Changed paths:
engines/zvision/scripting/effects/music_effect.cpp
diff --git a/engines/zvision/scripting/effects/music_effect.cpp b/engines/zvision/scripting/effects/music_effect.cpp
index a0d0c317e6..a8c51f22cb 100644
--- a/engines/zvision/scripting/effects/music_effect.cpp
+++ b/engines/zvision/scripting/effects/music_effect.cpp
@@ -36,7 +36,9 @@
namespace ZVision {
-static const uint8 dbMapLinear[256] =
+// FIXME: This is wrong, and not what the original is doing.
+// Using actual linear volume values fixes bug #7176.
+/*static const uint8 dbMapLinear[256] =
{0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@@ -52,7 +54,7 @@ static const uint8 dbMapLinear[256] =
26, 27, 28, 29, 30, 31, 32, 33, 34, 36, 37, 38, 40, 41, 43, 45,
46, 48, 50, 52, 53, 55, 57, 60, 62, 64, 67, 69, 72, 74, 77, 80,
83, 86, 89, 92, 96, 99, 103, 107, 111, 115, 119, 123, 128, 133, 137, 143,
-148, 153, 159, 165, 171, 177, 184, 191, 198, 205, 212, 220, 228, 237, 245, 255};
+148, 153, 159, 165, 171, 177, 184, 191, 198, 205, 212, 220, 228, 237, 245, 255};*/
MusicNode::MusicNode(ZVision *engine, uint32 key, Common::String &filename, bool loop, uint8 volume)
: MusicNodeBASE(engine, key, SCRIPTING_EFFECT_AUDIO) {
@@ -83,9 +85,9 @@ MusicNode::MusicNode(ZVision *engine, uint32 key, Common::String &filename, bool
if (_loop) {
Audio::LoopingAudioStream *loopingAudioStream = new Audio::LoopingAudioStream(audioStream, 0, DisposeAfterUse::YES);
- _engine->_mixer->playStream(Audio::Mixer::kPlainSoundType, &_handle, loopingAudioStream, -1, dbMapLinear[_volume]);
+ _engine->_mixer->playStream(Audio::Mixer::kPlainSoundType, &_handle, loopingAudioStream, -1, _volume /*dbMapLinear[_volume]*/);
} else {
- _engine->_mixer->playStream(Audio::Mixer::kPlainSoundType, &_handle, audioStream, -1, dbMapLinear[_volume]);
+ _engine->_mixer->playStream(Audio::Mixer::kPlainSoundType, &_handle, audioStream, -1, _volume /*dbMapLinear[_volume]*/);
}
if (_key != StateKey_NotSet)
@@ -166,7 +168,7 @@ void MusicNode::setVolume(uint8 newVolume) {
if (_deltaVolume >= _volume)
_engine->_mixer->setChannelVolume(_handle, 0);
else
- _engine->_mixer->setChannelVolume(_handle, dbMapLinear[_volume - _deltaVolume]);
+ _engine->_mixer->setChannelVolume(_handle, _volume - _deltaVolume /*dbMapLinear[_volume - _deltaVolume]*/);
}
uint8 MusicNode::getVolume() {
More information about the Scummvm-git-logs
mailing list