diff options
author | Colin Snover | 2017-09-24 01:56:04 -0500 |
---|---|---|
committer | Colin Snover | 2017-09-24 22:56:58 -0500 |
commit | f42480d7cd5f75b661acc74ad48572888af250fc (patch) | |
tree | d4b2083ad4b837a55377f21cb72c12e08f5a7a06 /engines/sci/graphics | |
parent | 817887216da95d8065eb187bd887cb08f7618736 (diff) | |
download | scummvm-rg350-f42480d7cd5f75b661acc74ad48572888af250fc.tar.gz scummvm-rg350-f42480d7cd5f75b661acc74ad48572888af250fc.tar.bz2 scummvm-rg350-f42480d7cd5f75b661acc74ad48572888af250fc.zip |
SCI32: Support palette-inverting SCI3 variant of kPalVary
This is used by RAMA in room 6201, after eating the alien fruit.
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r-- | engines/sci/graphics/palette32.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/engines/sci/graphics/palette32.cpp b/engines/sci/graphics/palette32.cpp index 4b008dd7d5..d878b8554f 100644 --- a/engines/sci/graphics/palette32.cpp +++ b/engines/sci/graphics/palette32.cpp @@ -751,7 +751,24 @@ void GfxPalette32::applyVary() { } void GfxPalette32::kernelPalVarySet(const GuiResourceId paletteId, const int16 percent, const int32 ticks, const int16 fromColor, const int16 toColor) { - const Palette palette = getPaletteFromResource(paletteId); + Palette palette; + + if (getSciVersion() == SCI_VERSION_3 && paletteId == 0xFFFF) { + palette = _currentPalette; + assert(fromColor >= 0 && fromColor < 256); + assert(toColor >= 0 && toColor < 256); + // While palette varying is normally inclusive of `toColor`, the + // palette inversion code in SSCI excludes `toColor`, and RAMA room + // 6201 requires this or else parts of the game's UI get inverted + for (int i = fromColor; i < toColor; ++i) { + palette.colors[i].r = ~palette.colors[i].r; + palette.colors[i].g = ~palette.colors[i].g; + palette.colors[i].b = ~palette.colors[i].b; + } + } else { + palette = getPaletteFromResource(paletteId); + } + setVary(palette, percent, ticks, fromColor, toColor); } |