aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2019-07-20 18:12:56 -0700
committerPaul Gilbert2019-09-29 15:08:52 -0700
commit30bf05479a8d4b9e63b243b0f1acac3fb946da32 (patch)
tree8bfde20656eef49ad0a167cf31318c78a8b8201c /engines
parent255f2b4c82867b3c113743d02cf91b91a15176bd (diff)
downloadscummvm-rg350-30bf05479a8d4b9e63b243b0f1acac3fb946da32.tar.gz
scummvm-rg350-30bf05479a8d4b9e63b243b0f1acac3fb946da32.tar.bz2
scummvm-rg350-30bf05479a8d4b9e63b243b0f1acac3fb946da32.zip
GLK: QUEST: Added detection entries
Diffstat (limited to 'engines')
-rw-r--r--engines/glk/quest/detection.cpp2
-rw-r--r--engines/glk/quest/detection_tables.h53
-rw-r--r--engines/glk/quest/geas_glk.cpp10
-rw-r--r--engines/glk/quest/quest.cpp2
-rw-r--r--engines/glk/quest/read_file.cpp3
5 files changed, 43 insertions, 27 deletions
diff --git a/engines/glk/quest/detection.cpp b/engines/glk/quest/detection.cpp
index a0aa6b8634..1423bc13fc 100644
--- a/engines/glk/quest/detection.cpp
+++ b/engines/glk/quest/detection.cpp
@@ -52,7 +52,7 @@ bool QuestMetaEngine::detectGames(const Common::FSList &fslist, DetectedGames &g
continue;
Common::String filename = file->getName();
- if (!filename.hasSuffixIgnoreCase(".quest"))
+ if (!filename.hasSuffixIgnoreCase(".cas") && !filename.hasSuffixIgnoreCase(".asl"))
continue;
Common::File gameFile;
diff --git a/engines/glk/quest/detection_tables.h b/engines/glk/quest/detection_tables.h
index 8e1fe11ba6..4cad4435a1 100644
--- a/engines/glk/quest/detection_tables.h
+++ b/engines/glk/quest/detection_tables.h
@@ -30,6 +30,14 @@ namespace Quest {
const PlainGameDescriptor QUEST_GAME_LIST[] = {
{ "quest", "Quest Game" },
+ { "adventureq", "Adventure!" },
+ { "attemptedassassination", "Attempted Assassination" },
+ { "hauntedhorror", "Haunted Horror" },
+ { "magicworld", "Magic World" },
+ { "redsaucemonday", "Red Sauce Monday" },
+ { "worldsend", "World's End" },
+
+#ifdef QUEST_EXT
{ "attackonfrightside", "Attack On Frightside" },
{ "balaclava", "Balaclava" },
{ "bearsepicquest", "Bear's Epic Quest" },
@@ -48,31 +56,38 @@ const PlainGameDescriptor QUEST_GAME_LIST[] = {
{ "thelasthero", "The Last Hero" },
{ "tokindlealight", "To Kindle a Light" },
{ "xanadu", "Xanadu - The World's Only Hope" },
-
+#endif
{ nullptr, nullptr }
};
const GlkDetectionEntry QUEST_GAMES[] = {
- DT_ENTRY0("attackonfrightside", "84542fc6460833bbf2594ed83f8b1fc7", 46019),
- DT_ENTRY0("balaclava", "8b30af05d9986f9f962c677181ecc766", 57719),
- DT_ENTRY0("bearsepicquest", "e6896a65527f456b4362aaebcf39e354", 62075),
- DT_ENTRY0("caught", "4502d89d8e304fe4165d46eb22f21f10", 5168593),
- DT_ENTRY0("cuttings", "e0ded5a6b78e8c9482e746d55f61972c", 6583866),
- DT_ENTRY0("draculacrl", "1af3ec877584b290f7ab1a1be8f944a5", 4548737),
- DT_ENTRY0("elections4", "d0bc0cd54182d6099808767068592b94", 591994),
- DT_ENTRY0("everyman", "410c7211d3f0c700f34e97ed258e33f1", 56218),
- DT_ENTRY0("firstTimes", "31d878c82d99856d473762612f154eb6", 10253826),
- DT_ENTRY0("giftofthemagi", "b33132ce71c8a2eed0f6c1c1af284765", 78647),
- DT_ENTRY0("medievalistsquest", "e0a15bc2a74a0bd6bb5c24661ea35829", 127977271),
- DT_ENTRY0("parishotel", "c9a42bc3f306aba5e318b0a74115e0d4", 474983),
- DT_ENTRY0("questforloot", "f7e32aec0f961a59a69bead3fadff4f0", 1357373),
- DT_ENTRY0("sleepingassassin", "9c2aa213bb73d8083506ee6f64436d9d", 287227),
- DT_ENTRY0("spondre", "c639077eb487eb6d1b63cda2c9ba5a9b", 1169469),
- DT_ENTRY0("thelasthero", "31e10b8a7f11a6289955b89437f8178c", 62512),
- DT_ENTRY0("tokindlealight", "5d3b57830b003046a621620ba0869d7c", 811845),
-
+ DT_ENTRY0("adventureq", "93a358f817066494dbdabf222fc20595", 6974),
+ DT_ENTRY0("attemptedassassination", "e8cf55898bcc5ee43a2527d5fefeaaff", 18833),
+ DT_ENTRY0("hauntedhorror", "89a5d511aed564d4810b372d271e33fa", 19635),
+ DT_ENTRY0("magicworld", "463cf8919c7321f3af305534b7ae78f3", 15176),
+ DT_ENTRY0("redsaucemonday", "5a2f3e25d4a8c77e0c53d980dbb37451", 20324),
+ DT_ENTRY0("worldsend", "4f5daac10085927bf5180bea24f7ef0d", 73396),
+#ifdef QUEST_EXT
+ DT_ENTRY0("attackonfrightside", "84542fc6460833bbf2594ed83f8b1fc7", 46019),
+ DT_ENTRY0("balaclava", "8b30af05d9986f9f962c677181ecc766", 57719),
+ DT_ENTRY0("bearsepicquest", "e6896a65527f456b4362aaebcf39e354", 62075),
+ DT_ENTRY0("caught", "4502d89d8e304fe4165d46eb22f21f10", 5168593),
+ DT_ENTRY0("cuttings", "e0ded5a6b78e8c9482e746d55f61972c", 6583866),
+ DT_ENTRY0("draculacrl", "1af3ec877584b290f7ab1a1be8f944a5", 4548737),
+ DT_ENTRY0("elections4", "d0bc0cd54182d6099808767068592b94", 591994),
+ DT_ENTRY0("everyman", "410c7211d3f0c700f34e97ed258e33f1", 56218),
+ DT_ENTRY0("firstTimes", "31d878c82d99856d473762612f154eb6", 10253826),
+ DT_ENTRY0("giftofthemagi", "b33132ce71c8a2eed0f6c1c1af284765", 78647),
+ DT_ENTRY0("medievalistsquest", "e0a15bc2a74a0bd6bb5c24661ea35829", 127977271),
+ DT_ENTRY0("parishotel", "c9a42bc3f306aba5e318b0a74115e0d4", 474983),
+ DT_ENTRY0("questforloot", "f7e32aec0f961a59a69bead3fadff4f0", 1357373),
+ DT_ENTRY0("sleepingassassin", "9c2aa213bb73d8083506ee6f64436d9d", 287227),
+ DT_ENTRY0("spondre", "c639077eb487eb6d1b63cda2c9ba5a9b", 1169469),
+ DT_ENTRY0("thelasthero", "31e10b8a7f11a6289955b89437f8178c", 62512),
+ DT_ENTRY0("tokindlealight", "5d3b57830b003046a621620ba0869d7c", 811845),
DT_ENTRY0("xanadu", "fef25e3473755ec572d4236d56f918e2", 396973),
+#endif
DT_END_MARKER
};
diff --git a/engines/glk/quest/geas_glk.cpp b/engines/glk/quest/geas_glk.cpp
index 8f48799d9a..571be78edc 100644
--- a/engines/glk/quest/geas_glk.cpp
+++ b/engines/glk/quest/geas_glk.cpp
@@ -116,8 +116,8 @@ void GeasGlkInterface::set_background(String s) {
* GeasInterface?
*/
String GeasGlkInterface::get_file(const String &fname) const {
- Common::File ifs;
- if (ifs.open(fname)) {
+ Common::File f;
+ if (!f.open(fname)) {
glk_put_cstring("Couldn't open ");
glk_put_cstring(fname.c_str());
g_vm->glk_put_char(0x0a);
@@ -125,10 +125,10 @@ String GeasGlkInterface::get_file(const String &fname) const {
}
// Read entirety of the file
- char *buf = new char[ifs.size()];
- ifs.read(buf, ifs.size());
+ char *buf = new char[f.size()];
+ f.read(buf, f.size());
- String result(buf, buf + ifs.size());
+ String result(buf, buf + f.size());
delete[] buf;
return result;
diff --git a/engines/glk/quest/quest.cpp b/engines/glk/quest/quest.cpp
index 93de43f6d7..8c4a22219d 100644
--- a/engines/glk/quest/quest.cpp
+++ b/engines/glk/quest/quest.cpp
@@ -96,6 +96,7 @@ void Quest::playGame() {
}
bool Quest::initialize() {
+ Streams::initialize();
glk_stylehint_set(wintype_TextBuffer, style_User2, stylehint_ReverseColor, 1);
// Open the main window
@@ -135,6 +136,7 @@ bool Quest::initialize() {
}
void Quest::deinitialize() {
+ Streams::deinitialize();
}
Common::Error Quest::readSaveData(Common::SeekableReadStream *rs) {
diff --git a/engines/glk/quest/read_file.cpp b/engines/glk/quest/read_file.cpp
index c749bb2718..766b8b5013 100644
--- a/engines/glk/quest/read_file.cpp
+++ b/engines/glk/quest/read_file.cpp
@@ -352,10 +352,9 @@ bool decompile(String data, Common::Array<String> &rv);
bool preprocess(Common::Array<String> v, String fname, Common::Array<String> &rv, GeasInterface *gi);
GeasFile read_geas_file(GeasInterface *gi, const String &filename) {
- //return GeasFile (split_lines(gi->get_file(s)), gi);
String file_contents = gi->get_file(filename);
- if (file_contents == "")
+ if (file_contents.empty())
return GeasFile();
Common::Array<String> data;