Add patch from cyx for:

1094340 - COMI: Frightening the gravedigger, he goes white.
905833 - COMI: Palette in Theater controls

svn-id: r18211
This commit is contained in:
Travis Howell 2005-05-21 15:45:09 +00:00
parent 30408308bc
commit 0b1094ef04
3 changed files with 19 additions and 6 deletions

View File

@ -269,7 +269,7 @@ void ScummEngine::setPaletteFromPtr(const byte *ptr, int numcolor) {
}
}
if (_heversion >= 90) {
if (_heversion >= 90 || _version == 8) {
memcpy(_darkenPalette, _currentPalette, 768);
}
@ -674,7 +674,7 @@ void ScummEngine::darkenPalette(int redScale, int greenScale, int blueScale, int
const byte *palptr;
int color, idx, j;
if (_heversion >= 90) {
if (_heversion >= 90 || _version == 8) {
palptr = _darkenPalette;
} else {
palptr = getPalettePtr(_curPalIndex, _roomResource);
@ -737,7 +737,7 @@ void ScummEngine_v8::desaturatePalette(int hueScale, int satScale, int lightScal
byte *cur;
int j;
cptr = getPalettePtr(_curPalIndex, _roomResource) + startColor * 3;
cptr = _darkenPalette + startColor * 3;
cur = _currentPalette + startColor * 3;
for (j = startColor; j <= endColor; j++) {
@ -809,7 +809,9 @@ int ScummEngine::remapPaletteColor(int r, int g, int b, int threshold) {
int i;
int ar, ag, ab;
uint sum, bestsum, bestitem = 0;
byte *pal = _currentPalette;
int startColor = (_version == 8) ? 24 : 1;
byte *pal = _currentPalette + startColor * 3;
if (r > 255)
r = 255;
@ -824,7 +826,7 @@ int ScummEngine::remapPaletteColor(int r, int g, int b, int threshold) {
g &= ~3;
b &= ~3;
for (i = 0; i < 256; i++, pal += 3) {
for (i = startColor; i < 256; i++, pal += 3) {
ar = pal[0] & ~3;
ag = pal[1] & ~3;
ab = pal[2] & ~3;
@ -901,6 +903,11 @@ void ScummEngine::setPalColor(int idx, int r, int g, int b) {
_currentPalette[idx * 3 + 0] = r;
_currentPalette[idx * 3 + 1] = g;
_currentPalette[idx * 3 + 2] = b;
if (_version == 8) {
_darkenPalette[idx * 3 + 0] = r;
_darkenPalette[idx * 3 + 1] = g;
_darkenPalette[idx * 3 + 2] = b;
}
setDirtyColors(idx, idx);
}

View File

@ -605,6 +605,7 @@ void ScummEngine::saveOrLoad(Serializer *s, uint32 savegameVersion) {
MK_OBSOLETE(ScummEngine, gdi._transparentColor, sleByte, VER(8), VER(50)),
MKARRAY(ScummEngine, _currentPalette[0], sleByte, 768, VER(8)),
MKARRAY(ScummEngine, _darkenPalette[0], sleByte, 768, VER(53)),
// Sam & Max specific palette replaced by _shadowPalette now.
MK_OBSOLETE_ARRAY(ScummEngine, _proc_special_palette[0], sleByte, 256, VER(8), VER(33)),
@ -915,6 +916,11 @@ void ScummEngine::saveOrLoad(Serializer *s, uint32 savegameVersion) {
s->saveLoadArrayOf(_palManipPalette, 0x300, 1, sleByte);
s->saveLoadArrayOf(_palManipIntermediatePal, 0x600, 1, sleByte);
}
// darkenPalette was not saved before V53
if (s->isLoading() && savegameVersion < VER(53)) {
memcpy(_darkenPalette, _currentPalette, 768);
}
//

View File

@ -45,7 +45,7 @@ namespace Scumm {
* only saves/loads those which are valid for the version of the savegame
* which is being loaded/saved currently.
*/
#define CURRENT_VER 52
#define CURRENT_VER 53
/**
* An auxillary macro, used to specify savegame versions. We use this instead