[Scummvm-git-logs] scummvm master -> a17109887cac2f039476ffc18fd396de4bf78d01

dreammaster dreammaster at scummvm.org
Sun Jan 15 16:06:11 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:
a17109887c GRAPHICS: Further fix compiler warnings for byte casts


Commit: a17109887cac2f039476ffc18fd396de4bf78d01
    https://github.com/scummvm/scummvm/commit/a17109887cac2f039476ffc18fd396de4bf78d01
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2017-01-15T10:06:00-05:00

Commit Message:
GRAPHICS: Further fix compiler warnings for byte casts

Changed paths:
    graphics/managed_surface.cpp


diff --git a/graphics/managed_surface.cpp b/graphics/managed_surface.cpp
index 00dc511..fe52472 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);





More information about the Scummvm-git-logs mailing list