aboutsummaryrefslogtreecommitdiff
path: root/engines/mohawk/riven.cpp
diff options
context:
space:
mode:
authorBastien Bouclet2016-11-05 12:39:51 +0100
committerEugene Sandulenko2017-07-03 08:50:10 +0200
commitefcf38f95f14272efd8ace91747a45bd53c74b57 (patch)
tree24dd9fd1c89ac06b84addd07da5efbee88f697e1 /engines/mohawk/riven.cpp
parentc04edb8f54f6e44079b389263428719c0b3c562c (diff)
downloadscummvm-rg350-efcf38f95f14272efd8ace91747a45bd53c74b57.tar.gz
scummvm-rg350-efcf38f95f14272efd8ace91747a45bd53c74b57.tar.bz2
scummvm-rg350-efcf38f95f14272efd8ace91747a45bd53c74b57.zip
MOHAWK: Factor out stack name-id mapping
Diffstat (limited to 'engines/mohawk/riven.cpp')
-rw-r--r--engines/mohawk/riven.cpp23
1 files changed, 2 insertions, 21 deletions
diff --git a/engines/mohawk/riven.cpp b/engines/mohawk/riven.cpp
index 7739dd5951..1b69e35d78 100644
--- a/engines/mohawk/riven.cpp
+++ b/engines/mohawk/riven.cpp
@@ -324,7 +324,7 @@ void MohawkEngine_Riven::changeToStack(uint16 n) {
_mhk.clear();
// Get the prefix character for the destination stack
- char prefix = getStackName(n)[0];
+ char prefix = RivenStacks::getName(n)[0];
// Load any file that fits the patterns
for (int i = 0; i < ARRAYSIZE(endings); i++) {
@@ -339,7 +339,7 @@ void MohawkEngine_Riven::changeToStack(uint16 n) {
// Make sure we have loaded files
if (_mhk.empty())
- error("Could not load stack %s", getStackName(n).c_str());
+ error("Could not load stack %s", RivenStacks::getName(n));
// Stop any currently playing sounds
_sound->stopAllSLST();
@@ -554,25 +554,6 @@ Common::Error MohawkEngine_Riven::saveGameState(int slot, const Common::String &
return _saveLoad->saveGame(slot, desc);
}
-Common::String MohawkEngine_Riven::getStackName(uint16 stack) const {
- static const char *rivenStackNames[] = {
- "<unknown>",
- "ospit",
- "pspit",
- "rspit",
- "tspit",
- "bspit",
- "gspit",
- "jspit",
- "aspit"
- };
-
- // Sanity check.
- assert(stack < ARRAYSIZE(rivenStackNames));
-
- return rivenStackNames[stack];
-}
-
void MohawkEngine_Riven::installTimer(TimerProc proc, uint32 time) {
removeTimer();
_timerProc = proc;