aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/detection.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'engines/scumm/detection.cpp')
-rw-r--r--engines/scumm/detection.cpp22
1 files changed, 9 insertions, 13 deletions
diff --git a/engines/scumm/detection.cpp b/engines/scumm/detection.cpp
index 9010cb84c3..6430ab7c4d 100644
--- a/engines/scumm/detection.cpp
+++ b/engines/scumm/detection.cpp
@@ -422,7 +422,6 @@ static void composeFileHashMap(const Common::FSList &fslist, DescMap &fileMD5Map
static void detectGames(const Common::FSList &fslist, Common::List<DetectorResult> &results, const char *gameid) {
DescMap fileMD5Map;
DetectorResult dr;
- char md5str[32+1];
// Dive one level down since mac indy3/loom has its files split into directories. See Bug #1438631
composeFileHashMap(fslist, fileMD5Map, 2, directoryGlobs);
@@ -467,7 +466,7 @@ static void detectGames(const Common::FSList &fslist, Common::List<DetectorResul
//
DetectorDesc &d = fileMD5Map[file];
if (d.md5.empty()) {
- Common::File *tmp = 0;
+ Common::SeekableReadStream *tmp = 0;
bool isDiskImg = (file.hasSuffix(".d64") || file.hasSuffix(".dsk") || file.hasSuffix(".prg"));
if (isDiskImg) {
@@ -475,14 +474,16 @@ static void detectGames(const Common::FSList &fslist, Common::List<DetectorResul
debug(2, "Falling back to disk-based detection");
} else {
- tmp = new Common::File;
- tmp->open(d.node);
+ tmp = d.node.createReadStream();
}
- if (tmp && tmp->isOpen() && Common::md5_file_string(*tmp, md5str, kMD5FileSizeLimit)) {
+ Common::String md5str;
+ if (tmp)
+ md5str = computeStreamMD5AsString(*tmp, kMD5FileSizeLimit);
+ if (!md5str.empty()) {
d.md5 = md5str;
- d.md5Entry = findInMD5Table(md5str);
+ d.md5Entry = findInMD5Table(md5str.c_str());
dr.md5 = d.md5;
@@ -494,7 +495,7 @@ static void detectGames(const Common::FSList &fslist, Common::List<DetectorResul
int filesize = tmp->size();
if (d.md5Entry->filesize != filesize)
debug(1, "SCUMM detector found matching file '%s' with MD5 %s, size %d\n",
- file.c_str(), md5str, filesize);
+ file.c_str(), md5str.c_str(), filesize);
// Sanity check: We *should* have found a matching gameid / variant at this point.
// If not, then there's a bug in our data tables...
@@ -1198,12 +1199,7 @@ SaveStateDescriptor ScummMetaEngine::querySaveMetaInfos(const char *target, int
int minutes = infos.time & 0xFF;
desc.setSaveTime(hour, minutes);
-
- minutes = infos.playtime / 60;
- hour = minutes / 60;
- minutes %= 60;
-
- desc.setPlayTime(hour, minutes);
+ desc.setPlayTime(infos.playtime * 1000);
}
return desc;