Fix detection of some later SCI32 games (RESMAP.001) and some cleanup.

svn-id: r43608
This commit is contained in:
Matthew Hoops 2009-08-21 19:48:48 +00:00
parent 4155e8eebf
commit 6b21f1c932

View File

@ -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