aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMartin Kiewitz2010-01-24 10:06:27 +0000
committerMartin Kiewitz2010-01-24 10:06:27 +0000
commitd0b8a8e468017ce9096729a78fe3b19ff4f89a68 (patch)
tree92c9129fb6e32d880e6589cbeca99d08ec36a356 /engines
parent0be507e9c32932b8b578f857d35232a53a0d450f (diff)
downloadscummvm-rg350-d0b8a8e468017ce9096729a78fe3b19ff4f89a68.tar.gz
scummvm-rg350-d0b8a8e468017ce9096729a78fe3b19ff4f89a68.tar.bz2
scummvm-rg350-d0b8a8e468017ce9096729a78fe3b19ff4f89a68.zip
SCI: supporting .used bit 1 in palettes (force direct palette setting) and clipping palette intensity results fixes fade in/out in sq5 intro (some timing problems remain)
svn-id: r47495
Diffstat (limited to 'engines')
-rw-r--r--engines/sci/graphics/palette.cpp4
-rw-r--r--engines/sci/graphics/screen.cpp6
2 files changed, 5 insertions, 5 deletions
diff --git a/engines/sci/graphics/palette.cpp b/engines/sci/graphics/palette.cpp
index ed2fa0c003..94980609d5 100644
--- a/engines/sci/graphics/palette.cpp
+++ b/engines/sci/graphics/palette.cpp
@@ -199,8 +199,8 @@ void SciPalette::merge(Palette *pFrom, Palette *pTo, uint16 flag) {
for (i = 1 ; i < 255; i++) {
if (!pFrom->colors[i].used)// color is not used - so skip it
continue;
- // forced palette merging or dest color is not used yet
- if (flag == 2 || (!pTo->colors[i].used)) {
+ // forced palette merging or dest color is not used yet or bit 1 of new color is set
+ if (flag == 2 || (!pTo->colors[i].used) || (pFrom->colors[i].used & 2)) {
pTo->colors[i].used = pFrom->colors[i].used;
pTo->colors[i].r = pFrom->colors[i].r;
pTo->colors[i].g = pFrom->colors[i].g;
diff --git a/engines/sci/graphics/screen.cpp b/engines/sci/graphics/screen.cpp
index a3131dec02..64155f4570 100644
--- a/engines/sci/graphics/screen.cpp
+++ b/engines/sci/graphics/screen.cpp
@@ -394,9 +394,9 @@ void Screen::setPalette(Palette*pal) {
for (int16 i = 0; i < 256; i++) {
if (!pal->colors[i].used)
continue;
- bpal[i * 4] = pal->colors[i].r * pal->intensity[i] / 100;
- bpal[i * 4 + 1] = pal->colors[i].g * pal->intensity[i] / 100;
- bpal[i * 4 + 2] = pal->colors[i].b * pal->intensity[i] / 100;
+ bpal[i * 4] = CLIP(pal->colors[i].r * pal->intensity[i] / 100, 0, 255);
+ bpal[i * 4 + 1] = CLIP(pal->colors[i].g * pal->intensity[i] / 100, 0, 255);
+ bpal[i * 4 + 2] = CLIP(pal->colors[i].b * pal->intensity[i] / 100, 0, 255);
bpal[i * 4 + 3] = 100;
}
g_system->setPalette(bpal, 0, 256);