diff options
author | Filippos Karapetis | 2016-01-08 11:09:29 +0200 |
---|---|---|
committer | Filippos Karapetis | 2016-01-08 11:09:29 +0200 |
commit | a119108835c9539acf5f7e6da5e483c59e637ee5 (patch) | |
tree | cf3ae7e2cef3fab031a4c6fb89bf548243b60951 /engines/sci/graphics/palette32.cpp | |
parent | 7379e531c75294577b4859fceb73ae01559dae0f (diff) | |
download | scummvm-rg350-a119108835c9539acf5f7e6da5e483c59e637ee5.tar.gz scummvm-rg350-a119108835c9539acf5f7e6da5e483c59e637ee5.tar.bz2 scummvm-rg350-a119108835c9539acf5f7e6da5e483c59e637ee5.zip |
SCI: Fix compilation
Diffstat (limited to 'engines/sci/graphics/palette32.cpp')
-rw-r--r-- | engines/sci/graphics/palette32.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
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) { |