From 05559c89f24e65fd1a2ee4092f1c84f8c50b9745 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Sat, 25 Feb 2006 18:24:22 +0000 Subject: Moved check for unknown MD5 checksum from ScummEngine::ScummEngine to Engine_SCUMM_create svn-id: r20882 --- engines/scumm/scumm.cpp | 26 +++++++++++--------------- 1 file changed, 11 insertions(+), 15 deletions(-) (limited to 'engines') diff --git a/engines/scumm/scumm.cpp b/engines/scumm/scumm.cpp index 9ecbc004e3..e77d7c1980 100644 --- a/engines/scumm/scumm.cpp +++ b/engines/scumm/scumm.cpp @@ -1215,21 +1215,6 @@ ScummEngine::ScummEngine(GameDetector *detector, OSystem *syst, const ScummGameS // Clean _substResFileNameBundle memset(&_substResFileNameBundle, 0, sizeof(_substResFileNameBundle)); - // Check for unknown MD5 - char md5str[32+1]; - for (int j = 0; j < 16; j++) { - sprintf(md5str + j*2, "%02x", (int)md5sum[j]); - } - const MD5Table *elem; -#ifdef PALMOS_68K - uint32 arraySize = MemPtrSize((void *)md5table) / sizeof(MD5Table) - 1; -#else - uint32 arraySize = ARRAYSIZE(md5table) - 1; -#endif - elem = (const MD5Table *)bsearch(md5str, md5table, arraySize, sizeof(MD5Table), compareMD5Table); - if (!elem) - printf("Unknown MD5 (%s)! Please report the details (language, platform, etc.) of this game to the ScummVM team\n", md5str); - _defaultFTSentenceScript = -1; _buggyFTSentenceScript = -1; @@ -3590,6 +3575,17 @@ Engine *Engine_SCUMM_create(GameDetector *detector, OSystem *syst) { game.midi = MDT_TOWNS; } + // Check for unknown MD5 checksums, and print a message if we encounter one. + const MD5Table *elem; +#ifdef PALMOS_68K + uint32 arraySize = MemPtrSize((void *)md5table) / sizeof(MD5Table) - 1; +#else + uint32 arraySize = ARRAYSIZE(md5table) - 1; +#endif + elem = (const MD5Table *)bsearch(md5, md5table, arraySize, sizeof(MD5Table), compareMD5Table); + if (!elem) + printf("Unknown MD5 (%s)! Please report the details (language, platform, etc.) of this game to the ScummVM team\n", md5); + // Finally, we have massaged the GameSettings to our satisfaction, and can // instantiate the appropriate game engine. Hooray! switch (game.version) { -- cgit v1.2.3