From 0fe067ba4a2d0eea71ad91eaad1d537f1b42e97c Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Wed, 12 Jun 2013 22:43:54 -0400 Subject: VOYEUR: Lock screen background now correctly showing --- engines/voyeur/files.cpp | 2 ++ engines/voyeur/graphics.cpp | 26 +++++++++++++++++++++++++- engines/voyeur/voyeur.cpp | 1 + 3 files changed, 28 insertions(+), 1 deletion(-) diff --git a/engines/voyeur/files.cpp b/engines/voyeur/files.cpp index b2f4d4f58c..74da77dda1 100644 --- a/engines/voyeur/files.cpp +++ b/engines/voyeur/files.cpp @@ -295,6 +295,8 @@ PictureResource *BoltFile::getPictureResource(uint32 id) { if ((int32)id == -1) return NULL; + if (id & 0xffff) + id <<= 16; return getBoltEntry(id)._picResource; } diff --git a/engines/voyeur/graphics.cpp b/engines/voyeur/graphics.cpp index 9f547c65ca..ace4b35718 100644 --- a/engines/voyeur/graphics.cpp +++ b/engines/voyeur/graphics.cpp @@ -344,7 +344,31 @@ void GraphicsManager::sDrawPic(DisplayResource *srcDisplay, DisplayResource *des // loc_2615E if (srcFlags & 2) { - error("TODO: sDrawPic"); + srcP = srcImgData + srcOffset; + + if (destFlags & 8) { + error("TODO: sDrawPic"); + } else { + // loc_25773 + // Copy from screen to surface with transparency + destP = destImgData + screenOffset; + srcP = (byte *)_screenSurface.pixels + srcOffset; + + if (srcFlags & 2) { + for (int yp = 0; yp < height1; ++yp) { + for (int xp = 0; xp < width2; ++xp, ++destP) { + byte srcPixel = *srcP++; + if (srcPixel) + *destP = srcPixel; + } + + destP += widthDiff2; + srcP += widthDiff; + } + } else { + error("TODO: sDrawPic"); + } + } } else { if (srcFlags & 0x100) { srcP = srcImgData; diff --git a/engines/voyeur/voyeur.cpp b/engines/voyeur/voyeur.cpp index c2e99076af..83e5d80802 100644 --- a/engines/voyeur/voyeur.cpp +++ b/engines/voyeur/voyeur.cpp @@ -214,6 +214,7 @@ bool VoyeurEngine::doLock() { Common::String password = lock._password; srcPic = _bVoy->getPictureResource(0x702); + assert(srcPic); // Get the mappings of keys on the keypad keyData = _bVoy->memberAddr(0x705); -- cgit v1.2.3