[Scummvm-cvs-logs] scummvm master -> e6b070711a76f8cd4008d687d12eefaed231bed6

dreammaster dreammaster at scummvm.org
Wed Aug 12 14:47:10 CEST 2015


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:
e6b070711a SHERLOCK: RT: Hook window/speech to ScummVM speech/subtitles setting


Commit: e6b070711a76f8cd4008d687d12eefaed231bed6
    https://github.com/scummvm/scummvm/commit/e6b070711a76f8cd4008d687d12eefaed231bed6
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2015-08-12T08:46:09-04:00

Commit Message:
SHERLOCK: RT: Hook window/speech to ScummVM speech/subtitles setting

Changed paths:
    engines/sherlock/detection.cpp
    engines/sherlock/detection_tables.h
    engines/sherlock/scalpel/scalpel_scene.cpp
    engines/sherlock/sound.cpp
    engines/sherlock/sound.h
    engines/sherlock/talk.cpp
    engines/sherlock/tattoo/tattoo.cpp
    engines/sherlock/tattoo/tattoo_talk.cpp



diff --git a/engines/sherlock/detection.cpp b/engines/sherlock/detection.cpp
index b60facb..5a94b34 100644
--- a/engines/sherlock/detection.cpp
+++ b/engines/sherlock/detection.cpp
@@ -63,7 +63,6 @@ static const PlainGameDescriptor sherlockGames[] = {
 #define GAMEOPTION_PORTRAITS_ON		GUIO_GAMEOPTIONS4
 #define GAMEOPTION_WINDOW_STYLE		GUIO_GAMEOPTIONS5
 #define GAMEOPTION_TRANSPARENT_WINDOWS		GUIO_GAMEOPTIONS6
-#define GAMEOPTION_TEXT_WINDOWS		GUIO_GAMEOPTIONS7
 
 static const ADExtraGuiOptionsMap optionsList[] = {
 	{
@@ -126,16 +125,6 @@ static const ADExtraGuiOptionsMap optionsList[] = {
 		}
 	},
 
-	{
-		GAMEOPTION_TEXT_WINDOWS,
-		{
-			_s("Text windows"),
-			_s("Show text windows during conversations"),
-			"text_windows",
-			true
-		}
-	},
-
 	AD_EXTRA_GUI_OPTIONS_TERMINATOR
 };
 
diff --git a/engines/sherlock/detection_tables.h b/engines/sherlock/detection_tables.h
index 58093cc..e2b5a3d 100644
--- a/engines/sherlock/detection_tables.h
+++ b/engines/sherlock/detection_tables.h
@@ -148,8 +148,7 @@ static const SherlockGameDescription gameDescriptions[] = {
 			Common::EN_ANY,
 			Common::kPlatformDOS,
 			ADGF_UNSTABLE,
-			GUIO4(GAMEOPTION_ORIGINAL_SAVES, GAMEOPTION_HELP_STYLE, GAMEOPTION_TEXT_WINDOWS,
-				GAMEOPTION_TRANSPARENT_WINDOWS)
+			GUIO3(GAMEOPTION_ORIGINAL_SAVES, GAMEOPTION_HELP_STYLE, GAMEOPTION_TRANSPARENT_WINDOWS)
 		},
 		GType_RoseTattoo
 	},
@@ -164,8 +163,7 @@ static const SherlockGameDescription gameDescriptions[] = {
 			Common::EN_ANY,
 			Common::kPlatformDOS,
 			ADGF_UNSTABLE,
-			GUIO4(GAMEOPTION_ORIGINAL_SAVES, GAMEOPTION_HELP_STYLE, GAMEOPTION_TEXT_WINDOWS,
-				GAMEOPTION_TRANSPARENT_WINDOWS)
+			GUIO3(GAMEOPTION_ORIGINAL_SAVES, GAMEOPTION_HELP_STYLE, GAMEOPTION_TRANSPARENT_WINDOWS)
 		},
 		GType_RoseTattoo,
 	},
