From 9948d3ca16ceff79dd3ccf6dde5024de04470f08 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Wed, 24 Dec 2014 06:13:49 +0200 Subject: ZVISION: Add a hack to set the correct frame delay for RLF videos Also, use Common::Rational to avoid using floating point math --- engines/zvision/scripting/sidefx/animation_node.cpp | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) (limited to 'engines') diff --git a/engines/zvision/scripting/sidefx/animation_node.cpp b/engines/zvision/scripting/sidefx/animation_node.cpp index 134ab1396f..1f62b61310 100644 --- a/engines/zvision/scripting/sidefx/animation_node.cpp +++ b/engines/zvision/scripting/sidefx/animation_node.cpp @@ -39,8 +39,20 @@ AnimationNode::AnimationNode(ZVision *engine, uint32 controlKey, const Common::S _mask(mask), _animation(NULL) { - _animation = engine->loadAnimation(fileName); - _frmDelay = 1000.0 / _animation->getDuration().framerate(); + if (fileName.hasSuffix(".rlf")) { + // HACK: Read the frame delay directly + Common::File *tmp = engine->getSearchManager()->openFile(fileName); + if (tmp) { + tmp->seek(176, SEEK_SET); + _frmDelay = tmp->readUint32LE() / 10; + delete tmp; + } + + _animation = engine->loadAnimation(fileName); + } else { + _animation = engine->loadAnimation(fileName); + _frmDelay = Common::Rational(1000, _animation->getDuration().framerate()).toInt(); + } if (frate > 0) _frmDelay = 1000.0 / frate; -- cgit v1.2.3