diff options
Diffstat (limited to 'engines/kyra')
-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; |