aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2015-12-26 13:03:26 +0200
committerFilippos Karapetis2015-12-26 13:03:26 +0200
commit6910a3b2690040dfa6592e6a49f0dbf95d2a2855 (patch)
tree997bd7b5c28b0410d35e4d0571452df6af3758c1 /engines
parentdc08713249c187bdb085570f12026cdaa2636ea6 (diff)
downloadscummvm-rg350-6910a3b2690040dfa6592e6a49f0dbf95d2a2855.tar.gz
scummvm-rg350-6910a3b2690040dfa6592e6a49f0dbf95d2a2855.tar.bz2
scummvm-rg350-6910a3b2690040dfa6592e6a49f0dbf95d2a2855.zip
LAB: Implement changeVolume()
Diffstat (limited to 'engines')
-rw-r--r--engines/lab/lab.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/engines/lab/lab.cpp b/engines/lab/lab.cpp
index e942617a26..815053e71e 100644
--- a/engines/lab/lab.cpp
+++ b/engines/lab/lab.cpp
@@ -221,7 +221,12 @@ void LabEngine::drawStaticMessage(byte index) {
}
void LabEngine::changeVolume(int delta) {
- warning("STUB: changeVolume()");
+ int sfxPrev = _mixer->getVolumeForSoundType(Audio::Mixer::kSFXSoundType);
+ int musicPrev = _mixer->getVolumeForSoundType(Audio::Mixer::kMusicSoundType);
+ int sfxNew = (delta > 0) ? MIN<int>(sfxPrev + 10, Audio::Mixer::kMaxMixerVolume) : MAX<int>(sfxPrev - 10, 0);
+ int musicNew = (delta > 0) ? MIN<int>(musicPrev + 10, Audio::Mixer::kMaxMixerVolume) : MAX<int>(musicPrev - 10, 0);
+ _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, sfxNew);
+ _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, musicNew);
}
void LabEngine::waitTOF() {