diff options
author | Paul Gilbert | 2013-11-05 08:19:02 -0500 |
---|---|---|
committer | Paul Gilbert | 2013-11-05 08:19:02 -0500 |
commit | 974348c77130867151a7443aad53ec18ba82fd00 (patch) | |
tree | 99422c49c1930887ed2b155caab3abda65f00fa5 /engines/tsage/graphics.cpp | |
parent | c0f9455b281d62e8089c47ddbed04135c6ed5f20 (diff) | |
download | scummvm-rg350-974348c77130867151a7443aad53ec18ba82fd00.tar.gz scummvm-rg350-974348c77130867151a7443aad53ec18ba82fd00.tar.bz2 scummvm-rg350-974348c77130867151a7443aad53ec18ba82fd00.zip |
TSAGE: Implemented R2R shadowing effect
Diffstat (limited to 'engines/tsage/graphics.cpp')
-rw-r--r-- | engines/tsage/graphics.cpp | 17 |
1 files changed, 13 insertions, 4 deletions
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; |