diff options
author | frosch <frosch@openttd.org> | 2011-11-27 14:53:05 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2011-11-27 14:53:05 +0000 |
commit | f8478cecb30d36d3e5efaa1f2af0f68922e308a0 (patch) | |
tree | ffaca24cd54cca02c7f6507c80e5f54825e3c859 /src | |
parent | 04c40aa04d86b237c1987ff43e24b783f02b1e53 (diff) | |
download | openttd-f8478cecb30d36d3e5efaa1f2af0f68922e308a0.tar.xz |
(svn r23343) -Fix (r23332): Incorrect encoding of sprites with much transparency.
Diffstat (limited to 'src')
-rw-r--r-- | src/blitter/8bpp_optimized.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/blitter/8bpp_optimized.cpp b/src/blitter/8bpp_optimized.cpp index 5106bd15f..300c79b52 100644 --- a/src/blitter/8bpp_optimized.cpp +++ b/src/blitter/8bpp_optimized.cpp @@ -196,9 +196,13 @@ Sprite *Blitter_8bppOptimized::Encode(SpriteLoader::Sprite *sprite, AllocatorPro dst++; } last_colour = colour; - pixels++; - *dst = colour; - dst++; + if (colour == 0) { + trans++; + } else { + pixels++; + *dst = colour; + dst++; + } } if (count_dst != NULL) *count_dst = pixels; |