aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/kyra/wsamovie.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/engines/kyra/wsamovie.cpp b/engines/kyra/wsamovie.cpp
index f7b4e9df1f..26638b8172 100644
--- a/engines/kyra/wsamovie.cpp
+++ b/engines/kyra/wsamovie.cpp
@@ -100,10 +100,15 @@ int WSAMovie_v1::open(const char *filename, int offscreenDecode, uint8 *palBuf)
}
for (int i = 1; i < _numFrames + 2; ++i) {
- _frameOffsTable[i] = READ_LE_UINT32(wsaData) - frameDataOffs;
+ _frameOffsTable[i] = READ_LE_UINT32(wsaData);
+ if (_frameOffsTable[i])
+ _frameOffsTable[i] -= frameDataOffs;
wsaData += 4;
}
+ if (!_frameOffsTable[_numFrames + 1])
+ _flags |= WF_NO_LAST_FRAME;
+
// skip palette
wsaData += offsPal;
@@ -162,13 +167,13 @@ void WSAMovie_v1::displayFrame(int frameNum, int pageNum, int x, int y, ...) {
int frameCount;
if (_currentFrame < frameNum) {
frameCount = _numFrames - frameNum + _currentFrame;
- if (diffCount > frameCount)
+ if (diffCount > frameCount && !(_flags & WF_NO_LAST_FRAME))
frameStep = -1;
else
frameCount = diffCount;
} else {
frameCount = _numFrames - _currentFrame + frameNum;
- if (frameCount >= diffCount) {
+ if (frameCount >= diffCount || (_flags & WF_NO_LAST_FRAME)) {
frameStep = -1;
frameCount = diffCount;
}
@@ -273,13 +278,13 @@ void WSAMovieAmiga::displayFrame(int frameNum, int pageNum, int x, int y, ...) {
int frameCount;
if (_currentFrame < frameNum) {
frameCount = _numFrames - frameNum + _currentFrame;
- if (diffCount > frameCount)
+ if (diffCount > frameCount && !(_flags & WF_NO_LAST_FRAME))
frameStep = -1;
else
frameCount = diffCount;
} else {
frameCount = _numFrames - _currentFrame + frameNum;
- if (frameCount >= diffCount) {
+ if (frameCount >= diffCount || (_flags & WF_NO_LAST_FRAME)) {
frameStep = -1;
frameCount = diffCount;
}