[Scummvm-cvs-logs] SF.net SVN: scummvm:[36175] scummvm/branches/branch-0-13-0

marcus_c at users.sourceforge.net marcus_c at users.sourceforge.net
Sun Feb 1 15:29:47 CET 2009


Revision: 36175
          http://scummvm.svn.sourceforge.net/scummvm/?rev=36175&view=rev
Author:   marcus_c
Date:     2009-02-01 14:29:47 +0000 (Sun, 01 Feb 2009)

Log Message:
-----------
Fixed alpha blending in the UI dialogs by adding alpha
computation to the blendPixelPtr() function.  To minimize
impact, pre-multiplied alpha is assumed, meaning that the
blending of the R, G and B components is the same both
with and without hardware alpha.

Modified Paths:
--------------
    scummvm/branches/branch-0-13-0/backends/platform/dc/display.cpp
    scummvm/branches/branch-0-13-0/graphics/VectorRendererSpec.cpp

Modified: scummvm/branches/branch-0-13-0/backends/platform/dc/display.cpp
===================================================================
--- scummvm/branches/branch-0-13-0/backends/platform/dc/display.cpp	2009-02-01 12:33:11 UTC (rev 36174)
+++ scummvm/branches/branch-0-13-0/backends/platform/dc/display.cpp	2009-02-01 14:29:47 UTC (rev 36175)
@@ -392,7 +392,7 @@
       TA_CMD_POLYGON_STRIPLENGTH_2|TA_CMD_POLYGON_PACKED_COLOUR|TA_CMD_POLYGON_TEXTURED;
     mypoly.mode1 = TA_POLYMODE1_Z_ALWAYS|TA_POLYMODE1_NO_Z_UPDATE;
     mypoly.mode2 =
-      TA_POLYMODE2_BLEND_SRC_ALPHA|TA_POLYMODE2_BLEND_DST_INVALPHA|
+      TA_POLYMODE2_BLEND_SRC/*_ALPHA*/|TA_POLYMODE2_BLEND_DST_INVALPHA|
       TA_POLYMODE2_ENABLE_ALPHA|
       TA_POLYMODE2_FOG_DISABLED|TA_POLYMODE2_TEXTURE_MODULATE_ALPHA|
       TA_POLYMODE2_U_SIZE_512|TA_POLYMODE2_V_SIZE_512;

Modified: scummvm/branches/branch-0-13-0/graphics/VectorRendererSpec.cpp
===================================================================
--- scummvm/branches/branch-0-13-0/graphics/VectorRendererSpec.cpp	2009-02-01 12:33:11 UTC (rev 36174)
+++ scummvm/branches/branch-0-13-0/graphics/VectorRendererSpec.cpp	2009-02-01 14:29:47 UTC (rev 36175)
@@ -405,7 +405,10 @@
 		(int)(idst & PixelFormat::kGreenMask)) * alpha) >> 8))) |
 		(PixelFormat::kBlueMask & ((idst & PixelFormat::kBlueMask) +
 		((int)(((int)(isrc & PixelFormat::kBlueMask) -
-		(int)(idst & PixelFormat::kBlueMask)) * alpha) >> 8))) );
+		(int)(idst & PixelFormat::kBlueMask)) * alpha) >> 8))) |
+		(PixelFormat::kAlphaMask & ((idst & PixelFormat::kAlphaMask) +
+                ((alpha >> (8 - PixelFormat::kAlphaBits)) << PixelFormat::kAlphaShift) -
+                (((int)(idst & PixelFormat::kAlphaMask) * alpha) >> 8))));
 }
 
 template <typename PixelType, typename PixelFormat>


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Scummvm-git-logs mailing list