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

thebluegr at users.sourceforge.net thebluegr at users.sourceforge.net
Sat Dec 26 14:35:18 CET 2009


Revision: 46580
          http://scummvm.svn.sourceforge.net/scummvm/?rev=46580&view=rev
Author:   thebluegr
Date:     2009-12-26 13:35:17 +0000 (Sat, 26 Dec 2009)

Log Message:
-----------
Fixed graphics functions detection in an old version of SQ3 - my initial thought to rely on the presence of the shiftParser selector was wrong

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

Modified: scummvm/trunk/engines/sci/engine/state.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/state.cpp	2009-12-26 13:20:07 UTC (rev 46579)
+++ scummvm/trunk/engines/sci/engine/state.cpp	2009-12-26 13:35:17 UTC (rev 46580)
@@ -598,49 +598,42 @@
 		}
 
 		if (getSciVersion() > SCI_VERSION_0_EARLY) {
-			if (_kernel->findSelector("shiftParser") != -1) {
-				// The shiftParser selector was introduced just a bit after the
-				// changes to the graphics functions, so if it exists, the game is
-				// definitely using newer graphics functions
-				_gfxFunctionsType = SCI_VERSION_0_LATE;
-			} else {
-				// No shiftparser selector, check if the game is using an overlay
-				bool found = false;
+			// Check if the game is using an overlay
+			bool found = false;
 
-				if (_kernel->_selectorCache.overlay == -1) {
-					// No overlay selector found, check if any method of the Rm object
-					// is calling kDrawPic, as the overlay selector might be missing in demos
-					
-					Object *obj = _segMan->getObject(_segMan->findObjectByName("Rm"));
-					for (uint m = 0; m < obj->getMethodCount(); m++) {
-						found = autoDetectFeature(kDetectGfxFunctions, m);
-						if (found)
-							break;
-					}
+			if (_kernel->_selectorCache.overlay == -1) {
+				// No overlay selector found, check if any method of the Rm object
+				// is calling kDrawPic, as the overlay selector might be missing in demos
+				
+				Object *obj = _segMan->getObject(_segMan->findObjectByName("Rm"));
+				for (uint m = 0; m < obj->getMethodCount(); m++) {
+					found = autoDetectFeature(kDetectGfxFunctions, m);
+					if (found)
+						break;
 				}
+			}
 
-				if (_kernel->_selectorCache.overlay == -1 && !found) {
-					// No overlay selector found, therefore the game is definitely
-					// using old graphics functions
-					_gfxFunctionsType = SCI_VERSION_0_EARLY;
-				} else if (_kernel->_selectorCache.overlay == -1 && found) {
-					// Detection already done above
-				} else {	// _kernel->_selectorCache.overlay != -1
-					// An in-between case: The game does not have a shiftParser
-					// selector, but it does have an overlay selector, so it uses an
-					// overlay. Therefore, check it to see how it calls kDrawPic to
-					// determine the graphics functions type used
+			if (_kernel->_selectorCache.overlay == -1 && !found) {
+				// No overlay selector found, therefore the game is definitely
+				// using old graphics functions
+				_gfxFunctionsType = SCI_VERSION_0_EARLY;
+			} else if (_kernel->_selectorCache.overlay == -1 && found) {
+				// Detection already done above
+			} else {	// _kernel->_selectorCache.overlay != -1
+				// An in-between case: The game does not have a shiftParser
+				// selector, but it does have an overlay selector, so it uses an
+				// overlay. Therefore, check it to see how it calls kDrawPic to
+				// determine the graphics functions type used
 
-					if (!autoDetectFeature(kDetectGfxFunctions)) {
-						warning("Graphics functions detection failed, taking an educated guess");
+				if (!autoDetectFeature(kDetectGfxFunctions)) {
+					warning("Graphics functions detection failed, taking an educated guess");
 
-						// Try detecting the graphics function types from the existence of the motionCue
-						// selector (which is a bit of a hack)
-						if (_kernel->findSelector("motionCue") != -1)
-							_gfxFunctionsType = SCI_VERSION_0_LATE;
-						else
-							_gfxFunctionsType = SCI_VERSION_0_EARLY;
-					}
+					// Try detecting the graphics function types from the existence of the motionCue
+					// selector (which is a bit of a hack)
+					if (_kernel->findSelector("motionCue") != -1)
+						_gfxFunctionsType = SCI_VERSION_0_LATE;
+					else
+						_gfxFunctionsType = SCI_VERSION_0_EARLY;
 				}
 			}
 		} else {	// (getSciVersion() == SCI_VERSION_0_EARLY)


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