aboutsummaryrefslogtreecommitdiff
path: root/engines/glk/glk.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2019-06-26 21:16:23 -0700
committerPaul Gilbert2019-07-06 15:27:08 -0700
commit9c197d71ab40143a40daa8b7599db18ed98a1215 (patch)
tree2a248cf467323905b04d74e43e7b00aa4dca7215 /engines/glk/glk.cpp
parent86f9985951203ed39e1a6c08e32730b478b10517 (diff)
downloadscummvm-rg350-9c197d71ab40143a40daa8b7599db18ed98a1215.tar.gz
scummvm-rg350-9c197d71ab40143a40daa8b7599db18ed98a1215.tar.bz2
scummvm-rg350-9c197d71ab40143a40daa8b7599db18ed98a1215.zip
GLK: ALAN3: Add support for loading a3r Blorb files
Diffstat (limited to 'engines/glk/glk.cpp')
-rw-r--r--engines/glk/glk.cpp19
1 files changed, 9 insertions, 10 deletions
diff --git a/engines/glk/glk.cpp b/engines/glk/glk.cpp
index ffb5015633..b17304d957 100644
--- a/engines/glk/glk.cpp
+++ b/engines/glk/glk.cpp
@@ -126,16 +126,15 @@ Common::Error GlkEngine::run() {
return Common::kNoGameDataFoundError;
} else {
// Check for a secondary blorb file with the same filename
- Common::String baseName = filename;
- while (baseName.contains('.'))
- baseName.deleteLastChar();
-
- if (Common::File::exists(baseName + ".blorb")) {
- _blorb = new Blorb(baseName + ".blorb", getInterpreterType());
- SearchMan.add("blorb", _blorb, 99, false);
- } else if (Common::File::exists(baseName + ".blb")) {
- _blorb = new Blorb(baseName + ".blb", getInterpreterType());
- SearchMan.add("blorb", _blorb, 99, false);
+ Common::StringArray blorbFilenames;
+ Blorb::getBlorbFilenames(filename, blorbFilenames, getInterpreterType());
+
+ for (uint idx = 0; idx < blorbFilenames.size(); ++idx) {
+ if (Common::File::exists(blorbFilenames[idx])) {
+ _blorb = new Blorb(blorbFilenames[idx], getInterpreterType());
+ SearchMan.add("blorb", _blorb, 99, false);
+ break;
+ }
}
// Open up the game file