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

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


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

Log Message:
-----------
Removed the hack inside findGameObject(), and replaced it with code from the segment manager, till we find out why the segment is sometimes off by 1 (note that findGameObject() works fine for finding the game ID itself)

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

Modified: scummvm/trunk/engines/sci/engine/game.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/game.cpp	2010-05-29 15:01:33 UTC (rev 49309)
+++ scummvm/trunk/engines/sci/engine/game.cpp	2010-05-29 15:27:27 UTC (rev 49310)
@@ -127,7 +127,13 @@
 
 	srand(g_system->getMillis()); // Initialize random number generator
 
-	s->_gameObj = g_sci->getResMan()->findGameObject();
+	// TODO: This is sometimes off by 1... find out why
+	//s->_gameObj = g_sci->getResMan()->findGameObject();
+	// Replaced by the code below for now
+	Script *scr000 = s->_segMan->getScript(1);
+	s->_gameObj = make_reg(1, scr000->validateExportFunc(0));
+	if (getSciVersion() >= SCI_VERSION_1_1)
+		 s->_gameObj.offset += scr000->_scriptSize;
 
 #ifdef USE_OLD_MUSIC_FUNCTIONS
 	if (s->sfx_init_flags & SFX_STATE_FLAG_NOSOUND)

Modified: scummvm/trunk/engines/sci/resource.cpp
===================================================================
--- scummvm/trunk/engines/sci/resource.cpp	2010-05-29 15:01:33 UTC (rev 49309)
+++ scummvm/trunk/engines/sci/resource.cpp	2010-05-29 15:27:27 UTC (rev 49310)
@@ -1926,10 +1926,6 @@
 	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);
 }
 
@@ -1947,10 +1943,6 @@
 
 	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 + gameObjectOffset + nameSelector * 2);
 	Common::String sierraId;


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