[Scummvm-cvs-logs] SF.net SVN: scummvm: [22456] scummvm/trunk
fingolfin at users.sourceforge.net
fingolfin at users.sourceforge.net
Sat May 13 10:43:08 CEST 2006
Revision: 22456
Author: fingolfin
Date: 2006-05-13 10:30:04 -0700 (Sat, 13 May 2006)
ViewCVS: http://svn.sourceforge.net/scummvm/?rev=22456&view=rev
Log Message:
-----------
Patch #1091170: ALL, SCUMM: Subtitle speed control
Modified Paths:
--------------
scummvm/trunk/NEWS
scummvm/trunk/engines/queen/journal.cpp
scummvm/trunk/engines/queen/queen.cpp
scummvm/trunk/engines/scumm/dialogs.cpp
scummvm/trunk/engines/scumm/dialogs.h
scummvm/trunk/engines/scumm/input.cpp
scummvm/trunk/engines/scumm/script.cpp
scummvm/trunk/engines/scumm/script_v8.cpp
scummvm/trunk/engines/scumm/scumm.cpp
scummvm/trunk/engines/scumm/scumm.h
scummvm/trunk/gui/launcher.cpp
scummvm/trunk/gui/options.cpp
scummvm/trunk/gui/options.h
scummvm/trunk/gui/theme-config.cpp
scummvm/trunk/gui/themes/modern.ini
Modified: scummvm/trunk/NEWS
===================================================================
--- scummvm/trunk/NEWS 2006-05-13 17:28:33 UTC (rev 22455)
+++ scummvm/trunk/NEWS 2006-05-13 17:30:04 UTC (rev 22456)
@@ -18,10 +18,12 @@
- Restructured our source tree partially.
- Fixed a bug that prevented you from overriding the scaler from the command
line for 640x480 games.
+ - Added subtitle configuration controls to the Launcher options dialogs.
SCUMM:
- Rewrote the detection code, for improved accuracy and better support of
fan translations. It should now work much better on games with unknown MD5.
+ - Added subtitle configuration controls to the options dialog.
Broken Sword 1:
- Added support for the --save-slot option.
Modified: scummvm/trunk/engines/queen/journal.cpp
===================================================================
--- scummvm/trunk/engines/queen/journal.cpp 2006-05-13 17:28:33 UTC (rev 22455)
+++ scummvm/trunk/engines/queen/journal.cpp 2006-05-13 17:30:04 UTC (rev 22456)
@@ -310,7 +310,7 @@
enterYesNoPanelMode(zoneNum, TXT_GIVE_UP);
break;
case ZN_TEXT_SPEED:
- val = (x - 136) * QueenEngine::MAX_TEXT_SPEED / (266 - 136);
+ val = (x - 136) * QueenEngine::MAX_TEXT_SPEED / (266 - 136);
_vm->talkSpeed(val);
drawConfigPanel();
break;
Modified: scummvm/trunk/engines/queen/queen.cpp
===================================================================
--- scummvm/trunk/engines/queen/queen.cpp 2006-05-13 17:28:33 UTC (rev 22455)
+++ scummvm/trunk/engines/queen/queen.cpp 2006-05-13 17:30:04 UTC (rev 22456)
@@ -186,7 +186,7 @@
_music->setVolume(ConfMan.getInt("music_volume"));
_sound->musicToggle(!ConfMan.getBool("music_mute"));
_sound->sfxToggle(!ConfMan.getBool("sfx_mute"));
- _talkSpeed = ConfMan.getInt("talkspeed");
+ _talkSpeed = (ConfMan.getInt("talkspeed") * (MAX_TEXT_SPEED - MIN_TEXT_SPEED) + 255 / 2) / 255 + MIN_TEXT_SPEED;
_sound->speechToggle(!ConfMan.getBool("speech_mute"));
_subtitles = ConfMan.getBool("subtitles");
checkOptionSettings();
@@ -196,7 +196,7 @@
ConfMan.setInt("music_volume", _music->volume());
ConfMan.setBool("music_mute", !_sound->musicOn());
ConfMan.setBool("sfx_mute", !_sound->sfxOn());
- ConfMan.setInt("talkspeed", _talkSpeed);
+ ConfMan.setInt("talkspeed", ((_talkSpeed - MIN_TEXT_SPEED) * 255 + (MAX_TEXT_SPEED - MIN_TEXT_SPEED) / 2) / (MAX_TEXT_SPEED - MIN_TEXT_SPEED));
ConfMan.setBool("speech_mute", !_sound->speechOn());
ConfMan.setBool("subtitles", _subtitles);
ConfMan.flushToDisk();
@@ -444,6 +444,7 @@
_sound = Sound::giveSound(_mixer, this, _resource->compression());
_walk = new Walk(this);
+ //_talkspeedScale = (MAX_TEXT_SPEED - MIN_TEXT_SPEED) / 255.0;
registerDefaultSettings();
readOptionSettings();
Modified: scummvm/trunk/engines/scumm/dialogs.cpp
===================================================================
--- scummvm/trunk/engines/scumm/dialogs.cpp 2006-05-13 17:28:33 UTC (rev 22455)
+++ scummvm/trunk/engines/scumm/dialogs.cpp 2006-05-13 17:30:04 UTC (rev 22456)
@@ -608,7 +608,7 @@
#pragma mark -
enum {
- kOKCmd = 'ok '
+ kOKCmd = 'ok '
};
enum {
@@ -653,8 +653,8 @@
// Some misc options
//
- _subtitlesCheckbox = new GUI::CheckboxWidget(this, "scummconfig_subtitlesCheckbox", "Show subtitles", 0, 'S');
- _speechCheckbox = new GUI::CheckboxWidget(this, "scummconfig_speechCheckbox", "Enable speech", 0, 'E');
+ // SCUMM has a talkspeed range of 0-9
+ addSubtitleControls(this, "scummconfig_", 9);
//
// Add the buttons
@@ -683,19 +683,9 @@
void ConfigDialog::open() {
GUI_OptionsDialog::open();
-
- // update checkboxes, too
- _subtitlesCheckbox->setState(ConfMan.getBool("subtitles", _domain));
- _speechCheckbox->setState(!ConfMan.getBool("speech_mute", _domain));
}
void ConfigDialog::close() {
- if (getResult()) {
- // Subtitles
- ConfMan.setBool("subtitles", _subtitlesCheckbox->getState(), _domain);
- ConfMan.setBool("speech_mute", !_speechCheckbox->getState(), _domain);
- }
-
GUI_OptionsDialog::close();
}
@@ -927,8 +917,9 @@
}
void ValueDisplayDialog::handleTickle() {
- if (getMillis() > _timer)
+ if (getMillis() > _timer) {
close();
+ }
}
void ValueDisplayDialog::handleKeyDown(uint16 ascii, int keycode, int modifiers) {
Modified: scummvm/trunk/engines/scumm/dialogs.h
===================================================================
--- scummvm/trunk/engines/scumm/dialogs.h 2006-05-13 17:28:33 UTC (rev 22455)
+++ scummvm/trunk/engines/scumm/dialogs.h 2006-05-13 17:30:04 UTC (rev 22456)
@@ -140,10 +140,6 @@
virtual void open();
virtual void close();
virtual void handleCommand(GUI::CommandSender *sender, uint32 cmd, uint32 data);
-
-protected:
- GUI::CheckboxWidget *_subtitlesCheckbox;
- GUI::CheckboxWidget *_speechCheckbox;
};
/**
Modified: scummvm/trunk/engines/scumm/input.cpp
===================================================================
--- scummvm/trunk/engines/scumm/input.cpp 2006-05-13 17:28:33 UTC (rev 22455)
+++ scummvm/trunk/engines/scumm/input.cpp 2006-05-13 17:30:04 UTC (rev 22456)
@@ -445,6 +445,9 @@
// Display the talk speed
ValueDisplayDialog dlg("Text speed: ", 0, 9, 9 - _defaultTalkDelay, '+', '-');
_defaultTalkDelay = 9 - runDialog(dlg);
+
+ // Save the new talkspeed value to ConfMan
+ setTalkspeed(9 - _defaultTalkDelay);
if (VAR_CHARINC != 0xFF)
VAR(VAR_CHARINC) = _defaultTalkDelay;
Modified: scummvm/trunk/engines/scumm/script.cpp
===================================================================
--- scummvm/trunk/engines/scumm/script.cpp 2006-05-13 17:28:33 UTC (rev 22455)
+++ scummvm/trunk/engines/scumm/script.cpp 2006-05-13 17:30:04 UTC (rev 22456)
@@ -617,7 +617,7 @@
}
if (var == VAR_CHARINC && ConfMan.hasKey("talkspeed")) {
- uint talkspeed = ConfMan.getInt("talkspeed");
+ uint talkspeed = getTalkspeed();
if (talkspeed <= 9)
VAR(VAR_CHARINC) = talkspeed;
} else {
Modified: scummvm/trunk/engines/scumm/script_v8.cpp
===================================================================
--- scummvm/trunk/engines/scumm/script_v8.cpp 2006-05-13 17:28:33 UTC (rev 22455)
+++ scummvm/trunk/engines/scumm/script_v8.cpp 2006-05-13 17:30:04 UTC (rev 22456)
@@ -420,7 +420,7 @@
checkRange(_numVariables - 1, 0, var, "Variable %d out of range(w)");
if (var == VAR_CHARINC && ConfMan.hasKey("talkspeed")) {
- uint talkspeed = ConfMan.getInt("talkspeed");
+ uint talkspeed = getTalkspeed();
if (talkspeed <= 9)
VAR(VAR_CHARINC) = talkspeed;
} else
Modified: scummvm/trunk/engines/scumm/scumm.cpp
===================================================================
--- scummvm/trunk/engines/scumm/scumm.cpp 2006-05-13 17:28:33 UTC (rev 22455)
+++ scummvm/trunk/engines/scumm/scumm.cpp 2006-05-13 17:30:04 UTC (rev 22456)
@@ -499,6 +499,12 @@
VAR_SOUNDPARAM3 = 0xFF;
VAR_MOUSEPRESENT = 0xFF;
VAR_MEMORY_PERFORMANCE = 0xFF;
+
+ if (ConfMan.hasKey("talkspeed")) {
+ _defaultTalkDelay = 9 - getTalkspeed();
+ VAR_CHARINC = _defaultTalkDelay;
+ }
+
VAR_VIDEO_PERFORMANCE = 0xFF;
VAR_ROOM_FLAG = 0xFF;
VAR_GAME_LOADED = 0xFF;
@@ -1498,7 +1504,6 @@
_mixer->setVolumeForSoundType(Audio::Mixer::kMusicSoundType, soundVolumeMusic);
_mixer->setVolumeForSoundType(Audio::Mixer::kSpeechSoundType, soundVolumeSpeech);
-
if (ConfMan.getBool("speech_mute"))
_voiceMode = 2;
else
@@ -1506,10 +1511,33 @@
if (VAR_VOICE_MODE != 0xFF)
VAR(VAR_VOICE_MODE) = _voiceMode;
+
+ _defaultTalkDelay = 9 - getTalkspeed();
+ VAR(VAR_CHARINC) = _defaultTalkDelay;
}
+void ScummEngine::setTalkspeed(int talkspeed) {
+ /*if (talkspeed != 0)
+ if (talkspeed == 9)
+ talkspeed = 255;
+ else
+ talkspeed = (int)(talkspeed * 255.0 / 9.0 + 0.5);*/
+ ConfMan.setInt("talkspeed", (talkspeed * 255 + 9 / 2) / 9);
+}
+int ScummEngine::getTalkspeed() {
+ /*int talkspeed = ConfMan.getInt("talkspeed");
+ if (talkspeed != 0)
+ if (talkspeed == 255)
+ talkspeed = 9;
+ else
+ talkspeed = (int)(talkspeed * 9.0 / 255.0 + 0.5);
+ return talkspeed;*/
+ return (ConfMan.getInt("talkspeed") * 9 + 255 / 2) / 255;
+}
+
+
#pragma mark -
#pragma mark --- Main loop ---
#pragma mark -
Modified: scummvm/trunk/engines/scumm/scumm.h
===================================================================
--- scummvm/trunk/engines/scumm/scumm.h 2006-05-13 17:28:33 UTC (rev 22455)
+++ scummvm/trunk/engines/scumm/scumm.h 2006-05-13 17:30:04 UTC (rev 22456)
@@ -470,6 +470,8 @@
void loadCJKFont();
void setupMusic(int midi);
void updateSoundSettings();
+ void setTalkspeed(int talkspeed);
+ int getTalkspeed();
protected:
// Scumm main loop & helper functions.
Modified: scummvm/trunk/gui/launcher.cpp
===================================================================
--- scummvm/trunk/gui/launcher.cpp 2006-05-13 17:28:33 UTC (rev 22455)
+++ scummvm/trunk/gui/launcher.cpp 2006-05-13 17:30:04 UTC (rev 22456)
@@ -189,7 +189,9 @@
_platformPopUp->appendEntry(p->description, p->id);
}
+ //
// 2) The 'Path' tab
+ //
tab->addTab("Paths");
// These buttons have to be extra wide, or the text will be truncated
@@ -230,6 +232,7 @@
_globalAudioOverride = new CheckboxWidget(tab, "gameoptions_audioCheckbox", "Override global audio settings", kCmdGlobalAudioOverride, 0);
addAudioControls(tab, "gameoptions_");
+ addSubtitleControls(tab, "gameoptions_");
//
// 5) The MIDI tab
@@ -249,7 +252,6 @@
addVolumeControls(tab, "gameoptions_");
-
// Activate the first tab
tab->setActiveTab(0);
@@ -271,7 +273,8 @@
_globalGraphicsOverride->setState(e);
e = ConfMan.hasKey("music_driver", _domain) ||
- ConfMan.hasKey("subtitles", _domain);
+ ConfMan.hasKey("subtitles", _domain) ||
+ ConfMan.hasKey("talkspeed", _domain);
_globalAudioOverride->setState(e);
e = ConfMan.hasKey("multi_midi", _domain) ||
@@ -346,6 +349,7 @@
break;
case kCmdGlobalAudioOverride:
setAudioSettingsState(data != 0);
+ setSubtitleSettingsState(data != 0);
draw();
break;
case kCmdGlobalMIDIOverride:
@@ -356,7 +360,6 @@
setVolumeSettingsState(data != 0);
draw();
break;
-
case kCmdChooseSoundFontCmd: {
BrowserDialog browser("Select SoundFont", false);
Modified: scummvm/trunk/gui/options.cpp
===================================================================
--- scummvm/trunk/gui/options.cpp 2006-05-13 17:28:33 UTC (rev 22455)
+++ scummvm/trunk/gui/options.cpp 2006-05-13 17:30:04 UTC (rev 22456)
@@ -55,11 +55,13 @@
// - music & graphics driver (but see also the comments on EditGameDialog
// for some techincal difficulties with this)
// - default volumes (sfx/speech/music)
-// - aspect ratio, language, platform, subtitles, debug mode/level, cd drive, joystick, multi midi, native mt32
+// - aspect ratio, language, platform, debug mode/level, cd drive, joystick, multi midi, native mt32
enum {
kMusicVolumeChanged = 'muvc',
kSfxVolumeChanged = 'sfvc',
+ kSubtitleToggle = 'sttg',
+ kSubtitleSpeedChanged = 'stsc',
kSpeechVolumeChanged = 'vcvc',
kChooseSoundFontCmd = 'chsf',
kChooseSaveDirCmd = 'chos',
@@ -83,6 +85,12 @@
init();
}
+const char *OptionsDialog::_subModeDesc[] = {
+ "Speech Only",
+ "Speech and Subtitles",
+ "Subtitles Only"
+};
+
void OptionsDialog::init() {
_enableGraphicSettings = false;
_gfxPopUp = 0;
@@ -90,19 +98,26 @@
_fullscreenCheckbox = 0;
_aspectCheckbox = 0;
_enableAudioSettings = false;
- _subCheckbox = 0;
_midiPopUp = 0;
_enableMIDISettings = false;
_multiMidiCheckbox = 0;
_mt32Checkbox = 0;
_enableGSCheckbox = 0;
_enableVolumeSettings = false;
+ _musicVolumeDesc = 0;
_musicVolumeSlider = 0;
_musicVolumeLabel = 0;
+ _sfxVolumeDesc = 0;
_sfxVolumeSlider = 0;
_sfxVolumeLabel = 0;
+ _speechVolumeDesc = 0;
_speechVolumeSlider = 0;
_speechVolumeLabel = 0;
+ _subToggleDesc = 0;
+ _subToggleButton = 0;
+ _subSpeedDesc = 0;
+ _subSpeedSlider = 0;
+ _subSpeedLabel = 0;
}
void OptionsDialog::open() {
@@ -111,6 +126,7 @@
// Reset result value
setResult(0);
+ // Graphic options
if (_fullscreenCheckbox) {
_gfxPopUp->setSelected(0);
@@ -150,7 +166,8 @@
#endif
}
- if (_subCheckbox) {
+ // Audio options
+ if (_midiPopUp) {
// Music driver
const MidiDriverDescription *md = MidiDriver::getAvailableMidiDrivers();
int i = 0;
@@ -163,9 +180,6 @@
md++;
}
_midiPopUp->setSelected(md->name ? i : 0);
-
- // Subtitles setting
- _subCheckbox->setState(ConfMan.getBool("subtitles", _domain));
}
if (_multiMidiCheckbox) {
@@ -202,10 +216,27 @@
_speechVolumeSlider->setValue(vol);
_speechVolumeLabel->setValue(vol);
}
+
+ // Subtitle options
+ if (_subToggleButton) {
+ int speed;
+ int sliderMaxValue = _subSpeedSlider->getMaxValue();
+
+ _subMode = getSubtitleMode(ConfMan.getBool("subtitles", _domain), ConfMan.getBool("speech_mute"));
+ _subToggleButton->setLabel(_subModeDesc[_subMode]);
+
+ // Engines that reuse the subtitle speed widget set their own max value.
+ // Scale the config value accordingly (see addSubtitleControls)
+ speed = (ConfMan.getInt("talkspeed", _domain) * sliderMaxValue + 255 / 2) / 255;
+ _subSpeedSlider->setValue(speed);
+ _subSpeedLabel->setValue(speed);
+ }
}
void OptionsDialog::close() {
if (getResult()) {
+
+ // Graphic options
if (_fullscreenCheckbox) {
if (_enableGraphicSettings) {
ConfMan.setBool("fullscreen", _fullscreenCheckbox->getState(), _domain);
@@ -224,6 +255,7 @@
}
}
+ // Volume options
if (_musicVolumeSlider) {
if (_enableVolumeSettings) {
ConfMan.setInt("music_volume", _musicVolumeSlider->getValue(), _domain);
@@ -236,9 +268,9 @@
}
}
- if (_subCheckbox) {
+ // Audio options
+ if (_midiPopUp) {
if (_enableAudioSettings) {
- ConfMan.setBool("subtitles", _subCheckbox->getState(), _domain);
const MidiDriverDescription *md = MidiDriver::getAvailableMidiDrivers();
while (md->name && md->id != (int)_midiPopUp->getSelectedTag())
md++;
@@ -248,7 +280,6 @@
ConfMan.removeKey("music_driver", _domain);
} else {
ConfMan.removeKey("music_driver", _domain);
- ConfMan.removeKey("subtitles", _domain);
}
}
@@ -270,6 +301,42 @@
}
}
+ // Subtitle options
+ if (_subToggleButton) {
+ if (_enableSubtitleSettings) {
+ bool subtitles, speech_mute;
+ int talkspeed;
+ int sliderMaxValue = _subSpeedSlider->getMaxValue();
+
+ switch (_subMode) {
+ case 0:
+ subtitles = speech_mute = false;
+ break;
+ case 1:
+ subtitles = true;
+ speech_mute = false;
+ break;
+ case 2:
+ default:
+ subtitles = speech_mute = true;
+ break;
+ }
+
+ ConfMan.setBool("subtitles", subtitles, _domain);
+ ConfMan.setBool("speech_mute", speech_mute, _domain);
+
+ // Engines that reuse the subtitle speed widget set their own max value.
+ // Scale the config value accordingly (see addSubtitleControls)
+ talkspeed = (_subSpeedSlider->getValue() * 255 + sliderMaxValue / 2) / sliderMaxValue;
+ ConfMan.setInt("talkspeed", talkspeed, _domain);
+
+ } else {
+ ConfMan.removeKey("subtitles", _domain);
+ ConfMan.removeKey("talkspeed", _domain);
+ ConfMan.removeKey("speech_mute", _domain);
+ }
+ }
+
// Save config file
ConfMan.flushToDisk();
}
@@ -291,6 +358,22 @@
_speechVolumeLabel->setValue(_speechVolumeSlider->getValue());
_speechVolumeLabel->draw();
break;
+ case kSubtitleToggle:
+ if (_subMode < 2)
+ _subMode++;
+ else
+ _subMode = 0;
+
+ _subToggleButton->setLabel(_subModeDesc[_subMode]);
+ _subToggleButton->draw();
+ _subSpeedDesc->draw();
+ _subSpeedSlider->draw();
+ _subSpeedLabel->draw();
+ break;
+ case kSubtitleSpeedChanged:
+ _subSpeedLabel->setValue(_subSpeedSlider->getValue());
+ _subSpeedLabel->draw();
+ break;
case kOKCmd:
setResult(1);
close();
@@ -315,7 +398,6 @@
_enableAudioSettings = enabled;
_midiPopUp->setEnabled(enabled);
- _subCheckbox->setEnabled(enabled);
}
void OptionsDialog::setMIDISettingsState(bool enabled) {
@@ -331,14 +413,27 @@
void OptionsDialog::setVolumeSettingsState(bool enabled) {
_enableVolumeSettings = enabled;
+ _musicVolumeDesc->setEnabled(enabled);
_musicVolumeSlider->setEnabled(enabled);
_musicVolumeLabel->setEnabled(enabled);
+ _sfxVolumeDesc->setEnabled(enabled);
_sfxVolumeSlider->setEnabled(enabled);
_sfxVolumeLabel->setEnabled(enabled);
+ _speechVolumeDesc->setEnabled(enabled);
_speechVolumeSlider->setEnabled(enabled);
_speechVolumeLabel->setEnabled(enabled);
}
+void OptionsDialog::setSubtitleSettingsState(bool enabled) {
+ _enableSubtitleSettings = enabled;
+
+ _subToggleButton->setEnabled(enabled);
+ _subToggleDesc->setEnabled(enabled);
+ _subSpeedDesc->setEnabled(enabled);
+ _subSpeedSlider->setEnabled(enabled);
+ _subSpeedLabel->setEnabled(enabled);
+}
+
void OptionsDialog::addGraphicControls(GuiObject *boss, String prefix) {
const OSystem::GraphicsMode *gm = g_system->getSupportedGraphicsModes();
@@ -391,9 +486,6 @@
md++;
}
- // Subtitles on/off
- _subCheckbox = new CheckboxWidget(boss, prefix + "auSubtitlesCheckbox", "Display subtitles", 0, 0);
-
_enableAudioSettings = true;
}
@@ -414,29 +506,41 @@
_enableMIDISettings = true;
}
+// The function has an extra slider range parameter, since both the launcher and SCUMM engine
+// make use of the widgets. The launcher range is 0-255. SCUMM's 0-9
+void OptionsDialog::addSubtitleControls(GuiObject *boss, String prefix, int maxSliderVal) {
+
+ _subToggleDesc = new StaticTextWidget(boss, prefix + "subToggleDesc", "Text and Speech:");
+ _subToggleButton = new ButtonWidget(boss, prefix + "subToggleButton", "", kSubtitleToggle, 0);
+
+ // Subtitle speed
+ _subSpeedDesc = new StaticTextWidget(boss, prefix + "subSubtitleSpeedDesc", "Subtitle speed:");
+ _subSpeedSlider = new SliderWidget(boss, prefix + "subSubtitleSpeedSlider", kSubtitleSpeedChanged);
+ _subSpeedLabel = new StaticTextWidget(boss, prefix + "subSubtitleSpeedLabel", "100%");
+ _subSpeedSlider->setMinValue(0); _subSpeedSlider->setMaxValue(maxSliderVal);
+ _subSpeedLabel->setFlags(WIDGET_CLEARBG);
+
+ _enableSubtitleSettings = true;
+}
+
void OptionsDialog::addVolumeControls(GuiObject *boss, String prefix) {
- const char *slider_labels[] = {
- "Music volume:",
- "SFX volume:",
- "Speech volume:"
- };
// Volume controllers
- new StaticTextWidget(boss, prefix + "vcMusicText", slider_labels[0]);
+ _musicVolumeDesc = new StaticTextWidget(boss, prefix + "vcMusicText", "Music volume:");
_musicVolumeSlider = new SliderWidget(boss, prefix + "vcMusicSlider", kMusicVolumeChanged);
_musicVolumeLabel = new StaticTextWidget(boss, prefix + "vcMusicLabel", "100%");
_musicVolumeSlider->setMinValue(0);
_musicVolumeSlider->setMaxValue(Audio::Mixer::kMaxMixerVolume);
_musicVolumeLabel->setFlags(WIDGET_CLEARBG);
- new StaticTextWidget(boss, prefix + "vcSfxText", slider_labels[1]);
+ _sfxVolumeDesc = new StaticTextWidget(boss, prefix + "vcSfxText", "SFX volume:");
_sfxVolumeSlider = new SliderWidget(boss, prefix + "vcSfxSlider", kSfxVolumeChanged);
_sfxVolumeLabel = new StaticTextWidget(boss, prefix + "vcSfxLabel", "100%");
_sfxVolumeSlider->setMinValue(0);
_sfxVolumeSlider->setMaxValue(Audio::Mixer::kMaxMixerVolume);
_sfxVolumeLabel->setFlags(WIDGET_CLEARBG);
- new StaticTextWidget(boss, prefix + "vcSpeechText" , slider_labels[2]);
+ _speechVolumeDesc = new StaticTextWidget(boss, prefix + "vcSpeechText" , "Speech volume:");
_speechVolumeSlider = new SliderWidget(boss, prefix + "vcSpeechSlider", kSpeechVolumeChanged);
_speechVolumeLabel = new StaticTextWidget(boss, prefix + "vcSpeechLabel", "100%");
_speechVolumeSlider->setMinValue(0);
@@ -446,6 +550,18 @@
_enableVolumeSettings = true;
}
+int OptionsDialog::getSubtitleMode(bool subtitles, bool speech_mute) {
+ if (!subtitles && !speech_mute) // Speech only
+ return 0;
+ else if (subtitles && !speech_mute) // Speech and subtitles
+ return 1;
+ else if (subtitles && speech_mute) // Subtitles only
+ return 2;
+ else
+ warning("Wrong configuration: Both subtitles and speech are off. Assuming subtitles only");
+ return 2;
+}
+
void OptionsDialog::handleScreenChanged() {
Dialog::handleScreenChanged();
@@ -481,6 +597,8 @@
tab->addTab("Audio");
addAudioControls(tab, "globaloptions_");
addVolumeControls(tab, "globaloptions_");
+ addSubtitleControls(tab, "globaloptions_");
+
// TODO: cd drive setting
//
Modified: scummvm/trunk/gui/options.h
===================================================================
--- scummvm/trunk/gui/options.h 2006-05-13 17:28:33 UTC (rev 22455)
+++ scummvm/trunk/gui/options.h 2006-05-13 17:30:04 UTC (rev 22456)
@@ -66,11 +66,15 @@
void addAudioControls(GuiObject *boss, String prefix);
void addMIDIControls(GuiObject *boss, String prefix);
void addVolumeControls(GuiObject *boss, String prefix);
+ // The default value is the launcher's non-scaled talkspeed value. When SCUMM uses the widget,
+ // it uses its own scale
+ void addSubtitleControls(GuiObject *boss, String prefix, int maxSliderVal = 255);
void setGraphicSettingsState(bool enabled);
void setAudioSettingsState(bool enabled);
void setMIDISettingsState(bool enabled);
void setVolumeSettingsState(bool enabled);
+ void setSubtitleSettingsState(bool enabled);
private:
//
@@ -87,7 +91,6 @@
//
bool _enableAudioSettings;
PopUpWidget *_midiPopUp;
- CheckboxWidget *_subCheckbox;
//
// MIDI controls
@@ -96,18 +99,34 @@
CheckboxWidget *_multiMidiCheckbox;
CheckboxWidget *_mt32Checkbox;
CheckboxWidget *_enableGSCheckbox;
+
+ //
+ // Subtitle controls
+ //
+ int getSubtitleMode(bool subtitles, bool speech_mute);
+ bool _enableSubtitleSettings;
+ StaticTextWidget *_subToggleDesc;
+ ButtonWidget *_subToggleButton;
+ int _subMode;
+ static const char *_subModeDesc[];
+ StaticTextWidget *_subSpeedDesc;
+ SliderWidget *_subSpeedSlider;
+ StaticTextWidget *_subSpeedLabel;
//
// Volume controls
//
bool _enableVolumeSettings;
+ StaticTextWidget *_musicVolumeDesc;
SliderWidget *_musicVolumeSlider;
StaticTextWidget *_musicVolumeLabel;
+ StaticTextWidget *_sfxVolumeDesc;
SliderWidget *_sfxVolumeSlider;
StaticTextWidget *_sfxVolumeLabel;
+ StaticTextWidget *_speechVolumeDesc;
SliderWidget *_speechVolumeSlider;
StaticTextWidget *_speechVolumeLabel;
};
Modified: scummvm/trunk/gui/theme-config.cpp
===================================================================
--- scummvm/trunk/gui/theme-config.cpp 2006-05-13 17:28:33 UTC (rev 22455)
+++ scummvm/trunk/gui/theme-config.cpp 2006-05-13 17:30:04 UTC (rev 22456)
@@ -50,6 +50,7 @@
"def_scummhelpX=5\n"
"def_scummhelpW=(w - 2 * 5)\n"
"def_midiControlsSpacing=1\n"
+"def_vcAudioTabIndent=0\n"
"use=XxY\n"
"# Scumm Saveload dialog\n"
"scummsaveload=8 8 (w - 2 * 8) (h - 16)\n"
@@ -85,6 +86,7 @@
"def_scummhelpW=370\n"
"def_scummhelpX=((w - scummhelpW) / 2)\n"
"def_midiControlsSpacing=2\n"
+"def_vcAudioTabIndent=10\n"
"##### Widgets config\n"
"ListWidget.leftPadding=4\n"
"ListWidget.rightPadding=0\n"
@@ -141,12 +143,14 @@
"\n"
"# graphics tab\n"
"opYoffset=vBorder\n"
+"opXoffset=0\n"
"useWithPrefix=graphicsControls globaloptions_\n"
"\n"
"# audio tab\n"
"opYoffset=vBorder\n"
"useWithPrefix=audioControls globaloptions_\n"
"useWithPrefix=volumeControls globaloptions_\n"
+"useWithPrefix=subtitleControls globaloptions_\n"
"\n"
"# MIDI tab\n"
"opYoffset=vBorder\n"
@@ -205,6 +209,7 @@
"\n"
"# graphics tab\n"
"opYoffset=vBorder\n"
+"opXoffset=gox\n"
"gameoptions_graphicsCheckbox=gox opYoffset (kFontHeight + 10 + 192) buttonHeight\n"
"opYoffset=(opYoffset + buttonHeight)\n"
"useWithPrefix=graphicsControls gameoptions_\n"
@@ -214,6 +219,7 @@
"gameoptions_audioCheckbox=gox opYoffset (kFontHeight + 10 + 180) buttonHeight\n"
"opYoffset=(opYoffset + buttonHeight)\n"
"useWithPrefix=audioControls gameoptions_\n"
+"useWithPrefix=subtitleControls gameoptions_\n"
"\n"
"# midi tab\n"
"opYoffset=vBorder\n"
@@ -251,9 +257,8 @@
"# hence it is on the end of the list\n"
"opYoffset=8\n"
"useWithPrefix=volumeControls scummconfig_\n"
-"scummconfig_subtitlesCheckbox=15 opYoffset (kFontHeight + 10 + 89) buttonHeight\n"
+"useWithPrefix=subtitleControls scummconfig_\n"
"opYoffset=(opYoffset + buttonHeight)\n"
-"scummconfig_speechCheckbox=prev.x opYoffset (kFontHeight + 10 + 85) buttonHeight\n"
"opYoffset=(opYoffset + buttonHeight + 4)\n"
"soWidth=(8 + 3 * buttonWidth + 4)\n"
"scummconfig_keys=(soWidth - 3 * (buttonWidth + 4) + 6) opYoffset (buttonWidth - 10) buttonHeight\n"
@@ -299,7 +304,6 @@
"chooser_cancel=(chooserW - 2 * (buttonWidth + 10)) (opHeight - buttonHeight - 8) buttonWidth buttonHeight\n"
"chooser_ok=(prev.x2 + 10) prev.y prev.w prev.h\n"
"\n"
-"\n"
"[graphicsControls]\n"
"gcx=10\n"
"gcw=(parent.w - 2 * 10)\n"
@@ -316,24 +320,23 @@
"aux=10\n"
"auw=(parent.w - 2 * 10)\n"
"auMidiPopup=(aux - 5) (opYoffset - 1) (auw + 5) (kLineHeight + 2)\n"
-"opYoffset=(opYoffset + kLineHeight + 4)\n"
-"auSubtitlesCheckbox=aux opYoffset (kFontHeight + 10 + 102) buttonHeight\n"
-"opYoffset=(opYoffset + buttonHeight + 18)\n"
+"opYoffset=(opYoffset + buttonHeight + 4)\n"
"\n"
"[volumeControls]\n"
-"vctextw=95\n"
-"vcxoff=(vctextw + 15)\n"
-"vcMusicText=10 (opYoffset + 2) vctextw kLineHeight\n"
+"vctextw=(95 + vcAudioTabIndent)\n"
+"vcxoff=(opXoffset + vctextw + 15)\n"
+"vcx=(opXoffset + 10)\n"
+"vcMusicText=vcx (opYoffset + 2) vctextw kLineHeight\n"
"vcMusicText.align=kTextAlignRight\n"
"vcMusicSlider=vcxoff opYoffset sliderWidth sliderHeight\n"
"vcMusicLabel=(vcxoff + prev.w + 10) (opYoffset + 2) 24 kLineHeight\n"
"opYoffset=(opYoffset + sliderHeight + 4)\n"
-"vcSfxText=10 (opYoffset + 2) vctextw kLineHeight\n"
+"vcSfxText=vcx (opYoffset + 2) vctextw kLineHeight\n"
"vcSfxText.align=kTextAlignRight\n"
"vcSfxSlider=vcxoff opYoffset sliderWidth sliderHeight\n"
"vcSfxLabel=(vcxoff + prev.w + 10) (opYoffset + 2) 24 kLineHeight\n"
"opYoffset=(opYoffset + sliderHeight + 4)\n"
-"vcSpeechText=10 (opYoffset + 2) vctextw kLineHeight\n"
+"vcSpeechText=vcx (opYoffset + 2) vctextw kLineHeight\n"
"vcSpeechText.align=kTextAlignRight\n"
"vcSpeechSlider=vcxoff opYoffset sliderWidth sliderHeight\n"
"vcSpeechLabel=(vcxoff + prev.w + 10) (opYoffset + 2) 24 kLineHeight\n"
@@ -351,6 +354,21 @@
"mcGSCheckbox=mcx opYoffset (kFontHeight + 10 + 142) buttonHeight\n"
"opYoffset=(opYoffset + buttonHeight + midiControlsSpacing)\n"
"\n"
+"[subtitleControls]\n"
+"sbx=(opXoffset + 10)\n"
+"sbYoff=(buttonHeight / 8)\n"
+"sbOff=((sliderHeight - kLineHeight) / 2 + 2)\n"
+"sbtextw=(100 + vcAudioTabIndent)\n"
+"opYoffset=(opYoffset + sbYoff)\n"
+"subToggleDesc=sbx (opYoffset + sbYoff) sbtextw buttonHeight\n"
+"subToggleButton=prev.x2 (opYoffset - sbYoff) (buttonWidth + 54) buttonHeight\n"
+"opYoffset=(opYoffset + buttonHeight + 6)\n"
+"subSubtitleSpeedDesc=sbx (opYoffset + sbOff) sbtextw kLineHeight\n"
+"subSubtitleSpeedDesc.align=kTextAlignRight\n"
+"subSubtitleSpeedSlider=prev.x2 opYoffset sliderWidth sliderHeight\n"
+"subSubtitleSpeedLabel=(prev.x2 + 10) (opYoffset + sbOff) 24 kLineHeight\n"
+"opYoffset=(opYoffset + sliderHeight + 8)\n"
+"\n"
"[scummmain]\n"
"## Main dialog\n"
"# note that scummmain size depends on overall height\n"
Modified: scummvm/trunk/gui/themes/modern.ini
===================================================================
--- scummvm/trunk/gui/themes/modern.ini 2006-05-13 17:28:33 UTC (rev 22455)
+++ scummvm/trunk/gui/themes/modern.ini 2006-05-13 17:30:04 UTC (rev 22456)
@@ -234,6 +234,7 @@
opYoffset=vBorder
useWithPrefix=audioControls globaloptions_
useWithPrefix=volumeControls globaloptions_
+useWithPrefix=subtitleControls globaloptions_
# MIDI tab
opYoffset=vBorder
@@ -302,6 +303,7 @@
gameoptions_audioCheckbox=gox opYoffset (kFontHeight + 10 + 180) buttonHeight
opYoffset=(opYoffset + buttonHeight + 6)
useWithPrefix=audioControls gameoptions_
+useWithPrefix=subtitleControls gameoptions_
# midi tab
opYoffset=vBorder
@@ -341,9 +343,8 @@
# hence it is on the end of the list
opYoffset=8
useWithPrefix=volumeControls scummconfig_
-scummconfig_subtitlesCheckbox=15 opYoffset (kFontHeight + 10 + 89) buttonHeight
+useWithPrefix=subtitleControls scummconfig_
opYoffset=(opYoffset + buttonHeight)
-scummconfig_speechCheckbox=prev.x opYoffset (kFontHeight + 10 + 85) buttonHeight
opYoffset=(opYoffset + buttonHeight + 4)
soWidth=(8 + 3 * buttonWidth + 4)
scummconfig_keys=(soWidth - 3 * (buttonWidth + 4) + 6) opYoffset (buttonWidth - 10) buttonHeight
@@ -389,7 +390,6 @@
chooser_cancel=(chooserW - 2 * (buttonWidth + 10)) (opHeight - buttonHeight - 8) buttonWidth buttonHeight
chooser_ok=(prev.x2 + 10) prev.y prev.w prev.h
-
[graphicsControls]
gcx=(opXoffset + 10)
gcw=(parent.w - gcx - 25)
@@ -404,26 +404,25 @@
[audioControls]
aux=(opXoffset + 10)
-auw=(parent.w - aux - 25)
-auMidiPopup=(aux - 5) (opYoffset - 1) (auw + 5) (kLineHeight + 2)
-opYoffset=(opYoffset + kLineHeight + 16)
-auSubtitlesCheckbox=aux opYoffset (kFontHeight + 10 + 102) buttonHeight
-opYoffset=(opYoffset + buttonHeight + 18)
+auw=(parent.w - aux - 30)
+auMidiPopup=(aux) (opYoffset - 1) (auw + 5) (kLineHeight + 2)
+opYoffset=(opYoffset + buttonHeight + 4)
[volumeControls]
-vctextw=95
-vcxoff=(vctextw + 15)
-vcMusicText=10 (opYoffset + 2) vctextw kLineHeight
+vctextw=110
+vcxoff=(opXoffset + vctextw + 10)
+vcx=(opXoffset + 10)
+vcMusicText=vcx (opYoffset + 2) vctextw kLineHeight
vcMusicText.align=kTextAlignRight
vcMusicSlider=vcxoff opYoffset sliderWidth sliderHeight
vcMusicLabel=(vcxoff + prev.w + 10) (opYoffset + 2) 24 kLineHeight
opYoffset=(opYoffset + sliderHeight + 8)
-vcSfxText=10 (opYoffset + 2) vctextw kLineHeight
+vcSfxText=vcx (opYoffset + 2) vctextw kLineHeight
vcSfxText.align=kTextAlignRight
vcSfxSlider=vcxoff opYoffset sliderWidth sliderHeight
vcSfxLabel=(vcxoff + prev.w + 10) (opYoffset + 2) 24 kLineHeight
opYoffset=(opYoffset + sliderHeight + 8)
-vcSpeechText=10 (opYoffset + 2) vctextw kLineHeight
+vcSpeechText=vcx (opYoffset + 2) vctextw kLineHeight
vcSpeechText.align=kTextAlignRight
vcSpeechSlider=vcxoff opYoffset sliderWidth sliderHeight
vcSpeechLabel=(vcxoff + prev.w + 10) (opYoffset + 2) 24 kLineHeight
@@ -442,6 +441,21 @@
mcGSCheckbox=mcx opYoffset (kFontHeight + 10 + 142) buttonHeight
opYoffset=(opYoffset + buttonHeight + midiControlsSpacing)
+[subtitleControls]
+sbx=(opXoffset + 10)
+sbtextw=110
+sbYoff=(buttonHeight / 8)
+sbOff=((sliderHeight - kLineHeight) / 2)
+opYoffset=(opYoffset + sbYoff)
+subToggleDesc=sbx (opYoffset + sbYoff) sbtextw buttonHeight
+subToggleButton=prev.x2 opYoffset (buttonWidth + 34) sliderHeight
+opYoffset=(opYoffset + buttonHeight + 6)
+subSubtitleSpeedDesc=sbx (opYoffset + sbOff) sbtextw kLineHeight
+subSubtitleSpeedDesc.align=kTextAlignRight
+subSubtitleSpeedSlider=prev.x2 opYoffset sliderWidth sliderHeight
+subSubtitleSpeedLabel=(prev.x2 + 10) (opYoffset + sbOff) 24 kLineHeight
+opYoffset=(opYoffset + sliderHeight + 8)
+
[scummmain]
## Main dialog
# note that scummmain size depends on overall height
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list