Mercurial > hg > openttd
changeset 19132:6748cd25d343 draft
(svn r23989) -Fix-ish: Zero the offsets of disabled zoomlevels.
author | frosch <frosch@openttd.org> |
---|---|
date | Sat, 25 Feb 2012 17:39:34 +0000 |
parents | 3b80ed8e25f8 |
children | 90e61b23da9f |
files | src/blitter/32bpp_optimized.cpp src/blitter/8bpp_optimized.cpp |
diffstat | 2 files changed, 2 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/src/blitter/32bpp_optimized.cpp +++ b/src/blitter/32bpp_optimized.cpp @@ -337,6 +337,7 @@ 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];
--- a/src/blitter/8bpp_optimized.cpp +++ b/src/blitter/8bpp_optimized.cpp @@ -141,6 +141,7 @@ * 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 */