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

fingolfin at users.sourceforge.net fingolfin at users.sourceforge.net
Sat Feb 13 12:58:15 CET 2010


Revision: 48044
          http://scummvm.svn.sourceforge.net/scummvm/?rev=48044&view=rev
Author:   fingolfin
Date:     2010-02-13 11:58:15 +0000 (Sat, 13 Feb 2010)

Log Message:
-----------
SCI: Change getSciVersionDesc() to return 'const char *' instead of 'Common::String'

Modified Paths:
--------------
    scummvm/trunk/engines/sci/console.cpp
    scummvm/trunk/engines/sci/engine/features.cpp
    scummvm/trunk/engines/sci/resource.cpp
    scummvm/trunk/engines/sci/sci.cpp
    scummvm/trunk/engines/sci/sci.h

Modified: scummvm/trunk/engines/sci/console.cpp
===================================================================
--- scummvm/trunk/engines/sci/console.cpp	2010-02-13 11:57:44 UTC (rev 48043)
+++ scummvm/trunk/engines/sci/console.cpp	2010-02-13 11:58:15 UTC (rev 48044)
@@ -414,15 +414,15 @@
 	bool hasVocab997 = s->resMan->testResource(ResourceId(kResourceTypeVocab, VOCAB_RESOURCE_SELECTORS)) ? true : false;
 
 	DebugPrintf("Game ID: %s\n", s->_gameId.c_str());
-	DebugPrintf("Emulated interpreter version: %s\n", getSciVersionDesc(getSciVersion()).c_str());
+	DebugPrintf("Emulated interpreter version: %s\n", getSciVersionDesc(getSciVersion()));
 	DebugPrintf("\n");
 	DebugPrintf("Detected features:\n");
 	DebugPrintf("------------------\n");
-	DebugPrintf("Sound type: %s\n", getSciVersionDesc(s->_features->detectDoSoundType()).c_str());
-	DebugPrintf("Graphics functions type: %s\n", getSciVersionDesc(s->_features->detectGfxFunctionsType()).c_str());
-	DebugPrintf("Lofs type: %s\n", getSciVersionDesc(s->_features->detectLofsType()).c_str());
+	DebugPrintf("Sound type: %s\n", getSciVersionDesc(s->_features->detectDoSoundType()));
+	DebugPrintf("Graphics functions type: %s\n", getSciVersionDesc(s->_features->detectGfxFunctionsType()));
+	DebugPrintf("Lofs type: %s\n", getSciVersionDesc(s->_features->detectLofsType()));
 	DebugPrintf("Move count type: %s\n", (s->_features->detectMoveCountType() == kIncrementMoveCount) ? "increment" : "ignore");
-	DebugPrintf("SetCursor type: %s\n", getSciVersionDesc(s->_features->detectSetCursorType()).c_str());
+	DebugPrintf("SetCursor type: %s\n", getSciVersionDesc(s->_features->detectSetCursorType()));
 	DebugPrintf("View type: %s\n", viewTypeDesc[s->resMan->getViewType()]);
 	DebugPrintf("Resource volume version: %s\n", s->resMan->getVolVersionDesc());
 	DebugPrintf("Resource map version: %s\n", s->resMan->getMapVersionDesc());

Modified: scummvm/trunk/engines/sci/engine/features.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/features.cpp	2010-02-13 11:57:44 UTC (rev 48043)
+++ scummvm/trunk/engines/sci/engine/features.cpp	2010-02-13 11:58:15 UTC (rev 48044)
@@ -151,7 +151,7 @@
 			}
 		}
 
-		debugC(1, kDebugLevelSound, "Detected DoSound type: %s", getSciVersionDesc(_doSoundType).c_str());
+		debugC(1, kDebugLevelSound, "Detected DoSound type: %s", getSciVersionDesc(_doSoundType));
 	}
 
 	return _doSoundType;
@@ -169,7 +169,7 @@
 			// If the Cursor object doesn't exist, we're using the SCI0 early kSetCursor semantics.
 			if (_segMan->findObjectByName("Cursor") == NULL_REG) {
 				_setCursorType = SCI_VERSION_0_EARLY;
-				debugC(1, kDebugLevelGraphics, "Detected SetCursor type: %s", getSciVersionDesc(_setCursorType).c_str());
+				debugC(1, kDebugLevelGraphics, "Detected SetCursor type: %s", getSciVersionDesc(_setCursorType));
 				return _setCursorType;
 			}
 
@@ -179,7 +179,7 @@
 			// If that doesn't exist, we assume it uses SCI1.1 kSetCursor semantics
 			if (objAddr == NULL_REG) {
 				_setCursorType = SCI_VERSION_1_1;
-				debugC(1, kDebugLevelGraphics, "Detected SetCursor type: %s", getSciVersionDesc(_setCursorType).c_str());
+				debugC(1, kDebugLevelGraphics, "Detected SetCursor type: %s", getSciVersionDesc(_setCursorType));
 				return _setCursorType;
 			}
 
@@ -194,7 +194,7 @@
 				_setCursorType = SCI_VERSION_0_EARLY;
 		}
 
-		debugC(1, kDebugLevelGraphics, "Detected SetCursor type: %s", getSciVersionDesc(_setCursorType).c_str());
+		debugC(1, kDebugLevelGraphics, "Detected SetCursor type: %s", getSciVersionDesc(_setCursorType));
 	}
 
 	return _setCursorType;
@@ -277,7 +277,7 @@
 				_lofsType = SCI_VERSION_0_EARLY;
 		}
 
