aboutsummaryrefslogtreecommitdiff
path: root/gui/options.cpp
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2013-04-18 23:37:54 +0200
committerWillem Jan Palenstijn2013-05-08 20:46:44 +0200
commit02c5cc75a7cb8885d2a0fa141fbc0e763c5b31a0 (patch)
tree72b64a67ebeca41e9b83593da80850e848a99e2e /gui/options.cpp
parent1539023834a2ad7cf8942711d60983891a10a82a (diff)
parent1e200620d673af4acdd2d128ed6e390df001aacf (diff)
downloadscummvm-rg350-02c5cc75a7cb8885d2a0fa141fbc0e763c5b31a0.tar.gz
scummvm-rg350-02c5cc75a7cb8885d2a0fa141fbc0e763c5b31a0.tar.bz2
scummvm-rg350-02c5cc75a7cb8885d2a0fa141fbc0e763c5b31a0.zip
Merge branch 'master'
Conflicts: configure base/plugins.cpp
Diffstat (limited to 'gui/options.cpp')
-rw-r--r--gui/options.cpp63
1 files changed, 19 insertions, 44 deletions
diff --git a/gui/options.cpp b/gui/options.cpp
index 5085f9cdd9..4868f1876d 100644
--- a/gui/options.cpp
+++ b/gui/options.cpp
@@ -102,7 +102,6 @@ void OptionsDialog::init() {
_renderModePopUpDesc = 0;
_fullscreenCheckbox = 0;
_aspectCheckbox = 0;
- _disableDitheringCheckbox = 0;
_enableAudioSettings = false;
_midiPopUp = 0;
_midiPopUpDesc = 0;
@@ -217,14 +216,6 @@ void OptionsDialog::open() {
}
#endif // SMALL_SCREEN_DEVICE
- // EGA undithering setting
- if (_guioptions.contains(GUIO_EGAUNDITHER) || _domain == Common::ConfigManager::kApplicationDomain) {
- _disableDitheringCheckbox->setEnabled(true);
- _disableDitheringCheckbox->setState(ConfMan.getBool("disable_dithering", _domain));
- } else {
- _disableDitheringCheckbox->setState(false);
- _disableDitheringCheckbox->setEnabled(false);
- }
}
// Audio options
@@ -333,7 +324,6 @@ void OptionsDialog::close() {
ConfMan.setBool("fullscreen", _fullscreenCheckbox->getState(), _domain);
ConfMan.setBool("aspect_ratio", _aspectCheckbox->getState(), _domain);
- ConfMan.setBool("disable_dithering", _disableDitheringCheckbox->getState(), _domain);
bool isSet = false;
@@ -359,7 +349,6 @@ void OptionsDialog::close() {
} else {
ConfMan.removeKey("fullscreen", _domain);
ConfMan.removeKey("aspect_ratio", _domain);
- ConfMan.removeKey("disable_dithering", _domain);
ConfMan.removeKey("gfx_mode", _domain);
ConfMan.removeKey("render_mode", _domain);
}
@@ -617,10 +606,6 @@ void OptionsDialog::setGraphicSettingsState(bool enabled) {
else
_aspectCheckbox->setEnabled(enabled);
#endif
- if (_guioptions.contains(GUIO_EGAUNDITHER) && enabled)
- _disableDitheringCheckbox->setEnabled(true);
- else
- _disableDitheringCheckbox->setEnabled(false);
}
void OptionsDialog::setAudioSettingsState(bool enabled) {
@@ -750,7 +735,7 @@ void OptionsDialog::addGraphicControls(GuiObject *boss, const Common::String &pr
}
// RenderMode popup
- const Common::String allFlags = renderType2GUIO((uint32)-1);
+ const Common::String allFlags = Common::allRenderModesGUIOs();
bool renderingTypeDefined = (strpbrk(_guioptions.c_str(), allFlags.c_str()) != NULL);
_renderModePopUpDesc = new StaticTextWidget(boss, prefix + "grRenderPopupDesc", _("Render mode:"), _("Special dithering modes supported by some games"));
@@ -759,7 +744,7 @@ void OptionsDialog::addGraphicControls(GuiObject *boss, const Common::String &pr
_renderModePopUp->appendEntry("");
const Common::RenderModeDescription *rm = Common::g_renderModes;
for (; rm->code; ++rm) {
- Common::String renderGuiOption = renderType2GUIO(rm->id);
+ Common::String renderGuiOption = Common::renderMode2GUIO(rm->id);
if ((_domain == Common::ConfigManager::kApplicationDomain) || (_domain != Common::ConfigManager::kApplicationDomain && !renderingTypeDefined) || (_guioptions.contains(renderGuiOption)))
_renderModePopUp->appendEntry(_c(rm->description, context), rm->id);
}
@@ -769,7 +754,6 @@ void OptionsDialog::addGraphicControls(GuiObject *boss, const Common::String &pr
// Aspect ratio checkbox
_aspectCheckbox = new CheckboxWidget(boss, prefix + "grAspectCheckbox", _("Aspect ratio correction"), _("Correct aspect ratio for 320x200 games"));
- _disableDitheringCheckbox = new CheckboxWidget(boss, prefix + "grDisableDitheringCheckbox", _("EGA undithering"), _("Enable undithering in EGA games that support it"));
_enableGraphicSettings = true;
}
@@ -997,6 +981,22 @@ void OptionsDialog::addVolumeControls(GuiObject *boss, const Common::String &pre
_enableVolumeSettings = true;
}
+void OptionsDialog::addEngineControls(GuiObject *boss, const Common::String &prefix, const ExtraGuiOptions &engineOptions) {
+ // Note: up to 7 engine options can currently fit on screen (the most that
+ // can fit in a 320x200 screen with the classic theme).
+ // TODO: Increase this number by including the checkboxes inside a scroll
+ // widget. The appropriate number of checkboxes will need to be added to
+ // the theme files.
+
+ uint i = 1;
+ ExtraGuiOptions::const_iterator iter;
+ for (iter = engineOptions.begin(); iter != engineOptions.end(); ++iter, ++i) {
+ Common::String id = Common::String::format("%d", i);
+ _engineCheckboxes.push_back(new CheckboxWidget(boss,
+ prefix + "customOption" + id + "Checkbox", _(iter->label), _(iter->tooltip)));
+ }
+}
+
bool OptionsDialog::loadMusicDeviceSetting(PopUpWidget *popup, Common::String setting, MusicType preferredType) {
if (!popup || !popup->isEnabled())
return true;
@@ -1010,7 +1010,7 @@ bool OptionsDialog::loadMusicDeviceSetting(PopUpWidget *popup, Common::String se
for (MusicDevices::iterator d = i.begin(); d != i.end(); ++d) {
if (setting.empty() ? (preferredType == d->getMusicType()) : (drv == d->getCompleteId())) {
popup->setSelectedTag(d->getHandle());
- return popup->getSelected() == -1 ? false : true;
+ return popup->getSelected() != -1;
}
}
}
@@ -1040,31 +1040,6 @@ void OptionsDialog::saveMusicDeviceSetting(PopUpWidget *popup, Common::String se
ConfMan.removeKey(setting, _domain);
}
-Common::String OptionsDialog::renderType2GUIO(uint32 renderType) {
- static const struct {
- Common::RenderMode type;
- const char *guio;
- } renderGUIOMapping[] = {
- { Common::kRenderHercG, GUIO_RENDERHERCGREEN },
- { Common::kRenderHercA, GUIO_RENDERHERCAMBER },
- { Common::kRenderCGA, GUIO_RENDERCGA },
- { Common::kRenderEGA, GUIO_RENDEREGA },
- { Common::kRenderVGA, GUIO_RENDERVGA },
- { Common::kRenderAmiga, GUIO_RENDERAMIGA },
- { Common::kRenderFMTowns, GUIO_RENDERFMTOWNS },
- { Common::kRenderPC9821, GUIO_RENDERPC9821 },
- { Common::kRenderPC9801, GUIO_RENDERPC9801 }
- };
- Common::String res;
-
- for (int i = 0; i < ARRAYSIZE(renderGUIOMapping); i++) {
- if (renderType == renderGUIOMapping[i].type || renderType == (uint32)-1)
- res += renderGUIOMapping[i].guio;
- }
-
- return res;
-}
-
int OptionsDialog::getSubtitleMode(bool subtitles, bool speech_mute) {
if (_guioptions.contains(GUIO_NOSUBTITLES))
return kSubtitlesSpeech; // Speech only