aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorColin Snover2016-08-11 20:46:17 -0500
committerColin Snover2016-08-12 09:28:46 -0500
commitf3d007ea5b32eefe3ea6eb2dbe98e2ec2d0fd1da (patch)
tree451d05bcfba9a30a1e837a7cf0c9c2eee9991226 /engines
parent1fc21de2fc2dfc69b7b5cab9673f645dbcb2cf9d (diff)
downloadscummvm-rg350-f3d007ea5b32eefe3ea6eb2dbe98e2ec2d0fd1da.tar.gz
scummvm-rg350-f3d007ea5b32eefe3ea6eb2dbe98e2ec2d0fd1da.tar.bz2
scummvm-rg350-f3d007ea5b32eefe3ea6eb2dbe98e2ec2d0fd1da.zip
SCI32: Fix KQ7 1.51 video background
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/graphics/video32.cpp23
1 files changed, 22 insertions, 1 deletions
diff --git a/engines/sci/graphics/video32.cpp b/engines/sci/graphics/video32.cpp
index bc1cf0547b..94f8852633 100644
--- a/engines/sci/graphics/video32.cpp
+++ b/engines/sci/graphics/video32.cpp
@@ -371,7 +371,25 @@ void AVIPlayer::renderFrame() const {
return;
}
- bitmap.getBuffer().copyRectToSurface(*surface, 0, 0, Common::Rect(surface->w, surface->h));
+ // KQ7 1.51 encodes videos with palette entry 0 as white, which makes
+ // the area around the video turn white too, since it is coded to use
+ // palette entry 0. This happens to work in the original game because
+ // the video is rendered by VfW, not in the engine itself. To fix this,
+ // we just modify the incoming pixel data from the video so if a pixel
+ // is using entry 0, we change it to use entry 255, which is guaranteed
+ // to always be white
+ if (getSciVersion() == SCI_VERSION_2_1_EARLY && g_sci->getGameId() == GID_KQ7) {
+ uint8 *target = bitmap.getPixels();
+ uint8 *source = (uint8 *)surface->getPixels();
+ uint8 *end = (uint8 *)surface->getPixels() + surface->w * surface->h;
+
+ while (source != end) {
+ uint8 value = *source++;
+ *target++ = value == 0 ? 255 : value;
+ }
+ } else {
+ bitmap.getBuffer().copyRectToSurface(*surface, 0, 0, Common::Rect(surface->w, surface->h));
+ }
const bool dirtyPalette = _decoder->hasDirtyPalette();
if (dirtyPalette) {
@@ -384,6 +402,9 @@ void AVIPlayer::renderFrame() const {
palette.colors[i].used = true;
}
+ // Prevent KQ7 1.51 from setting entry 0 to white
+ palette.colors[0].used = false;
+
g_sci->_gfxPalette32->submit(palette);
}