aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTravis Howell2005-03-12 00:47:17 +0000
committerTravis Howell2005-03-12 00:47:17 +0000
commitc39a92933d4d66f7436bbaf3b152f906d24ccfd7 (patch)
treed1b9663a1eef912f2da4471458f894060404865a
parenta52de03324bf07891be4ff4e161668ed59a78d6e (diff)
downloadscummvm-rg350-c39a92933d4d66f7436bbaf3b152f906d24ccfd7.tar.gz
scummvm-rg350-c39a92933d4d66f7436bbaf3b152f906d24ccfd7.tar.bz2
scummvm-rg350-c39a92933d4d66f7436bbaf3b152f906d24ccfd7.zip
Add key to toggle speech/subtitles
svn-id: r17082
-rw-r--r--doc/05_04.tex2
-rw-r--r--doc/08.tex5
-rw-r--r--scumm/dialogs.cpp10
-rw-r--r--scumm/dialogs.h1
-rw-r--r--scumm/input.cpp36
-rw-r--r--scumm/scumm.cpp12
-rw-r--r--scumm/scumm.h1
-rw-r--r--scumm/sound.cpp3
8 files changed, 65 insertions, 5 deletions
diff --git a/doc/05_04.tex b/doc/05_04.tex
index b074d23b77..e238ba53be 100644
--- a/doc/05_04.tex
+++ b/doc/05_04.tex
@@ -31,6 +31,8 @@ Simon games.
Ctrl 0-9 and Alt 0-9 & Load and save game state\\
Ctrl-g & Runs in really REALLY fast mode\\
Ctrl-d & Starts the debugger\\
+ Ctrl-t & Switch been 'Voice only', 'Text and Voice'\\
+ & and 'Text Display only'\\
Tilde \verb#~# & Show/hide the debugging console\\
Ctrl-s & Shows memory consumption\\
$[$ and $]$ & Music volume, down/up\\
diff --git a/doc/08.tex b/doc/08.tex
index 7c508ca600..a6a17a6b7c 100644
--- a/doc/08.tex
+++ b/doc/08.tex
@@ -77,6 +77,7 @@ The following keywords are recognized:
\\
language &string Specify language (en, de, fr, it, pt, es, jp,\\
& zh, kr, se, gb, hb, cz, ru)\\
+ speech\_mute &bool &If true, speech is muted\\
subtitles &bool Set to true to enable subtitles.\\
talkspeed &number Text speed\\
\\
@@ -122,14 +123,12 @@ Broken Sword II adds the following non-standard keywords:\\
object\_labels &bool &If true, object labels are enabled\\
reverse\_stereo &bool &If true, stereo channels are reversed\\
sfx\_mute &bool &If true, sound effects are muted\\
- speech\_mute &bool &If true, speech is muted\\
\end{tabular}
Flight of the Amazon Queen adds the following non-standard keywords:\\
\begin{tabular}[h]{lll}
music\_mute &bool &If true, music is muted\\
sfx\_mute &bool &If true, sound effects are muted\\
- speech\_mute &bool &If true, speech is muted\\
\end{tabular}
Simon the Sorcerer 1 \& 2 add the following non-standard keywords:\\
@@ -138,6 +137,4 @@ Simon the Sorcerer 1 \& 2 add the following non-standard keywords:\\
music\_mute &bool &If true, music is muted\\
slow\_down &number &Makes games slower (1- 10)\\
sfx\_mute &bool &If true, sound effects are muted\\
- speech\_mute &bool &If true, speech is muted\\
- & &[Simon the Sorcerer 2 only]\\
\end{tabular}
diff --git a/scumm/dialogs.cpp b/scumm/dialogs.cpp
index 75bfaeb6a7..0b30d45cb5 100644
--- a/scumm/dialogs.cpp
+++ b/scumm/dialogs.cpp
@@ -422,6 +422,7 @@ ConfigDialog::ConfigDialog(ScummEngine *scumm)
// 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 @@ void ConfigDialog::open() {
// update checkboxes, too
subtitlesCheckbox->setState(ConfMan.getBool("subtitles"));
+ speechCheckbox->setState(!ConfMan.getBool("speech_mute"));
}
void ConfigDialog::close() {
@@ -449,9 +451,15 @@ void ConfigDialog::close() {
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();
diff --git a/scumm/dialogs.h b/scumm/dialogs.h
index faf4ad4bdc..158e599fb7 100644
--- a/scumm/dialogs.h
+++ b/scumm/dialogs.h
@@ -117,6 +117,7 @@ public:
protected:
GUI::CheckboxWidget *subtitlesCheckbox;
+ GUI::CheckboxWidget *speechCheckbox;
};
/**
diff --git a/scumm/input.cpp b/scumm/input.cpp
index 5120c0891d..827eb4c50c 100644
--- a/scumm/input.cpp
+++ b/scumm/input.cpp
@@ -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 @@ void ScummEngine::processKbd(bool smushMode) {
}
#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();
diff --git a/scumm/scumm.cpp b/scumm/scumm.cpp
index 508ff7878f..ff270a6760 100644
--- a/scumm/scumm.cpp
+++ b/scumm/scumm.cpp
@@ -829,6 +829,7 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS
_copyProtection = false;
_demoMode = false;
_confirmExit = false;
+ _voiceMode = 0;
_talkDelay = 0;
_keepText = false;
_existLanguageFile = false;
@@ -1024,6 +1025,17 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS
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")) {
diff --git a/scumm/scumm.h b/scumm/scumm.h
index 44fa8ead0d..41c924f22d 100644
--- a/scumm/scumm.h
+++ b/scumm/scumm.h
@@ -1043,6 +1043,7 @@ public:
byte *_shadowPalette;
bool _skipDrawObject, _skipProcessActors;
int _timers[4];
+ int _voiceMode;
protected:
int _shadowPaletteSize;
diff --git a/scumm/sound.cpp b/scumm/sound.cpp
index 23584b6a76..01fdd86ac4 100644
--- a/scumm/sound.cpp
+++ b/scumm/sound.cpp
@@ -989,6 +989,9 @@ void Sound::soundKludge(int *list, int num) {
}
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;