diff options
author | Johannes Schickel | 2011-02-19 21:42:34 +0100 |
---|---|---|
committer | Johannes Schickel | 2011-02-19 21:46:45 +0100 |
commit | e21d6e0d1120e917a4a019a4070ec4db5e988b9b (patch) | |
tree | 1142828b72ccf17d513c621e108d749f148fd32b /engines/sci/graphics | |
parent | 32d0e4c15fb33f80db194087850466664a43516a (diff) | |
parent | b26f30b98793c522265a3eeb48fb3b41034663c6 (diff) | |
download | scummvm-rg350-e21d6e0d1120e917a4a019a4070ec4db5e988b9b.tar.gz scummvm-rg350-e21d6e0d1120e917a4a019a4070ec4db5e988b9b.tar.bz2 scummvm-rg350-e21d6e0d1120e917a4a019a4070ec4db5e988b9b.zip |
Merge branch 'osystem-palette' of https://github.com/lordhoto/scummvm into master
Conflicts:
backends/platform/android/android.cpp
engines/sci/graphics/screen.cpp
engines/sci/graphics/transitions.cpp
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r-- | engines/sci/graphics/cursor.cpp | 2 | ||||
-rw-r--r-- | engines/sci/graphics/palette.cpp | 22 | ||||
-rw-r--r-- | engines/sci/graphics/transitions.cpp | 17 |
3 files changed, 20 insertions, 21 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/palette.cpp b/engines/sci/graphics/palette.cpp index b802f7294a..534890315c 100644 --- a/engines/sci/graphics/palette.cpp +++ b/engines/sci/graphics/palette.cpp @@ -431,7 +431,7 @@ static byte convertMacGammaToSCIGamma(int comp) { void GfxPalette::copySysPaletteToScreen() { // 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); @@ -439,14 +439,14 @@ void GfxPalette::copySysPaletteToScreen() { for (int16 i = 0; i < 256; i++) { if (colorIsFromMacClut(i)) { // If we've got a Mac CLUT, override the SCI palette with its non-black colors - bpal[i * 4 ] = convertMacGammaToSCIGamma(_macClut[i * 3 ]); - bpal[i * 4 + 1] = convertMacGammaToSCIGamma(_macClut[i * 3 + 1]); - bpal[i * 4 + 2] = convertMacGammaToSCIGamma(_macClut[i * 3 + 2]); + bpal[i * 3 ] = convertMacGammaToSCIGamma(_macClut[i * 3 ]); + bpal[i * 3 + 1] = convertMacGammaToSCIGamma(_macClut[i * 3 + 1]); + bpal[i * 3 + 2] = convertMacGammaToSCIGamma(_macClut[i * 3 + 2]); } else if (_sysPalette.colors[i].used != 0) { // Otherwise, copy to the screen - bpal[i * 4 ] = CLIP(_sysPalette.colors[i].r * _sysPalette.intensity[i] / 100, 0, 255); - bpal[i * 4 + 1] = CLIP(_sysPalette.colors[i].g * _sysPalette.intensity[i] / 100, 0, 255); - bpal[i * 4 + 2] = CLIP(_sysPalette.colors[i].b * _sysPalette.intensity[i] / 100, 0, 255); + bpal[i * 3 ] = CLIP(_sysPalette.colors[i].r * _sysPalette.intensity[i] / 100, 0, 255); + bpal[i * 3 + 1] = CLIP(_sysPalette.colors[i].g * _sysPalette.intensity[i] / 100, 0, 255); + bpal[i * 3 + 2] = CLIP(_sysPalette.colors[i].b * _sysPalette.intensity[i] / 100, 0, 255); } } @@ -609,14 +609,14 @@ void GfxPalette::kernelAssertPalette(GuiResourceId resourceId) { void GfxPalette::kernelSyncScreenPalette() { // 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++) { - _sysPalette.colors[i].r = bpal[i * 4]; - _sysPalette.colors[i].g = bpal[i * 4 + 1]; - _sysPalette.colors[i].b = bpal[i * 4 + 2]; + _sysPalette.colors[i].r = bpal[i * 3]; + _sysPalette.colors[i].g = bpal[i * 3 + 1]; + _sysPalette.colors[i].b = bpal[i * 3 + 2]; } } diff --git a/engines/sci/graphics/transitions.cpp b/engines/sci/graphics/transitions.cpp index e741f66fde..e025a2f9ab 100644 --- a/engines/sci/graphics/transitions.cpp +++ b/engines/sci/graphics/transitions.cpp @@ -302,7 +302,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,17 +313,16 @@ void GfxTransitions::fadeOut() { for (stepNr = 100; stepNr >= 0; stepNr -= 10) { 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]; + workPalette[colorNr * 3 + 0] = oldPalette[colorNr * 3]; + workPalette[colorNr * 3 + 1] = oldPalette[colorNr * 3 + 1]; + workPalette[colorNr * 3 + 2] = oldPalette[colorNr * 3 + 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; + 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); } } |