diff options
Diffstat (limited to 'engines/sci/graphics')
-rw-r--r-- | engines/sci/graphics/palette.cpp | 4 | ||||
-rw-r--r-- | engines/sci/graphics/palette.h | 2 | ||||
-rw-r--r-- | engines/sci/graphics/screen.cpp | 14 | ||||
-rw-r--r-- | engines/sci/graphics/screen.h | 3 |
4 files changed, 21 insertions, 2 deletions
diff --git a/engines/sci/graphics/palette.cpp b/engines/sci/graphics/palette.cpp index 7e9dc0ed31..957199f8b9 100644 --- a/engines/sci/graphics/palette.cpp +++ b/engines/sci/graphics/palette.cpp @@ -498,6 +498,10 @@ void GfxPalette::kernelAssertPalette(GuiResourceId resourceId) { } } +void GfxPalette::kernelSyncScreenPalette() { + _screen->getPalette(&_sysPalette); +} + // palVary // init - only does, if palVaryOn == false // target, start, new palette allocation diff --git a/engines/sci/graphics/palette.h b/engines/sci/graphics/palette.h index 1fa8c16d26..6af1d5a490 100644 --- a/engines/sci/graphics/palette.h +++ b/engines/sci/graphics/palette.h @@ -65,6 +65,8 @@ public: void kernelAnimateSet(); void kernelAssertPalette(GuiResourceId resourceId); + void kernelSyncScreenPalette(); + bool kernelPalVaryInit(GuiResourceId resourceId, uint16 ticks, uint16 stepStop, uint16 direction); int16 kernelPalVaryReverse(int16 ticks, uint16 stepStop, int16 direction); int16 kernelPalVaryGetCurrentStep(); diff --git a/engines/sci/graphics/screen.cpp b/engines/sci/graphics/screen.cpp index 1d3a4ea1f7..488bb83ab3 100644 --- a/engines/sci/graphics/screen.cpp +++ b/engines/sci/graphics/screen.cpp @@ -499,7 +499,19 @@ void GfxScreen::bitsRestoreDisplayScreen(Common::Rect rect, byte *&memoryPtr) { } } -void GfxScreen::setPalette(Palette*pal) { +void GfxScreen::getPalette(Palette *pal) { + // just copy palette to system + byte bpal[4 * 256]; + // Get current palette, update it and put back + g_system->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]; + } +} + +void GfxScreen::setPalette(Palette *pal) { // just copy palette to system byte bpal[4 * 256]; // Get current palette, update it and put back diff --git a/engines/sci/graphics/screen.h b/engines/sci/graphics/screen.h index 900c338bb2..f1e3d028a8 100644 --- a/engines/sci/graphics/screen.h +++ b/engines/sci/graphics/screen.h @@ -106,7 +106,8 @@ public: void bitsGetRect(byte *memoryPtr, Common::Rect *destRect); void bitsRestore(byte *memoryPtr); - void setPalette(Palette*pal); + void getPalette(Palette *pal); + void setPalette(Palette *pal); void setVerticalShakePos(uint16 shakePos); |