aboutsummaryrefslogtreecommitdiff
path: root/engines/wintermute
diff options
context:
space:
mode:
authorWillem Jan Palenstijn2013-08-25 23:33:02 +0200
committerWillem Jan Palenstijn2013-08-25 23:36:53 +0200
commit2141ad285e0200f4773726a13504f960e382f13e (patch)
tree32fbca0b5915c19ce624e9b7650002e4dd9f426f /engines/wintermute
parente9cbda135bbc822009ff311cad6e420fb23cff82 (diff)
downloadscummvm-rg350-2141ad285e0200f4773726a13504f960e382f13e.tar.gz
scummvm-rg350-2141ad285e0200f4773726a13504f960e382f13e.tar.bz2
scummvm-rg350-2141ad285e0200f4773726a13504f960e382f13e.zip
WINTERMUTE: Fix colormod with alpha blending
Now apply colormod only to the src color instead of to the dst. The original code did this inconsistently depending on if the colormod was 0 or not.
Diffstat (limited to 'engines/wintermute')
-rw-r--r--engines/wintermute/graphics/transparent_surface.cpp12
1 files changed, 6 insertions, 6 deletions
diff --git a/engines/wintermute/graphics/transparent_surface.cpp b/engines/wintermute/graphics/transparent_surface.cpp
index 00a3db83fd..cd200354f7 100644
--- a/engines/wintermute/graphics/transparent_surface.cpp
+++ b/engines/wintermute/graphics/transparent_surface.cpp
@@ -468,21 +468,21 @@ Common::Rect TransparentSurface::blit(Graphics::Surface &target, int posX, int p
outg = ((o_pix >> gShiftTarget) & 0xff) * (255 - a);
outr = ((o_pix >> rShiftTarget) & 0xff) * (255 - a);
if (cb == 0)
- outb = 0;
+ outb = outb >> 8;
else if (cb != 255)
- outb = ((outb + b * a) * cb) >> 16;
+ outb = ((outb<<8) + b * a * cb) >> 16;
else
outb = (outb + b * a) >> 8;
if (cg == 0)
- outg = 0;
+ outg = outg >> 8;
else if (cg != 255)
- outg = ((outg + g * a) * cg) >> 16;
+ outg = ((outg<<8) + g * a * cg) >> 16;
else
outg = (outg + g * a) >> 8;
if (cr == 0)
- outr = 0;
+ outr = outr >> 8;
else if (cr != 255)
- outr = ((outr + r * a) * cr) >> 16;
+ outr = ((outr<<8) + r * a * cr) >> 16;
else
outr = (outr + r * a) >> 8;
out[aIndex] = outa;