Fix slider buttons in LoL (and some minor cleanup).

svn-id: r41732
This commit is contained in:
Johannes Schickel 2009-06-21 19:49:20 +00:00
parent 67119f9c52
commit 198e35a79f
3 changed files with 7 additions and 7 deletions

View file

@ -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;

View file

@ -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);

View file

@ -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;