From 6b21f1c9327170c86d839ee5160a9eaeec7d82ef Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Fri, 21 Aug 2009 19:48:48 +0000 Subject: Fix detection of some later SCI32 games (RESMAP.001) and some cleanup. svn-id: r43608 --- engines/sci/resource.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'engines') diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp index 049abe8202..e07b904324 100644 --- a/engines/sci/resource.cpp +++ b/engines/sci/resource.cpp @@ -356,6 +356,8 @@ int ResourceManager::addAppropriateSources() { #ifdef ENABLE_SCI32 else if (Common::File::exists("RESMAP.000")) map = addExternalMap("RESMAP.000"); + else if (Common::File::exists("RESMAP.001")) + map = addExternalMap("RESMAP.001"); #endif else return 0; @@ -746,14 +748,11 @@ ResourceManager::ResVersion ResourceManager::detectMapVersion() { while (!fileStream->eos()) { directoryType = fileStream->readByte(); directoryOffset = fileStream->readUint16LE(); - + // Only SCI32 has directory type < 0x80 - if (directoryType < 0x80 && mapDetected != kResVersionUnknown && mapDetected != kResVersionSci32) + if (directoryType < 0x80 && (mapDetected == kResVersionUnknown || mapDetected == kResVersionSci32)) mapDetected = kResVersionSci32; - else - break; - - if (directoryType > 0xA0 && directoryType != 0xFF) + else if ((directoryType < 0x80) || (directoryType > 0xA0 && directoryType != 0xFF)) break; // Offset is above file size? -> definitely not SCI1/SCI1.1 -- cgit v1.2.3