1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-31 02:19:09 +00:00

Codechange: Use std::byte for glyph sprite buffer.

This commit is contained in:
2025-05-13 00:48:05 +01:00
committed by Peter Nelson
parent c718858999
commit 5585363407
3 changed files with 3 additions and 3 deletions

View File

@@ -29,7 +29,7 @@ protected:
/** Container for information about a glyph. */
struct GlyphEntry {
std::unique_ptr<uint8_t[]> data; ///< The loaded sprite.
std::unique_ptr<std::byte[]> data; ///< The loaded sprite.
uint8_t width = 0; ///< The width of the glyph.
Sprite *GetSprite() { return reinterpret_cast<Sprite *>(data.get()); }

View File

@@ -899,7 +899,7 @@ void *CacheSpriteAllocator::AllocatePtr(size_t mem_req)
void *UniquePtrSpriteAllocator::AllocatePtr(size_t size)
{
this->data = std::make_unique<uint8_t[]>(size);
this->data = std::make_unique<std::byte[]>(size);
return this->data.get();
}

View File

@@ -34,7 +34,7 @@ extern uint _sprite_cache_size;
/** SpriteAllocator that allocates memory via a unique_ptr array. */
class UniquePtrSpriteAllocator : public SpriteAllocator {
public:
std::unique_ptr<uint8_t[]> data;
std::unique_ptr<std::byte[]> data;
protected:
void *AllocatePtr(size_t size) override;
};