aboutsummaryrefslogtreecommitdiff
path: root/engines/sherlock
diff options
context:
space:
mode:
authorPaul Gilbert2015-05-09 08:41:13 -0400
committerPaul Gilbert2015-05-09 08:41:13 -0400
commit13c06c100e6eac2538de3ec178e654147c38bb1f (patch)
tree4834f0fce271b965659712e83a6bb01ee6a27b90 /engines/sherlock
parentf622d7471e7f04f92c728cab7de9dd0a109886c3 (diff)
downloadscummvm-rg350-13c06c100e6eac2538de3ec178e654147c38bb1f.tar.gz
scummvm-rg350-13c06c100e6eac2538de3ec178e654147c38bb1f.tar.bz2
scummvm-rg350-13c06c100e6eac2538de3ec178e654147c38bb1f.zip
SHERLOCK: Simplify animation loading filename handling
Diffstat (limited to 'engines/sherlock')
-rw-r--r--engines/sherlock/animation.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/engines/sherlock/animation.cpp b/engines/sherlock/animation.cpp
index fc84680d5e..46568f8742 100644
--- a/engines/sherlock/animation.cpp
+++ b/engines/sherlock/animation.cpp
@@ -78,13 +78,8 @@ bool Animation::play(const Common::String &filename, int minDelay, int fade,
// Check for any any sound frames for the given animation
const int *soundFrames = checkForSoundFrames(filename);
- // Strip any extension off of the passed filename and add .vdx suffix
- Common::String baseName = filename;
- const char *p = strchr(baseName.c_str(), '.');
- if (p)
- baseName = Common::String(filename.c_str(), MIN(p - 1, baseName.c_str() + 7));
-
- Common::String vdxName = baseName + ".vdx";
+ // Add on the VDX extension
+ Common::String vdxName = filename + ".vdx";
// Load the animation
Common::SeekableReadStream *stream;
@@ -96,7 +91,7 @@ bool Animation::play(const Common::String &filename, int minDelay, int fade,
stream = _vm->_res->load(vdxName, "epilogue.lib");
// Load initial image
- Common::String vdaName = baseName + ".vda";
+ Common::String vdaName = filename + ".vda";
ImageFile images(vdaName, true, true);
events.wait(minDelay);
@@ -144,8 +139,8 @@ bool Animation::play(const Common::String &filename, int minDelay, int fade,
++soundNumber;
++soundFrames;
Common::String fname = _vm->_soundOverride.empty() ?
- Common::String::format("%s%01d", baseName.c_str(), soundNumber) :
- Common::String::format("%s%02d", baseName.c_str(), soundNumber);
+ Common::String::format("%s%01d", filename.c_str(), soundNumber) :
+ Common::String::format("%s%02d", filename.c_str(), soundNumber);
if (sound._voices)
sound.playSound(fname);