[Scummvm-git-logs] scummvm master -> 12b5dde457cb69e7e8e7136628889f57f4ecfd04

antoniou79 antoniou at cti.gr
Fri Jun 21 15:18:09 CEST 2019


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:
12b5dde457 BLADERUNNER: Fix max volume in VQAs with audio stream


Commit: 12b5dde457cb69e7e8e7136628889f57f4ecfd04
    https://github.com/scummvm/scummvm/commit/12b5dde457cb69e7e8e7136628889f57f4ecfd04
Author: Thanasis Antoniou (a.antoniou79 at gmail.com)
Date: 2019-06-21T16:09:58+03:00

Commit Message:
BLADERUNNER: Fix max volume in VQAs with audio stream

Closes #10987

Changed paths:
    engines/bladerunner/audio_player.cpp
    engines/bladerunner/bladerunner.cpp
    engines/bladerunner/vqa_player.cpp


diff --git a/engines/bladerunner/audio_player.cpp b/engines/bladerunner/audio_player.cpp
index 8673fab..4fb2fef 100644
--- a/engines/bladerunner/audio_player.cpp
+++ b/engines/bladerunner/audio_player.cpp
@@ -48,7 +48,7 @@ AudioPlayer::AudioPlayer(BladeRunnerEngine *vm) {
 		_tracks[i].stream = nullptr;
 	}
 
-	_sfxVolume =BLADERUNNER_ORIGINAL_SETTINGS ? 65 : 100;
+	_sfxVolume = BLADERUNNER_ORIGINAL_SETTINGS ? 65 : 100;
 }
 
 AudioPlayer::~AudioPlayer() {
diff --git a/engines/bladerunner/bladerunner.cpp b/engines/bladerunner/bladerunner.cpp
index 0966b6c..45bd857 100644
--- a/engines/bladerunner/bladerunner.cpp
+++ b/engines/bladerunner/bladerunner.cpp
@@ -465,20 +465,6 @@ bool BladeRunnerEngine::startup(bool hasSavegames) {
 	_gameFlags = new GameFlags();
 	_gameFlags->setFlagCount(_gameInfo->getFlagCount());
 
-	// Assign default values to the ScummVM configuration manager, in case settings are missing
-	ConfMan.registerDefault("subtitles", "true");
-	ConfMan.registerDefault("sfx_volume", 192);
-	ConfMan.registerDefault("music_volume", 192);
-	ConfMan.registerDefault("speech_volume", 192);
-	ConfMan.registerDefault("mute", "false");
-	ConfMan.registerDefault("speech_mute", "false");
-
-	// get value from the ScummVM configuration manager
-	syncSoundSettings();
-
-	_sitcomMode = ConfMan.getBool("sitcom");
-	_shortyMode = ConfMan.getBool("shorty");
-
 	_items = new Items(this);
 
 	_audioCache = new AudioCache();
@@ -493,6 +479,19 @@ bool BladeRunnerEngine::startup(bool hasSavegames) {
 
 	_ambientSounds = new AmbientSounds(this);
 
+	// Assign default values to the ScummVM configuration manager, in case settings are missing
+	ConfMan.registerDefault("subtitles", "true");
+	ConfMan.registerDefault("sfx_volume", 192);
+	ConfMan.registerDefault("music_volume", 192);
+	ConfMan.registerDefault("speech_volume", 192);
+	ConfMan.registerDefault("mute", "false");
+	ConfMan.registerDefault("speech_mute", "false");
+
+	// get value from the ScummVM configuration manager
+	syncSoundSettings();
+
+	_sitcomMode = ConfMan.getBool("sitcom");
+	_shortyMode = ConfMan.getBool("shorty");
 	// BLADE.INI was read here, but it was replaced by ScummVM configuration
 
 	_chapters = new Chapters(this);
@@ -1844,16 +1843,17 @@ void BladeRunnerEngine::syncSoundSettings() {
 	_mixer->setVolumeForSoundType(_mixer->kMusicSoundType, ConfMan.getInt("music_volume"));
 	_mixer->setVolumeForSoundType(_mixer->kSFXSoundType, ConfMan.getInt("sfx_volume"));
 	_mixer->setVolumeForSoundType(_mixer->kSpeechSoundType, ConfMan.getInt("speech_volume"));
-
 	// debug("syncSoundSettings: Volumes synced as Music: %d, Sfx: %d, Speech: %d", ConfMan.getInt("music_volume"), ConfMan.getInt("sfx_volume"), ConfMan.getInt("speech_volume"));
 
+	bool allSoundIsMuted = false;
 	if (ConfMan.hasKey("mute")) {
-		_mixer->muteSoundType(_mixer->kMusicSoundType, ConfMan.getBool("mute"));
-		_mixer->muteSoundType(_mixer->kSFXSoundType, ConfMan.getBool("mute"));
-		_mixer->muteSoundType(_mixer->kSpeechSoundType, ConfMan.getBool("mute"));
+		allSoundIsMuted = ConfMan.getBool("mute");
+		_mixer->muteSoundType(_mixer->kMusicSoundType, allSoundIsMuted);
+		_mixer->muteSoundType(_mixer->kSFXSoundType, allSoundIsMuted);
+		_mixer->muteSoundType(_mixer->kSpeechSoundType, allSoundIsMuted);
 	}
 
-	if (ConfMan.hasKey("speech_mute")) {
+	if (ConfMan.hasKey("speech_mute") && !allSoundIsMuted) {
 		// if true it means show only subtitles
 		// "subtitles" key will already be set appropriately by Engine::syncSoundSettings();
 		// but we need to mute the speech
diff --git a/engines/bladerunner/vqa_player.cpp b/engines/bladerunner/vqa_player.cpp
index 05ce15d..4925ca7 100644
--- a/engines/bladerunner/vqa_player.cpp
+++ b/engines/bladerunner/vqa_player.cpp
@@ -24,6 +24,7 @@
 
 #include "bladerunner/bladerunner.h"
 #include "bladerunner/time.h"
+#include "bladerunner/audio_player.h"
 
 #include "audio/decoders/raw.h"
 
@@ -134,7 +135,7 @@ int VQAPlayer::update(bool forceDraw, bool advanceFrame, bool useTime, Graphics:
 						queueAudioFrame(_decoder.decodeAudioFrame());
 					}
 				}
-				_vm->_mixer->playStream(Audio::Mixer::kPlainSoundType, &_soundHandle, _audioStream);
+				_vm->_mixer->playStream(Audio::Mixer::kSFXSoundType, &_soundHandle, _audioStream);
 				_audioStarted = true;
 			}
 			if (_frameNext + audioPreloadFrames < _frameEnd) {





More information about the Scummvm-git-logs mailing list