diff options
author | lukaslw | 2014-06-09 20:19:15 +0200 |
---|---|---|
committer | lukaslw | 2014-06-22 20:08:52 +0200 |
commit | 8f98d80f4eec40e93977fda2315f09a59a722960 (patch) | |
tree | 3e5ee22077d8dcf9967682c4835fe47ecb82be9f | |
parent | 26db9ae9f57f90fa67bd1b406e5b14696229e1fc (diff) | |
download | scummvm-rg350-8f98d80f4eec40e93977fda2315f09a59a722960.tar.gz scummvm-rg350-8f98d80f4eec40e93977fda2315f09a59a722960.tar.bz2 scummvm-rg350-8f98d80f4eec40e93977fda2315f09a59a722960.zip |
PRINCE: drawMask() update
-rw-r--r-- | engines/prince/graphics.cpp | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/engines/prince/graphics.cpp b/engines/prince/graphics.cpp index 8b07796538..2ca6370df4 100644 --- a/engines/prince/graphics.cpp +++ b/engines/prince/graphics.cpp @@ -138,18 +138,22 @@ void GraphicsMan::drawTransparent(Graphics::Surface *screen, DrawNode *drawNode) } void GraphicsMan::drawMask(Graphics::Surface *screen, DrawNode *drawNode) { + byte *src1 = (byte *)drawNode->originalRoomSurface->getBasePtr(drawNode->posX, drawNode->posY); + byte *dst1 = (byte *)screen->getBasePtr(drawNode->posX, drawNode->posY); int maskWidth = drawNode->width >> 3; int maskPostion = 0; int maskCounter = 128; + for (int y = 0; y < drawNode->height; y++) { + byte *src2 = src1; + byte *dst2 = dst1; int tempMaskPostion = maskPostion; - for (int x = 0; x < drawNode->width; x++) { + for (int x = 0; x < drawNode->width; x++, src2++, dst2++) { if (x + drawNode->posX < screen->w && x + drawNode->posX >= 0) { if (y + drawNode->posY < screen->h && y + drawNode->posY >= 0) { if ((drawNode->data[tempMaskPostion] & maskCounter) != 0) { - byte orgPixel = *((byte*)drawNode->originalRoomSurface->getBasePtr(x + drawNode->posX, y + drawNode->posY)); - *((byte*)screen->getBasePtr(x + drawNode->posX, y + drawNode->posY)) = orgPixel; - //*((byte*)screen->getBasePtr(x + drawNode->posX, y + drawNode->posY)) = 0; // for debugging + *dst2 = *src2; + //*dst2 = 0; // for debugging } } } @@ -159,6 +163,8 @@ void GraphicsMan::drawMask(Graphics::Surface *screen, DrawNode *drawNode) { tempMaskPostion++; } } + src1 += drawNode->originalRoomSurface->pitch; + dst1 += screen->pitch; maskPostion += maskWidth; maskCounter = 128; } |