diff options
author | James Brown | 2002-03-07 08:11:48 +0000 |
---|---|---|
committer | James Brown | 2002-03-07 08:11:48 +0000 |
commit | 4eb99938bf7b638cf1797445a9545e17d47ea882 (patch) | |
tree | 34f2ad808166e7fc441fb52a790e352a43eddd0c | |
parent | f5ff443424e1316cdcd6fed036a9dab97a1bbade (diff) | |
download | scummvm-rg350-4eb99938bf7b638cf1797445a9545e17d47ea882.tar.gz scummvm-rg350-4eb99938bf7b638cf1797445a9545e17d47ea882.tar.bz2 scummvm-rg350-4eb99938bf7b638cf1797445a9545e17d47ea882.zip |
Fixed music volume control for some games.
svn-id: r3680
-rw-r--r-- | scummvm.cpp | 5 | ||||
-rw-r--r-- | sound.cpp | 5 | ||||
-rw-r--r-- | sound/imuse.cpp | 4 |
3 files changed, 8 insertions, 6 deletions
diff --git a/scummvm.cpp b/scummvm.cpp index 5c854e371a..246323b02c 100644 --- a/scummvm.cpp +++ b/scummvm.cpp @@ -483,8 +483,9 @@ void Scumm::parseCommandLine(int argc, char **argv) { if (*(s+1) == '\0') goto ShowHelpAndExit; SoundEngine *se = (SoundEngine*)_soundEngine; - if (se) - se->set_music_volume(atoi(s+1)); + + if (se) + se->set_music_volume(atoi(s+1)); goto NextArg; } default: @@ -327,9 +327,10 @@ void Scumm::talkSound(uint32 a, uint32 b, int mode) { void Scumm::setupSound() { SoundEngine *se = (SoundEngine*)_soundEngine; - if (se) + if (se) { se->setBase(res.address[rtSound]); - + se->set_master_volume(100); + } _sfxFile = openSfxFile(); } diff --git a/sound/imuse.cpp b/sound/imuse.cpp index 8c3a4a5d9a..2dccd75975 100644 --- a/sound/imuse.cpp +++ b/sound/imuse.cpp @@ -635,14 +635,14 @@ int SoundEngine::set_music_volume(uint vol) { } int SoundEngine::set_master_volume(uint vol) { - int i; + int i; if (vol > 127) return -1; if (_music_volume > 0) vol = vol / (100 / _music_volume); - _master_volume = vol; + _master_volume = vol; for (i=0; i!=8; i++) _channel_volume_eff[i] = (_channel_volume[i]+1) * vol >> 7; update_volumes(); |