[Scummvm-cvs-logs] CVS: scummvm/scumm scumm.cpp,1.283.2.3,1.283.2.4
Max Horn
fingolfin at users.sourceforge.net
Tue Jan 4 17:32:16 CET 2005
Update of /cvsroot/scummvm/scummvm/scumm
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3985
Modified Files:
Tag: branch-0-7-0
scumm.cpp
Log Message:
Backport change to 0.7.x branch
Index: scumm.cpp
===================================================================
RCS file: /cvsroot/scummvm/scummvm/scumm/scumm.cpp,v
retrieving revision 1.283.2.3
retrieving revision 1.283.2.4
diff -u -d -r1.283.2.3 -r1.283.2.4
--- scumm.cpp 19 Dec 2004 02:26:37 -0000 1.283.2.3
+++ scumm.cpp 5 Jan 2005 01:27:56 -0000 1.283.2.4
@@ -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)) {
@@ -2617,7 +2623,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]);
@@ -2697,7 +2703,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