diff options
-rw-r--r-- | engines/fullpipe/fullpipe.h | 1 | ||||
-rw-r--r-- | engines/fullpipe/modal.cpp | 36 | ||||
-rw-r--r-- | engines/fullpipe/sound.cpp | 4 |
3 files changed, 40 insertions, 1 deletions
diff --git a/engines/fullpipe/fullpipe.h b/engines/fullpipe/fullpipe.h index 9ba5da3726..5c3eeaebfb 100644 --- a/engines/fullpipe/fullpipe.h +++ b/engines/fullpipe/fullpipe.h @@ -161,6 +161,7 @@ public: void stopAllSoundStreams(); void stopAllSoundInstances(int id); void updateSoundVolume(); + void setMusicVolume(int vol); int _sfxVolume; diff --git a/engines/fullpipe/modal.cpp b/engines/fullpipe/modal.cpp index 5cdc449d91..85cb06544d 100644 --- a/engines/fullpipe/modal.cpp +++ b/engines/fullpipe/modal.cpp @@ -1028,7 +1028,41 @@ void ModalMainMenu::updateVolume() { } void ModalMainMenu::updateSliderPos() { - warning("STUB: ModalMainMenu::updateSliderPos()"); + if (_lastArea->picIdL == PIC_MNU_SLIDER_L) { + int x = g_fp->_mouseScreenPos.x + _sliderOffset; + + if (x >= 65) { + if (x > 238) + x = 238; + } else { + x = 65; + } + + _lastArea->picObjD->setOXY(x, _lastArea->picObjD->_oy); + _lastArea->picObjL->setOXY(x, _lastArea->picObjD->_oy); + + int vol = 1000 * (3 * x - 195); + g_fp->_sfxVolume = vol / 173 - 3000; + + if (!(vol / 173)) + g_fp->_sfxVolume = -10000; + + g_fp->updateSoundVolume(); + } else if (_lastArea->picIdL == PIC_MNU_MUSICSLIDER_L) { + int x = g_fp->_mouseScreenPos.x + _sliderOffset; + + if (x >= 65) { + if (x > 238) + x = 238; + } else { + x = 65; + } + + _lastArea->picObjD->setOXY(x, _lastArea->picObjD->_oy); + _lastArea->picObjL->setOXY(x, _lastArea->picObjD->_oy); + + g_fp->setMusicVolume(255 * (x - 65) / 173); + } } int ModalMainMenu::checkHover(Common::Point &point) { diff --git a/engines/fullpipe/sound.cpp b/engines/fullpipe/sound.cpp index bb6aabd2b5..b9ee473eb4 100644 --- a/engines/fullpipe/sound.cpp +++ b/engines/fullpipe/sound.cpp @@ -203,4 +203,8 @@ void FullpipeEngine::updateSoundVolume() { debug(3, "STUB FullpipeEngine::updateSoundVolume()"); } +void FullpipeEngine::setMusicVolume(int vol) { + debug(3, "STUB FullpipeEngine::setMusicVolume()"); +} + } // End of namespace Fullpipe |