diff options
Diffstat (limited to 'engines/sci/graphics/view.cpp')
-rw-r--r-- | engines/sci/graphics/view.cpp | 28 |
1 files changed, 26 insertions, 2 deletions
diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp index a0d5b51a2b..a77bcccc52 100644 --- a/engines/sci/graphics/view.cpp +++ b/engines/sci/graphics/view.cpp @@ -172,6 +172,20 @@ void GfxView::initData(GuiResourceId resourceId) { cel->displaceX = (signed char)celData[4]; cel->displaceY = celData[5]; cel->clearKey = celData[6]; + + // HACK: Fix Ego's odd displacement in the QFG3 demo, scene 740. + // For some reason, ego jumps above the rope, so we fix his rope + // hanging view by displacing it down by 40 pixels. Fixes bug + // #3035693. + // FIXME: Remove this once we figure out why Ego jumps so high. + // Likely culprits include kInitBresen, kDoBresen and kCantBeHere. + // The scripts have the y offset that hero reaches (11) hardcoded, + // so it might be collision detection. However, since this requires + // extensive work to fix properly for very little gain, this hack + // here will suffice until the actual issue is found. + if (g_sci->getGameId() == GID_QFG3 && g_sci->isDemo() && resourceId == 39) + cel->displaceY = 98; + if (isEGA) { cel->offsetEGA = celOffset + 7; cel->offsetRLE = 0; @@ -418,10 +432,11 @@ void unpackCelData(byte *inBuffer, byte *celBitmap, byte clearColor, int pixelCo // Skip the next YYYYY pixels (i.e. transparency) if (literalPos && isMacSci11ViewData) { - // KQ6/Freddy Pharkas use byte lengths, all others use uint16 + // KQ6/Freddy Pharkas/Slater use byte lengths, all others use uint16 // The SCI devs must have realized that a max of 255 pixels wide // was not very good for 320 or 640 width games. - bool hasByteLengths = (g_sci->getGameId() == GID_KQ6 || g_sci->getGameId() == GID_FREDDYPHARKAS); + bool hasByteLengths = (g_sci->getGameId() == GID_KQ6 || g_sci->getGameId() == GID_FREDDYPHARKAS + || g_sci->getGameId() == GID_SLATER); // compression for SCI1.1+ Mac while (pixelNr < pixelCount) { @@ -837,4 +852,13 @@ void GfxView::adjustBackUpscaledCoordinates(int16 &y, int16 &x) { _screen->adjustBackUpscaledCoordinates(y, x, _sci2ScaleRes); } +byte GfxView::getColorAtCoordinate(int16 loopNo, int16 celNo, int16 x, int16 y) { + const CelInfo *celInfo = getCelInfo(loopNo, celNo); + const byte *bitmap = getBitmap(loopNo, celNo); + const int16 celWidth = celInfo->width; + + bitmap += (celWidth * y); + return bitmap[x]; +} + } // End of namespace Sci |