From 5163d6ce4e4e793491fc15416892bf7b0ed16dcc Mon Sep 17 00:00:00 2001 From: lukaslw Date: Thu, 12 Jun 2014 03:46:30 +0200 Subject: PRINCE: GraphicsMan - name changing; Options window - right mouse button handling progress --- engines/prince/graphics.cpp | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'engines/prince/graphics.cpp') 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); -- cgit v1.2.3