diff options
author | Matthew Hoops | 2011-02-17 13:13:30 -0500 |
---|---|---|
committer | Matthew Hoops | 2011-02-17 13:38:23 -0500 |
commit | 266806d8925330ec0d9e020fafffd74a2cb272e6 (patch) | |
tree | d53d8b4365d819573093fb89262947e62f98d8d7 /engines/sci/graphics/transitions.cpp | |
parent | b5d1c669158951d4ea1633d3c10c58729d28fda5 (diff) | |
download | scummvm-rg350-266806d8925330ec0d9e020fafffd74a2cb272e6.tar.gz scummvm-rg350-266806d8925330ec0d9e020fafffd74a2cb272e6.tar.bz2 scummvm-rg350-266806d8925330ec0d9e020fafffd74a2cb272e6.zip |
SCI: Fix Mac icon bar palettes
The Mac icon bar uses a palette from the executable and keeps those entries in the palette constantly.
In addition, we're now performing gamma correction on the Mac-based colors so that they are in the same gamma as SCI. The color matching now works with this and using the same color finding as the Mac Palette Manager.
Diffstat (limited to 'engines/sci/graphics/transitions.cpp')
-rw-r--r-- | engines/sci/graphics/transitions.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/engines/sci/graphics/transitions.cpp b/engines/sci/graphics/transitions.cpp index b7b2bfb38e..e741f66fde 100644 --- a/engines/sci/graphics/transitions.cpp +++ b/engines/sci/graphics/transitions.cpp @@ -271,9 +271,8 @@ void GfxTransitions::doTransition(int16 number, bool blackoutFlag) { } void GfxTransitions::setNewPalette(bool blackoutFlag) { - if (!blackoutFlag) - if (_isVGA) - _palette->setOnScreen(); + if (!blackoutFlag && _isVGA) + _palette->setOnScreen(); } void GfxTransitions::setNewScreen(bool blackoutFlag) { @@ -312,11 +311,18 @@ void GfxTransitions::fadeOut() { g_system->getPaletteManager()->grabPalette(oldPalette, 0, 256); for (stepNr = 100; stepNr >= 0; stepNr -= 10) { - for (colorNr = 1; colorNr < tillColorNr; colorNr++){ - workPalette[colorNr * 4 + 0] = oldPalette[colorNr * 4] * stepNr / 100; - workPalette[colorNr * 4 + 1] = oldPalette[colorNr * 4 + 1] * stepNr / 100; - workPalette[colorNr * 4 + 2] = oldPalette[colorNr * 4 + 2] * stepNr / 100; + for (colorNr = 1; colorNr < tillColorNr; colorNr++) { + if (_palette->colorIsFromMacClut(colorNr)) { + workPalette[colorNr * 4 + 0] = oldPalette[colorNr * 4]; + workPalette[colorNr * 4 + 1] = oldPalette[colorNr * 4 + 1]; + workPalette[colorNr * 4 + 2] = oldPalette[colorNr * 4 + 2]; + } else { + workPalette[colorNr * 4 + 0] = oldPalette[colorNr * 4] * stepNr / 100; + workPalette[colorNr * 4 + 1] = oldPalette[colorNr * 4 + 1] * stepNr / 100; + workPalette[colorNr * 4 + 2] = oldPalette[colorNr * 4 + 2] * stepNr / 100; + } } + g_system->getPaletteManager()->setPalette(workPalette + 4, 1, 254); g_sci->getEngineState()->wait(2); } |