aboutsummaryrefslogtreecommitdiff
path: root/engines/sci/graphics/view.cpp
diff options
context:
space:
mode:
authorMartin Kiewitz2010-06-30 14:26:47 +0000
committerMartin Kiewitz2010-06-30 14:26:47 +0000
commit4e999c8295adeade2317d9c486b943d3fd290c2c (patch)
tree1d0aa507dbdf8cad7d731ec92e9572fbc6e1009c /engines/sci/graphics/view.cpp
parentbff3e89e48a6f819d5b23ba4cc848cbcf35aa965 (diff)
downloadscummvm-rg350-4e999c8295adeade2317d9c486b943d3fd290c2c.tar.gz
scummvm-rg350-4e999c8295adeade2317d9c486b943d3fd290c2c.tar.bz2
scummvm-rg350-4e999c8295adeade2317d9c486b943d3fd290c2c.zip
SCI: support for hires views in gk1
svn-id: r50533
Diffstat (limited to 'engines/sci/graphics/view.cpp')
-rw-r--r--engines/sci/graphics/view.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/engines/sci/graphics/view.cpp b/engines/sci/graphics/view.cpp
index 244114e866..816dad0cbb 100644
--- a/engines/sci/graphics/view.cpp
+++ b/engines/sci/graphics/view.cpp
@@ -81,6 +81,7 @@ void GfxView::initData(GuiResourceId resourceId) {
_loopCount = 0;
_embeddedPal = false;
_EGAmapping = NULL;
+ _isSci2Hires = false;
// 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
@@ -191,6 +192,7 @@ void GfxView::initData(GuiResourceId resourceId) {
assert(headerSize >= 16);
_loopCount = _resourceData[2];
assert(_loopCount);
+ _isSci2Hires = _resourceData[5] == 1 ? true : false;
palOffset = READ_SCI11ENDIAN_UINT32(_resourceData + 8);
// FIXME: After LoopCount there is another byte and its set for view 50
// within Laura Bow 2 CD, check what it means.
@@ -240,6 +242,9 @@ void GfxView::initData(GuiResourceId resourceId) {
cel->offsetEGA = 0;
cel->offsetRLE = READ_SCI11ENDIAN_UINT32(celData + 24);
cel->offsetLiteral = READ_SCI11ENDIAN_UINT32(celData + 28);
+ // GK1-hires content is actually uncompressed, we need to swap both so that we process it as such
+ if ((cel->offsetRLE) && (!cel->offsetLiteral))
+ SWAP(cel->offsetRLE, cel->offsetLiteral);
cel->rawBitmap = 0;
if (_loop[loopNo].mirrorFlag)
@@ -288,6 +293,10 @@ Palette *GfxView::getPalette() {
return _embeddedPal ? &_viewPalette : NULL;
}
+bool GfxView::isSci2Hires() {
+ return _isSci2Hires;
+}
+
void GfxView::getCelRect(int16 loopNo, int16 celNo, int16 x, int16 y, int16 z, Common::Rect &outRect) const {
const CelInfo *celInfo = getCelInfo(loopNo, celNo);
outRect.left = x + celInfo->displaceX - (celInfo->width >> 1);