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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Fri May 21 09:51:47 CEST 2010


Revision: 49126
          http://scummvm.svn.sourceforge.net/scummvm/?rev=49126&view=rev
Author:   thebluegr
Date:     2010-05-21 07:51:47 +0000 (Fri, 21 May 2010)

Log Message:
-----------
Removed the reliance on the segment manager from the fallback detector, for SCI0-SCI1 games (it still doesn't work with SCI1.1 and newer games, though)

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

Modified: scummvm/trunk/engines/sci/detection.cpp
===================================================================
--- scummvm/trunk/engines/sci/detection.cpp	2010-05-21 07:30:37 UTC (rev 49125)
+++ scummvm/trunk/engines/sci/detection.cpp	2010-05-21 07:51:47 UTC (rev 49126)
@@ -215,7 +215,6 @@
 	int objType = 0;
 	int16 exportsOffset = 0;
 	int16 magicOffset = (getSciVersion() < SCI_VERSION_1_1) ? 8 : 0;
-	Common::String sierraId;
 
 	// TODO: SCI1.1 version
 	if (getSciVersion() >= SCI_VERSION_1_1) {
@@ -239,17 +238,21 @@
 			break;
 		case SCI_OBJ_OBJECT:
 		case SCI_OBJ_CLASS:
-			// The game object is the first export. Script 0 is always at segment 1
+			// The game object is the first export
 			if (curOffset == exportsOffset - magicOffset) {
-				reg_t nameSelector = make_reg(1, READ_UINT16(script->data + curOffset + magicOffset + 3 * 2));
+				// The name selector is the third one
+				uint16 nameSelectorOffset = READ_UINT16(script->data + curOffset + magicOffset + 3 * 2);
 
-				// TODO: stop using the segment manager and read the object name here
-				SegManager *segMan = new SegManager(resMan);
-				script_instantiate(resMan, segMan, 0);
-				sierraId = segMan->derefString(nameSelector);
-				delete segMan;
+				char sierraId[20];
+				int i = 0;
+				byte curChar = 0;
 
-				break;
+				do {
+					curChar = *(script->data + nameSelectorOffset + i);
+					sierraId[i++] = curChar;
+				} while (curChar != 0);
+
+				return sierraId;
 			}
 			break;
 		case SCI_OBJ_CODE:
@@ -263,7 +266,7 @@
 		curOffset += objLength - 4;
 	} while (objType != 0 && curOffset < script->size - 2);
 
-	return sierraId;
+	return "sci";	// detection failed
 }
 
 const ADGameDescription *SciMetaEngine::fallbackDetect(const Common::FSList &fslist) const {


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