aboutsummaryrefslogtreecommitdiff
path: root/graphics/pixelformat.h
diff options
context:
space:
mode:
authorMatthew Hoops2012-06-15 23:11:28 -0400
committerMatthew Hoops2012-06-15 23:11:28 -0400
commit984e0012d9b96a752b40a008aa1689d43d9a9920 (patch)
tree9a3660348d5c8dcc548d2507a9d3081d32849111 /graphics/pixelformat.h
parent5230a0d61795e2855625a43d60dc3bc2ed83fc3d (diff)
downloadscummvm-rg350-984e0012d9b96a752b40a008aa1689d43d9a9920.tar.gz
scummvm-rg350-984e0012d9b96a752b40a008aa1689d43d9a9920.tar.bz2
scummvm-rg350-984e0012d9b96a752b40a008aa1689d43d9a9920.zip
GRAPHICS: Fix colorToARGB's alpha value when no alpha channel is present
Diffstat (limited to 'graphics/pixelformat.h')
-rw-r--r--graphics/pixelformat.h2
1 files changed, 1 insertions, 1 deletions
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;