diff options
author | Filippos Karapetis | 2014-12-24 06:13:49 +0200 |
---|---|---|
committer | Filippos Karapetis | 2014-12-24 06:13:49 +0200 |
commit | 9948d3ca16ceff79dd3ccf6dde5024de04470f08 (patch) | |
tree | e8cb82d0fb47924ef2230681db32d5f10778f981 | |
parent | 6afeec129504a16ee67c77b35cd27f0808d566d2 (diff) | |
download | scummvm-rg350-9948d3ca16ceff79dd3ccf6dde5024de04470f08.tar.gz scummvm-rg350-9948d3ca16ceff79dd3ccf6dde5024de04470f08.tar.bz2 scummvm-rg350-9948d3ca16ceff79dd3ccf6dde5024de04470f08.zip |
ZVISION: Add a hack to set the correct frame delay for RLF videos
Also, use Common::Rational to avoid using floating point math
-rw-r--r-- | engines/zvision/scripting/sidefx/animation_node.cpp | 16 |
1 files changed, 14 insertions, 2 deletions
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; |