From 984e0012d9b96a752b40a008aa1689d43d9a9920 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Fri, 15 Jun 2012 23:11:28 -0400 Subject: GRAPHICS: Fix colorToARGB's alpha value when no alpha channel is present --- graphics/pixelformat.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'graphics/pixelformat.h') diff --git a/graphics/pixelformat.h b/graphics/pixelformat.h index e0cf6ce401..ca4ef11c17 100644 --- a/graphics/pixelformat.h +++ b/graphics/pixelformat.h @@ -97,7 +97,7 @@ struct PixelFormat { } inline void colorToARGB(uint32 color, uint8 &a, uint8 &r, uint8 &g, uint8 &b) const { - a = ((color >> aShift) << aLoss) & 0xFF; + a = (aBits() == 0) ? 0xFF : (((color >> aShift) << aLoss) & 0xFF); r = ((color >> rShift) << rLoss) & 0xFF; g = ((color >> gShift) << gLoss) & 0xFF; b = ((color >> bShift) << bLoss) & 0xFF; -- cgit v1.2.3