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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Sat May 29 17:01:33 CEST 2010


Revision: 49309
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49309&view=rev
Author:   thebluegr
Date:     2010-05-29 15:01:33 +0000 (Sat, 29 May 2010)

Log Message:
-----------
Fixed regression in SCI2-SCI21 games from commit 49308

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

Modified: scummvm/trunk/engines/sci/resource.cpp
===================================================================
--- scummvm/trunk/engines/sci/resource.cpp	2010-05-29 14:03:08 UTC (rev 49308)
+++ scummvm/trunk/engines/sci/resource.cpp	2010-05-29 15:01:33 UTC (rev 49309)
@@ -1926,6 +1926,10 @@
 	if (getSciVersion() >= SCI_VERSION_1_1 && addSci11ScriptOffset)
 		offset += script->size;
 
+	// TODO: Investigate why this is needed for SCI2+ games
+	if (getSciVersion() >= SCI_VERSION_2)
+		offset += 1;
+
 	return make_reg(1, offset);
 }
 
@@ -1941,8 +1945,14 @@
 		nameSelector += 5;
 	}
 
+	int16 gameObjectOffset = findGameObject(false).offset;
+
+	// Compensate for the odd offsets of SCI2+ games
+	if (getSciVersion() >= SCI_VERSION_2)
+		gameObjectOffset -= 1;
+
 	// Seek to the name selector of the first export
-	byte *seeker = heap->data + READ_UINT16(heap->data + findGameObject(false).offset + nameSelector * 2);
+	byte *seeker = heap->data + READ_UINT16(heap->data + gameObjectOffset + nameSelector * 2);
 	Common::String sierraId;
 	sierraId += (const char *)seeker;
 


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