Skip to content

Commit

Permalink
ZVISION: Check .avi and .rlf suffix only in MetaAnimation.
Browse files Browse the repository at this point in the history
  • Loading branch information
Marisa-Chan committed Sep 9, 2014
1 parent 2b6d65f commit 78552af
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 16 deletions.
10 changes: 6 additions & 4 deletions engines/zvision/animation/meta_animation.cpp
Expand Up @@ -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();
Expand Down
3 changes: 1 addition & 2 deletions engines/zvision/scripting/controls/hotmov_control.cpp
Expand Up @@ -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());
}
Expand Down
3 changes: 1 addition & 2 deletions engines/zvision/scripting/controls/lever_control.cpp
Expand Up @@ -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
Expand Down
3 changes: 1 addition & 2 deletions engines/zvision/scripting/controls/safe_control.cpp
Expand Up @@ -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;
Expand Down
8 changes: 2 additions & 6 deletions engines/zvision/scripting/sidefx/animation_node.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 78552af

Please sign in to comment.