[Scummvm-cvs-logs] CVS: scummvm/scumm dialogs.cpp,1.126,1.127 dialogs.h,1.47,1.48 input.cpp,2.18,2.19 scumm.cpp,1.357,1.358 scumm.h,1.537,1.538 sound.cpp,1.427,1.428

kirben kirben at users.sourceforge.net
Fri Mar 11 16:47:50 CET 2005


Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8541/scumm

Modified Files:
	dialogs.cpp dialogs.h input.cpp scumm.cpp scumm.h sound.cpp 
Log Message:

Add key to toggle speech/subtitles


Index: dialogs.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/dialogs.cpp,v
retrieving revision 1.126
retrieving revision 1.127
diff -u -d -r1.126 -r1.127
--- dialogs.cpp	8 Mar 2005 23:44:07 -0000	1.126
+++ dialogs.cpp	12 Mar 2005 00:47:02 -0000	1.127
@@ -422,6 +422,7 @@
 	// Some misc options
 	//
 	subtitlesCheckbox = new GUI::CheckboxWidget(this, 15, 78, 200, 16, "Show subtitles", 0, 'S');
+	speechCheckbox = new GUI::CheckboxWidget(this, 130, 78, 200, 16, "Enable speech", 0, 'E');
 
 	//
 	// Create the sub dialog(s)
@@ -442,6 +443,7 @@
 
 	// update checkboxes, too
 	subtitlesCheckbox->setState(ConfMan.getBool("subtitles"));
+	speechCheckbox->setState(!ConfMan.getBool("speech_mute"));
 }
 
 void ConfigDialog::close() {
@@ -449,9 +451,15 @@
 	if (getResult()) {
 		// Subtitles
 		ConfMan.set("subtitles", subtitlesCheckbox->getState(), _domain);
+		ConfMan.set("speech_mute", !subtitlesCheckbox->getState(), _domain);
 		// Sync with current setting
+		if (ConfMan.getBool("speech_mute"))
+			_vm->_voiceMode = 2;
+		else
+			_vm->_voiceMode = ConfMan.getBool("subtitles");
+
 		if (_vm->_version >= 7)
-			_vm->VAR(_vm->VAR_VOICE_MODE) = subtitlesCheckbox->getState();
+			_vm->VAR(_vm->VAR_VOICE_MODE) = _vm->_voiceMode;
 	}
 
 	GUI_OptionsDialog::close();

Index: dialogs.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/dialogs.h,v
retrieving revision 1.47
retrieving revision 1.48
diff -u -d -r1.47 -r1.48
--- dialogs.h	8 Mar 2005 23:44:07 -0000	1.47
+++ dialogs.h	12 Mar 2005 00:47:15 -0000	1.48
@@ -117,6 +117,7 @@
 
 protected:
 	GUI::CheckboxWidget *subtitlesCheckbox;
+	GUI::CheckboxWidget *speechCheckbox;
 };
 
 /**

Index: input.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/input.cpp,v
retrieving revision 2.18
retrieving revision 2.19
diff -u -d -r2.18 -r2.19
--- input.cpp	11 Mar 2005 10:42:00 -0000	2.18
+++ input.cpp	12 Mar 2005 00:47:15 -0000	2.19
@@ -25,6 +25,9 @@
 #include "common/config-manager.h"
 #include "common/system.h"
 
+#include "gui/message.h"
+#include "gui/newgui.h"
+
 #include "scumm/debugger.h"
 #include "scumm/dialogs.h"
 #include "scumm/imuse.h"
@@ -337,6 +340,39 @@
 	}
 #endif
 
+	if (_version >= 6 && _lastKeyHit == 20) {
+		char buf[256];
+
+		_voiceMode++;
+		if (_voiceMode == 3)
+			_voiceMode = 0;
+
+		switch(_voiceMode) {
+		case 0:
+			sprintf(buf, "Speech Only");
+			ConfMan.set("speech_mute", false);
+			ConfMan.set("subtitles", false);
+			break;
+		case 1:
+			sprintf(buf, "Speech and Subtitles");
+			ConfMan.set("speech_mute", false);
+			ConfMan.set("subtitles", true);
+			break;
+		case 2:
+			sprintf(buf, "Subtitles Only");
+			ConfMan.set("speech_mute", true);
+			ConfMan.set("subtitles", true);
+			break;
+		}
+
+		if (_version >= 7)
+			VAR(VAR_VOICE_MODE) = _voiceMode;
+
+		GUI::TimedMessageDialog dialog(buf, 1500);
+		runDialog(dialog);
+		return;
+	}
+
 	if (VAR_RESTART_KEY != 0xFF && _lastKeyHit == VAR(VAR_RESTART_KEY) ||
 	   (((_version <= 2) || (_features & GF_FMTOWNS && _version == 3)) && _lastKeyHit == 8)) {
 		confirmrestartDialog();

Index: scumm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.cpp,v
retrieving revision 1.357
retrieving revision 1.358
diff -u -d -r1.357 -r1.358
--- scumm.cpp	11 Mar 2005 10:46:28 -0000	1.357
+++ scumm.cpp	12 Mar 2005 00:47:15 -0000	1.358
@@ -829,6 +829,7 @@
 	_copyProtection = false;
 	_demoMode = false;
 	_confirmExit = false;
+	_voiceMode = 0;
 	_talkDelay = 0;
 	_keepText = false;
 	_existLanguageFile = false;
@@ -1024,6 +1025,17 @@
 		if (!ConfMan.hasKey("subtitles"))
 			ConfMan.set("subtitles", !ConfMan.getBool("nosubtitles"));
 	}
+
+	// Make sure that at least subtitles are enabled
+	if (ConfMan.getBool("speech_mute") && !ConfMan.getBool("subtitles"))
+		ConfMan.set("subtitles", 1);
+
+	// TODO Detect subtitle only versions of scumm6 games
+	if (ConfMan.getBool("speech_mute"))
+		_voiceMode = 2;
+	else
+		_voiceMode = ConfMan.getBool("subtitles");
+
 	_confirmExit = ConfMan.getBool("confirm_exit");
 
 	if (ConfMan.hasKey("render_mode")) {

Index: scumm.h
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.h,v
retrieving revision 1.537
retrieving revision 1.538
diff -u -d -r1.537 -r1.538
--- scumm.h	2 Mar 2005 23:14:06 -0000	1.537
+++ scumm.h	12 Mar 2005 00:47:15 -0000	1.538
@@ -1043,6 +1043,7 @@
 	byte *_shadowPalette;
 	bool _skipDrawObject, _skipProcessActors;
 	int _timers[4];
+	int _voiceMode;
 
 protected:
 	int _shadowPaletteSize;

Index: sound.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/sound.cpp,v
retrieving revision 1.427
retrieving revision 1.428
diff -u -d -r1.427 -r1.428
--- sound.cpp	9 Mar 2005 18:12:41 -0000	1.427
+++ sound.cpp	12 Mar 2005 00:47:16 -0000	1.428
@@ -989,6 +989,9 @@
 }
 
 void Sound::talkSound(uint32 a, uint32 b, int mode, int channel) {
+	if (_vm->_version >= 6 && ConfMan.getBool("speech_mute"))
+		return;
+
 	if (mode == 1) {
 		_talk_sound_a1 = a;
 		_talk_sound_b1 = b;





More information about the Scummvm-git-logs mailing list