[Scummvm-cvs-logs] scummvm master -> 28a450982ae4e144f991e243c216ec5bc65576ad
urukgit
urukgit at users.noreply.github.com
Wed Aug 13 20:26:17 CEST 2014
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
28a450982a CGE2: Fix initVolumeSwitch().
Commit: 28a450982ae4e144f991e243c216ec5bc65576ad
https://github.com/scummvm/scummvm/commit/28a450982ae4e144f991e243c216ec5bc65576ad
Author: uruk (koppirnyo at gmail.com)
Date: 2014-08-13T20:25:38+02:00
Commit Message:
CGE2: Fix initVolumeSwitch().
Changed paths:
engines/cge2/cge2.h
engines/cge2/toolbar.cpp
diff --git a/engines/cge2/cge2.h b/engines/cge2/cge2.h
index 4fc19a8..cf03d09 100644
--- a/engines/cge2/cge2.h
+++ b/engines/cge2/cge2.h
@@ -224,7 +224,7 @@ public:
void switchVox();
void switchSay();
void initToolbar();
- void initVolumeSwitch(Sprite *volSwitch);
+ void initVolumeSwitch(Sprite *volSwitch, int val);
void checkSounds();
diff --git a/engines/cge2/toolbar.cpp b/engines/cge2/toolbar.cpp
index 3972df9..501a25c 100644
--- a/engines/cge2/toolbar.cpp
+++ b/engines/cge2/toolbar.cpp
@@ -198,17 +198,20 @@ void CGE2Engine::initToolbar() {
_vol[0] = _vga->_showQ->locate(kDvolRef);
_vol[1] = _vga->_showQ->locate(kMvolRef);
- if (_vol[0])
- initVolumeSwitch(_vol[0]);
+ if (_vol[0]) {
+ int val = ConfMan.getInt("sfx_volume");
+ initVolumeSwitch(_vol[0], val);
+ }
- if (_vol[1])
- initVolumeSwitch(_vol[1]);
+ if (_vol[1]) {
+ int val = ConfMan.getInt("music_volume");
+ initVolumeSwitch(_vol[1], val);
+ }
}
-void CGE2Engine::initVolumeSwitch(Sprite *volSwitch) {
+void CGE2Engine::initVolumeSwitch(Sprite *volSwitch, int val) {
int state = 0;
- if (!ConfMan.getBool("mute"))
- state = ConfMan.getInt("sfx_volume") / kSoundNumtoStateRate;
+ state = val / kSoundNumtoStateRate;
volSwitch->step(state);
}
More information about the Scummvm-git-logs
mailing list