diff options
author | Eugene Sandulenko | 2014-04-18 21:09:12 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2014-04-18 21:09:12 +0300 |
commit | e6c6eac9affaca53ac7f28d9a96d0a29d3826ed4 (patch) | |
tree | 937cd1afd7a0b006f6004f124ce60fda0d41f7bb | |
parent | 4598b3b2d92a75de5970d31692b0c0da14f0fb46 (diff) | |
download | scummvm-rg350-e6c6eac9affaca53ac7f28d9a96d0a29d3826ed4.tar.gz scummvm-rg350-e6c6eac9affaca53ac7f28d9a96d0a29d3826ed4.tar.bz2 scummvm-rg350-e6c6eac9affaca53ac7f28d9a96d0a29d3826ed4.zip |
FULLPIPE: Implement ModalMainMenu::updateSliderPos()
-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 |