From 974348c77130867151a7443aad53ec18ba82fd00 Mon Sep 17 00:00:00 2001 From: Paul Gilbert Date: Tue, 5 Nov 2013 08:19:02 -0500 Subject: TSAGE: Implemented R2R shadowing effect --- engines/tsage/graphics.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) (limited to 'engines/tsage/graphics.cpp') diff --git a/engines/tsage/graphics.cpp b/engines/tsage/graphics.cpp index 32810626e7..f00dcf0378 100644 --- a/engines/tsage/graphics.cpp +++ b/engines/tsage/graphics.cpp @@ -559,9 +559,11 @@ static GfxSurface ResizeSurface(GfxSurface &src, int xSize, int ySize, int trans } /** - * Copys an area from one GfxSurface to another + * Copys an area from one GfxSurface to another. + * */ -void GfxSurface::copyFrom(GfxSurface &src, Rect srcBounds, Rect destBounds, Region *priorityRegion) { +void GfxSurface::copyFrom(GfxSurface &src, Rect srcBounds, Rect destBounds, + Region *priorityRegion, const byte *shadowMap) { GfxSurface srcImage; if (srcBounds.isEmpty()) return; @@ -631,8 +633,15 @@ void GfxSurface::copyFrom(GfxSurface &src, Rect srcBounds, Rect destBounds, Regi if (!priorityRegion || !priorityRegion->contains(Common::Point( xp + g_globals->_sceneManager._scene->_sceneBounds.left, destBounds.top + y + g_globals->_sceneManager._scene->_sceneBounds.top))) { - if (*tempSrc != src._transColor) - *tempDest = *tempSrc; + if (*tempSrc != src._transColor) { + if (shadowMap) { + // Using a shadow map, so translate the dest pixel using the mapping array + *tempDest = shadowMap[*tempDest]; + } else { + // Otherwise, it's a standard pixel copy + *tempDest = *tempSrc; + } + } } ++tempSrc; ++tempDest; -- cgit v1.2.3