mirror of https://github.com/OpenTTD/OpenTTD
(svn r23989) -Fix-ish: Zero the offsets of disabled zoomlevels.
parent
dac51654fe
commit
058017e178
|
@ -337,6 +337,7 @@ Sprite *Blitter_32bppOptimized::Encode(SpriteLoader::Sprite *sprite, AllocatorPr
|
||||||
dest_sprite->y_offs = sprite->y_offs;
|
dest_sprite->y_offs = sprite->y_offs;
|
||||||
|
|
||||||
SpriteData *dst = (SpriteData *)dest_sprite->data;
|
SpriteData *dst = (SpriteData *)dest_sprite->data;
|
||||||
|
memset(dst, 0, sizeof(*dst));
|
||||||
|
|
||||||
for (ZoomLevel z = zoom_min; z <= zoom_max; z++) {
|
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];
|
dst->offset[z][0] = z == zoom_min ? 0 : lengths[z - 1][1] + dst->offset[z - 1][1];
|
||||||
|
|
|
@ -141,6 +141,7 @@ Sprite *Blitter_8bppOptimized::Encode(SpriteLoader::Sprite *sprite, AllocatorPro
|
||||||
* and the memory usage is quite low. */
|
* and the memory usage is quite low. */
|
||||||
static ReusableBuffer<byte> temp_buffer;
|
static ReusableBuffer<byte> temp_buffer;
|
||||||
SpriteData *temp_dst = (SpriteData *)temp_buffer.Allocate(memory);
|
SpriteData *temp_dst = (SpriteData *)temp_buffer.Allocate(memory);
|
||||||
|
memset(temp_dst, 0, sizeof(*temp_dst));
|
||||||
byte *dst = temp_dst->data;
|
byte *dst = temp_dst->data;
|
||||||
|
|
||||||
/* Make the sprites per zoom-level */
|
/* Make the sprites per zoom-level */
|
||||||
|
|
Loading…
Reference in New Issue