aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/video
diff options
context:
space:
mode:
authorMatthew Hoops2010-05-17 21:59:05 +0000
committerMatthew Hoops2010-05-17 21:59:05 +0000
commitc7fa1074fbc55e9e519f9c7e08dea9603af22e61 (patch)
tree502ce42530df3ea513eebf7096dfc72bf05a3dd7 /engines/sci/video
parentea84abf5880f0af2642dd3de08a6d9c6f7f88426 (diff)
downloadscummvm-rg350-c7fa1074fbc55e9e519f9c7e08dea9603af22e61.tar.gz
scummvm-rg350-c7fa1074fbc55e9e519f9c7e08dea9603af22e61.tar.bz2
scummvm-rg350-c7fa1074fbc55e9e519f9c7e08dea9603af22e61.zip
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
Diffstat (limited to 'engines/sci/video')
-rw-r--r--engines/sci/video/seq_decoder.cpp6
-rw-r--r--engines/sci/video/vmd_decoder.cpp6
2 files changed, 8 insertions, 4 deletions
diff --git a/engines/sci/video/seq_decoder.cpp b/engines/sci/video/seq_decoder.cpp
index ef2622704d..ccce873a15 100644
--- a/engines/sci/video/seq_decoder.cpp
+++ b/engines/sci/video/seq_decoder.cpp
@@ -61,7 +61,7 @@ bool SeqDecoder::loadFile(const char *fileName, int frameDelay) {
return false;
// Seek to the first frame
- _videoInfo.currentFrame = 0;
+ _videoInfo.currentFrame = -1;
_videoInfo.width = SCREEN_WIDTH;
_videoInfo.height = SCREEN_HEIGHT;
@@ -129,6 +129,8 @@ bool SeqDecoder::decodeNextFrame() {
_fileStream->seek(offset);
+ _videoInfo.currentFrame++;
+
if (_videoInfo.currentFrame == 0)
_videoInfo.startTime = g_system->getMillis();
@@ -151,7 +153,7 @@ bool SeqDecoder::decodeNextFrame() {
delete[] buf;
}
- return ++_videoInfo.currentFrame < _videoInfo.frameCount;
+ return !endOfVideo();
}
#define WRITE_TO_BUFFER(n) \
diff --git a/engines/sci/video/vmd_decoder.cpp b/engines/sci/video/vmd_decoder.cpp
index 4e56e51054..9e95521ebb 100644
--- a/engines/sci/video/vmd_decoder.cpp
+++ b/engines/sci/video/vmd_decoder.cpp
@@ -75,7 +75,7 @@ bool VMDDecoder::loadFile(const char *fileName) {
_videoInfo.frameCount = _vmdDecoder->getFramesCount();
_videoInfo.frameRate = _vmdDecoder->getFrameRate();
_videoInfo.frameDelay = _videoInfo.frameRate * 100;
- _videoInfo.currentFrame = 0;
+ _videoInfo.currentFrame = -1;
_videoInfo.firstframeOffset = 0; // not really necessary for VMDs
if (_vmdDecoder->hasExtraData())
@@ -103,6 +103,8 @@ void VMDDecoder::closeFile() {
}
bool VMDDecoder::decodeNextFrame() {
+ _videoInfo.currentFrame++;
+
if (_videoInfo.currentFrame == 0)
_videoInfo.startTime = g_system->getMillis();
@@ -113,7 +115,7 @@ bool VMDDecoder::decodeNextFrame() {
setPalette(_palette);
}
- return ++_videoInfo.currentFrame < _videoInfo.frameCount;
+ return !endOfVideo();
}
void VMDDecoder::getPalette() {