diff options
author | frosch <frosch@openttd.org> | 2012-02-25 17:39:34 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2012-02-25 17:39:34 +0000 |
commit | 058017e178ada5d35a9b04676c392b8696965f71 (patch) | |
tree | 777a8144bc18cdb5d18f699da10bfbdac37b2881 | |
parent | dac51654fe78a02fa744b72979658bbee2e14ef6 (diff) | |
download | openttd-058017e178ada5d35a9b04676c392b8696965f71.tar.xz |
(svn r23989) -Fix-ish: Zero the offsets of disabled zoomlevels.
-rw-r--r-- | src/blitter/32bpp_optimized.cpp | 1 | ||||
-rw-r--r-- | src/blitter/8bpp_optimized.cpp | 1 |
2 files changed, 2 insertions, 0 deletions
diff --git a/src/blitter/32bpp_optimized.cpp b/src/blitter/32bpp_optimized.cpp index c11a40401..ee3e05e9d 100644 --- a/src/blitter/32bpp_optimized.cpp +++ b/src/blitter/32bpp_optimized.cpp @@ -337,6 +337,7 @@ Sprite *Blitter_32bppOptimized::Encode(SpriteLoader::Sprite *sprite, AllocatorPr dest_sprite->y_offs = sprite->y_offs; SpriteData *dst = (SpriteData *)dest_sprite->data; + memset(dst, 0, sizeof(*dst)); for (ZoomLevel z = zoom_min; z <= zoom_max; z++) { dst->offset[z][0] = z == zoom_min ? 0 : lengths[z - 1][1] + dst->offset[z - 1][1]; diff --git a/src/blitter/8bpp_optimized.cpp b/src/blitter/8bpp_optimized.cpp index acef6949e..77fc36576 100644 --- a/src/blitter/8bpp_optimized.cpp +++ b/src/blitter/8bpp_optimized.cpp @@ -141,6 +141,7 @@ Sprite *Blitter_8bppOptimized::Encode(SpriteLoader::Sprite *sprite, AllocatorPro * and the memory usage is quite low. */ static ReusableBuffer<byte> temp_buffer; SpriteData *temp_dst = (SpriteData *)temp_buffer.Allocate(memory); + memset(temp_dst, 0, sizeof(*temp_dst)); byte *dst = temp_dst->data; /* Make the sprites per zoom-level */ |