[Scummvm-git-logs] scummvm master -> 87012cbf21c9159bd0fee8a9ef6e03b0189ab9a3
sev-
sev at scummvm.org
Sat Oct 16 06:24:33 UTC 2021
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
87012cbf21 AD: Added ADGF for calculating md5 from the file tail
Commit: 87012cbf21c9159bd0fee8a9ef6e03b0189ab9a3
https://github.com/scummvm/scummvm/commit/87012cbf21c9159bd0fee8a9ef6e03b0189ab9a3
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2021-10-16T09:24:08+03:00
Commit Message:
AD: Added ADGF for calculating md5 from the file tail
Changed paths:
engines/advancedDetector.cpp
engines/advancedDetector.h
diff --git a/engines/advancedDetector.cpp b/engines/advancedDetector.cpp
index dfec5a7585..a770ca6fcd 100644
--- a/engines/advancedDetector.cpp
+++ b/engines/advancedDetector.cpp
@@ -489,6 +489,8 @@ namespace Common {
static char flagsToMD5Prefix(uint32 flags) {
if (flags & ADGF_MACRESFORK)
return 'm';
+ if (flags & ADGF_TAILMD5)
+ return 't';
return 'f';
}
@@ -563,6 +565,9 @@ bool AdvancedMetaEngine::getFilePropertiesExtern(uint md5Bytes, const FileMap &a
if (!testFile.open(allFiles[fname]))
return false;
+ if (game.flags & ADGF_TAILMD5)
+ testFile.seek(md5Bytes, SEEK_END);
+
fileProps.size = testFile.size();
fileProps.md5 = Common::computeStreamMD5AsString(testFile, md5Bytes);
return true;
diff --git a/engines/advancedDetector.h b/engines/advancedDetector.h
index ceeab21e7a..c7fc00d1b2 100644
--- a/engines/advancedDetector.h
+++ b/engines/advancedDetector.h
@@ -90,6 +90,7 @@ struct ADGameFileDescription {
*/
enum ADGameFlags {
ADGF_NO_FLAGS = 0, ///< No flags.
+ ADGF_TAILMD5 = (1 << 16), ///< Calculate the MD5 for this entry from the end of the file.
ADGF_REMASTERED = (1 << 17), ///< Add "-remastered' to gameid.
ADGF_AUTOGENTARGET = (1 << 18), ///< Automatically generate gameid from @ref ADGameDescription::extra.
ADGF_UNSTABLE = (1 << 19), ///< Flag to designate not yet officially supported games that are not fit for public testing.
More information about the Scummvm-git-logs
mailing list