diff options
Diffstat (limited to 'engines')
-rw-r--r-- | engines/sci/graphics/frameout.cpp | 6 | ||||
-rw-r--r-- | engines/sci/graphics/picture.cpp | 7 | ||||
-rw-r--r-- | engines/sci/graphics/picture.h | 1 |
3 files changed, 11 insertions, 3 deletions
diff --git a/engines/sci/graphics/frameout.cpp b/engines/sci/graphics/frameout.cpp index c6956e97ca..bbfbd37ebe 100644 --- a/engines/sci/graphics/frameout.cpp +++ b/engines/sci/graphics/frameout.cpp @@ -218,12 +218,12 @@ void GfxFrameout::kernelFrameout() { if (planePicture) { // Show base picture - planePicture->drawSci32Vga(0, planePicture->getSci32celX(0), planePicture->getSci32celY(0), planePictureMirrored); +// planePicture->drawSci32Vga(0, planePicture->getSci32celX(0), planePicture->getSci32celY(0), planePictureMirrored); // Allocate memory for picture cels pictureCels = (FrameoutEntry *)malloc(planePicture->getSci32celCount() * sizeof(FrameoutEntry)); // Add following cels to the itemlist FrameoutEntry *picEntry = pictureCels; - for (int pictureCelNr = 1; pictureCelNr < planePictureCels; pictureCelNr++) { + for (int pictureCelNr = 0; pictureCelNr < planePictureCels; pictureCelNr++) { picEntry->celNo = pictureCelNr; picEntry->object = NULL_REG; picEntry->y = planePicture->getSci32celY(pictureCelNr); @@ -233,7 +233,7 @@ void GfxFrameout::kernelFrameout() { if (_screen->getWidth() > 320) celHeight = celHeight / 2; - picEntry->priority = picEntry->y + celHeight; + picEntry->priority = planePicture->getSci32celPriority(pictureCelNr); // picEntry->y + celHeight; picEntry->y = ((picEntry->y * _screen->getHeight()) / planeResY); picEntry->x = ((picEntry->x * _screen->getWidth()) / planeResX); diff --git a/engines/sci/graphics/picture.cpp b/engines/sci/graphics/picture.cpp index 2b4ceac97b..b1ba656ccd 100644 --- a/engines/sci/graphics/picture.cpp +++ b/engines/sci/graphics/picture.cpp @@ -145,6 +145,13 @@ int16 GfxPicture::getSci32celX(int16 celNo) { return READ_LE_UINT16(inbuffer + cel_headerPos + 38); } +int16 GfxPicture::getSci32celPriority(int16 celNo) { + byte *inbuffer = _resource->data; + int header_size = READ_LE_UINT16(inbuffer); + int cel_headerPos = header_size + 42 * celNo; + return READ_LE_UINT16(inbuffer + cel_headerPos + 36); +} + int16 GfxPicture::getSci32celHeight(int16 celNo) { byte *inbuffer = _resource->data; int header_size = READ_LE_UINT16(inbuffer); diff --git a/engines/sci/graphics/picture.h b/engines/sci/graphics/picture.h index 571d291442..e684fc6fe1 100644 --- a/engines/sci/graphics/picture.h +++ b/engines/sci/graphics/picture.h @@ -58,6 +58,7 @@ public: int16 getSci32celCount(); int16 getSci32celY(int16 celNo); int16 getSci32celX(int16 celNo); + int16 getSci32celPriority(int16 celNo); int16 getSci32celHeight(int16 celNo); void drawSci32Vga(int16 celNo, int16 callerX, int16 callerY, bool mirrored); #endif |