-		debugC(1, kDebugLevelVM, "Detected Lofs type: %s", getSciVersionDesc(_lofsType).c_str());
+		debugC(1, kDebugLevelVM, "Detected Lofs type: %s", getSciVersionDesc(_lofsType));
 	}
 
 	return _lofsType;
@@ -366,7 +366,7 @@
 			_gfxFunctionsType = SCI_VERSION_0_EARLY;
 		}
 
-		debugC(1, kDebugLevelVM, "Detected graphics functions type: %s", getSciVersionDesc(_gfxFunctionsType).c_str());
+		debugC(1, kDebugLevelVM, "Detected graphics functions type: %s", getSciVersionDesc(_gfxFunctionsType));
 	}
 
 	return _gfxFunctionsType;
@@ -416,7 +416,7 @@
 		if (!autoDetectSci21KernelType())
 			error("Could not detect the SCI2.1 kernel table type");
 
-		debugC(1, kDebugLevelVM, "Detected SCI2.1 kernel type: %s", getSciVersionDesc(_sci21KernelType).c_str());
+		debugC(1, kDebugLevelVM, "Detected SCI2.1 kernel type: %s", getSciVersionDesc(_sci21KernelType));
 	}
 	return _sci21KernelType;
 }

Modified: scummvm/trunk/engines/sci/resource.cpp
===================================================================
--- scummvm/trunk/engines/sci/resource.cpp	2010-02-13 11:57:44 UTC (rev 48043)
+++ scummvm/trunk/engines/sci/resource.cpp	2010-02-13 11:58:15 UTC (rev 48044)
@@ -44,6 +44,37 @@
 	return s_sciVersion;
 }
 
+const char *getSciVersionDesc(SciVersion version) {
+	switch (version) {
+	case SCI_VERSION_NONE:
+		return "Invalid SCI version";
+	case SCI_VERSION_0_EARLY:
+		return "Early SCI0";
+	case SCI_VERSION_0_LATE:
+		return "Late SCI0";
+	case SCI_VERSION_01:
+		return "SCI01";
+	case SCI_VERSION_1_EGA:
+		return "SCI1 EGA";
+	case SCI_VERSION_1_EARLY:
+		return "Early SCI1";
+	case SCI_VERSION_1_MIDDLE:
+		return "Middle SCI1";
+	case SCI_VERSION_1_LATE:
+		return "Late SCI1";
+	case SCI_VERSION_1_1:
+		return "SCI1.1";
+	case SCI_VERSION_2:
+		return "SCI2";
+	case SCI_VERSION_2_1:
+		return "SCI2.1";
+	case SCI_VERSION_3:
+		return "SCI3";
+	default:
+		return "Unknown";
+	}
+}
+
 #undef SCI_REQUIRE_RESOURCE_FILES
 
 //#define SCI_VERBOSE_resMan 1
@@ -621,7 +652,7 @@
 
 	detectSciVersion();
 
-	debugC(1, kDebugLevelResMan, "resMan: Detected %s", getSciVersionDesc(getSciVersion()).c_str());
+	debugC(1, kDebugLevelResMan, "resMan: Detected %s", getSciVersionDesc(getSciVersion()));
 
 	switch (_viewType) {
 	case kViewEga:

Modified: scummvm/trunk/engines/sci/sci.cpp
===================================================================
--- scummvm/trunk/engines/sci/sci.cpp	2010-02-13 11:57:44 UTC (rev 48043)
+++ scummvm/trunk/engines/sci/sci.cpp	2010-02-13 11:58:15 UTC (rev 48044)
@@ -239,7 +239,7 @@
 #endif
 		_gamestate->_gui->init(_gamestate->_features->usesOldGfxFunctions());
 
-	debug("Emulating SCI version %s\n", getSciVersionDesc(getSciVersion()).c_str());
+	debug("Emulating SCI version %s\n", getSciVersionDesc(getSciVersion()));
 
 	// Check whether loading a savestate was requested
 	if (ConfMan.hasKey("save_slot")) {

Modified: scummvm/trunk/engines/sci/sci.h
===================================================================
--- scummvm/trunk/engines/sci/sci.h	2010-02-13 11:57:44 UTC (rev 48043)
+++ scummvm/trunk/engines/sci/sci.h	2010-02-13 11:58:15 UTC (rev 48044)
@@ -159,36 +159,10 @@
  */
 SciVersion getSciVersion();
 
-inline static Common::String getSciVersionDesc(SciVersion version) {
-	switch (version) {
-	case SCI_VERSION_NONE:
-		return "Invalid SCI version";
-	case SCI_VERSION_0_EARLY:
-		return "Early SCI0";
-	case SCI_VERSION_0_LATE:
-		return "Late SCI0";
-	case SCI_VERSION_01:
-		return "SCI01";
-	case SCI_VERSION_1_EGA:
-		return "SCI1 EGA";
-	case SCI_VERSION_1_EARLY:
-		return "Early SCI1";
-	case SCI_VERSION_1_MIDDLE:
-		return "Middle SCI1";
-	case SCI_VERSION_1_LATE:
-		return "Late SCI1";
-	case SCI_VERSION_1_1:
-		return "SCI1.1";
-	case SCI_VERSION_2:
-		return "SCI2";
-	case SCI_VERSION_2_1:
-		return "SCI2.1";
-	case SCI_VERSION_3:
-		return "SCI3";
-	default:
-		return "Unknown";
-	}
-}
+/**
+ * Convenience function converting an SCI version into a human-readable string.
+ */
+const char *getSciVersionDesc(SciVersion version);
 
 } // End of namespace Sci
 


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