From a861226f203b9cdff448a3cd5642d776837fed7c Mon Sep 17 00:00:00 2001 From: Gregory Montoir Date: Fri, 2 Sep 2005 18:35:01 +0000 Subject: [PATCH] fix shape loading for cdrom version svn-id: r18737 --- kyra/kyra.cpp | 7 ++++++- kyra/screen.cpp | 3 +++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/kyra/kyra.cpp b/kyra/kyra.cpp index 79b9901c08c..3f3d616a954 100644 --- a/kyra/kyra.cpp +++ b/kyra/kyra.cpp @@ -433,7 +433,12 @@ uint8 *KyraEngine::seq_setPanPages(int pageNum, int shape) { const uint8 *data = _screen->getPagePtr(pageNum); uint16 numShapes = READ_LE_UINT16(data); if (shape < numShapes) { - uint16 offs = READ_LE_UINT16(data + 2 + shape * 2); + uint32 offs = 0; + if (_game == KYRA1CD) { + offs = READ_LE_UINT32(data + 2 + shape * 4); + } else { + offs = READ_LE_UINT16(data + 2 + shape * 2); + } if (offs != 0) { data += offs; uint16 sz = READ_LE_UINT16(data + 6); diff --git a/kyra/screen.cpp b/kyra/screen.cpp index c23fbf5885f..229009986f5 100644 --- a/kyra/screen.cpp +++ b/kyra/screen.cpp @@ -323,6 +323,9 @@ void Screen::drawShape(uint8 pageNum, const uint8 *shapeData, int x, int y, int DrawShapePlotPixelCallback plotPixel = _drawShapePlotPixelTable[ppc]; const uint8 *src = shapeData; + if (_vm->game() == KYRA1CD) { + src += 2; + } uint16 shapeFlags = READ_LE_UINT16(src); src += 2; int shapeHeight = *src++;