aboutsummaryrefslogtreecommitdiff
path: root/engines/sci
diff options
context:
space:
mode:
Diffstat (limited to 'engines/sci')
-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() {