diff options
-rw-r--r-- | engines/titanic/support/avi_surface.cpp | 18 | ||||
-rw-r--r-- | engines/titanic/support/avi_surface.h | 5 |
2 files changed, 14 insertions, 9 deletions
diff --git a/engines/titanic/support/avi_surface.cpp b/engines/titanic/support/avi_surface.cpp index 6240de951c..de7b9abe3e 100644 --- a/engines/titanic/support/avi_surface.cpp +++ b/engines/titanic/support/avi_surface.cpp @@ -132,18 +132,21 @@ bool AVISurface::startAtFrame(int frameNumber) { if (frameNumber == -1) // Default to starting frame of first movie range frameNumber = _movieRangeInfo.front()->_startFrame; - if (_isReversed && frameNumber == _decoder->getFrameCount()) + if (_isReversed && frameNumber == (int)_decoder->getFrameCount()) --frameNumber; - // Get the initial frame - seekToFrame(frameNumber); - renderFrame(); - // Start the playback _decoder->start(); + + // Seek to the starting frame + seekToFrame(frameNumber); + + // If we're in reverse playback, set the decoder to play in reverse if (_isReversed) _decoder->setRate(-1.0); + renderFrame(); + return true; } @@ -155,12 +158,9 @@ void AVISurface::seekToFrame(uint frameNumber) { _decoder->seekToFrame(frameNumber); _currentFrame = (int)frameNumber; } - - renderFrame(); } void AVISurface::setReversed(bool isReversed) { - _decoder->setReverse(isReversed); _isReversed = isReversed; } @@ -196,8 +196,8 @@ bool AVISurface::handleEvents(CMovieEventList &events) { if (isPlaying()) { if (newFrame != getFrame()) { // The frame has been changed, so move to new position - setReversed(info->_isReversed); seekToFrame(newFrame); + renderFrame(); } // Get any events for the given position diff --git a/engines/titanic/support/avi_surface.h b/engines/titanic/support/avi_surface.h index 4ee6cc6e0b..216d4f8837 100644 --- a/engines/titanic/support/avi_surface.h +++ b/engines/titanic/support/avi_surface.h @@ -179,6 +179,11 @@ public: int getFrame() const { return _currentFrame; } /** + * Returns true if the surface is playing in reverse + */ + bool isReversed() const { return _isReversed; } + + /** * Add a movie event */ bool addEvent(int frameNumber, CGameObject *obj); |