SCUMM: Fix an original palette issue at Stan's in MONKEY1-CD (WORKAROUND)

In the versions of Monkey Island 1 with the full 256-color inventory,
going at Stan's (when he's not there) will mess up the color of some
objects, such as the "striking yellow color" of the flower from the
forest suddenly being greenish in this room.  The VGA floppy release
doesn't appear to have this issue, so this is probably another oversight
from the v5 release.

The setPalColor() calls are taken from the Ultimate Talkie Edition.

This fix is not applied to the FM-TOWNS and Sega CD releases, since they
use a smaller palette (and I don't have them).
This commit is contained in:
Donovan Watteau 2022-09-12 17:00:04 +02:00 committed by Filippos Karapetis
parent 658e4114f4
commit d488212f7d

View file

@ -642,6 +642,27 @@ void ScummEngine_v5::o5_setClass() {
while ((_opcode = fetchScriptByte()) != 0xFF) {
cls = getVarOrDirectWord(PARAM_1);
// WORKAROUND: In the CD versions of Monkey 1 with the full 256-color
// inventory, going at Stan's messes up the color of some objects, such
// as the "striking yellow color" of the flower from the forest, the
// rubber chicken, or Guybrush's trousers. The following palette fixes
// are taken from the Ultimate Talkie Edition.
if (_game.id == GID_MONKEY && _game.platform != Common::kPlatformFMTowns &&
_game.platform != Common::kPlatformSegaCD && _roomResource == 59 &&
vm.slot[_currentScript].number == 10002 && obj == 915 && cls == 6 &&
_currentPalette[251 * 3] == 0 && _enableEnhancements &&
strcmp(_game.variant, "SE Talkie") != 0) {
// True as long as Guybrush isn't done with the voodoo recipe on the
// Sea Monkey. The Ultimate Talkie Edition probably does this as a way
// to limit this palette override to Part One; just copy this behavior.
if (_scummVars[260] < 8) {
setPalColor(245, 68, 68, 68); // gray
setPalColor(247, 252, 244, 0); // yellow
setPalColor(249, 112, 212, 0); // lime
}
setPalColor(251, 32, 84, 0); // green
}
// WORKAROUND bug #3099: Due to a script bug, the wrong opcode is
// used to test and set the state of various objects (e.g. the inside
// door (object 465) of the of the Hostel on Mars), when opening the