diff options
| author | uruk | 2014-07-29 16:27:18 +0200 | 
|---|---|---|
| committer | uruk | 2014-07-29 16:27:18 +0200 | 
| commit | fc8f6d9cfef1345774ef3dc4a0193033597a4b04 (patch) | |
| tree | 0e05902e681eeb4e63740973c698963b6752d5aa | |
| parent | b33653000da25846bebe7a76c26337d49743884d (diff) | |
| download | scummvm-rg350-fc8f6d9cfef1345774ef3dc4a0193033597a4b04.tar.gz scummvm-rg350-fc8f6d9cfef1345774ef3dc4a0193033597a4b04.tar.bz2 scummvm-rg350-fc8f6d9cfef1345774ef3dc4a0193033597a4b04.zip | |
CGE2: Fix initialization of volume switches.
| -rw-r--r-- | engines/cge2/cge2.h | 1 | ||||
| -rw-r--r-- | engines/cge2/toolbar.cpp | 11 | 
2 files changed, 10 insertions, 2 deletions
| diff --git a/engines/cge2/cge2.h b/engines/cge2/cge2.h index 05afd2640d..38b48aaa23 100644 --- a/engines/cge2/cge2.h +++ b/engines/cge2/cge2.h @@ -218,6 +218,7 @@ public:  	void switchSay();  	void checkSaySwitch();  	void initToolbar(); +	void initVolumeSwitch(Sprite *volSwitch);  	void checkSounds(); diff --git a/engines/cge2/toolbar.cpp b/engines/cge2/toolbar.cpp index 2604a2fee7..51614af8ed 100644 --- a/engines/cge2/toolbar.cpp +++ b/engines/cge2/toolbar.cpp @@ -281,9 +281,16 @@ void CGE2Engine::initToolbar() {  	_vol[1] = _vga->_showQ->locate(kMvolRef);  	if (_vol[0]) -		_vol[0]->step(ConfMan.getInt("sfx_volume") / kSoundNumtoStateRate); +		initVolumeSwitch(_vol[0]);  	if (_vol[1]) -		_vol[1]->step(ConfMan.getInt("music_volume") / kSoundNumtoStateRate); +		initVolumeSwitch(_vol[1]); +} + +void CGE2Engine::initVolumeSwitch(Sprite *volSwitch) { +	int state = 0; +	if (!ConfMan.getBool("mute")) +		state = ConfMan.getInt("sfx_volume") / kSoundNumtoStateRate; +	volSwitch->step(state);  }  } // End of namespace CGE2 | 
