aboutsummaryrefslogtreecommitdiff
path: root/engines/glk/detection.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2018-11-17 19:04:06 -0800
committerPaul Gilbert2018-12-08 19:05:59 -0800
commit3b906cb2bb302d9256d07cb462f445af16c7d129 (patch)
tree0928d07e9f923953401ff82eb488705d59878d9b /engines/glk/detection.cpp
parentb05a16a0ad0dcc2881aeda81e0d1a84a752eccab (diff)
downloadscummvm-rg350-3b906cb2bb302d9256d07cb462f445af16c7d129.tar.gz
scummvm-rg350-3b906cb2bb302d9256d07cb462f445af16c7d129.tar.bz2
scummvm-rg350-3b906cb2bb302d9256d07cb462f445af16c7d129.zip
GLK: Fixes for combined loading/saving code
Diffstat (limited to 'engines/glk/detection.cpp')
-rw-r--r--engines/glk/detection.cpp15
1 files changed, 12 insertions, 3 deletions
diff --git a/engines/glk/detection.cpp b/engines/glk/detection.cpp
index e6a129f8e2..a91c6033b0 100644
--- a/engines/glk/detection.cpp
+++ b/engines/glk/detection.cpp
@@ -120,13 +120,22 @@ Common::Error GlkMetaEngine::createInstance(OSystem *syst, Engine **engine) cons
return Common::kNoGameDataFoundError;
}
+ // Get the MD5
+ Common::File f;
+ if (!f.open(Common::FSNode(ConfMan.get("path")).getChild(gameDesc._filename)))
+ return Common::kNoGameDataFoundError;
+
+ gameDesc._md5 = Common::computeStreamMD5AsString(f, 5000);
+ f.close();
+
// Correct the correct engine
- if (Glk::Frotz::FrotzMetaEngine::findGame(gameDesc._gameId.c_str()).description)
+ if (Glk::Frotz::FrotzMetaEngine::findGame(gameDesc._gameId.c_str()).description) {
*engine = new Glk::Frotz::Frotz(syst, gameDesc);
- else if (Glk::Scott::ScottMetaEngine::findGame(gameDesc._gameId.c_str()).description)
+ } else if (Glk::Scott::ScottMetaEngine::findGame(gameDesc._gameId.c_str()).description) {
*engine = new Glk::Scott::Scott(syst, gameDesc);
- else
+ } else {
return Common::kNoGameDataFoundError;
+ }
return Common::kNoError;
}