diff options
author | uruk | 2014-07-25 22:32:18 +0200 |
---|---|---|
committer | uruk | 2014-07-25 22:32:18 +0200 |
commit | 944465431a4b0d4c8372456e52720f7baf5865ec (patch) | |
tree | 77db601fe72a4c9f028bb0065ec2fae9aedb1e5f /engines | |
parent | 668b133dabdf642ee08b53bab75a273c90cc9529 (diff) | |
download | scummvm-rg350-944465431a4b0d4c8372456e52720f7baf5865ec.tar.gz scummvm-rg350-944465431a4b0d4c8372456e52720f7baf5865ec.tar.bz2 scummvm-rg350-944465431a4b0d4c8372456e52720f7baf5865ec.zip |
CGE2: Implement the sfx volume button on the toolbar.
Diffstat (limited to 'engines')
-rw-r--r-- | engines/cge2/cge2.cpp | 3 | ||||
-rw-r--r-- | engines/cge2/cge2.h | 2 | ||||
-rw-r--r-- | engines/cge2/toolbar.cpp | 10 |
3 files changed, 14 insertions, 1 deletions
diff --git a/engines/cge2/cge2.cpp b/engines/cge2/cge2.cpp index d28215bc93..9dbbf7db06 100644 --- a/engines/cge2/cge2.cpp +++ b/engines/cge2/cge2.cpp @@ -74,6 +74,7 @@ CGE2Engine::CGE2Engine(OSystem *syst, const ADGameDescription *gameDescription) _quitFlag = false; _bitmapPalette = nullptr; _music = true; + _sfx = true; _startupMode = 1; _now = 1; _sex = 1; @@ -102,7 +103,7 @@ CGE2Engine::CGE2Engine(OSystem *syst, const ADGameDescription *gameDescription) } else { _oldSpeechVolume = ConfMan.getInt("speech_volume"); _oldMusicVolume = _musicVolume = ConfMan.getInt("music_volume"); - _sfxVolume = ConfMan.getInt("sfx_volume"); + _oldSfxVolume = _sfxVolume = ConfMan.getInt("sfx_volume"); } } diff --git a/engines/cge2/cge2.h b/engines/cge2/cge2.h index caf39227c6..613168e88e 100644 --- a/engines/cge2/cge2.h +++ b/engines/cge2/cge2.h @@ -260,7 +260,9 @@ public: bool _quitFlag; Dac *_bitmapPalette; bool _music; + bool _sfx; int _oldMusicVolume; + int _oldSfxVolume; int _startupMode; int _now; int _sex; diff --git a/engines/cge2/toolbar.cpp b/engines/cge2/toolbar.cpp index edabd123b0..bf538b5f5a 100644 --- a/engines/cge2/toolbar.cpp +++ b/engines/cge2/toolbar.cpp @@ -194,6 +194,16 @@ void CGE2Engine::checkVolumeSwitches() { if (musicMuted && _music) { _vol[1]->step(0); } + + if ((!sfxMuted && !_sfx) || (sfxVolume != _oldSfxVolume)) { + _vol[0]->step(sfxVolume / kSoundNumtoStateRate); + _oldSfxVolume = sfxVolume; + _sfx = true; + } + if (sfxMuted && _sfx) { + _vol[0]->step(0); + _sfx = false; + } } void CGE2Engine::switchCap() { |