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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Sun May 30 17:17:30 CEST 2010


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

Log Message:
-----------
Fixed findGameObject() for SCI11 games

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-30 13:42:04 UTC (rev 49325)
+++ scummvm/trunk/engines/sci/engine/game.cpp	2010-05-30 15:17:29 UTC (rev 49326)
@@ -127,13 +127,7 @@
 
 	srand(g_system->getMillis()); // Initialize random number generator
 
-	// 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;
+	s->_gameObj = g_sci->getResMan()->findGameObject();
 
 #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-30 13:42:04 UTC (rev 49325)
+++ scummvm/trunk/engines/sci/resource.cpp	2010-05-30 15:17:29 UTC (rev 49326)
@@ -1923,9 +1923,13 @@
 
 	// In SCI1.1 and newer, the heap is appended at the end of the script,
 	// so adjust the offset accordingly
-	if (getSciVersion() >= SCI_VERSION_1_1 && addSci11ScriptOffset)
+	if (getSciVersion() >= SCI_VERSION_1_1 && addSci11ScriptOffset) {
 		offset += script->size;
 
+		if (script->size & 2)
+			offset++;
+	}
+
 	return make_reg(1, offset);
 }
 


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