aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
authorMax Horn2010-02-13 11:58:15 +0000
committerMax Horn2010-02-13 11:58:15 +0000
commite17a2bd37d23cbfec63f28b1399ce5ebded536ee (patch)
tree6b75cd0760e97349551b9e4c5a7794319939d6ec /engines/sci
parent2c9883773ce7df2955d077b9c04c4c00eff94c26 (diff)
downloadscummvm-rg350-e17a2bd37d23cbfec63f28b1399ce5ebded536ee.tar.gz
scummvm-rg350-e17a2bd37d23cbfec63f28b1399ce5ebded536ee.tar.bz2
scummvm-rg350-e17a2bd37d23cbfec63f28b1399ce5ebded536ee.zip
SCI: Change getSciVersionDesc() to return 'const char *' instead of 'Common::String'
svn-id: r48044
Diffstat (limited to 'engines/sci')
-rw-r--r--engines/sci/console.cpp10
-rw-r--r--engines/sci/engine/features.cpp14
-rw-r--r--engines/sci/resource.cpp33
-rw-r--r--engines/sci/sci.cpp2
-rw-r--r--engines/sci/sci.h34
5 files changed, 49 insertions, 44 deletions
diff --git a/engines/sci/console.cpp b/engines/sci/console.cpp
index c26c6285b2..e1641d473f 100644
--- a/engines/sci/console.cpp
+++ b/engines/sci/console.cpp
@@ -414,15 +414,15 @@ bool Console::cmdGetVersion(int argc, const char **argv) {
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());
diff --git a/engines/sci/engine/features.cpp b/engines/sci/engine/features.cpp
index adabf0f3f0..23247d65f8 100644
--- a/engines/sci/engine/features.cpp
+++ b/engines/sci/engine/features.cpp
@@ -151,7 +151,7 @@ SciVersion GameFeatures::detectDoSoundType() {
}
}
- 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 @@ SciVersion GameFeatures::detectSetCursorType() {
// 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 @@ SciVersion GameFeatures::detectSetCursorType() {
// 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 @@ SciVersion GameFeatures::detectSetCursorType() {
_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 @@ SciVersion GameFeatures::detectLofsType() {
_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 @@ SciVersion GameFeatures::detectGfxFunctionsType() {
_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 @@ SciVersion GameFeatures::detectSci21KernelType() {
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;
}
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp
index ce0f8fdcc8..9f16e1cc2a 100644
--- a/engines/sci/resource.cpp
+++ b/engines/sci/resource.cpp
@@ -44,6 +44,37 @@ SciVersion getSciVersion() {
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 @@ void ResourceManager::init() {
detectSciVersion();
- debugC(1, kDebugLevelResMan, "resMan: Detected %s", getSciVersionDesc(getSciVersion()).c_str());
+ debugC(1, kDebugLevelResMan, "resMan: Detected %s", getSciVersionDesc(getSciVersion()));
switch (_viewType) {
case kViewEga:
diff --git a/engines/sci/sci.cpp b/engines/sci/sci.cpp
index 0ad293fb25..8b891c3fc8 100644
--- a/engines/sci/sci.cpp
+++ b/engines/sci/sci.cpp
@@ -239,7 +239,7 @@ Common::Error SciEngine::run() {
#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")) {
diff --git a/engines/sci/sci.h b/engines/sci/sci.h
index 0b2a7d0e1a..31e8631fa8 100644
--- a/engines/sci/sci.h
+++ b/engines/sci/sci.h
@@ -159,36 +159,10 @@ private:
*/
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