aboutsummaryrefslogtreecommitdiff
path: root/engines/cine/cine.cpp
diff options
context:
space:
mode:
authordhewg2011-03-19 14:51:28 +0100
committerdhewg2011-03-19 15:34:57 +0100
commite5056cab91843ec0de9b2c9d1b6d91ed49189da9 (patch)
tree4f2b08082dc9bf604dfcdde45cf5c463e7ce1a39 /engines/cine/cine.cpp
parentf8271e0d07db5af850934595cb2c708f7d61bfaf (diff)
downloadscummvm-rg350-e5056cab91843ec0de9b2c9d1b6d91ed49189da9.tar.gz
scummvm-rg350-e5056cab91843ec0de9b2c9d1b6d91ed49189da9.tar.bz2
scummvm-rg350-e5056cab91843ec0de9b2c9d1b6d91ed49189da9.zip
CINE: Init volume levels on startup
Add syncSoundSettings() to set the volume for kPlainSoundType and respect the global mute setting
Diffstat (limited to 'engines/cine/cine.cpp')
-rw-r--r--engines/cine/cine.cpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/engines/cine/cine.cpp b/engines/cine/cine.cpp
index d80ab70660..54d113d69c 100644
--- a/engines/cine/cine.cpp
+++ b/engines/cine/cine.cpp
@@ -50,20 +50,15 @@ Sound *g_sound = 0;
CineEngine *g_cine = 0;
CineEngine::CineEngine(OSystem *syst, const CINEGameDescription *gameDesc) : Engine(syst), _gameDescription(gameDesc) {
+ // Setup mixer
+ syncSoundSettings();
+
DebugMan.addDebugChannel(kCineDebugScript, "Script", "Script debug level");
DebugMan.addDebugChannel(kCineDebugPart, "Part", "Part debug level");
DebugMan.addDebugChannel(kCineDebugSound, "Sound", "Sound debug level");
DebugMan.addDebugChannel(kCineDebugCollision, "Collision", "Collision debug level");
_console = new CineConsole(this);
- // Setup mixer
- _mixer->setVolumeForSoundType(Audio::Mixer::kSFXSoundType, ConfMan.getInt("sfx_volume"));
- _mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, ConfMan.getInt("music_volume"));
- // Use music volume for plain sound types (At least the AdLib player uses a plain sound type
- // so previously the music and sfx volume controls didn't affect it at all).
- // FIXME: Make AdLib player differentiate between playing sound effects and music and remove this.
- _mixer->setVolumeForSoundType(Audio::Mixer::kPlainSoundType, ConfMan.getInt("music_volume"));
-
g_cine = this;
g_eventRec.registerRandomSource(_rnd, "cine");
@@ -78,6 +73,20 @@ CineEngine::~CineEngine() {
delete _console;
}
+void CineEngine::syncSoundSettings() {
+ Engine::syncSoundSettings();
+
+ bool mute = false;
+ if (ConfMan.hasKey("mute"))
+ mute = ConfMan.getBool("mute");
+
+ // Use music volume for plain sound types (At least the AdLib player uses a plain sound type
+ // so previously the music and sfx volume controls didn't affect it at all).
+ // FIXME: Make AdLib player differentiate between playing sound effects and music and remove this.
+ _mixer->setVolumeForSoundType(Audio::Mixer::kPlainSoundType,
+ mute ? 0 : ConfMan.getInt("music_volume"));
+}
+
Common::Error CineEngine::run() {
// Initialize backend
initGraphics(320, 200, false);