aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm
diff options
context:
space:
mode:
authorJohannes Schickel2011-08-26 06:34:59 +0200
committerJohannes Schickel2011-08-26 06:35:46 +0200
commit618d01c41c9e8507408b117dfa63750975fec68b (patch)
treefb1ed5fca9581b631676dfcb922a05d38e1a14a7 /engines/scumm
parent4ea4172cbad466738836f7be8ebdcad4eabd0bb9 (diff)
downloadscummvm-rg350-618d01c41c9e8507408b117dfa63750975fec68b.tar.gz
scummvm-rg350-618d01c41c9e8507408b117dfa63750975fec68b.tar.bz2
scummvm-rg350-618d01c41c9e8507408b117dfa63750975fec68b.zip
SCUMM: Fix some range checks in Indy4 Amiga palette code.
Diffstat (limited to 'engines/scumm')
-rw-r--r--engines/scumm/palette.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp
index 930b287f00..c00a117751 100644
--- a/engines/scumm/palette.cpp
+++ b/engines/scumm/palette.cpp
@@ -889,7 +889,7 @@ void ScummEngine::darkenPalette(int redScale, int greenScale, int blueScale, int
const byte *palptr = getPalettePtr(_curPalIndex, _roomResource) + startColor * 3;
for (int i = startColor; i <= endColor; ++i) {
- if (i >= 16 && i <= 48) {
+ if (i >= 16 && i < 48) {
if (cycleFlag)
_colorUsedByCycle[i - 16] &= ~2;
else
@@ -916,7 +916,7 @@ void ScummEngine::darkenPalette(int redScale, int greenScale, int blueScale, int
}
for (int i = 0; i < 256; ++i) {
- if (i >= 16 && i <= _amigaFirstUsedColor)
+ if (i >= 16 && i < _amigaFirstUsedColor)
continue;
bool inRange = (startColor <= i && i <= endColor);
@@ -1196,7 +1196,7 @@ void ScummEngine::setPalColor(int idx, int r, int g, int b) {
}
if (_game.platform == Common::kPlatformAmiga && _game.id == GID_INDY4) {
- if (idx < 16 || idx > _amigaFirstUsedColor) {
+ if (idx < 16 || idx >= _amigaFirstUsedColor) {
mapRoomPalette(idx);
mapVerbPalette(idx);
} else if (idx >= 16 && idx < 48 && idx != 33) {
@@ -1205,7 +1205,7 @@ void ScummEngine::setPalColor(int idx, int r, int g, int b) {
_amigaPalette[(idx - 16) * 3 + 2] = _currentPalette[idx * 3 + 2] >> 4;
for (int i = 0; i < 256; ++i) {
- if (i >= 16 && i <= _amigaFirstUsedColor)
+ if (i >= 16 && i < _amigaFirstUsedColor)
continue;
if (idx - 16 == _roomPalette[i])
@@ -1217,7 +1217,7 @@ void ScummEngine::setPalColor(int idx, int r, int g, int b) {
_amigaPalette[(idx - 16) * 3 + 2] = _currentPalette[idx * 3 + 2] >> 4;
for (int i = 0; i < 256; ++i) {
- if (i >= 16 && i <= _amigaFirstUsedColor)
+ if (i >= 16 && i < _amigaFirstUsedColor)
continue;
if (idx - 16 == _verbPalette[i])