aboutsummaryrefslogtreecommitdiff
path: root/graphics/VectorRendererSpec.cpp
diff options
context:
space:
mode:
authorMarcus Comstedt2009-02-01 14:56:19 +0000
committerMarcus Comstedt2009-02-01 14:56:19 +0000
commitf90e4545c27fa92cc6ba835f80551556929df43d (patch)
tree0d6b0b4f9480788ee8feabf47b3801f83a076e9f /graphics/VectorRendererSpec.cpp
parent6438c40958a09561f785631d8a5dddf0a37f52d0 (diff)
downloadscummvm-rg350-f90e4545c27fa92cc6ba835f80551556929df43d.tar.gz
scummvm-rg350-f90e4545c27fa92cc6ba835f80551556929df43d.tar.bz2
scummvm-rg350-f90e4545c27fa92cc6ba835f80551556929df43d.zip
Merged r36175 from branch-0-13-0:
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. svn-id: r36177
Diffstat (limited to 'graphics/VectorRendererSpec.cpp')
-rw-r--r--graphics/VectorRendererSpec.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp
index 37281839cb..ac21203da1 100644
--- a/graphics/VectorRendererSpec.cpp
+++ b/graphics/VectorRendererSpec.cpp
@@ -403,7 +403,10 @@ blendPixelPtr(PixelType *ptr, PixelType color, uint8 alpha) {
(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>