aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics/view.cpp
diff options
context:
space:
mode:
authormd52011-02-24 16:35:19 +0200
committermd52011-02-24 16:35:19 +0200
commit8bd01f69b202e12ba656524a8e64691b5fb08414 (patch)
treef42226c1e9ce6daed7fd9010d37908d621472ca5 /engines/sci/graphics/view.cpp
parent9748e2378bdf3d2b3b8176c44b02999b4d92c50f (diff)
downloadscummvm-rg350-8bd01f69b202e12ba656524a8e64691b5fb08414.tar.gz
scummvm-rg350-8bd01f69b202e12ba656524a8e64691b5fb08414.tar.bz2
scummvm-rg350-8bd01f69b202e12ba656524a8e64691b5fb08414.zip
SCI: Added a workaround for script bug #3044500 - "SQ1EGA: Skimmer-Buyer Dialogue Portrait Backwards Anim"
Diffstat (limited to 'engines/sci/graphics/view.cpp')
-rw-r--r--engines/sci/graphics/view.cpp25
1 files changed, 25 insertions, 0 deletions
diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp
index 3c1f417740..9e8cc2ca44 100644
--- a/engines/sci/graphics/view.cpp
+++ b/engines/sci/graphics/view.cpp
@@ -313,6 +313,24 @@ int16 GfxView::getHeight(int16 loopNo, int16 celNo) const {
const CelInfo *GfxView::getCelInfo(int16 loopNo, int16 celNo) const {
assert(_loopCount);
+
+ // WORKAROUND for the EGA version of SQ1: View 506 is the portrait of the
+ // skimmer buyer in room 41 in SQ1. Loop 0 is his face looking left (shown
+ // the first time Roger arrives in Ulence Flats) and loop 1 is his face
+ // looking right (shown the second time he appears, when he makes the
+ // second offer for the skimmer). In the VGA version, the first two loops
+ // have 2 cels, a valid one (cel 0) and an invalid one (cel 1). In the EGA
+ // version, the cels in these two loops have been swapped. The game scripts,
+ // however seem to get confused by this situation, and when they check loop
+ // 1, cel 0 via kCelHigh and kCelWide regard it as invalid and never show
+ // it. We just swap the two cels here in the EGA version, making it behave
+ // like the VGA version, thus the game scripts show the correct loop. Fixes
+ // bug #3044500. Note that the same workaround is in getBitmap().
+ if (g_sci->getGameId() == GID_SQ1 && !_resMan->isVGA() && _resourceId == 506) {
+ if ((loopNo == 0 || loopNo == 1) && celNo == 0)
+ celNo = 1;
+ }
+
loopNo = CLIP<int16>(loopNo, 0, _loopCount - 1);
celNo = CLIP<int16>(celNo, 0, _loop[loopNo].celCount - 1);
return &_loop[loopNo].cel[celNo];
@@ -516,6 +534,13 @@ void GfxView::unpackCel(int16 loopNo, int16 celNo, byte *outPtr, uint32 pixelCou
}
const byte *GfxView::getBitmap(int16 loopNo, int16 celNo) {
+ // WORKAROUND for the EGA version of SQ1, same as the one in getCelInfo().
+ // Check getCelInfo() above for more information.
+ if (g_sci->getGameId() == GID_SQ1 && !_resMan->isVGA() && _resourceId == 506) {
+ if ((loopNo == 0 || loopNo == 1) && celNo == 0)
+ celNo = 1;
+ }
+
loopNo = CLIP<int16>(loopNo, 0, _loopCount -1);
celNo = CLIP<int16>(celNo, 0, _loop[loopNo].celCount - 1);
if (_loop[loopNo].cel[celNo].rawBitmap)