diff options
author | smatz <smatz@openttd.org> | 2008-06-26 16:47:29 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2008-06-26 16:47:29 +0000 |
commit | 1834a2f670491dd950e3101b1b0172bd37fba39b (patch) | |
tree | b62f60a01958578c40c352edb5be1e0f608303bc /src/blitter/32bpp_base.hpp | |
parent | 114c820c569ef0280018d8cd268f15021d9e5d20 (diff) | |
download | openttd-1834a2f670491dd950e3101b1b0172bd37fba39b.tar.xz |
(svn r13640) -Codechange: make colours behind not fully solid objects less darker for BM_TRANSPARENT (for 32bpp blitters)
Diffstat (limited to 'src/blitter/32bpp_base.hpp')
-rw-r--r-- | src/blitter/32bpp_base.hpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/blitter/32bpp_base.hpp b/src/blitter/32bpp_base.hpp index 30df9dd0e..1e9ae1d16 100644 --- a/src/blitter/32bpp_base.hpp +++ b/src/blitter/32bpp_base.hpp @@ -105,16 +105,17 @@ public: /** * Make a pixel looks like it is transparent. * @param colour the colour already on the screen. - * @param amount the amount of transparency, times 256. + * @param nom the amount of transparency, nominator, makes colour lighter. + * @param denom denominator, makes colour darker. * @return the new colour for the screen. */ - static inline uint32 MakeTransparent(uint32 colour, uint amount) + static inline uint32 MakeTransparent(uint32 colour, uint nom, uint denom = 256) { uint r = GB(colour, 16, 8); uint g = GB(colour, 8, 8); uint b = GB(colour, 0, 8); - return ComposeColour(0xFF, r * amount / 256, g * amount / 256, b * amount / 256); + return ComposeColour(0xFF, r * nom / denom, g * nom / denom, b * nom / denom); } /** |