aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2009-09-24 23:54:48 +0000
committerWillem Jan Palenstijn2009-09-24 23:54:48 +0000
commit10b63492917d8811f5af83da84d4e4cfbb78c00c (patch)
treeb91e774f64a0cea1e09132c7d41faede567fac4c
parent825421108b2a8dff065a2e1f0c24e131e8b9fa64 (diff)
downloadscummvm-rg350-10b63492917d8811f5af83da84d4e4cfbb78c00c.tar.gz
scummvm-rg350-10b63492917d8811f5af83da84d4e4cfbb78c00c.tar.bz2
scummvm-rg350-10b63492917d8811f5af83da84d4e4cfbb78c00c.zip
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
-rw-r--r--engines/sci/gfx/palette.cpp10
1 files changed, 10 insertions, 0 deletions
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;