aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Kiewitz2010-07-31 13:13:46 +0000
committerMartin Kiewitz2010-07-31 13:13:46 +0000
commitfd7bc295367f848b3a8f0658f65adb6a8447710a (patch)
tree93e8643e97773b935e720655584cc88db7a7fce8
parentfec3ab7bee659f2cb2214cee2f88020b95f4fe8e (diff)
downloadscummvm-rg350-fd7bc295367f848b3a8f0658f65adb6a8447710a.tar.gz
scummvm-rg350-fd7bc295367f848b3a8f0658f65adb6a8447710a.tar.bz2
scummvm-rg350-fd7bc295367f848b3a8f0658f65adb6a8447710a.zip
SCI: adjusting inside view::getCelRect for sci0early
fixes cels being placed wrongly, sci0early didnt have the z adjust. svn-id: r51537
-rw-r--r--engines/sci/graphics/view.cpp5
-rw-r--r--engines/sci/graphics/view.h3
2 files changed, 7 insertions, 1 deletions
diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp
index 29b370aa82..38682770e4 100644
--- a/engines/sci/graphics/view.cpp
+++ b/engines/sci/graphics/view.cpp
@@ -85,6 +85,9 @@ void GfxView::initData(GuiResourceId resourceId) {
_EGAmapping = NULL;
_isSci2Hires = false;
+ // we adjust inside getCelRect for SCI0EARLY (that version didn't have the +1 when calculating bottom)
+ adjustForSci0Early = getSciVersion() == SCI_VERSION_0_EARLY ? -1 : 0;
+
// If we find an SCI1/SCI1.1 view (not amiga), we switch to that type for
// EGA. This could get used to make view patches for EGA games, where the
// new views include more colors. Users could manually adjust old views to
@@ -322,7 +325,7 @@ void GfxView::getCelRect(int16 loopNo, int16 celNo, int16 x, int16 y, int16 z, C
const CelInfo *celInfo = getCelInfo(loopNo, celNo);
outRect.left = x + celInfo->displaceX - (celInfo->width >> 1);
outRect.right = outRect.left + celInfo->width;
- outRect.bottom = y + celInfo->displaceY - z + 1;
+ outRect.bottom = y + celInfo->displaceY - z + 1 + adjustForSci0Early;
outRect.top = outRect.bottom - celInfo->height;
}
diff --git a/engines/sci/graphics/view.h b/engines/sci/graphics/view.h
index 25e110ad13..0853f2e5a6 100644
--- a/engines/sci/graphics/view.h
+++ b/engines/sci/graphics/view.h
@@ -100,6 +100,9 @@ private:
bool _isSci2Hires;
byte *_EGAmapping;
+
+ // this is set for sci0early to adjust for the getCelRect() change
+ int16 adjustForSci0Early;
};
} // End of namespace Sci