aboutsummaryrefslogtreecommitdiff
path: root/engines/zvision/scripting/controls/safe_control.cpp
diff options
context:
space:
mode:
authorFilippos Karapetis2014-12-16 00:48:16 +0200
committerFilippos Karapetis2014-12-16 01:58:55 +0200
commit7f61a094781256f7c2734aa08637494c1dfac6bf (patch)
tree2dd89d28d338daeb8bdf06e41bcc9e5768cf9885 /engines/zvision/scripting/controls/safe_control.cpp
parent67bd78a95f6efab6d0da4b3bef1b0cebc79c537c (diff)
downloadscummvm-rg350-7f61a094781256f7c2734aa08637494c1dfac6bf.tar.gz
scummvm-rg350-7f61a094781256f7c2734aa08637494c1dfac6bf.tar.bz2
scummvm-rg350-7f61a094781256f7c2734aa08637494c1dfac6bf.zip
ZVISION: Make the RLF decoder a subclass of the common video decoder
This way, the redundant MetaAnimation class can now be removed
Diffstat (limited to 'engines/zvision/scripting/controls/safe_control.cpp')
-rw-r--r--engines/zvision/scripting/controls/safe_control.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/engines/zvision/scripting/controls/safe_control.cpp b/engines/zvision/scripting/controls/safe_control.cpp
index 3ad5d3a8ae..9f4e29acae 100644
--- a/engines/zvision/scripting/controls/safe_control.cpp
+++ b/engines/zvision/scripting/controls/safe_control.cpp
@@ -28,15 +28,14 @@
#include "zvision/scripting/script_manager.h"
#include "zvision/graphics/render_manager.h"
#include "zvision/cursors/cursor_manager.h"
-#include "zvision/animation/meta_animation.h"
#include "zvision/utility/utility.h"
#include "common/stream.h"
#include "common/file.h"
#include "common/tokenizer.h"
#include "common/system.h"
-
#include "graphics/surface.h"
+#include "video/video_decoder.h"
namespace ZVision {
@@ -65,7 +64,7 @@ SafeControl::SafeControl(ZVision *engine, uint32 key, Common::SeekableReadStream
while (!stream.eos() && !line.contains('}')) {
if (param.matchString("animation", true)) {
- _animation = new MetaAnimation(values, _engine);
+ _animation = _engine->loadAnimation(values);
} else if (param.matchString("rectangle", true)) {
int x;
int y;
@@ -129,7 +128,8 @@ void SafeControl::renderFrame(uint frameNumber) {
int x = _rectangle.left;
int y = _rectangle.top;
- frameData = _animation->getFrameData(frameNumber);
+ _animation->seekToFrame(frameNumber);
+ frameData = _animation->decodeNextFrame();
if (frameData)
_engine->getRenderManager()->blitSurfaceToBkg(*frameData, x, y);
}
@@ -149,7 +149,7 @@ bool SafeControl::process(uint32 deltaTimeInMillis) {
_curFrame--;
renderFrame(_curFrame);
}
- _frameTime = _animation->frameTime();
+ _frameTime = 1000.0 / _animation->getDuration().framerate();
}
}
return false;