diff options
author | Strangerke | 2014-09-28 23:43:07 +0200 |
---|---|---|
committer | Strangerke | 2014-09-28 23:43:07 +0200 |
commit | 9ee78d1e4c9770d8f3b768e9823e1f93dae65b1a (patch) | |
tree | caadd639870012f368f76b3e7d8d50f2369e270f /engines/cge2 | |
parent | cd86ccb73e43ceb3109bd84c81cc43d1b1848766 (diff) | |
download | scummvm-rg350-9ee78d1e4c9770d8f3b768e9823e1f93dae65b1a.tar.gz scummvm-rg350-9ee78d1e4c9770d8f3b768e9823e1f93dae65b1a.tar.bz2 scummvm-rg350-9ee78d1e4c9770d8f3b768e9823e1f93dae65b1a.zip |
CGE2: Fix the case of a couple of constants, remove a useless variable
Diffstat (limited to 'engines/cge2')
-rw-r--r-- | engines/cge2/toolbar.cpp | 15 |
1 files changed, 7 insertions, 8 deletions
diff --git a/engines/cge2/toolbar.cpp b/engines/cge2/toolbar.cpp index 92f73877e6..0cd220c984 100644 --- a/engines/cge2/toolbar.cpp +++ b/engines/cge2/toolbar.cpp @@ -35,11 +35,11 @@ namespace CGE2 { -#define kSoundNumtoStateRate 25.7 +#define kSoundNumToStateRate 25.7 // == 257 / 10; where 10 equals to the volume switches' number of states [0..9] // and ScummVM has a scale of 257 different values for setting sounds. -#define kSoundStatetoNumRate 28.45 +#define kSoundStateToNumRate 28.45 // == 256 / 9 + 0.1; where 256 is the positive range of numbers we can set the volume to // and the 10 states of a switch cut this range up to 9 equally big parts. // We don't take into account 0 regarding the 256 different values (it would be the 257th), @@ -120,7 +120,7 @@ void CGE2Engine::setVolume(int idx, int cnt) { int p = _vol[idx]->_seqPtr + cnt; if ((p >= 0) && (p < _vol[idx]->_seqCnt)) { _vol[idx]->step(p); - int newVolume = (int)(p * kSoundStatetoNumRate); + int newVolume = (int)(p * kSoundStateToNumRate); switch (idx) { case 0: _oldSfxVolume = ConfMan.getInt("sfx_volume"); @@ -140,11 +140,11 @@ void CGE2Engine::setVolume(int idx, int cnt) { void CGE2Engine::checkVolumeSwitches() { int musicVolume = ConfMan.getInt("music_volume"); if (musicVolume != _oldMusicVolume) - _vol[1]->step((int)(musicVolume / kSoundNumtoStateRate)); + _vol[1]->step((int)(musicVolume / kSoundNumToStateRate)); int sfxVolume = ConfMan.getInt("sfx_volume"); if (sfxVolume != _oldSfxVolume) - _vol[0]->step((int)(sfxVolume / kSoundNumtoStateRate)); + _vol[0]->step((int)(sfxVolume / kSoundNumToStateRate)); } void CGE2Engine::switchCap() { @@ -208,14 +208,13 @@ void CGE2Engine::initToolbar() { void CGE2Engine::initVolumeSwitch(Sprite *volSwitch, int val) { int state = 0; - state = (int)(val / kSoundNumtoStateRate); + state = (int)(val / kSoundNumToStateRate); volSwitch->step(state); } void CGE2Engine::checkMute() { bool mute = ConfMan.getBool("mute"); - bool mutedChanged = mute != _muteAll; - if (mutedChanged) { + if (mute != _muteAll) { switchMusic(); switchVox(); _muteAll = mute; |