aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBLooperZ2019-11-27 07:37:21 +0200
committerFilippos Karapetis2019-12-07 21:42:14 +0200
commit7eea773fc73524cdfaf96a3760f4739c4f100398 (patch)
tree322f33b6b1fc26367dd0b2fe4d9a2105b26ee123
parent1a81f1580b0362918fe39a43d44e27a438d40212 (diff)
downloadscummvm-rg350-7eea773fc73524cdfaf96a3760f4739c4f100398.tar.gz
scummvm-rg350-7eea773fc73524cdfaf96a3760f4739c4f100398.tar.bz2
scummvm-rg350-7eea773fc73524cdfaf96a3760f4739c4f100398.zip
COMPOSER: fallback load default configs
-rw-r--r--engines/composer/composer.cpp7
-rw-r--r--engines/composer/composer.h2
-rw-r--r--engines/composer/detection.cpp7
3 files changed, 6 insertions, 10 deletions
diff --git a/engines/composer/composer.cpp b/engines/composer/composer.cpp
index 6e2df19adf..9931298bf6 100644
--- a/engines/composer/composer.cpp
+++ b/engines/composer/composer.cpp
@@ -85,11 +85,8 @@ Common::Error ComposerEngine::run() {
_queuedScripts[i]._scriptId = 0;
}
- Common::String configFile;
- getConfigFile(configFile);
-
- if (!(_bookIni.loadFromFile(configFile))) {
- warning("Detected config file is not available - trying other options");
+ if (!loadDetectedConfigFile(_bookIni)) {
+ // Config files for Darby the Dragon are located in subdirectory
_directoriesToStrip = 0;
if (!_bookIni.loadFromFile("programs/book.ini")) {
error("failed to find book.ini");
diff --git a/engines/composer/composer.h b/engines/composer/composer.h
index 8af620de70..64ec077676 100644
--- a/engines/composer/composer.h
+++ b/engines/composer/composer.h
@@ -182,7 +182,7 @@ public:
uint32 getFeatures() const;
Common::Language getLanguage() const;
Common::Platform getPlatform() const;
- void getConfigFile(Common::String &file) const;
+ bool loadDetectedConfigFile(Common::INIFile &configFile) const;
const ComposerGameDescription *_gameDescription;
diff --git a/engines/composer/detection.cpp b/engines/composer/detection.cpp
index 3d09089149..69100d673e 100644
--- a/engines/composer/detection.cpp
+++ b/engines/composer/detection.cpp
@@ -56,17 +56,16 @@ Common::Platform ComposerEngine::getPlatform() const {
return _gameDescription->desc.platform;
}
-void ComposerEngine::getConfigFile(Common::String &configFile) const {
+bool ComposerEngine::loadDetectedConfigFile(Common::INIFile &configFile) const {
const ADGameFileDescription *res = _gameDescription->desc.filesDescriptions;
while (res->fileName != NULL) {
if (res->fileType == GAME_CONFIGFILE) {
- configFile = res->fileName;
- return;
+ return configFile.loadFromFile(res->fileName);
}
res++;
}
// default config file name
- configFile = "book.ini";
+ return configFile.loadFromFile("book.ini") || configFile.loadFromFile("book.mac");
}
}