diff options
author | lukaslw | 2014-06-09 19:51:50 +0200 |
---|---|---|
committer | lukaslw | 2014-06-22 20:08:51 +0200 |
commit | ffa438afeb80f967573852bcdd3ba51f7c24ca84 (patch) | |
tree | b61776f346d9c3d5435e8f12ea92f60d09b52a10 | |
parent | 98525c1145f8b62c1e12d463754ff3777bcc7db7 (diff) | |
download | scummvm-rg350-ffa438afeb80f967573852bcdd3ba51f7c24ca84.tar.gz scummvm-rg350-ffa438afeb80f967573852bcdd3ba51f7c24ca84.tar.bz2 scummvm-rg350-ffa438afeb80f967573852bcdd3ba51f7c24ca84.zip |
PRINCE: drawTransparent() update
-rw-r--r-- | engines/prince/graphics.cpp | 22 |
1 files changed, 14 insertions, 8 deletions
diff --git a/engines/prince/graphics.cpp b/engines/prince/graphics.cpp index 593390ea56..fe7ea0bc99 100644 --- a/engines/prince/graphics.cpp +++ b/engines/prince/graphics.cpp @@ -117,17 +117,23 @@ void GraphicsMan::drawTransparentWithBlend(Graphics::Surface *screen, int32 posX } void GraphicsMan::drawTransparent(Graphics::Surface *screen, DrawNode *drawNode) { + byte *src1 = (byte *)drawNode->s->getBasePtr(0, 0); + byte *dst1 = (byte *)screen->getBasePtr(drawNode->posX, drawNode->posY); + for (int y = 0; y < drawNode->s->h; y++) { - for (int x = 0; x < drawNode->s->w; x++) { - byte pixel = *((byte*)drawNode->s->getBasePtr(x, y)); - if (pixel != 255) { - if (x + drawNode->posX < screen->w && x + drawNode->posX >= 0) { - if (y + drawNode->posY < screen->h && y + drawNode->posY >= 0) { - *((byte*)screen->getBasePtr(x + drawNode->posX, y + drawNode->posY)) = pixel; - } - } + byte *src2 = src1; + byte *dst2 = dst1; + for (int x = 0; x < drawNode->s->w; x++, src2++, dst2++) { + if (*src2 != 255) { + if (x + drawNode->posX < screen->w && x + drawNode->posX >= 0) { + if (y + drawNode->posY < screen->h && y + drawNode->posY >= 0) { + *dst2 = *src2; + } + } } } + src1 += drawNode->s->pitch; + dst1 += screen->pitch; } } |