diff options
author | Johannes Schickel | 2011-02-13 19:54:15 +0100 |
---|---|---|
committer | Johannes Schickel | 2011-02-14 17:08:33 +0100 |
commit | bba430eebc2a0701b9cea5fd5cc57ec1da87a5c9 (patch) | |
tree | b27f5a870e908e4a185cb1ef289e43a98f402731 | |
parent | 6d2c3230505765c3d4df64a0ac6d5ed4ffd8680a (diff) | |
download | scummvm-rg350-bba430eebc2a0701b9cea5fd5cc57ec1da87a5c9.tar.gz scummvm-rg350-bba430eebc2a0701b9cea5fd5cc57ec1da87a5c9.tar.bz2 scummvm-rg350-bba430eebc2a0701b9cea5fd5cc57ec1da87a5c9.zip |
SCI: Adapt to setPalette/grabPalette RGBA->RGB change.
-rw-r--r-- | engines/sci/graphics/cursor.cpp | 2 | ||||
-rw-r--r-- | engines/sci/graphics/screen.cpp | 17 | ||||
-rw-r--r-- | engines/sci/graphics/transitions.cpp | 10 |
3 files changed, 14 insertions, 15 deletions
diff --git a/engines/sci/graphics/cursor.cpp b/engines/sci/graphics/cursor.cpp index e78d3e67cb..b085654d02 100644 --- a/engines/sci/graphics/cursor.cpp +++ b/engines/sci/graphics/cursor.cpp @@ -488,7 +488,7 @@ void GfxCursor::kernelSetMacCursor(GuiResourceId viewNum, int loopNum, int celNu uint16 hotspotX = READ_BE_UINT16(data); uint16 hotspotY = READ_BE_UINT16(data + 2); - static const byte cursorPalette[] = { 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0x00 }; + static const byte cursorPalette[] = { 0x00, 0x00, 0x00, 0xff, 0xff, 0xff }; CursorMan.replaceCursor(cursorBitmap, 16, 16, hotspotX, hotspotY, 0); CursorMan.replaceCursorPalette(cursorPalette, 1, 2); diff --git a/engines/sci/graphics/screen.cpp b/engines/sci/graphics/screen.cpp index 896ac0db22..1a17be8ec8 100644 --- a/engines/sci/graphics/screen.cpp +++ b/engines/sci/graphics/screen.cpp @@ -511,28 +511,27 @@ void GfxScreen::bitsRestoreDisplayScreen(Common::Rect rect, byte *&memoryPtr) { void GfxScreen::getPalette(Palette *pal) { // just copy palette to system - byte bpal[4 * 256]; + byte bpal[3 * 256]; // Get current palette, update it and put back g_system->getPaletteManager()->grabPalette(bpal, 0, 256); for (int16 i = 1; i < 255; i++) { - pal->colors[i].r = bpal[i * 4]; - pal->colors[i].g = bpal[i * 4 + 1]; - pal->colors[i].b = bpal[i * 4 + 2]; + pal->colors[i].r = bpal[i * 3]; + pal->colors[i].g = bpal[i * 3 + 1]; + pal->colors[i].b = bpal[i * 3 + 2]; } } void GfxScreen::setPalette(Palette *pal) { // just copy palette to system - byte bpal[4 * 256]; + byte bpal[3 * 256]; // Get current palette, update it and put back g_system->getPaletteManager()->grabPalette(bpal, 0, 256); for (int16 i = 0; i < 256; i++) { if (!pal->colors[i].used) continue; - 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; + bpal[i * 3] = CLIP(pal->colors[i].r * pal->intensity[i] / 100, 0, 255); + bpal[i * 3 + 1] = CLIP(pal->colors[i].g * pal->intensity[i] / 100, 0, 255); + bpal[i * 3 + 2] = CLIP(pal->colors[i].b * pal->intensity[i] / 100, 0, 255); } g_system->getPaletteManager()->setPalette(bpal, 0, 256); } diff --git a/engines/sci/graphics/transitions.cpp b/engines/sci/graphics/transitions.cpp index b7b2bfb38e..5e14778c0c 100644 --- a/engines/sci/graphics/transitions.cpp +++ b/engines/sci/graphics/transitions.cpp @@ -303,7 +303,7 @@ void GfxTransitions::copyRectToScreen(const Common::Rect rect, bool blackoutFlag // Note: don't do too many steps in here, otherwise cpu will crap out because of // the load void GfxTransitions::fadeOut() { - byte oldPalette[4 * 256], workPalette[4 * 256]; + byte oldPalette[3 * 256], workPalette[3 * 256]; int16 stepNr, colorNr; // Sierra did not fade in/out color 255 for sci1.1, but they used it in // several pictures (e.g. qfg3 demo/intro), so the fading looked weird @@ -313,11 +313,11 @@ void GfxTransitions::fadeOut() { 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; + workPalette[colorNr * 3 + 0] = oldPalette[colorNr * 3] * stepNr / 100; + workPalette[colorNr * 3 + 1] = oldPalette[colorNr * 3 + 1] * stepNr / 100; + workPalette[colorNr * 3 + 2] = oldPalette[colorNr * 3 + 2] * stepNr / 100; } - g_system->getPaletteManager()->setPalette(workPalette + 4, 1, 254); + g_system->getPaletteManager()->setPalette(workPalette + 3, 1, 254); g_sci->getEngineState()->wait(2); } } |