[Scummvm-cvs-logs] scummvm master -> a119108835c9539acf5f7e6da5e483c59e637ee5
bluegr
bluegr at gmail.com
Fri Jan 8 10:10:18 CET 2016
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
a119108835 SCI: Fix compilation
Commit: a119108835c9539acf5f7e6da5e483c59e637ee5
https://github.com/scummvm/scummvm/commit/a119108835c9539acf5f7e6da5e483c59e637ee5
Author: Filippos Karapetis (bluegr at gmail.com)
Date: 2016-01-08T11:09:29+02:00
Commit Message:
SCI: Fix compilation
Changed paths:
engines/sci/graphics/palette.cpp
engines/sci/graphics/palette32.cpp
diff --git a/engines/sci/graphics/palette.cpp b/engines/sci/graphics/palette.cpp
index 667aef4..3742a8d 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 61ca1b9..0b53eb1 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) {
More information about the Scummvm-git-logs
mailing list