aboutsummaryrefslogtreecommitdiff
path: root/engines/composer
diff options
context:
space:
mode:
authorAlyssa Milburn2011-08-13 22:11:14 +0200
committerAlyssa Milburn2011-08-13 22:11:27 +0200
commitbdc24b6565c69f57d194feb5538a67caa5cdfa1c (patch)
tree7851f720826fd5ed827e4a2c35158f3a37a97206 /engines/composer
parentc3339c15fad1f729dd55d5f4780c5d483643b59c (diff)
downloadscummvm-rg350-bdc24b6565c69f57d194feb5538a67caa5cdfa1c.tar.gz
scummvm-rg350-bdc24b6565c69f57d194feb5538a67caa5cdfa1c.tar.bz2
scummvm-rg350-bdc24b6565c69f57d194feb5538a67caa5cdfa1c.zip
COMPOSER: Split out filename mangling into a separate function.
Diffstat (limited to 'engines/composer')
-rw-r--r--engines/composer/composer.cpp5
-rw-r--r--engines/composer/composer.h1
2 files changed, 6 insertions, 0 deletions
diff --git a/engines/composer/composer.cpp b/engines/composer/composer.cpp
index d3252d43b9..165918adfd 100644
--- a/engines/composer/composer.cpp
+++ b/engines/composer/composer.cpp
@@ -275,6 +275,11 @@ Common::String ComposerEngine::getStringFromConfig(const Common::String &section
Common::String ComposerEngine::getFilename(const Common::String &section, uint id) {
Common::String key = Common::String::format("%d", id);
Common::String filename = getStringFromConfig(section, key);
+
+ return mangleFilename(filename);
+}
+
+Common::String ComposerEngine::mangleFilename(Common::String filename) {
while (filename.size() && (filename[0] == '~' || filename[0] == ':' || filename[0] == '\\'))
filename = filename.c_str() + 1;
diff --git a/engines/composer/composer.h b/engines/composer/composer.h
index 99ed56ead7..955b78d3cd 100644
--- a/engines/composer/composer.h
+++ b/engines/composer/composer.h
@@ -172,6 +172,7 @@ private:
Common::String getStringFromConfig(const Common::String &section, const Common::String &key);
Common::String getFilename(const Common::String &section, uint id);
+ Common::String mangleFilename(Common::String filename);
void loadLibrary(uint id);
void unloadLibrary(uint id);