diff options
author | Johannes Schickel | 2009-06-21 19:49:20 +0000 |
---|---|---|
committer | Johannes Schickel | 2009-06-21 19:49:20 +0000 |
commit | 198e35a79f059ab0d14bf8ded6811a25d8330d69 (patch) | |
tree | af413b0d7949e2eca08ed7f82ff30309c1ef0f32 | |
parent | 67119f9c52a9c5bdb0c0019e8ccdf626053f5c28 (diff) | |
download | scummvm-rg350-198e35a79f059ab0d14bf8ded6811a25d8330d69.tar.gz scummvm-rg350-198e35a79f059ab0d14bf8ded6811a25d8330d69.tar.bz2 scummvm-rg350-198e35a79f059ab0d14bf8ded6811a25d8330d69.zip |
Fix slider buttons in LoL (and some minor cleanup).
svn-id: r41732
-rw-r--r-- | engines/kyra/gui_hof.cpp | 3 | ||||
-rw-r--r-- | engines/kyra/gui_lol.cpp | 6 | ||||
-rw-r--r-- | engines/kyra/gui_mr.cpp | 5 |
3 files changed, 7 insertions, 7 deletions
diff --git a/engines/kyra/gui_hof.cpp b/engines/kyra/gui_hof.cpp index 7a7f7c1c84..d89529a9aa 100644 --- a/engines/kyra/gui_hof.cpp +++ b/engines/kyra/gui_hof.cpp @@ -1098,8 +1098,7 @@ int GUI_HoF::sliderHandler(Button *caller) { else newVolume = _vm->_mouseX - caller->x - 7; - newVolume = MAX(2, newVolume); - newVolume = MIN(97, newVolume); + newVolume = CLIP(newVolume, 2, 97); if (newVolume == oldVolume) return 0; diff --git a/engines/kyra/gui_lol.cpp b/engines/kyra/gui_lol.cpp index dcd9727824..5ac6ed8380 100644 --- a/engines/kyra/gui_lol.cpp +++ b/engines/kyra/gui_lol.cpp @@ -2670,7 +2670,7 @@ int GUI_LoL::clickedAudioMenu(Button *button) { } int tX = button->x; - int oldVolume = _vm->getVolume((KyraEngine_v1::kVolumeEntry)(button->arg - 3)); + const int oldVolume = _vm->getVolume((KyraEngine_v1::kVolumeEntry)(button->arg - 3)); int newVolume = oldVolume; if (button->index == 0) { @@ -2689,7 +2689,9 @@ int GUI_LoL::clickedAudioMenu(Button *button) { return 0; _screen->drawShape(0, _vm->_gameShapes[87], tX + oldVolume, button->y, 0, 0x10); - _screen->drawShape(0, _vm->_gameShapes[86], tX + newVolume, button->y, 0, 0x10); + // Temporary HACK + const int volumeDrawX = _vm->convertValueFromMixer(_vm->convertValueToMixer(newVolume)); + _screen->drawShape(0, _vm->_gameShapes[86], tX + volumeDrawX, button->y, 0, 0x10); _screen->updateScreen(); _vm->snd_stopSpeech(0); diff --git a/engines/kyra/gui_mr.cpp b/engines/kyra/gui_mr.cpp index 4340cf793c..02ed7f8746 100644 --- a/engines/kyra/gui_mr.cpp +++ b/engines/kyra/gui_mr.cpp @@ -1554,7 +1554,7 @@ int GUI_MR::sliderHandler(Button *caller) { assert(button >= 0 && button <= 3); - int oldVolume = _vm->getVolume(KyraEngine_v1::kVolumeEntry(button)); + const int oldVolume = _vm->getVolume(KyraEngine_v1::kVolumeEntry(button)); int newVolume = oldVolume; if (caller->index >= 24 && caller->index <= 27) @@ -1564,8 +1564,7 @@ int GUI_MR::sliderHandler(Button *caller) { else newVolume = _vm->_mouseX - caller->x - 7; - newVolume = MAX(2, newVolume); - newVolume = MIN(97, newVolume); + newVolume = CLIP(newVolume, 2, 97); if (newVolume == oldVolume) return 0; |