diff options
author | richiesams | 2013-08-28 09:13:05 -0500 |
---|---|---|
committer | richiesams | 2013-08-28 16:44:28 -0500 |
commit | 3e6144970e2674380a8adab3b17e5bd1ce24ffea (patch) | |
tree | 411d0372e95c327f1f7557dad91b6af78b75a676 | |
parent | ab18d20ead93b5e1f65f474fe73212724394c1fc (diff) | |
download | scummvm-rg350-3e6144970e2674380a8adab3b17e5bd1ce24ffea.tar.gz scummvm-rg350-3e6144970e2674380a8adab3b17e5bd1ce24ffea.tar.bz2 scummvm-rg350-3e6144970e2674380a8adab3b17e5bd1ce24ffea.zip |
ZVISION: Implement avi frame seeking
-rw-r--r-- | engines/zvision/lever_control.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/engines/zvision/lever_control.cpp b/engines/zvision/lever_control.cpp index 3c5b6370bb..7592968413 100644 --- a/engines/zvision/lever_control.cpp +++ b/engines/zvision/lever_control.cpp @@ -27,6 +27,8 @@ #include "common/tokenizer.h" #include "common/system.h" +#include "graphics/surface.h" + #include "zvision/lever_control.h" #include "zvision/zvision.h" #include "zvision/script_manager.h" @@ -318,21 +320,24 @@ int LeverControl::calculateVectorAngle(const Common::Point &pointOne, const Comm void LeverControl::renderFrame(uint frameNumber) { const uint16 *frameData; int pitch; - int x; - int y; + int x = _animationCoords.left; + int y = _animationCoords.top; int width; int height; if (_fileType == RLF) { // getFrameData() will automatically optimize to getNextFrame() / getPreviousFrame() if it can - frameData = _animation.rlf->getFrameData(_currentFrame); + frameData = _animation.rlf->getFrameData(frameNumber); pitch = _animation.rlf->width() * sizeof(uint16); - x = _animationCoords.left; - y = _animationCoords.right; width = _animation.rlf->width(); // Use the animation width instead of _animationCoords.width() height = _animation.rlf->height(); // Use the animation height instead of _animationCoords.height() } else if (_fileType == AVI) { - // Cry because AVI seeking isn't implemented (yet) + _animation.avi->seekToFrame(frameNumber); + const Graphics::Surface *surface = _animation.avi->decodeNextFrame(); + frameData = (const uint16 *)surface->getBasePtr(0, 0); + pitch = surface->pitch; + width = surface->w; + height = surface->h; } _engine->_system->copyRectToScreen(frameData, pitch, x + _engine->_workingWindow.left, y + _engine->_workingWindow.top, width, height); |