From c7fa1074fbc55e9e519f9c7e08dea9603af22e61 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Mon, 17 May 2010 21:59:05 +0000 Subject: Change VideoDecoder::getCurFrame() to mean the last frame drawn instead of the next frame to draw. This is patch 1 from patch #2963496 (VideoDecoder Rewrite). svn-id: r49063 --- graphics/video/dxa_decoder.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'graphics/video/dxa_decoder.cpp') diff --git a/graphics/video/dxa_decoder.cpp b/graphics/video/dxa_decoder.cpp index 827ee0846f..86f2415922 100644 --- a/graphics/video/dxa_decoder.cpp +++ b/graphics/video/dxa_decoder.cpp @@ -56,7 +56,7 @@ DXADecoder::DXADecoder() { _frameSize = 0; _videoInfo.frameCount = 0; - _videoInfo.currentFrame = 0; + _videoInfo.currentFrame = -1; _videoInfo.frameRate = 0; _videoInfo.frameDelay = 0; @@ -159,7 +159,7 @@ bool DXADecoder::loadFile(const char *fileName) { // Read the sound header _soundTag = _fileStream->readUint32BE(); - _videoInfo.currentFrame = 0; + _videoInfo.currentFrame = -1; _videoInfo.firstframeOffset = _fileStream->pos(); @@ -484,6 +484,8 @@ void DXADecoder::decode13(int size) { bool DXADecoder::decodeNextFrame() { uint32 tag; + _videoInfo.currentFrame++; + if (_videoInfo.currentFrame == 0) _videoInfo.startTime = g_system->getMillis(); @@ -557,7 +559,7 @@ bool DXADecoder::decodeNextFrame() { break; } - return ++_videoInfo.currentFrame < _videoInfo.frameCount; + return !endOfVideo(); } } // End of namespace Graphics -- cgit v1.2.3