diff options
author | lukaslw | 2014-06-12 03:46:30 +0200 |
---|---|---|
committer | lukaslw | 2014-06-22 20:08:59 +0200 |
commit | 5163d6ce4e4e793491fc15416892bf7b0ed16dcc (patch) | |
tree | 010bb701f1405830f2e885aedd728dc88d62508a /engines/prince/graphics.cpp | |
parent | a9536b621fdf636fcc83550ffa34ec939cda0b60 (diff) | |
download | scummvm-rg350-5163d6ce4e4e793491fc15416892bf7b0ed16dcc.tar.gz scummvm-rg350-5163d6ce4e4e793491fc15416892bf7b0ed16dcc.tar.bz2 scummvm-rg350-5163d6ce4e4e793491fc15416892bf7b0ed16dcc.zip |
PRINCE: GraphicsMan - name changing; Options window - right mouse button handling progress
Diffstat (limited to 'engines/prince/graphics.cpp')
-rw-r--r-- | engines/prince/graphics.cpp | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/engines/prince/graphics.cpp b/engines/prince/graphics.cpp index 4f80c8cbe3..b86628009f 100644 --- a/engines/prince/graphics.cpp +++ b/engines/prince/graphics.cpp @@ -102,7 +102,28 @@ void GraphicsMan::drawTransparentSurface(Graphics::Surface *screen, int32 posX, change(); } -void GraphicsMan::drawTransparentWithBlend(Graphics::Surface *screen, int32 posX, int32 posY, const Graphics::Surface *s, int transColor) { +void GraphicsMan::drawAsShadowSurface(Graphics::Surface *screen, int32 posX, int32 posY, const Graphics::Surface *s, byte *shadowTable) { + byte *src1 = (byte *)s->getBasePtr(0, 0); + byte *dst1 = (byte *)screen->getBasePtr(posX, posY); + + for (int y = 0; y < s->h; y++) { + byte *src2 = src1; + byte *dst2 = dst1; + for (int x = 0; x < s->w; x++, src2++, dst2++) { + if (*src2 == kShadowColor) { + if (x + posX < screen->w && x + posX >= 0) { + if (y + posY < screen->h && y + posY >= 0) { + *dst2 = *(shadowTable + *dst2); + } + } + } + } + src1 += s->pitch; + dst1 += screen->pitch; + } +} + +void GraphicsMan::drawTransparentWithBlendSurface(Graphics::Surface *screen, int32 posX, int32 posY, const Graphics::Surface *s, int transColor) { byte *src1 = (byte *)s->getBasePtr(0, 0); byte *dst1 = (byte *)screen->getBasePtr(posX, posY); byte *blendTable = (byte *)malloc(256); @@ -149,7 +170,7 @@ void GraphicsMan::drawTransparentDrawNode(Graphics::Surface *screen, DrawNode *d } } -void GraphicsMan::drawMask(Graphics::Surface *screen, DrawNode *drawNode) { +void GraphicsMan::drawMaskDrawNode(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; @@ -182,7 +203,7 @@ void GraphicsMan::drawMask(Graphics::Surface *screen, DrawNode *drawNode) { } } -void GraphicsMan::drawAsShadow(Graphics::Surface *screen, DrawNode *drawNode) { +void GraphicsMan::drawAsShadowDrawNode(Graphics::Surface *screen, DrawNode *drawNode) { byte *src1 = (byte *)drawNode->s->getBasePtr(0, 0); byte *dst1 = (byte *)screen->getBasePtr(drawNode->posX, drawNode->posY); |