aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorJohannes Schickel2009-06-07 00:51:19 +0000
committerJohannes Schickel2009-06-07 00:51:19 +0000
commit6cfb706faee5020fd6196889de27ddf3e07c4c80 (patch)
treec11367291062060d7cde7366a2b56954317eb9a2 /engines
parent4416881c0770e4a287cc64fff5c4f91337aa0696 (diff)
downloadscummvm-rg350-6cfb706faee5020fd6196889de27ddf3e07c4c80.tar.gz
scummvm-rg350-6cfb706faee5020fd6196889de27ddf3e07c4c80.tar.bz2
scummvm-rg350-6cfb706faee5020fd6196889de27ddf3e07c4c80.zip
Fix WSA v2 code, now the automap remove WSA file in Lands of Lore plays correctly.
svn-id: r41315
Diffstat (limited to 'engines')
-rw-r--r--engines/kyra/wsamovie.cpp16
-rw-r--r--engines/kyra/wsamovie.h1
2 files changed, 7 insertions, 10 deletions
diff --git a/engines/kyra/wsamovie.cpp b/engines/kyra/wsamovie.cpp
index fc33201d65..f7b4e9df1f 100644
--- a/engines/kyra/wsamovie.cpp
+++ b/engines/kyra/wsamovie.cpp
@@ -416,17 +416,13 @@ int WSAMovie_v2::open(const char *filename, int unk1, uint8 *palBuf) {
for (int i = 1; i < _numFrames + 2; ++i) {
_frameOffsTable[i] = READ_LE_UINT32(wsaData);
+ if (_frameOffsTable[i])
+ _frameOffsTable[i] -= frameDataOffs;
wsaData += 4;
}
- for (int i = 1; i < _numFrames; ++i)
- _frameOffsTable[i] -= frameDataOffs;
-
- // WSA movies without last frame offset need special treatment
- if (_frameOffsTable[_numFrames + 1])
- _frameOffsTable[_numFrames] -= frameDataOffs;
- else
- _frameOffsTable[_numFrames] = 0;
+ if (!_frameOffsTable[_numFrames + 1])
+ _flags |= WF_NO_LAST_FRAME;
// skip palette
wsaData += offsPal;
@@ -477,13 +473,13 @@ void WSAMovie_v2::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;
}
diff --git a/engines/kyra/wsamovie.h b/engines/kyra/wsamovie.h
index ab6007f060..fdceca1cd8 100644
--- a/engines/kyra/wsamovie.h
+++ b/engines/kyra/wsamovie.h
@@ -80,6 +80,7 @@ public:
enum WSAFlags {
WF_OFFSCREEN_DECODE = 0x10,
+ WF_NO_LAST_FRAME = 0x20,
WF_NO_FIRST_FRAME = 0x40,
WF_HAS_PALETTE = 0x100,
WF_XOR = 0x200