aboutsummaryrefslogtreecommitdiff
path: root/kyra
diff options
context:
space:
mode:
authorJohannes Schickel2006-01-14 15:20:00 +0000
committerJohannes Schickel2006-01-14 15:20:00 +0000
commit576ac7ca116161693ec1e20caa6c3c7bf68daa71 (patch)
tree3da1e12764a4062d5bbb4794a85b5046ff8193f9 /kyra
parent7823a6795bb84afa624e2821387e3d34fa7077cd (diff)
downloadscummvm-rg350-576ac7ca116161693ec1e20caa6c3c7bf68daa71.tar.gz
scummvm-rg350-576ac7ca116161693ec1e20caa6c3c7bf68daa71.tar.bz2
scummvm-rg350-576ac7ca116161693ec1e20caa6c3c7bf68daa71.zip
Fixed bug # 1401236. (KYRA: Erroneous animation in the pantheon of moonlight).
svn-id: r20026
Diffstat (limited to 'kyra')
-rw-r--r--kyra/screen.cpp29
-rw-r--r--kyra/screen.h2
-rw-r--r--kyra/script_v1.cpp4
-rw-r--r--kyra/wsamovie.cpp6
4 files changed, 27 insertions, 14 deletions
diff --git a/kyra/screen.cpp b/kyra/screen.cpp
index aeeb374f19..3677132056 100644
--- a/kyra/screen.cpp
+++ b/kyra/screen.cpp
@@ -1307,8 +1307,8 @@ void Screen::decodeFrameDelta(uint8 *dst, const uint8 *src) {
}
}
-void Screen::decodeFrameDeltaPage(uint8 *dst, const uint8 *src, int pitch) {
- debug(9, "Screen::decodeFrameDeltaPage(0x%X, 0x%X, %d)", dst, src, pitch);
+void Screen::decodeFrameDeltaPage(uint8 *dst, const uint8 *src, int pitch, int noXor) {
+ debug(9, "Screen::decodeFrameDeltaPage(0x%X, 0x%X, %d, %d)", dst, src, pitch, noXor);
int count = 0;
uint8 *dstNext = dst;
while (1) {
@@ -1317,7 +1317,11 @@ void Screen::decodeFrameDeltaPage(uint8 *dst, const uint8 *src, int pitch) {
uint8 len = *src++;
code = *src++;
while (len--) {
- *dst++ ^= code;
+ if (noXor) {
+ *dst++ = code;
+ } else {
+ *dst++ ^= code;
+ }
if (++count == pitch) {
count = 0;
dstNext += SCREEN_W;
@@ -1335,7 +1339,6 @@ void Screen::decodeFrameDeltaPage(uint8 *dst, const uint8 *src, int pitch) {
dstNext += SCREEN_W;
dst = dstNext + count;
}
-
} else {
uint16 subcode = READ_LE_UINT16(src); src += 2;
if (subcode == 0) {
@@ -1346,7 +1349,11 @@ void Screen::decodeFrameDeltaPage(uint8 *dst, const uint8 *src, int pitch) {
uint16 len = subcode - 0x4000;
code = *src++;
while (len--) {
- *dst++ ^= code;
+ if (noXor) {
+ *dst++ = code;
+ } else {
+ *dst++ ^= code;
+ }
if (++count == pitch) {
count = 0;
dstNext += SCREEN_W;
@@ -1355,7 +1362,11 @@ void Screen::decodeFrameDeltaPage(uint8 *dst, const uint8 *src, int pitch) {
}
} else {
while (subcode--) {
- *dst++ ^= *src++;
+ if (noXor) {
+ *dst++ = *src++;
+ } else {
+ *dst++ ^= *src++;
+ }
if (++count == pitch) {
count = 0;
dstNext += SCREEN_W;
@@ -1377,7 +1388,11 @@ void Screen::decodeFrameDeltaPage(uint8 *dst, const uint8 *src, int pitch) {
}
} else {
while (code--) {
- *dst++ ^= *src++;
+ if (noXor) {
+ *dst++ = *src++;
+ } else {
+ *dst++ ^= *src++;
+ }
if (++count == pitch) {
count = 0;
dstNext += SCREEN_W;
diff --git a/kyra/screen.h b/kyra/screen.h
index 1bc769ec18..cdf9761106 100644
--- a/kyra/screen.h
+++ b/kyra/screen.h
@@ -125,7 +125,7 @@ public:
static void decodeFrame3(const uint8 *src, uint8 *dst, uint32 size);
static void decodeFrame4(const uint8 *src, uint8 *dst, uint32 dstSize);
static void decodeFrameDelta(uint8 *dst, const uint8 *src);
- static void decodeFrameDeltaPage(uint8 *dst, const uint8 *src, int pitch);
+ static void decodeFrameDeltaPage(uint8 *dst, const uint8 *src, int pitch, int noXor);
uint8 *encodeShape(int x, int y, int w, int h, int flags);
void copyRegionToBuffer(int pageNum, int x, int y, int w, int h, uint8 *dest);
diff --git a/kyra/script_v1.cpp b/kyra/script_v1.cpp
index 696a146282..88900dd0b9 100644
--- a/kyra/script_v1.cpp
+++ b/kyra/script_v1.cpp
@@ -411,12 +411,12 @@ int KyraEngine::cmd_setScaleMode(ScriptState *script) {
}
int KyraEngine::cmd_openWSAFile(ScriptState *script) {
- debug(3, "cmd_openWSAFile(0x%X) ('%s', %d)", script, stackPosString(0), stackPos(1));
+ debug(3, "cmd_openWSAFile(0x%X) ('%s', %d, %d)", script, stackPosString(0), stackPos(1), stackPos(2));
char *filename = stackPosString(0);
int wsaIndex = stackPos(1);
- _movieObjects[wsaIndex]->open(filename, 1, 0);
+ _movieObjects[wsaIndex]->open(filename, (stackPos(2) != 0) ? 1 : 0, 0);
assert(_movieObjects[wsaIndex]->opened());
return 0;
diff --git a/kyra/wsamovie.cpp b/kyra/wsamovie.cpp
index 1cc4a97251..b46055336a 100644
--- a/kyra/wsamovie.cpp
+++ b/kyra/wsamovie.cpp
@@ -132,13 +132,11 @@ void WSAMovieV1::displayFrame(int frameNum) {
}
if (_currentFrame == _numFrames) {
- if (!(_flags & WF_OFFSCREEN_DECODE) && (_vm->features() & GF_TALKIE))
- _vm->screen()->clearPage(_drawPage);
if (!(_flags & WF_NO_FIRST_FRAME)) {
if (_flags & WF_OFFSCREEN_DECODE) {
Screen::decodeFrameDelta(dst, _deltaBuffer);
} else {
- Screen::decodeFrameDeltaPage(dst, _deltaBuffer, _width);
+ Screen::decodeFrameDeltaPage(dst, _deltaBuffer, _width, 1);
}
}
_currentFrame = 0;
@@ -201,7 +199,7 @@ void WSAMovieV1::processFrame(int frameNum, uint8 *dst) {
if (_flags & WF_OFFSCREEN_DECODE) {
Screen::decodeFrameDelta(dst, _deltaBuffer);
} else {
- Screen::decodeFrameDeltaPage(dst, _deltaBuffer, _width);
+ Screen::decodeFrameDeltaPage(dst, _deltaBuffer, _width, 0);
}
}
} // end of namespace Kyra