aboutsummaryrefslogtreecommitdiff
path: root/engines/glk/blorb.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/blorb.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/blorb.cpp')
-rw-r--r--engines/glk/blorb.cpp34
1 files changed, 33 insertions, 1 deletions
diff --git a/engines/glk/blorb.cpp b/engines/glk/blorb.cpp
index 03c3dd3051..3c60fd36fc 100644
--- a/engines/glk/blorb.cpp
+++ b/engines/glk/blorb.cpp
@@ -215,7 +215,39 @@ bool Blorb::isBlorb(const Common::String &filename, uint32 type) {
bool Blorb::hasBlorbExt(const Common::String &filename) {
return filename.hasSuffixIgnoreCase(".blorb") || filename.hasSuffixIgnoreCase(".zblorb")
- || filename.hasSuffixIgnoreCase(".gblorb") || filename.hasSuffixIgnoreCase(".blb");
+ || filename.hasSuffixIgnoreCase(".gblorb") || filename.hasSuffixIgnoreCase(".blb")
+ || filename.hasSuffixIgnoreCase(".a3r");
+}
+
+void Blorb::getBlorbFilenames(const Common::String &srcFilename, Common::StringArray &filenames,
+ InterpreterType interpType) {
+ // Strip off the source filename extension
+ Common::String filename = srcFilename;
+ if (!filename.contains('.')) {
+ filename += '.';
+ } else {
+ while (filename[filename.size() - 1] != '.')
+ filename.deleteLastChar();
+ }
+
+ // Add in the different possible filenames
+ filenames.clear();
+ filenames.push_back(filename + "blorb");
+ filenames.push_back(filename + "blb");
+
+ switch (interpType) {
+ case INTERPRETER_ALAN3:
+ filenames.push_back(filename + "a3r");
+ break;
+ case INTERPRETER_FROTZ:
+ filenames.push_back(filename + "zblorb");
+ break;
+ case INTERPRETER_GLULXE:
+ filenames.push_back(filename + "gblorb");
+ break;
+ default:
+ break;
+ }
}
} // End of namespace Glk