[Scummvm-cvs-logs] scummvm master -> 2141ad285e0200f4773726a13504f960e382f13e

wjp wjp at usecode.org
Sun Aug 25 23:38:31 CEST 2013


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
2141ad285e WINTERMUTE: Fix colormod with alpha blending


Commit: 2141ad285e0200f4773726a13504f960e382f13e
    https://github.com/scummvm/scummvm/commit/2141ad285e0200f4773726a13504f960e382f13e
Author: Willem Jan Palenstijn (wjp at usecode.org)
Date: 2013-08-25T14:36:53-07:00

Commit Message:
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.

Changed paths:
    engines/wintermute/graphics/transparent_surface.cpp



diff --git a/engines/wintermute/graphics/transparent_surface.cpp b/engines/wintermute/graphics/transparent_surface.cpp
index 00a3db8..cd20035 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;






More information about the Scummvm-git-logs mailing list