diff options
author | Max Horn | 2002-07-29 16:12:15 +0000 |
---|---|---|
committer | Max Horn | 2002-07-29 16:12:15 +0000 |
commit | a99fe80d4b721e7e8745c6fd0c9d8b75205bba6b (patch) | |
tree | 8c40de658e150058102033bedbd1917fb1144c97 /sound | |
parent | e5e119947f51c1eb6255df39bb3cdc2424e974ff (diff) | |
download | scummvm-rg350-a99fe80d4b721e7e8745c6fd0c9d8b75205bba6b.tar.gz scummvm-rg350-a99fe80d4b721e7e8745c6fd0c9d8b75205bba6b.tar.bz2 scummvm-rg350-a99fe80d4b721e7e8745c6fd0c9d8b75205bba6b.zip |
fixed imuse volume bug introduced recently by me and painelf - iMuse internally does require the 0-127 change
svn-id: r4677
Diffstat (limited to 'sound')
-rw-r--r-- | sound/imuse.cpp | 24 |
1 files changed, 15 insertions, 9 deletions
diff --git a/sound/imuse.cpp b/sound/imuse.cpp index 200a1ab008..8490f20b20 100644 --- a/sound/imuse.cpp +++ b/sound/imuse.cpp @@ -400,6 +400,8 @@ private: void lock(); void unlock(); + int set_master_volume_intern(uint vol); + public: Part *parts_ptr() { return _parts; @@ -1264,13 +1266,8 @@ int IMuseInternal::set_music_volume(uint vol) return 0; } -int IMuseInternal::set_master_volume(uint vol) +int IMuseInternal::set_master_volume_intern(uint vol) { - int i; - - // recalibrate from 0-256 range - vol = vol * 127 / 256; - if (vol > 127) return -1; @@ -1278,12 +1275,21 @@ int IMuseInternal::set_master_volume(uint vol) vol = vol * _music_volume / 128; _master_volume = vol; - for (i = 0; i != 8; i++) + for (int i = 0; i != 8; i++) _channel_volume_eff[i] = (_channel_volume[i] + 1) * vol >> 7; update_volumes(); + return 0; } +int IMuseInternal::set_master_volume(uint vol) +{ + // recalibrate from 0-256 range + vol = vol * 127 / 256; + + return set_master_volume_intern(vol); +} + int IMuseInternal::get_master_volume() { // recalibrate to 0-256 range @@ -1334,9 +1340,9 @@ int32 IMuseInternal::do_command(int a, int b, int c, int d, int e, int f, int g, if (param == 0) { switch (cmd) { case 6: - return set_master_volume(b); + return set_master_volume_intern(b); case 7: - return get_master_volume(); + return _master_volume; case 8: return start_sound(b) ? 0 : -1; case 9: |