aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorFilippos Karapetis2012-03-31 13:55:03 +0300
committerFilippos Karapetis2012-03-31 13:55:03 +0300
commit6a49d3eadd7555a4f5f539ceb73fdfe370fce9da (patch)
tree9bee862bbd896efe29573c73938f84159be8e5b1 /engines
parent7f9c63239b2f360b6d96e8ff4dd007b80d990e46 (diff)
downloadscummvm-rg350-6a49d3eadd7555a4f5f539ceb73fdfe370fce9da.tar.gz
scummvm-rg350-6a49d3eadd7555a4f5f539ceb73fdfe370fce9da.tar.bz2
scummvm-rg350-6a49d3eadd7555a4f5f539ceb73fdfe370fce9da.zip
ENGINES: Return all available custom GUI options if no target is specified
This is used to set default settings for all custom game options when an engine starts
Diffstat (limited to 'engines')
-rw-r--r--engines/advancedDetector.cpp13
-rw-r--r--engines/metaengine.h9
-rw-r--r--engines/queen/queen.cpp8
-rw-r--r--engines/sci/engine/features.cpp2
-rw-r--r--engines/sci/sci.cpp3
-rw-r--r--engines/sci/sound/soundcmd.cpp5
-rw-r--r--engines/sky/detection.cpp8
7 files changed, 36 insertions, 12 deletions
diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp
index dc7f7e007c..ac06e74e0a 100644
--- a/engines/advancedDetector.cpp
+++ b/engines/advancedDetector.cpp
@@ -171,12 +171,21 @@ const ExtraGuiOptions AdvancedMetaEngine::getExtraGuiOptions(const Common::Strin
if (!_extraGuiOptions)
return ExtraGuiOptions();
+ ExtraGuiOptions options;
+
+ // If there isn't any target specified, return all available GUI options.
+ // Only used when an engine starts in order to set option defaults.
+ if (target.empty()) {
+ for (const ADExtraGuiOptionsMap *entry = _extraGuiOptions; entry->guioFlag; ++entry)
+ options.push_back(entry->option);
+
+ return options;
+ }
+
// Query the GUI options
const Common::String guiOptionsString = ConfMan.get("guioptions", target);
const Common::String guiOptions = parseGameGUIOptions(guiOptionsString);
- ExtraGuiOptions options;
-
// Add all the applying extra GUI options.
for (const ADExtraGuiOptionsMap *entry = _extraGuiOptions; entry->guioFlag; ++entry) {
if (guiOptions.contains(entry->guioFlag))
diff --git a/engines/metaengine.h b/engines/metaengine.h
index 632c204978..ffa682fc53 100644
--- a/engines/metaengine.h
+++ b/engines/metaengine.h
@@ -112,10 +112,17 @@ public:
}
/**
- * Return a list of extra GUI options.
+ * Return a list of extra GUI options for the specified target.
+ * If no target is specified, all of the available custom GUI options are
+ * Returned for the plugin (used to set default values).
+ *
* Currently, this only supports options with checkboxes.
*
* The default implementation returns an empty list.
+ *
+ * @param target name of a config manager target
+ * @return a list of extra GUI options for an engine plugin and
+ * target
*/
virtual const ExtraGuiOptions getExtraGuiOptions(const Common::String &target) const {
return ExtraGuiOptions();
diff --git a/engines/queen/queen.cpp b/engines/queen/queen.cpp
index 1b07d3c01a..3acc87b856 100644
--- a/engines/queen/queen.cpp
+++ b/engines/queen/queen.cpp
@@ -112,12 +112,18 @@ int QueenMetaEngine::getMaximumSaveSlot() const { return 99; }
const ExtraGuiOptions QueenMetaEngine::getExtraGuiOptions(const Common::String &target) const {
Common::String guiOptions;
+ ExtraGuiOptions options;
+
+ if (target.empty()) {
+ options.push_back(queenExtraGuiOption);
+ return options;
+ }
+
if (ConfMan.hasKey("guioptions", target)) {
guiOptions = ConfMan.get("guioptions", target);
guiOptions = parseGameGUIOptions(guiOptions);
}
- ExtraGuiOptions options;
if (!guiOptions.contains(GUIO_NOSPEECH))
options.push_back(queenExtraGuiOption);
return options;
diff --git a/engines/sci/engine/features.cpp b/engines/sci/engine/features.cpp
index a284c319c0..cad95b1c18 100644
--- a/engines/sci/engine/features.cpp
+++ b/engines/sci/engine/features.cpp
@@ -43,7 +43,7 @@ GameFeatures::GameFeatures(SegManager *segMan, Kernel *kernel) : _segMan(segMan)
_sci2StringFunctionType = kSci2StringFunctionUninitialized;
#endif
_usesCdTrack = Common::File::exists("cdaudio.map");
- if (ConfMan.hasKey("use_cdaudio") && !ConfMan.getBool("use_cdaudio"))
+ if (!ConfMan.getBool("use_cdaudio"))
_usesCdTrack = false;
}
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index c77b49400f..9b0ee6924b 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -221,8 +221,7 @@ Common::Error SciEngine::run() {
// Initialize the game screen
_gfxScreen = new GfxScreen(_resMan);
- bool enableUnDitheringFlag = ConfMan.hasKey("disable_dithering") && ConfMan.getBool("disable_dithering");
- _gfxScreen->enableUndithering(enableUnDitheringFlag);
+ _gfxScreen->enableUndithering(ConfMan.getBool("disable_dithering"));
_kernel = new Kernel(_resMan, segMan);
diff --git a/engines/sci/sound/soundcmd.cpp b/engines/sci/sound/soundcmd.cpp
index 8481f10171..05bb90332a 100644
--- a/engines/sci/sound/soundcmd.cpp
+++ b/engines/sci/sound/soundcmd.cpp
@@ -44,10 +44,7 @@ SoundCommandParser::SoundCommandParser(ResourceManager *resMan, SegManager *segM
// resource number, but it's totally unrelated to the menu music).
// The GK1 demo (very late SCI1.1) does the same thing
// TODO: Check the QFG4 demo
-
- // If the prefer_digitalsfx key is missing, default to enable digital SFX
- bool preferDigitalSfx = !ConfMan.hasKey("prefer_digitalsfx") || ConfMan.getBool("prefer_digitalsfx");
- _useDigitalSFX = (getSciVersion() >= SCI_VERSION_2 || g_sci->getGameId() == GID_GK1 || preferDigitalSfx);
+ _useDigitalSFX = (getSciVersion() >= SCI_VERSION_2 || g_sci->getGameId() == GID_GK1 || ConfMan.getBool("prefer_digitalsfx"));
_music = new SciMusic(_soundVersion, _useDigitalSFX);
_music->init();
diff --git a/engines/sky/detection.cpp b/engines/sky/detection.cpp
index 05dbe10338..dfa3ded50b 100644
--- a/engines/sky/detection.cpp
+++ b/engines/sky/detection.cpp
@@ -118,12 +118,18 @@ GameList SkyMetaEngine::getSupportedGames() const {
const ExtraGuiOptions SkyMetaEngine::getExtraGuiOptions(const Common::String &target) const {
Common::String guiOptions;
+ ExtraGuiOptions options;
+
+ if (target.empty()) {
+ options.push_back(skyExtraGuiOption);
+ return options;
+ }
+
if (ConfMan.hasKey("guioptions", target)) {
guiOptions = ConfMan.get("guioptions", target);
guiOptions = parseGameGUIOptions(guiOptions);
}
- ExtraGuiOptions options;
if (!guiOptions.contains(GUIO_NOSPEECH))
options.push_back(skyExtraGuiOption);
return options;