aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorlukaslw2014-06-09 20:03:33 +0200
committerlukaslw2014-06-22 20:08:51 +0200
commit26db9ae9f57f90fa67bd1b406e5b14696229e1fc (patch)
tree9bbc4a88c9fb8085c7ae639eff5d6f5dd0e48192 /engines
parentffa438afeb80f967573852bcdd3ba51f7c24ca84 (diff)
downloadscummvm-rg350-26db9ae9f57f90fa67bd1b406e5b14696229e1fc.tar.gz
scummvm-rg350-26db9ae9f57f90fa67bd1b406e5b14696229e1fc.tar.bz2
scummvm-rg350-26db9ae9f57f90fa67bd1b406e5b14696229e1fc.zip
PRINCE: drawAsShadow() update
Diffstat (limited to 'engines')
-rw-r--r--engines/prince/graphics.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/engines/prince/graphics.cpp b/engines/prince/graphics.cpp
index fe7ea0bc99..8b07796538 100644
--- a/engines/prince/graphics.cpp
+++ b/engines/prince/graphics.cpp
@@ -165,18 +165,23 @@ void GraphicsMan::drawMask(Graphics::Surface *screen, DrawNode *drawNode) {
}
void GraphicsMan::drawAsShadow(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 == kShadowColor) {
+ byte *src2 = src1;
+ byte *dst2 = dst1;
+ for (int x = 0; x < drawNode->s->w; x++, src2++, dst2++) {
+ if (*src2 == kShadowColor) {
if (x + drawNode->posX < screen->w && x + drawNode->posX >= 0) {
if (y + drawNode->posY < screen->h && y + drawNode->posY >= 0) {
- byte *background = (byte *)screen->getBasePtr(x + drawNode->posX, y + drawNode->posY);
- *background = *(drawNode->data + *background);
+ *dst2 = *(drawNode->data + *dst2);
}
}
}
}
+ src1 += drawNode->s->pitch;
+ dst1 += screen->pitch;
}
}