diff --git a/engines/tinsel/config.cpp b/engines/tinsel/config.cpp index cb2099c130a..803d2231e4c 100644 --- a/engines/tinsel/config.cpp +++ b/engines/tinsel/config.cpp @@ -39,9 +39,9 @@ namespace Tinsel { //----------------- GLOBAL GLOBAL DATA -------------------- int dclickSpeed = DOUBLE_CLICK_TIME; -int volMidi = MAXMIDIVOL; -int volSound = MAXSAMPVOL; -int volVoice = MAXSAMPVOL; +int volMidi = Audio::Mixer::kMaxChannelVolume; +int volSound = Audio::Mixer::kMaxChannelVolume; +int volVoice = Audio::Mixer::kMaxChannelVolume; int speedText = DEFTEXTSPEED; int bSubtitles = false; int bSwapButtons = 0; @@ -57,9 +57,9 @@ bool bNoBlocking; */ void WriteConfig(void) { ConfMan.setInt("dclick_speed", dclickSpeed); - ConfMan.setInt("music_volume", (volMidi * Audio::Mixer::kMaxChannelVolume) / MAXMIDIVOL); - ConfMan.setInt("sfx_volume", (volSound * Audio::Mixer::kMaxChannelVolume) / MAXSAMPVOL); - ConfMan.setInt("speech_volume", (volVoice * Audio::Mixer::kMaxChannelVolume) / MAXSAMPVOL); + ConfMan.setInt("music_volume", volMidi); + ConfMan.setInt("sfx_volume", volSound); + ConfMan.setInt("speech_volume", volVoice); ConfMan.setInt("talkspeed", (speedText * 255) / 100); ConfMan.setBool("subtitles", bSubtitles); //ConfMan.setBool("swap_buttons", bSwapButtons ? 1 : 0); @@ -101,9 +101,9 @@ void ReadConfig(void) { if (ConfMan.hasKey("dclick_speed")) dclickSpeed = ConfMan.getInt("dclick_speed"); - volMidi = (ConfMan.getInt("music_volume") * MAXMIDIVOL) / Audio::Mixer::kMaxChannelVolume; - volSound = (ConfMan.getInt("sfx_volume") * MAXSAMPVOL) / Audio::Mixer::kMaxChannelVolume; - volVoice = (ConfMan.getInt("speech_volume") * MAXSAMPVOL) / Audio::Mixer::kMaxChannelVolume; + volMidi = ConfMan.getInt("music_volume"); + volSound = ConfMan.getInt("sfx_volume"); + volVoice = ConfMan.getInt("speech_volume"); if (ConfMan.hasKey("talkspeed")) speedText = (ConfMan.getInt("talkspeed") * 100) / 255; diff --git a/engines/tinsel/inventory.cpp b/engines/tinsel/inventory.cpp index ffecacd1be9..d20ada51ac4 100644 --- a/engines/tinsel/inventory.cpp +++ b/engines/tinsel/inventory.cpp @@ -525,9 +525,9 @@ CONFBOX restartBox[] = { }; #else CONFBOX soundBox[] = { - { SLIDER, MIDIVOL, NULL, SIX_MVOL_SLIDER, 142, 25, MAXMIDIVOL, 2, &volMidi, 0 }, - { SLIDER, NOFUNC, NULL, SIX_SVOL_SLIDER, 142, 25+40, MAXSAMPVOL, 2, &volSound, 0 }, - { SLIDER, NOFUNC, NULL, SIX_VVOL_SLIDER, 142, 25+2*40, MAXSAMPVOL, 2, &volVoice, 0 } + { SLIDER, MIDIVOL, NULL, SIX_MVOL_SLIDER, 142, 25, Audio::Mixer::kMaxChannelVolume, 2, &volMidi, 0 }, + { SLIDER, NOFUNC, NULL, SIX_SVOL_SLIDER, 142, 25+40, Audio::Mixer::kMaxChannelVolume, 2, &volSound, 0 }, + { SLIDER, NOFUNC, NULL, SIX_VVOL_SLIDER, 142, 25+2*40, Audio::Mixer::kMaxChannelVolume, 2, &volVoice, 0 } }; #endif diff --git a/engines/tinsel/music.cpp b/engines/tinsel/music.cpp index 4d77ee4ace9..d165ba0a106 100644 --- a/engines/tinsel/music.cpp +++ b/engines/tinsel/music.cpp @@ -263,7 +263,7 @@ int GetMidiVolume() { * @param vol New volume - 0..MAXMIDIVOL */ void SetMidiVolume(int vol) { - assert(vol >= 0 && vol <= MAXMIDIVOL); + assert(vol >= 0 && vol <= Audio::Mixer::kMaxChannelVolume); if (vol == 0 && volMidi == 0) { // Nothing to do @@ -343,8 +343,6 @@ MusicPlayer::~MusicPlayer() { } void MusicPlayer::setVolume(int volume) { - // FIXME: Could we simply change MAXMIDIVOL to match ScummVM's range? - volume = CLIP((255 * volume) / MAXMIDIVOL, 0, 255); _vm->_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, volume); if (_masterVolume == volume) diff --git a/engines/tinsel/music.h b/engines/tinsel/music.h index 80456e2a760..3d647f95bf7 100644 --- a/engines/tinsel/music.h +++ b/engines/tinsel/music.h @@ -34,8 +34,6 @@ namespace Tinsel { -#define MAXMIDIVOL 127 - bool PlayMidiSequence( // Plays the specified MIDI sequence through the sound driver uint32 dwFileOffset, // handle of MIDI sequence data bool bLoop); // Whether to loop the sequence diff --git a/engines/tinsel/sound.h b/engines/tinsel/sound.h index c17995e91e9..330409cf591 100644 --- a/engines/tinsel/sound.h +++ b/engines/tinsel/sound.h @@ -37,7 +37,6 @@ namespace Tinsel { -#define MAXSAMPVOL 127 /*----------------------------------------------------------------------*\ |* Function Prototypes *|