aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohannes Schickel2012-06-20 09:24:08 -0700
committerJohannes Schickel2012-06-20 09:24:08 -0700
commit82a553a12c033489939c031bb104e37e77ee0797 (patch)
treed78753e7c248542ae5ef48e7efdaa812346252d4
parent0a26f7084f8df9d0cb65a94a45942796ba5e4d56 (diff)
parent984e0012d9b96a752b40a008aa1689d43d9a9920 (diff)
downloadscummvm-rg350-82a553a12c033489939c031bb104e37e77ee0797.tar.gz
scummvm-rg350-82a553a12c033489939c031bb104e37e77ee0797.tar.bz2
scummvm-rg350-82a553a12c033489939c031bb104e37e77ee0797.zip
Merge pull request #247 from clone2727/pixelformat-argb-fix
GRAPHICS: Fix colorToARGB's alpha value when no alpha channel is present
-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;