From 204174180d6a29ae07f44e527d6044efc7f0915d Mon Sep 17 00:00:00 2001 From: Walter van Niftrik Date: Fri, 24 Apr 2009 23:05:08 +0000 Subject: SCI: Initialize pixmap to transparency before decoding cel RLE data. This fixes some of the views in KQ6. svn-id: r40132 --- engines/sci/gfx/res_view1.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'engines/sci/gfx/res_view1.cpp') diff --git a/engines/sci/gfx/res_view1.cpp b/engines/sci/gfx/res_view1.cpp index 3bf10cb7de..eea8aa3259 100644 --- a/engines/sci/gfx/res_view1.cpp +++ b/engines/sci/gfx/res_view1.cpp @@ -68,6 +68,10 @@ static int decompress_sci_view(int id, int loop, int cel, byte *resource, byte * int writepos = mirrored ? xl : 0; int linebase = 0; + // For some cels the RLE data ends at the last non-transparent pixel, + // so we initialize the whole pixmap to transparency first + memset(dest, color_key, pixmap_size); + while ((mirrored ? linebase < pixmap_size : writepos < pixmap_size) && literal_pos < size && runlength_pos < size) { int op = resource[runlength_pos]; int bytes; -- cgit v1.2.3