diff options
author | richiesams | 2013-08-28 09:14:32 -0500 |
---|---|---|
committer | richiesams | 2013-08-28 16:44:39 -0500 |
commit | 945982c8577b9c8a34333898841b5ffcfaa7138b (patch) | |
tree | b292c271b3c9f9a00f2dda5c26ebd3d4f55fa861 /engines/zvision | |
parent | 3e6144970e2674380a8adab3b17e5bd1ce24ffea (diff) | |
download | scummvm-rg350-945982c8577b9c8a34333898841b5ffcfaa7138b.tar.gz scummvm-rg350-945982c8577b9c8a34333898841b5ffcfaa7138b.tar.bz2 scummvm-rg350-945982c8577b9c8a34333898841b5ffcfaa7138b.zip |
ZVISION: Add support for animation 'mirroring'
If an animation is 'mirrored', it doesn't have B-frames, only I-frames. However the animations are built
so the last half of the animation is the reverse of the first half
Diffstat (limited to 'engines/zvision')
-rw-r--r-- | engines/zvision/lever_control.cpp | 6 | ||||
-rw-r--r-- | engines/zvision/lever_control.h | 1 |
2 files changed, 7 insertions, 0 deletions
diff --git a/engines/zvision/lever_control.cpp b/engines/zvision/lever_control.cpp index 7592968413..4ed3f10878 100644 --- a/engines/zvision/lever_control.cpp +++ b/engines/zvision/lever_control.cpp @@ -45,6 +45,7 @@ LeverControl::LeverControl(ZVision *engine, uint32 key, Common::SeekableReadStre _frameCount(0), _startFrame(0), _currentFrame(0), + _lastRenderedFrame(0), _mouseIsCaptured(false), _isReturning(false) { @@ -318,6 +319,10 @@ int LeverControl::calculateVectorAngle(const Common::Point &pointOne, const Comm } void LeverControl::renderFrame(uint frameNumber) { + if (frameNumber < _lastRenderedFrame && _mirrored) { + frameNumber = (_frameCount * 2) - 1 - frameNumber; + } + const uint16 *frameData; int pitch; int x = _animationCoords.left; @@ -341,6 +346,7 @@ void LeverControl::renderFrame(uint frameNumber) { } _engine->_system->copyRectToScreen(frameData, pitch, x + _engine->_workingWindow.left, y + _engine->_workingWindow.top, width, height); + _lastRenderedFrame = frameNumber; } } // End of namespace ZVision diff --git a/engines/zvision/lever_control.h b/engines/zvision/lever_control.h index 42577a1776..cf41aac6b3 100644 --- a/engines/zvision/lever_control.h +++ b/engines/zvision/lever_control.h @@ -80,6 +80,7 @@ private: FrameInfo *_frameInfo; uint _currentFrame; + uint _lastRenderedFrame; bool _mouseIsCaptured; bool _isReturning; Common::Point _lastMousePos; |