[Scummvm-cvs-logs] SF.net SVN: scummvm:[43755] scummvm/trunk/engines/sci/resource.cpp

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Wed Aug 26 11:38:51 CEST 2009


Revision: 43755
          http://scummvm.svn.sourceforge.net/scummvm/?rev=43755&view=rev
Author:   thebluegr
Date:     2009-08-26 09:38:51 +0000 (Wed, 26 Aug 2009)

Log Message:
-----------
If a resource map entry can't be read, retry with the volume version instead, if it's different than the map version

Modified Paths:
--------------
    scummvm/trunk/engines/sci/resource.cpp

Modified: scummvm/trunk/engines/sci/resource.cpp
===================================================================
--- scummvm/trunk/engines/sci/resource.cpp	2009-08-26 09:36:54 UTC (rev 43754)
+++ scummvm/trunk/engines/sci/resource.cpp	2009-08-26 09:38:51 UTC (rev 43755)
@@ -1023,12 +1023,20 @@
 		// adding a new resource
 		if (_resMap.contains(resId) == false) {
 			res = new Resource;
-			res->file_offset = offset & (((~bMask) << 24) | 0xFFFFFF);
-			res->id = resId;
 			res->source = getVolume(map, offset >> bShift);
 			if (!res->source) {
 				warning("Could not get volume for resource %d, VolumeID %d", id, offset >> bShift);
+				if (_mapVersion != _volVersion) {
+					warning("Retrying with the detected volume version instead");
+					warning("Map version was: %d, retrying with: %d", _mapVersion, _volVersion);
+					_mapVersion = _volVersion;
+					bMask = (_mapVersion == kResVersionSci1Middle) ? 0xF0 : 0xFC;
+					bShift = (_mapVersion == kResVersionSci1Middle) ? 28 : 26;
+					res->source = getVolume(map, offset >> bShift);
+				}
 			}
+			res->file_offset = offset & (((~bMask) << 24) | 0xFFFFFF);
+			res->id = resId;
 			_resMap.setVal(resId, res);
 		}
 	} while (!file.eos());


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list