1
0
mirror of https://github.com/OpenTTD/OpenTTD synced 2026-01-18 18:02:37 +01:00

Codechange: Use std::unordered_map for storing TrueTypeFontCache's GlyphEntry.

This commit is contained in:
Peter Nelson
2024-05-12 15:03:03 +01:00
committed by Peter Nelson
parent 7b717fcccb
commit 48539992e8
7 changed files with 48 additions and 69 deletions

View File

@@ -894,6 +894,12 @@ void *SimpleSpriteAllocator::AllocatePtr(size_t size)
return MallocT<uint8_t>(size);
}
void *UniquePtrSpriteAllocator::AllocatePtr(size_t size)
{
this->data = std::make_unique<uint8_t[]>(size);
return this->data.get();
}
/**
* Handles the case when a sprite of different type is requested than is present in the SpriteCache.
* For SpriteType::Font sprites, it is normal. In other cases, default sprite is loaded instead.