1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-20 04:59:11 +00:00

Codechange: let the ReusableBuffer use std::vector as storage

This commit is contained in:
Rubidium
2025-02-16 14:24:18 +01:00
committed by rubidium42
parent 59df0ff496
commit 576a96c685
4 changed files with 18 additions and 34 deletions

View File

@@ -148,8 +148,7 @@ Sprite *Blitter_8bppOptimized::Encode(const SpriteLoader::SpriteCollection &spri
* memory around as this function is called quite often
* and the memory usage is quite low. */
static ReusableBuffer<uint8_t> temp_buffer;
SpriteData *temp_dst = (SpriteData *)temp_buffer.Allocate(memory);
memset(temp_dst, 0, sizeof(*temp_dst));
SpriteData *temp_dst = reinterpret_cast<SpriteData *>(temp_buffer.ZeroAllocate(memory));
uint8_t *dst = temp_dst->data;
/* Make the sprites per zoom-level */