Patch #591581 to fix #558711. Please check SMALL_HEADER games to make

sure this doesn't cause any sideeffects.

svn-id: r4718
This commit is contained in:
Paweł Kołodziejski 2002-08-08 11:14:45 +00:00
parent a92a750f48
commit 9409960e59
2 changed files with 16 additions and 9 deletions

View File

@ -1922,8 +1922,8 @@ void Scumm::o5_roomOps()
b = getVarOrDirectWord(0x40);
}
checkRange(256, 0, a, "o5_roomOps: 2: Illegal room color slot (%d)");
_shadowPalette[a] = b;
// _fullRedraw = 1;
_shadowPalette[b] = a;
setDirtyColors(b, b);
} else {
a = getVarOrDirectWord(0x80);
b = getVarOrDirectWord(0x40);

View File

@ -1381,19 +1381,26 @@ void Scumm::updatePalette() {
int first = _palDirtyMin;
int num = _palDirtyMax - first + 1;
int i;
byte *data = _currentPalette + first * 3;
byte palette_colors[1024],*p = palette_colors;
// Sam & Max film noir mode
if (_gameId == GID_SAMNMAX && readVar(0x8000))
desaturatePalette();
for (i = 0; i != num; i++, data += 3, p+=4) {
p[0] = data[0];
p[1] = data[1];
p[2] = data[2];
p[3] = 0;
for (i = _palDirtyMin; i <= _palDirtyMax; i++) {
byte *data;
if (_features & GF_SMALL_HEADER)
data = _currentPalette + _shadowPalette[i] * 3;
else
data = _currentPalette + i * 3;
*p++ = data[0];
*p++ = data[1];
*p++ = data[2];
*p++ = 0;
}
_system->set_palette(palette_colors, first, num);