From 10b63492917d8811f5af83da84d4e4cfbb78c00c Mon Sep 17 00:00:00 2001 From: Willem Jan Palenstijn Date: Thu, 24 Sep 2009 23:54:48 +0000 Subject: SCI: When setting global palette, map all unused colours to index 0. This fixes white artifacts outside the bar in the SQ4CD intro, but might cause regressions elsewhere. svn-id: r44320 --- engines/sci/gfx/palette.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/engines/sci/gfx/palette.cpp b/engines/sci/gfx/palette.cpp index e69787a389..14564eeebc 100644 --- a/engines/sci/gfx/palette.cpp +++ b/engines/sci/gfx/palette.cpp @@ -285,6 +285,16 @@ void Palette::forceInto(Palette *parent) { _parent->_colors[i].refcount = 1; } else { _parent->_colors[i].refcount = 0; + // Force all unused colours to index 0 + _colors[i].parent_index = 0; + if (_parent->_colors[0].refcount != PALENTRY_LOCKED) { + if (i == 0) + _parent->_colors[0].refcount = 1; + else + _parent->_colors[0].refcount++; + } + if (_colors[i].r || _colors[i].g || _colors[i].b) + warning("Non-black unused colour in pic: index %d, %02X %02X %02X", i, _colors[i].r, _colors[i].g, _colors[i].b); } } _parent->_dirty = true; -- cgit v1.2.3