diff options
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/graphics/palette.cpp | 4 | ||||
-rw-r--r-- | engines/sci/graphics/screen.cpp | 6 |
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); |