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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Fri Nov 20 21:30:31 CET 2009


Revision: 46019
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46019&view=rev
Author:   thebluegr
Date:     2009-11-20 20:30:31 +0000 (Fri, 20 Nov 2009)

Log Message:
-----------
Removed the syncTime and syncCue selectors from the list of static selectors, along with their relevant FIXMEs. These selectors are used for lip syncing in CD talkie games, which always got a selector vocabulary, so we don't need to hardcode them. Did some further simplification/rewrite of the static selector tables

Modified Paths:
--------------
    scummvm/trunk/engines/sci/engine/static_selectors.cpp
    scummvm/trunk/engines/sci/engine/vm.h

Modified: scummvm/trunk/engines/sci/engine/static_selectors.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/static_selectors.cpp	2009-11-20 19:48:07 UTC (rev 46018)
+++ scummvm/trunk/engines/sci/engine/static_selectors.cpp	2009-11-20 20:30:31 UTC (rev 46019)
@@ -31,6 +31,8 @@
 namespace Sci {
 	
 struct SelectorRemap {
+	SciVersion minVersion;
+	SciVersion maxVersion;
 	const char *name;
 	uint32 slot;
 };
@@ -61,39 +63,24 @@
           "frame",        "vol",          "pri",    "perform",  "moveDone"  // 93 - 97
 };
 
-// Taken from Codename: Iceman (Full Game)
-static const SelectorRemap sci0SelectorRemap[] = {
-    {     "moveDone", 170 }, {      "points",  316 }, {        "flags", 368 },
-	{              0,   0 }
+static const SelectorRemap sciSelectorRemap[] = {
+    {    SCI_VERSION_0_EARLY,     SCI_VERSION_0_LATE,   "moveDone", 170 },
+	{    SCI_VERSION_0_EARLY,     SCI_VERSION_0_LATE,     "points", 316 },
+	{    SCI_VERSION_0_EARLY,     SCI_VERSION_0_LATE,      "flags", 368 },
+	{    SCI_VERSION_1_EARLY,        SCI_VERSION_1_1,    "nodePtr",  44 },
+	{    SCI_VERSION_1_EARLY,        SCI_VERSION_1_1, "cantBeHere",  57 },
+	{    SCI_VERSION_1_EARLY,        SCI_VERSION_1_1,  "topString", 101 },
+	{    SCI_VERSION_1_EARLY,        SCI_VERSION_1_1,      "flags", 102 },
+	{        SCI_VERSION_1_1,        SCI_VERSION_1_1,     "scaleX", 104 },
+	{        SCI_VERSION_1_1,        SCI_VERSION_1_1,     "scaleY", 105 },
+	{ SCI_VERSION_AUTODETECT, SCI_VERSION_AUTODETECT,            0,   0 }
 };
 
-// Taken from Leisure Suit Larry 1 VGA (Full Game)
-static const SelectorRemap sci1SelectorRemap[] = {
-	{      "nodePtr",  44 }, {   "cantBeHere",  57 }, {    "topString", 101 },
-	{        "flags", 102 },
-	// FIXME: These two selectors differ for each game. We need to find a reliable
-	// way to detect them, or apply them on a per-game basis for games which are
-	// missing them
-	{     "syncTime", 247 }, {      "syncCue", 248 },
-	{              0,   0 }
-};
-
-// Taken from KQ6 floppy (Full Game)
-static const SelectorRemap sci11SelectorRemap[] = {
-	{      "nodePtr",  41 }, {   "cantBeHere",  54 }, {     "topString", 98 },
-	{        "flags",  99 }, {       "scaleX", 104 }, {       "scaleY", 105 },
-	// FIXME: These two selectors differ for each game. We need to find a reliable
-	// way to detect them, or apply them on a per-game basis for games which are
-	// missing them
-	{     "syncTime", 279 }, {      "syncCue", 280 },
-	{              0,   0 }
-};
-
 Common::StringList Kernel::checkStaticSelectorNames() {
 	Common::StringList names;
 	const int offset = (getSciVersion() < SCI_VERSION_1_1) ? 3 : 0;
 	const int count = ARRAYSIZE(sci0Selectors) + offset;
-	const SelectorRemap *selectorRemap = sci0SelectorRemap;
+	const SelectorRemap *selectorRemap = sciSelectorRemap;
 	int i;
 
 	// Resize the list of selector names and fill in the SCI 0 names.
@@ -103,26 +90,24 @@
 	for (i = offset; i < count; i++)
 		names[i] = sci0Selectors[i - offset];
 
-	if (getSciVersion() <= SCI_VERSION_01) {
-		selectorRemap = sci0SelectorRemap;
-	} else {
+	if (getSciVersion() > SCI_VERSION_01) {
 		// Several new selectors were added in SCI 1 and later.
 		int count2 = ARRAYSIZE(sci1Selectors);
 		names.resize(count + count2);
 		for (i = count; i < count + count2; i++)
 			names[i] = sci1Selectors[i - count];
-
-		if (getSciVersion() < SCI_VERSION_1_1) {
-			selectorRemap = sci1SelectorRemap;
-		} else {
-			selectorRemap = sci11SelectorRemap;
-		}
 	}
 
 	for (; selectorRemap->slot; ++selectorRemap) {
+		uint32 slot = selectorRemap->slot;
 		if (selectorRemap->slot >= names.size())
 			names.resize(selectorRemap->slot + 1);
-		names[selectorRemap->slot] = selectorRemap->name;
+		if (getSciVersion() >= selectorRemap->minVersion && getSciVersion() <= selectorRemap->maxVersion) {
+			// The SCI1 selectors we use exist in SCI1.1 too, offset by 3
+			if (selectorRemap->minVersion == SCI_VERSION_1_EARLY && getSciVersion() == SCI_VERSION_1_1)
+				slot -= 3;
+			names[slot] = selectorRemap->name;
+		}
 	}
 
 	return names;

Modified: scummvm/trunk/engines/sci/engine/vm.h
===================================================================
--- scummvm/trunk/engines/sci/engine/vm.h	2009-11-20 19:48:07 UTC (rev 46018)
+++ scummvm/trunk/engines/sci/engine/vm.h	2009-11-20 20:30:31 UTC (rev 46019)
@@ -184,7 +184,8 @@
 	Selector topString; // SCI1 scroll lists use this instead of lsTop
 	Selector flags;
 
-	// SCI1+ music-related selectors, not static
+	// SCI1+ audio sync related selectors, not static. They're used for lip syncing in
+	// CD talkie games
 	Selector syncCue; // Used by DoSync()
 	Selector syncTime;
 


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