[Scummvm-cvs-logs] CVS: scummvm/scumm scumm.cpp,1.292,1.293
Max Horn
fingolfin at users.sourceforge.net
Tue Jan 4 17:29:18 CET 2005
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3795
Modified Files:
scumm.cpp
Log Message:
When computing a games MD5, only use the first 1 MB of the file (this should only affect the special mac container formats, and ensures we do not try to compute the MD5 of a 500 MB file each time the game is run)
Index: scumm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.cpp,v
retrieving revision 1.292
retrieving revision 1.293
diff -u -d -r1.292 -r1.293
--- scumm.cpp 1 Jan 2005 16:09:16 -0000 1.292
+++ scumm.cpp 5 Jan 2005 01:26:57 -0000 1.293
@@ -89,6 +89,12 @@
};
+enum {
+ // We only compute the MD5 of the first megabyte of our data files.
+ kMD5FileSizeLimit = 1024 * 1024
+};
+
+
static const ScummGameSettings scumm_settings[] = {
/* Scumm Version 1 */
/* Scumm Version 2 */
@@ -453,7 +459,7 @@
elem = (const MD5Table *)bsearch(md5str, md5table, ARRAYSIZE(md5table)-1, sizeof(MD5Table), compareMD5Table);
if (!elem)
- printf("Unknown MD5! Please report the details (language, platform, etc.) of this game to the ScummVM team\n");
+ printf("Unknown MD5 (%s)! Please report the details (language, platform, etc.) of this game to the ScummVM team\n", md5str);
// Add default file directories.
if (((_features & GF_AMIGA) || (_features & GF_ATARI_ST)) && (_version <= 4)) {
@@ -2587,7 +2593,7 @@
for (StringSet::const_iterator iter = fileSet.begin(); iter != fileSet.end(); ++iter) {
uint8 md5sum[16];
const char *name = iter->_key.c_str();
- if (md5_file(name, md5sum)) {
+ if (md5_file(name, md5sum, 0, kMD5FileSizeLimit)) {
char md5str[32+1];
for (int j = 0; j < 16; j++) {
sprintf(md5str + j*2, "%02x", (int)md5sum[j]);
@@ -2667,7 +2673,7 @@
strcat(detectName, ".000");
}
- if (md5_file(detectName, md5sum, ConfMan.get("path").c_str())) {
+ if (md5_file(detectName, md5sum, ConfMan.get("path").c_str(), kMD5FileSizeLimit)) {
for (int j = 0; j < 16; j++) {
sprintf(gameMD5 + j*2, "%02x", (int)md5sum[j]);
}
More information about the Scummvm-git-logs
mailing list