aboutsummaryrefslogtreecommitdiff
path: root/sword2/controls.cpp
diff options
context:
space:
mode:
authorMax Horn2004-12-27 03:00:36 +0000
committerMax Horn2004-12-27 03:00:36 +0000
commit01fc7adffdd8f43c1646486c064e49057c47c97e (patch)
treea890472c2e3ecd05dd67551bdc5e1470ccb3406e /sword2/controls.cpp
parent357eb38b49c47efdd11ea94f649ed900f505dcfd (diff)
downloadscummvm-rg350-01fc7adffdd8f43c1646486c064e49057c47c97e.tar.gz
scummvm-rg350-01fc7adffdd8f43c1646486c064e49057c47c97e.tar.bz2
scummvm-rg350-01fc7adffdd8f43c1646486c064e49057c47c97e.zip
Use the same volume ranges as most of the rest of ScummVM (i.e. 0-255)
svn-id: r16333
Diffstat (limited to 'sword2/controls.cpp')
-rw-r--r--sword2/controls.cpp35
1 files changed, 9 insertions, 26 deletions
diff --git a/sword2/controls.cpp b/sword2/controls.cpp
index 899bb40d4d..c3712970b9 100644
--- a/sword2/controls.cpp
+++ b/sword2/controls.cpp
@@ -891,9 +891,9 @@ public:
_fxSwitch->linkSurfaceImages(_musicSwitch, 516, 250);
_fxSwitch->reverseStates();
- _musicSlider = new Slider(this, _panel, 16, 309, 161, 170, 27);
- _speechSlider = new Slider(this, _panel, 14, 309, 208, 170, 27, _musicSlider);
- _fxSlider = new Slider(this, _panel, 14, 309, 254, 170, 27, _musicSlider);
+ _musicSlider = new Slider(this, _panel, 255, 309, 161, 170, 27);
+ _speechSlider = new Slider(this, _panel, 255, 309, 208, 170, 27, _musicSlider);
+ _fxSlider = new Slider(this, _panel, 255, 309, 254, 170, 27, _musicSlider);
_gfxSlider = new Slider(this, _panel, 3, 309, 341, 170, 27, _musicSlider);
_gfxPreview = new Widget(this, 4);
@@ -1476,23 +1476,6 @@ public:
};
Gui::Gui(Sword2Engine *vm) : _vm(vm), _baseSlot(0) {
- int i;
-
- for (i = 0; i < ARRAYSIZE(_musicVolume); i++) {
- _musicVolume[i] = (i * 255) / (ARRAYSIZE(_musicVolume) - 1);
- if ((i * 255) % (ARRAYSIZE(_musicVolume) - 1))
- _musicVolume[i]++;
- }
-
- for (i = 0; i < ARRAYSIZE(_soundVolume); i++) {
- _soundVolume[i] = (i * 255) / (ARRAYSIZE(_soundVolume) - 1);
- if ((i * 255) % (ARRAYSIZE(_soundVolume) - 1))
- _soundVolume[i]++;
- }
-
- ConfMan.registerDefault("music_volume", _musicVolume[12]);
- ConfMan.registerDefault("speech_volume", _soundVolume[10]);
- ConfMan.registerDefault("sfx_volume", _soundVolume[10]);
ConfMan.registerDefault("music_mute", false);
ConfMan.registerDefault("speech_mute", false);
ConfMan.registerDefault("sfx_mute", false);
@@ -1508,9 +1491,9 @@ void Gui::readOptionSettings(void) {
updateGraphicsLevel((uint8) ConfMan.getInt("gfx_details"));
- _vm->_sound->setMusicVolume((16 * ConfMan.getInt("music_volume")) / 255);
- _vm->_sound->setSpeechVolume((14 * ConfMan.getInt("speech_volume")) / 255);
- _vm->_sound->setFxVolume((14 * ConfMan.getInt("sfx_volume")) / 255);
+ _vm->_sound->setMusicVolume(ConfMan.getInt("music_volume"));
+ _vm->_sound->setSpeechVolume(ConfMan.getInt("speech_volume"));
+ _vm->_sound->setFxVolume(ConfMan.getInt("sfx_volume"));
_vm->_sound->muteMusic(ConfMan.getBool("music_mute"));
_vm->_sound->muteSpeech(ConfMan.getBool("speech_mute"));
_vm->_sound->muteFx(ConfMan.getBool("sfx_mute"));
@@ -1518,9 +1501,9 @@ void Gui::readOptionSettings(void) {
}
void Gui::writeOptionSettings(void) {
- ConfMan.set("music_volume", _musicVolume[_vm->_sound->getMusicVolume()]);
- ConfMan.set("speech_volume", _soundVolume[_vm->_sound->getSpeechVolume()]);
- ConfMan.set("sfx_volume", _soundVolume[_vm->_sound->getFxVolume()]);
+ ConfMan.set("music_volume", _vm->_sound->getMusicVolume());
+ ConfMan.set("speech_volume", _vm->_sound->getSpeechVolume());
+ ConfMan.set("sfx_volume", _vm->_sound->getFxVolume());
ConfMan.set("music_mute", _vm->_sound->isMusicMute());
ConfMan.set("speech_mute", _vm->_sound->isSpeechMute());
ConfMan.set("sfx_mute", _vm->_sound->isFxMute());