aboutsummaryrefslogtreecommitdiff
path: root/graphics
diff options
context:
space:
mode:
Diffstat (limited to 'graphics')
-rw-r--r--graphics/managed_surface.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/graphics/managed_surface.cpp b/graphics/managed_surface.cpp
index 00dc511904..fe524724cd 100644
--- a/graphics/managed_surface.cpp
+++ b/graphics/managed_surface.cpp
@@ -287,9 +287,9 @@ void transBlit(const Surface &src, const Common::Rect &srcRect, Surface &dest, c
} else {
// Partially transparent, so calculate new pixel colors
alpha = (double)aSrc / 255.0;
- rDest = (rSrc * alpha) + (rDest * (1.0 - alpha));
- gDest = (gSrc * alpha) + (gDest * (1.0 - alpha));
- bDest = (bSrc * alpha) + (bDest * (1.0 - alpha));
+ rDest = static_cast<byte>((rSrc * alpha) + (rDest * (1.0 - alpha)));
+ gDest = static_cast<byte>((gSrc * alpha) + (gDest * (1.0 - alpha)));
+ bDest = static_cast<byte>((bSrc * alpha) + (bDest * (1.0 - alpha)));
}
destLine[xCtr] = destFormat.ARGBToColor(0xff, rDest, gDest, bDest);