aboutsummaryrefslogtreecommitdiff
path: root/scumm
diff options
context:
space:
mode:
authorMax Horn2004-09-21 13:54:30 +0000
committerMax Horn2004-09-21 13:54:30 +0000
commit2f9ea12ddd9901eaacd46de7a3062375ec4439b3 (patch)
tree3bd0a7c7d723c27ba268afc5211e5fbb1ea872ff /scumm
parent5f0ec872e04dbd8c5fb491be4a56802d522d6704 (diff)
downloadscummvm-rg350-2f9ea12ddd9901eaacd46de7a3062375ec4439b3.tar.gz
scummvm-rg350-2f9ea12ddd9901eaacd46de7a3062375ec4439b3.tar.bz2
scummvm-rg350-2f9ea12ddd9901eaacd46de7a3062375ec4439b3.zip
cleanup
svn-id: r15224
Diffstat (limited to 'scumm')
-rw-r--r--scumm/actor.cpp9
-rw-r--r--scumm/akos.cpp4
-rw-r--r--scumm/palette.cpp6
-rw-r--r--scumm/script_v6.cpp2
-rw-r--r--scumm/script_v8.cpp2
-rw-r--r--scumm/scumm.h2
6 files changed, 10 insertions, 15 deletions
diff --git a/scumm/actor.cpp b/scumm/actor.cpp
index 1cc051b5ca..afe8eb6900 100644
--- a/scumm/actor.cpp
+++ b/scumm/actor.cpp
@@ -1805,12 +1805,9 @@ void Actor::remapActorPalette(int r_fact, int g_fact, int b_fact, int threshold)
// allow remap of generic palette entry?
if (!shadow_mode || akpl_color >= 16) {
- if (r_fact != 256)
- r = (r * r_fact) >> 8;
- if (g_fact != 256)
- g = (g * g_fact) >> 8;
- if (b_fact != 256)
- b = (b * b_fact) >> 8;
+ r = (r * r_fact) >> 8;
+ g = (g * g_fact) >> 8;
+ b = (b * b_fact) >> 8;
palette[i] = _vm->remapPaletteColor(r, g, b, threshold);
}
}
diff --git a/scumm/akos.cpp b/scumm/akos.cpp
index 3dd0c35fcd..f98f4892be 100644
--- a/scumm/akos.cpp
+++ b/scumm/akos.cpp
@@ -289,17 +289,15 @@ void ScummEngine::akos_decodeData(Actor *a, int frame, uint usemask) {
}
void AkosRenderer::setPalette(byte *new_palette) {
- const byte *the_akpl;
uint size, i;
- the_akpl = _vm->findResourceData(MKID('AKPL'), akos);
size = _vm->getResourceDataSize(akpl);
if (size > 256)
error("akos_setPalette: %d is too many colors", size);
for (i = 0; i < size; i++) {
- palette[i] = new_palette[i] != 0xFF ? new_palette[i] : the_akpl[i];
+ palette[i] = new_palette[i] != 0xFF ? new_palette[i] : akpl[i];
}
if (_vm->_heversion == 70 && size) {
diff --git a/scumm/palette.cpp b/scumm/palette.cpp
index 99c2a9f665..4bc80dc40e 100644
--- a/scumm/palette.cpp
+++ b/scumm/palette.cpp
@@ -436,7 +436,7 @@ void ScummEngine::setupShadowPalette(int slot, int redScale, int greenScale, int
*table++ = remapPaletteColor((curpal[0] * redScale) >> 8,
(curpal[1] * greenScale) >> 8,
(curpal[2] * blueScale) >> 8,
- (uint) - 1);
+ -1);
curpal += 3;
}
}
@@ -658,7 +658,7 @@ void ScummEngine::desaturatePalette(int hueScale, int satScale, int lightScale,
}
-int ScummEngine::remapPaletteColor(int r, int g, int b, uint threshold) {
+int ScummEngine::remapPaletteColor(int r, int g, int b, int threshold) {
int i;
int ar, ag, ab;
uint sum, bestsum, bestitem = 0;
@@ -692,7 +692,7 @@ int ScummEngine::remapPaletteColor(int r, int g, int b, uint threshold) {
}
}
- if (threshold != (uint) - 1 && bestsum > colorWeight(threshold, threshold, threshold)) {
+ if (threshold != -1 && bestsum > colorWeight(threshold, threshold, threshold)) {
// Best match exceeded threshold. Try to find an unused palette entry and
// use it for our purpose.
pal = _currentPalette + (256 - 2) * 3;
diff --git a/scumm/script_v6.cpp b/scumm/script_v6.cpp
index f20864200b..3d75a883cf 100644
--- a/scumm/script_v6.cpp
+++ b/scumm/script_v6.cpp
@@ -2705,7 +2705,7 @@ void ScummEngine_v6::o6_kernelGetFunctions() {
push(checkXYInBoxBounds(args[3], args[1], args[2]));
break;
case 206:
- push(remapPaletteColor(args[1], args[2], args[3], (uint) - 1));
+ push(remapPaletteColor(args[1], args[2], args[3], -1));
break;
case 207:
i = getObjectIndex(args[1]);
diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp
index f5f2b8e77c..8db0f72516 100644
--- a/scumm/script_v8.cpp
+++ b/scumm/script_v8.cpp
@@ -1362,7 +1362,7 @@ void ScummEngine_v8::o8_kernelGetFunctions() {
push(getKeyState(args[1]));
break;
case 0xCE: // getRGBSlot
- push(remapPaletteColor(args[1], args[2], args[3], (uint) - 1));
+ push(remapPaletteColor(args[1], args[2], args[3], -1));
break;
case 0xD7: // getBox
push(checkXYInBoxBounds(args[3], args[1], args[2]));
diff --git a/scumm/scumm.h b/scumm/scumm.h
index 9df953c4db..7463deb914 100644
--- a/scumm/scumm.h
+++ b/scumm/scumm.h
@@ -978,7 +978,7 @@ protected:
virtual void palManipulateInit(int resID, int start, int end, int time);
void palManipulate();
public:
- int remapPaletteColor(int r, int g, int b, uint threshold); // Used by Actor::remapActorPalette
+ int remapPaletteColor(int r, int g, int b, int threshold); // Used by Actor::remapActorPalette
protected:
void moveMemInPalRes(int start, int end, byte direction);
void setupShadowPalette(int slot, int redScale, int greenScale, int blueScale, int startColor, int endColor);