diff options
author | Colin Snover | 2017-07-13 21:06:24 -0500 |
---|---|---|
committer | Colin Snover | 2017-07-13 21:31:21 -0500 |
commit | bbad7ada1b88c18f89590119bccc0ae1bd70b04b (patch) | |
tree | bb44f918e578e3751d4054cf207b97e9f441d3ff | |
parent | 7543bd444d46b2a8d4a2c79967c0a8d45a0874d1 (diff) | |
download | scummvm-rg350-bbad7ada1b88c18f89590119bccc0ae1bd70b04b.tar.gz scummvm-rg350-bbad7ada1b88c18f89590119bccc0ae1bd70b04b.tar.bz2 scummvm-rg350-bbad7ada1b88c18f89590119bccc0ae1bd70b04b.zip |
SCI32: Ignore chest view palette in Phantasmagoria
This fixes the 3-frame glitch that was also present in the
original game when moving in the chapel from room 6500 to 6400 in
chapter 7.
Fixes Trac#9788.
-rw-r--r-- | engines/sci/graphics/celobj32.cpp | 14 | ||||
-rw-r--r-- | engines/sci/graphics/palette32.cpp | 4 |
2 files changed, 16 insertions, 2 deletions
diff --git a/engines/sci/graphics/celobj32.cpp b/engines/sci/graphics/celobj32.cpp index df55ec9567..49b3b0053b 100644 --- a/engines/sci/graphics/celobj32.cpp +++ b/engines/sci/graphics/celobj32.cpp @@ -982,7 +982,19 @@ CelObjView::CelObjView(const GuiResourceId viewId, const int16 loopNo, const int error("Cel is less than 0 on loop 0"); } - _hunkPaletteOffset = data.getUint32SEAt(8); + // HACK: Phantasmagoria view 64001 contains a bad palette that overwrites + // parts of the palette used by the background picture in room 6400, causing + // the black shadows to become tan, and many of the other background colors + // to end up a little bit off. View 64001 renders fine using the existing + // palette created by the background image, so here we just ignore the + // embedded palette entirely. + if (g_sci->getGameId() == GID_PHANTASMAGORIA && + _info.type == kCelTypeView && _info.resourceId == 64001) { + + _hunkPaletteOffset = 0; + } else { + _hunkPaletteOffset = data.getUint32SEAt(8); + } _celHeaderOffset = loopHeader.getUint32SEAt(12) + (data[13] * _info.celNo); const SciSpan<const byte> celHeader = data.subspan(_celHeaderOffset); diff --git a/engines/sci/graphics/palette32.cpp b/engines/sci/graphics/palette32.cpp index fded8f00b0..0ea64d6864 100644 --- a/engines/sci/graphics/palette32.cpp +++ b/engines/sci/graphics/palette32.cpp @@ -570,7 +570,9 @@ void GfxPalette32::mergePalette(Palette &to, const Palette &from) { // cannot actually change index 255 (it is forced to white when generating // the hardware palette in updateHardware). While this causes some // additional unnecessary source palette invalidations, not doing it breaks - // some badly programmed rooms, like room 6400 in Phant1 (see Trac#9788) + // some badly programmed rooms, like room 6400 in Phant1 (see Trac#9788). + // (Note, however, that that specific glitch is fully fixed by ignoring a + // bad palette in the CelObjView constructor) for (int i = 0; i < ARRAYSIZE(to.colors); ++i) { if (from.colors[i].used) { to.colors[i] = from.colors[i]; |