@@ -180,8 +178,7 @@ static const SherlockGameDescription gameDescriptions[] = {
   			Common::DE_DEU,
 			Common::kPlatformDOS,
 			ADGF_UNSTABLE,
-			GUIO4(GAMEOPTION_ORIGINAL_SAVES, GAMEOPTION_HELP_STYLE, GAMEOPTION_TEXT_WINDOWS,
-				GAMEOPTION_TRANSPARENT_WINDOWS)
+			GUIO3(GAMEOPTION_ORIGINAL_SAVES, GAMEOPTION_HELP_STYLE, GAMEOPTION_TRANSPARENT_WINDOWS)
 		},
 		GType_RoseTattoo,
 	},
diff --git a/engines/sherlock/scalpel/scalpel_scene.cpp b/engines/sherlock/scalpel/scalpel_scene.cpp
index 2f60ceb..ff92b50 100644
--- a/engines/sherlock/scalpel/scalpel_scene.cpp
+++ b/engines/sherlock/scalpel/scalpel_scene.cpp
@@ -169,7 +169,6 @@ void ScalpelScene::checkBgShapes() {
 void ScalpelScene::doBgAnimCheckCursor() {
 	Inventory &inv = *_vm->_inventory;
 	Events &events = *_vm->_events;
-	Sound &sound = *_vm->_sound;
 	UserInterface &ui = *_vm->_ui;
 	Common::Point mousePos = events.mousePos();
 	events.animateCursorIfNeeded();
@@ -193,11 +192,6 @@ void ScalpelScene::doBgAnimCheckCursor() {
 			events.setCursor(ARROW);
 		}
 	}
-
-	if (sound._diskSoundPlaying && !*sound._soundIsOn) {
-		// Loaded sound just finished playing
-		sound.freeDigiSound();
-	}
 }
 
 void ScalpelScene::doBgAnim() {
diff --git a/engines/sherlock/sound.cpp b/engines/sherlock/sound.cpp
index f72b053..c9b30b1 100644
--- a/engines/sherlock/sound.cpp
+++ b/engines/sherlock/sound.cpp
@@ -55,7 +55,6 @@ static const uint8 creativeADPCM_AdjustMap[64] = {
 Sound::Sound(SherlockEngine *vm, Audio::Mixer *mixer) : _vm(vm), _mixer(mixer) {
 	_digitized = false;
 	_voices = 0;
-	_diskSoundPlaying = false;
 	_soundPlaying = false;
 	_speechPlaying = false;
 	_soundIsOn = &_soundPlaying;
@@ -92,7 +91,8 @@ Sound::Sound(SherlockEngine *vm, Audio::Mixer *mixer) : _vm(vm), _mixer(mixer) {
 
 void Sound::syncSoundSettings() {
 	_digitized = !ConfMan.getBool("mute");
-	_voices = !ConfMan.getBool("mute") && !ConfMan.getBool("speech_mute") ? 1 : 0;
+	_speechOn = !ConfMan.getBool("mute") && !ConfMan.getBool("speech_mute");
+	_voices = _speechOn ? 1 : 0;
 }
 
 void Sound::loadSound(const Common::String &name, int priority) {
@@ -191,7 +191,6 @@ bool Sound::playSound(const Common::String &name, WaitType waitType, int priorit
 	_curPriority = priority;
 
 	if (waitType == WAIT_RETURN_IMMEDIATELY) {
-		_diskSoundPlaying = true;
 		return true;
 	}
 
@@ -245,7 +244,6 @@ void Sound::stopSndFuncPtr(int v1, int v2) {
 void Sound::freeDigiSound() {
 	delete[] _digiBuf;
 	_digiBuf = nullptr;
-	_diskSoundPlaying = false;
 	_soundPlaying = false;
 }
 
diff --git a/engines/sherlock/sound.h b/engines/sherlock/sound.h
index a52de1c..3894d16 100644
--- a/engines/sherlock/sound.h
+++ b/engines/sherlock/sound.h
@@ -56,7 +56,6 @@ public:
 	int _voices;
 	bool _soundOn;
 	bool _speechOn;
-	bool _diskSoundPlaying;
 	bool _soundPlaying;
 	bool _speechPlaying;
 	bool *_soundIsOn;
diff --git a/engines/sherlock/talk.cpp b/engines/sherlock/talk.cpp
index d6194ec..ab8eed8 100644
--- a/engines/sherlock/talk.cpp
+++ b/engines/sherlock/talk.cpp
@@ -922,6 +922,7 @@ int Talk::waitForMore(int delay) {
 	UserInterface &ui = *_vm->_ui;
 	CursorId oldCursor = events.getCursor();
 	int key2 = 254;
+	bool playingSpeech = false;
 
 	// Unless we're in stealth mode, show the appropriate cursor
 	if (!_talkStealth) {
@@ -932,6 +933,7 @@ int Talk::waitForMore(int delay) {
 	if (IS_ROSE_TATTOO && sound._speechOn) {
 		sound.playSpeech(sound._talkSoundFile);
 		sound._talkSoundFile.setChar(sound._talkSoundFile.lastChar() + 1, sound._talkSoundFile.size() - 1);
+		playingSpeech = sound.isSpeechPlaying();
 	}
 
 	do {
@@ -975,7 +977,7 @@ int Talk::waitForMore(int delay) {
 			--delay;
 
 		// If there are voices playing, reset delay so that they keep playing
-		if (sound._voices == 2 && *sound._soundIsOn)
+		if ((sound._voices == 2 && *sound._soundIsOn) || (playingSpeech && !sound.isSpeechPlaying()))
 			delay = 0;
 	} while (!_vm->shouldQuit() && key2 == 254 && (delay || (sound._voices == 2 && *sound._soundIsOn))
 		&& !events._released && !events._rightReleased);
@@ -984,8 +986,8 @@ int Talk::waitForMore(int delay) {
 	if (sound._voices == 2)
 		sound._voices = 1;
 
-	if (delay > 0 && sound._diskSoundPlaying)
-		sound.stopSndFuncPtr(0, 0);
+	if (delay > 0 && sound.isSpeechPlaying())
+		sound.stopSpeech();
 
 	// Adjust _talkStealth mode:
 	// mode 1 - It was by a pause without stealth being on before the pause, so reset back to 0
diff --git a/engines/sherlock/tattoo/tattoo.cpp b/engines/sherlock/tattoo/tattoo.cpp
index b11615a..54301e4 100644
--- a/engines/sherlock/tattoo/tattoo.cpp
+++ b/engines/sherlock/tattoo/tattoo.cpp
@@ -183,14 +183,14 @@ void TattooEngine::loadConfig() {
 	SherlockEngine::loadConfig();
 
 	_transparentMenus = ConfMan.getBool("transparent_windows");
-	_textWindowsOn = ConfMan.getBool("text_windows");
+	_textWindowsOn = ConfMan.getBool("subtitles");
 }
 
 void TattooEngine::saveConfig() {
 	SherlockEngine::saveConfig();
 
 	ConfMan.setBool("transparent_windows", _transparentMenus);
-	ConfMan.setBool("text_windows", _textWindowsOn);
+	ConfMan.setBool("subtitles", _textWindowsOn);
 	ConfMan.flushToDisk();
 }
 
diff --git a/engines/sherlock/tattoo/tattoo_talk.cpp b/engines/sherlock/tattoo/tattoo_talk.cpp
index 816e0e2..9aa1390 100644
--- a/engines/sherlock/tattoo/tattoo_talk.cpp
+++ b/engines/sherlock/tattoo/tattoo_talk.cpp
@@ -189,6 +189,7 @@ void TattooTalk::talkInterface(const byte *&str) {
 	TattooUserInterface &ui = *(TattooUserInterface *)_vm->_ui;
 	const byte *s = str;
 
+	_wait = 1;
 	if (!vm._textWindowsOn && sound._speechOn && _speaker != -1)
 		return;
 
@@ -203,7 +204,6 @@ void TattooTalk::talkInterface(const byte *&str) {
 	ui.banishWindow();
 	ui._textWidget.load(Common::String((const char *)s, (const char *)str), _speaker);
 	ui._textWidget.summonWindow();
-	_wait = true;
 }
 
 void TattooTalk::nothingToSay() {






More information about the Scummvm-git-logs mailing list