diff options
author | lukaslw | 2014-05-31 20:57:46 +0200 |
---|---|---|
committer | lukaslw | 2014-06-22 20:08:27 +0200 |
commit | 7874a4e7820378c8ca260f646e0ee8ee84bf6b9c (patch) | |
tree | 95b2a7c5243206badba08a7eca6f221acd1d715f /engines/prince/graphics.cpp | |
parent | dab83cc3ebe13ec604ba117ad163bc8a005bc7b2 (diff) | |
download | scummvm-rg350-7874a4e7820378c8ca260f646e0ee8ee84bf6b9c.tar.gz scummvm-rg350-7874a4e7820378c8ca260f646e0ee8ee84bf6b9c.tar.bz2 scummvm-rg350-7874a4e7820378c8ca260f646e0ee8ee84bf6b9c.zip |
PRINCE: drawMask progress, changes in spriteCheck
Diffstat (limited to 'engines/prince/graphics.cpp')
-rw-r--r-- | engines/prince/graphics.cpp | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/engines/prince/graphics.cpp b/engines/prince/graphics.cpp index 93b558a03b..4f55b5a23e 100644 --- a/engines/prince/graphics.cpp +++ b/engines/prince/graphics.cpp @@ -90,15 +90,28 @@ void GraphicsMan::drawTransparent(int32 posX, int32 posY, const Graphics::Surfac } void GraphicsMan::drawMask(int32 posX, int32 posY, int32 width, int32 height, byte *maskData, const Graphics::Surface *originalRoomSurface) { + int maskWidth = width >> 3; + int maskPostion = 0; + int maskCounter = 128; for (int y = 0; y < height; y++) { + int tempMaskPostion = maskPostion; for (int x = 0; x < width; x++) { if (x + posX < _frontScreen->w && x + posX >= 0) { if (y + posY < _frontScreen->h && y + posY >= 0) { - byte orgPixel = *((byte*)originalRoomSurface->getBasePtr(x + posX, y + posY)); - *((byte*)_frontScreen->getBasePtr(x + posX, y + posY)) = orgPixel; + if ((maskData[tempMaskPostion] & maskCounter) != 0) { + byte orgPixel = *((byte*)originalRoomSurface->getBasePtr(x + posX, y + posY)); + *((byte*)_frontScreen->getBasePtr(x + posX, y + posY)) = orgPixel; + } + maskCounter >>= 1; + if (maskCounter == 0) { + maskCounter = 128; + tempMaskPostion++; + } } } } + maskPostion += maskWidth; + maskCounter = 128; } change(); } |