diff options
author | Jamieson Christian | 2002-11-19 17:18:16 +0000 |
---|---|---|
committer | Jamieson Christian | 2002-11-19 17:18:16 +0000 |
commit | 69c7179e562c9d2ad9b5bf4f3bc376ec10d607a9 (patch) | |
tree | 29f7bc282c8c4a5bffa279f4bb23fe51791c2ad4 | |
parent | 5627fb7c0b84ee0a8f7e068ef4543709ad842a66 (diff) | |
download | scummvm-rg350-69c7179e562c9d2ad9b5bf4f3bc376ec10d607a9.tar.gz scummvm-rg350-69c7179e562c9d2ad9b5bf4f3bc376ec10d607a9.tar.bz2 scummvm-rg350-69c7179e562c9d2ad9b5bf4f3bc376ec10d607a9.zip |
Volume control fixes
svn-id: r5623
-rw-r--r-- | scumm/scummvm.cpp | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/scumm/scummvm.cpp b/scumm/scummvm.cpp index 6e7e81a9aa..ba61000857 100644 --- a/scumm/scummvm.cpp +++ b/scumm/scummvm.cpp @@ -157,7 +157,7 @@ Scumm::Scumm (GameDetector *detector, OSystem *syst) } _silentDigitalImuse = true; } - _mixer->setVolume(kDefaultSFXVolume); + _mixer->setVolume(kDefaultSFXVolume * kDefaultMasterVolume / 255); _mixer->setMusicVolume(kDefaultMusicVolume); // Init iMuse @@ -1129,20 +1129,21 @@ void Scumm::processKbd() if (_sound->_sfxMode & 2) stopTalk(); return; - } else if (_lastKeyHit == '[') { // [ volume down - _sound->_sound_volume_master-=5; - if (_sound->_sound_volume_master < 0) - _sound->_sound_volume_master = 0; - if (_imuse) { - _imuse->set_master_volume(_sound->_sound_volume_master); - } - } else if (_lastKeyHit == ']') { // ] volume down - _sound->_sound_volume_master+=5; - if (_sound->_sound_volume_master > 128) - _sound->_sound_volume_master = 128; - if (_imuse) { - _imuse->set_master_volume(_sound->_sound_volume_master); - } + } else if (_lastKeyHit == '[') { // [ Music volume down + int vol = _sound->_sound_volume_music; + if (!(vol & 0xF) && vol) + vol -= 16; + vol = vol & 0xF0; + _sound->_sound_volume_music = vol; + if (_imuse) + _imuse->set_music_volume (vol); + } else if (_lastKeyHit == ']') { // ] Music volume up + int vol = _sound->_sound_volume_music; + vol = (vol + 16) & 0xFF0; + if (vol > 255) vol = 255; + _sound->_sound_volume_music = vol; + if (_imuse) + _imuse->set_music_volume (vol); } else if (_lastKeyHit == '-') { // - text speed down _defaultTalkDelay+=5; if (_defaultTalkDelay > 90) |