aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics/transitions.cpp
diff options
context:
space:
mode:
authorMatthew Hoops2011-02-17 13:13:30 -0500
committerMatthew Hoops2011-02-17 13:38:23 -0500
commit266806d8925330ec0d9e020fafffd74a2cb272e6 (patch)
treed53d8b4365d819573093fb89262947e62f98d8d7 /engines/sci/graphics/transitions.cpp
parentb5d1c669158951d4ea1633d3c10c58729d28fda5 (diff)
downloadscummvm-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.cpp20
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);
}