[Scummvm-git-logs] scummvm master -> 553f1c2ef4f0965b4035f2af725f45d308888adf

dreammaster dreammaster at scummvm.org
Sun Jan 15 15:33:41 CET 2017


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:
553f1c2ef4 GRAPHICS: Fix compiler warnings of double to byte casts


Commit: 553f1c2ef4f0965b4035f2af725f45d308888adf
    https://github.com/scummvm/scummvm/commit/553f1c2ef4f0965b4035f2af725f45d308888adf
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-01-15T09:32:55-05:00

Commit Message:
GRAPHICS: Fix compiler warnings of double to byte casts

Changed paths:
    graphics/managed_surface.cpp


diff --git a/graphics/managed_surface.cpp b/graphics/managed_surface.cpp
index e781d7a..00dc511 100644
--- a/graphics/managed_surface.cpp
+++ b/graphics/managed_surface.cpp
@@ -208,9 +208,9 @@ void ManagedSurface::blitFrom(const Surface &src, const Common::Rect &srcRect,
 				} 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)));
 				}
 
 				destPixel = format.ARGBToColor(0xff, rDest, gDest, bDest);





More information about the Scummvm-git-logs mailing list