From efcf38f95f14272efd8ace91747a45bd53c74b57 Mon Sep 17 00:00:00 2001 From: Bastien Bouclet Date: Sat, 5 Nov 2016 12:39:51 +0100 Subject: MOHAWK: Factor out stack name-id mapping --- engines/mohawk/riven.cpp | 23 ++--------------------- 1 file changed, 2 insertions(+), 21 deletions(-) (limited to 'engines/mohawk/riven.cpp') 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[] = { - "", - "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; -- cgit v1.2.3