aboutsummaryrefslogtreecommitdiff
path: root/engines/scumm/palette.cpp
diff options
context:
space:
mode:
authorJohannes Schickel2011-08-27 17:41:12 +0200
committerJohannes Schickel2011-08-27 17:41:12 +0200
commitcd45d63e064c5f45e911256de75c3efef156337d (patch)
tree13a9f9ec621f5b88ad4cc3f6a2d8a69e1b96398b /engines/scumm/palette.cpp
parentf77fc07b6b1e0137cf5ef46c8530ec8b696eefe3 (diff)
downloadscummvm-rg350-cd45d63e064c5f45e911256de75c3efef156337d.tar.gz
scummvm-rg350-cd45d63e064c5f45e911256de75c3efef156337d.tar.bz2
scummvm-rg350-cd45d63e064c5f45e911256de75c3efef156337d.zip
SCUMM: Added some comments about special colors in Indy4 Amiga.
Diffstat (limited to 'engines/scumm/palette.cpp')
-rw-r--r--engines/scumm/palette.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/engines/scumm/palette.cpp b/engines/scumm/palette.cpp
index 4d53b2ec74..9977436dc6 100644
--- a/engines/scumm/palette.cpp
+++ b/engines/scumm/palette.cpp
@@ -382,6 +382,9 @@ void ScummEngine::setAmigaPaletteFromPtr(const byte *ptr) {
_amigaFirstUsedColor = 80;
for (; _amigaFirstUsedColor < 256; ++_amigaFirstUsedColor) {
+ // We look for the first used color here. If all color components are
+ // >= 252 the color seems to be unused. Check remapPaletteColor for
+ // the same behavior.
if (ptr[_amigaFirstUsedColor * 3 + 0] <= 251
|| ptr[_amigaFirstUsedColor * 3 + 1] <= 251
|| ptr[_amigaFirstUsedColor * 3 + 2] <= 251)
@@ -408,6 +411,10 @@ void ScummEngine::setAmigaPaletteFromPtr(const byte *ptr) {
_roomPalette[i] = idx;
_verbPalette[i] = idx + 32;
} else {
+ // In all my tests it seems the colors 0 and 32 in
+ // _amigaPalette are in fact black. Thus 17 is probably black.
+ // For the room map the color 17 is 33 (17+16), for the verb
+ // map it is 65 (17+32).
_roomPalette[i] = 0;
_verbPalette[i] = 32;
}
@@ -418,6 +425,8 @@ void ScummEngine::setAmigaPaletteFromPtr(const byte *ptr) {
}
void ScummEngine::mapRoomPalette(int idx) {
+ // For Color 33 (which is in fact 17+16) see the special case in
+ // setAmigaPaletteFromPtr.
if (idx >= 16 && idx < 48 && idx != 33)
_roomPalette[idx] = idx - 16;
else
@@ -462,6 +471,8 @@ void ScummEngine::mapVerbPalette(int idx) {
// the original we set up the verb palette at colors [32, 63].
// The original instead used two different palettes for the verb virtual
// screen and all the rest.
+ // For Color 65 (which is in fact 17+32) see the special case in
+ // setAmigaPaletteFromPtr.
if (idx >= 48 && idx < 80 && idx != 65)
_verbPalette[idx] = idx - 16;
else
@@ -910,6 +921,8 @@ void ScummEngine::darkenPalette(int redScale, int greenScale, int blueScale, int
}
for (int i = startColor; i <= endColor; ++i) {
+ // Colors 33 (17+16) and 65 (17+32) will never get changed. For
+ // more information about these check setAmigaPaletteFromPtr.
if (i >= 16 && i < 48 && i != 33) {
remappedRoomColors = true;
_amigaPalette[(i - 16) * 3 + 0] = _currentPalette[i * 3 + 0] >> 4;
@@ -1204,6 +1217,8 @@ void ScummEngine::setPalColor(int idx, int r, int g, int b) {
}
if (_game.platform == Common::kPlatformAmiga && _game.id == GID_INDY4) {
+ // Colors 33 (17+16) and 65 (17+32) will never get changed. For
+ // more information about these check setAmigaPaletteFromPtr.
if (idx < 16 || idx >= _amigaFirstUsedColor) {
mapRoomPalette(idx);
mapVerbPalette(idx);