From a119108835c9539acf5f7e6da5e483c59e637ee5 Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Fri, 8 Jan 2016 11:09:29 +0200 Subject: SCI: Fix compilation --- engines/sci/graphics/palette.cpp | 4 ++-- engines/sci/graphics/palette32.cpp | 14 +++++++------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/engines/sci/graphics/palette.cpp b/engines/sci/graphics/palette.cpp index 667aef4f28..3742a8d2d8 100644 --- a/engines/sci/graphics/palette.cpp +++ b/engines/sci/graphics/palette.cpp @@ -977,7 +977,7 @@ void GfxPalette::palVaryProcess(int signal, bool setPalette) { _palVaryResourceId = -1; // Calculate inbetween palette - Sci::Color inbetween; + Color inbetween; int16 color; for (int colorNr = 1; colorNr < 255; colorNr++) { inbetween.used = _sysPalette.colors[colorNr].used; @@ -988,7 +988,7 @@ void GfxPalette::palVaryProcess(int signal, bool setPalette) { color = _palVaryTargetPalette.colors[colorNr].b - _palVaryOriginPalette.colors[colorNr].b; inbetween.b = ((color * _palVaryStep) / 64) + _palVaryOriginPalette.colors[colorNr].b; - if (memcmp(&inbetween, &_sysPalette.colors[colorNr], sizeof(Sci::Color))) { + if (memcmp(&inbetween, &_sysPalette.colors[colorNr], sizeof(Color))) { _sysPalette.colors[colorNr] = inbetween; _sysPaletteChanged = true; } diff --git a/engines/sci/graphics/palette32.cpp b/engines/sci/graphics/palette32.cpp index 61ca1b99c2..0b53eb1b01 100644 --- a/engines/sci/graphics/palette32.cpp +++ b/engines/sci/graphics/palette32.cpp @@ -134,15 +134,17 @@ inline void _applyCycleToPalette(PalCycler *cycler, Palette *palette) { const int16 currentCycle = cycler->currentCycle; const uint16 numColorsToCycle = cycler->numColorsToCycle; - Sci::Color tempPalette[numColorsToCycle]; - Sci::Color *sourceColor = palette->colors + cycler->fromColor; + Color *tempPalette = new Color[numColorsToCycle]; + Color *sourceColor = palette->colors + cycler->fromColor; memcpy(tempPalette, sourceColor, sizeof(tempPalette)); - Sci::Color *targetColor = sourceColor; + Color *targetColor = sourceColor; for (int numColorsCycled = 0; numColorsCycled < numColorsToCycle; ++numColorsCycled) { - Sci::Color sourceColor = *(tempPalette + ((currentCycle + numColorsCycled) % numColorsToCycle)); + Color sourceColor = *(tempPalette + ((currentCycle + numColorsCycled) % numColorsToCycle)); *(targetColor + numColorsCycled) = sourceColor; } + + delete[] tempPalette; } void GfxPalette32::applyAllCycles() { @@ -176,8 +178,6 @@ void GfxPalette32::applyCycles() { } int16 GfxPalette32::setCycle(const uint16 fromColor, const uint16 toColor, const int16 direction, const int16 delay) { - assert(fromColor <= UINT8_MAX); - assert(toColor <= UINT8_MAX); assert(fromColor < toColor); int cyclerIndex; @@ -323,7 +323,7 @@ void GfxPalette32::applyFade() { // TODO: Create and update a _nextPalette, not a single _sysPalette, to // conform to the way the actual SCI32 engine works (writes to a // next-frame-palette and then copies to the current palette on frameout) - Sci::Color *color = _sysPalette.colors; + Color *color = _sysPalette.colors; uint8 *fadeAmount = _fadeTable; for (int i = 0; i < 256; ++i) { if (*fadeAmount == 100) { -- cgit v1.2.3