diff options
Diffstat (limited to 'sound')
-rw-r--r-- | sound/mixer.cpp | 8 | ||||
-rw-r--r-- | sound/mixer.h | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/sound/mixer.cpp b/sound/mixer.cpp index 73b793814c..e44b459ca4 100644 --- a/sound/mixer.cpp +++ b/sound/mixer.cpp @@ -201,6 +201,11 @@ void SoundMixer::set_volume(int volume) _volume_table[i] = ((int8)i) * volume; } +void SoundMixer::set_music_volume(int volume) +{ + _music_volume = volume; +} + #ifdef COMPRESSED_SOUND_FILE bool SoundMixer::Channel::sound_finished() { @@ -710,8 +715,7 @@ void SoundMixer::Channel_MP3_CDMUSIC::mix(int16 *data, uint len) { mad_fixed_t const *ch; mad_timer_t frame_duration; - const int16 *vol_tab = _mixer->_volume_table; - unsigned char volume = ((int)vol_tab[1]) * 32 / 255; + unsigned char volume = _mixer->_music_volume * 32 / 255; if (_to_be_destroyed) { real_destroy(); diff --git a/sound/mixer.h b/sound/mixer.h index 531cfc9c69..49fe0eca19 100644 --- a/sound/mixer.h +++ b/sound/mixer.h @@ -131,6 +131,7 @@ public: uint _output_rate; int16 *_volume_table; + int _music_volume; bool _paused; @@ -192,6 +193,7 @@ public: /* set the volume, 0-256 */ void set_volume(int volume); + void set_music_volume(int volume); /* pause - unpause */ void pause(bool paused); |