aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--graphics/VectorRendererSpec.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/graphics/VectorRendererSpec.cpp b/graphics/VectorRendererSpec.cpp
index ac21203da1..62bd560909 100644
--- a/graphics/VectorRendererSpec.cpp
+++ b/graphics/VectorRendererSpec.cpp
@@ -393,6 +393,7 @@ inline void VectorRendererSpec<PixelType, PixelFormat>::
blendPixelPtr(PixelType *ptr, PixelType color, uint8 alpha) {
register int idst = *ptr;
register int isrc = color;
+ int rightShift = 8 - PixelFormat::kAlphaBits;
*ptr = (PixelType)(
(PixelFormat::kRedMask & ((idst & PixelFormat::kRedMask) +
@@ -405,7 +406,7 @@ blendPixelPtr(PixelType *ptr, PixelType color, uint8 alpha) {
((int)(((int)(isrc & PixelFormat::kBlueMask) -
(int)(idst & PixelFormat::kBlueMask)) * alpha) >> 8))) |
(PixelFormat::kAlphaMask & ((idst & PixelFormat::kAlphaMask) +
- ((alpha >> (8 - PixelFormat::kAlphaBits)) << PixelFormat::kAlphaShift) -
+ ((alpha >> rightShift) << PixelFormat::kAlphaShift) -
(((int)(idst & PixelFormat::kAlphaMask) * alpha) >> 8))));
}