aboutsummaryrefslogtreecommitdiff
path: root/engines/zvision
diff options
context:
space:
mode:
authorMarisa-Chan2014-09-09 12:31:11 +0700
committerMarisa-Chan2014-09-09 12:31:11 +0700
commit78552afdae3b7b27845d7ea4d2c2638fa3182333 (patch)
tree046d867fd74e254308df62afe54df0838b76967e /engines/zvision
parent2b6d65f83bdc26b3d07cfc3061a27882d87df67c (diff)
downloadscummvm-rg350-78552afdae3b7b27845d7ea4d2c2638fa3182333.tar.gz
scummvm-rg350-78552afdae3b7b27845d7ea4d2c2638fa3182333.tar.bz2
scummvm-rg350-78552afdae3b7b27845d7ea4d2c2638fa3182333.zip
ZVISION: Check .avi and .rlf suffix only in MetaAnimation.
Diffstat (limited to 'engines/zvision')
-rw-r--r--engines/zvision/animation/meta_animation.cpp10
-rw-r--r--engines/zvision/scripting/controls/hotmov_control.cpp3
-rw-r--r--engines/zvision/scripting/controls/lever_control.cpp3
-rw-r--r--engines/zvision/scripting/controls/safe_control.cpp3
-rw-r--r--engines/zvision/scripting/sidefx/animation_node.cpp8
5 files changed, 11 insertions, 16 deletions
diff --git a/engines/zvision/animation/meta_animation.cpp b/engines/zvision/animation/meta_animation.cpp
index 38f56699bb..1ea6df6481 100644
--- a/engines/zvision/animation/meta_animation.cpp
+++ b/engines/zvision/animation/meta_animation.cpp
@@ -40,14 +40,16 @@ namespace ZVision {
MetaAnimation::MetaAnimation(const Common::String &fileName, ZVision *engine)
: _fileType(RLF),
_cur_frame(NULL) {
- if (fileName.hasSuffix(".rlf")) {
+ Common::String tmpFileName = fileName;
+ tmpFileName.toLowercase();
+ if (tmpFileName.hasSuffix(".rlf")) {
_fileType = RLF;
- Common::File *_file = engine->getSearchManager()->openFile(fileName);
+ Common::File *_file = engine->getSearchManager()->openFile(tmpFileName);
_animation.rlf = new RlfAnimation(_file, false);
_frmDelay = _animation.rlf->frameTime();
- } else if (fileName.hasSuffix(".avi")) {
+ } else if (tmpFileName.hasSuffix(".avi")) {
_fileType = AVI;
- Common::File *_file = engine->getSearchManager()->openFile(fileName);
+ Common::File *_file = engine->getSearchManager()->openFile(tmpFileName);
_animation.avi = new ZorkAVIDecoder();
_animation.avi->loadStream(_file);
_frmDelay = 1000.0 / _animation.avi->getDuration().framerate();
diff --git a/engines/zvision/scripting/controls/hotmov_control.cpp b/engines/zvision/scripting/controls/hotmov_control.cpp
index 1e1886e1a8..8ffc3392be 100644
--- a/engines/zvision/scripting/controls/hotmov_control.cpp
+++ b/engines/zvision/scripting/controls/hotmov_control.cpp
@@ -80,8 +80,7 @@ HotMovControl::HotMovControl(ZVision *engine, uint32 key, Common::SeekableReadSt
char filename[64];
sscanf(values.c_str(), "%s", filename);
values = Common::String(filename);
- if (values.hasSuffix(".avi") || values.hasSuffix(".rlf"))
- _animation = new MetaAnimation(values, _engine);
+ _animation = new MetaAnimation(values, _engine);
} else if (param.matchString("venus_id", true)) {
_venus_id = atoi(values.c_str());
}
diff --git a/engines/zvision/scripting/controls/lever_control.cpp b/engines/zvision/scripting/controls/lever_control.cpp
index 87fbb433dd..8072079435 100644
--- a/engines/zvision/scripting/controls/lever_control.cpp
+++ b/engines/zvision/scripting/controls/lever_control.cpp
@@ -104,8 +104,7 @@ void LeverControl::parseLevFile(const Common::String &fileName) {
Common::String animationFileName(fileNameBuffer);
- if (animationFileName.hasSuffix(".avi") || animationFileName.hasSuffix(".rlf"))
- _animation = new MetaAnimation(animationFileName, _engine);
+ _animation = new MetaAnimation(animationFileName, _engine);
} else if (line.matchString("*skipcolor*", true)) {
// Not used
diff --git a/engines/zvision/scripting/controls/safe_control.cpp b/engines/zvision/scripting/controls/safe_control.cpp
index a6be20bce8..d5eff09502 100644
--- a/engines/zvision/scripting/controls/safe_control.cpp
+++ b/engines/zvision/scripting/controls/safe_control.cpp
@@ -66,8 +66,7 @@ SafeControl::SafeControl(ZVision *engine, uint32 key, Common::SeekableReadStream
while (!stream.eos() && !line.contains('}')) {
if (param.matchString("animation", true)) {
- if (values.hasSuffix(".avi") || values.hasSuffix(".rlf"))
- _animation = new MetaAnimation(values, _engine);
+ _animation = new MetaAnimation(values, _engine);
} else if (param.matchString("rectangle", true)) {
int x;
int y;
diff --git a/engines/zvision/scripting/sidefx/animation_node.cpp b/engines/zvision/scripting/sidefx/animation_node.cpp
index 4a606adc9e..bd9c543d52 100644
--- a/engines/zvision/scripting/sidefx/animation_node.cpp
+++ b/engines/zvision/scripting/sidefx/animation_node.cpp
@@ -40,12 +40,8 @@ AnimationNode::AnimationNode(ZVision *engine, uint32 controlKey, const Common::S
_mask(mask),
_animation(NULL) {
- if (fileName.hasSuffix(".rlf") || fileName.hasSuffix(".avi")) {
- _animation = new MetaAnimation(fileName, engine);
- _frmDelay = _animation->frameTime();
- } else {
- warning("Unrecognized animation file type: %s", fileName.c_str());
- }
+ _animation = new MetaAnimation(fileName, engine);
+ _frmDelay = _animation->frameTime();
if (frate > 0)
_frmDelay = 1000.0 / frate;