summaryrefslogtreecommitdiff
path: root/src/blitter/32bpp_anim.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/blitter/32bpp_anim.cpp')
-rw-r--r--src/blitter/32bpp_anim.cpp25
1 files changed, 17 insertions, 8 deletions
diff --git a/src/blitter/32bpp_anim.cpp b/src/blitter/32bpp_anim.cpp
index 9523c2dec..1c91911ff 100644
--- a/src/blitter/32bpp_anim.cpp
+++ b/src/blitter/32bpp_anim.cpp
@@ -136,15 +136,24 @@ inline void Blitter_32bppAnim::Draw(const Blitter::BlitterParams *bp, ZoomLevel
* we produce a result the newgrf maker didn't expect ;) */
/* Make the current color a bit more black, so it looks like this image is transparent */
- src_px += n;
src_n += n;
-
- do {
- *dst = MakeTransparent(*dst, 192);
- *anim = remap[*anim];
- anim++;
- dst++;
- } while (--n != 0);
+ if (src_px->a == 255) {
+ src_px += n;
+ do {
+ *dst = MakeTransparent(*dst, 3, 4);
+ *anim = remap[*anim];
+ anim++;
+ dst++;
+ } while (--n != 0);
+ } else {
+ do {
+ *dst = MakeTransparent(*dst, (256 * 4 - src_px->a), 256 * 4);
+ *anim = remap[*anim];
+ anim++;
+ dst++;
+ src_px++;
+ } while (--n != 0);
+ }
break;
default: