OpenTTD Source  20240917-master-g9ab0a47812
UniquePtrSpriteAllocator Class Reference

SpriteAllocator that allocates memory via a unique_ptr array. More...

#include <spritecache.h>

Inheritance diagram for UniquePtrSpriteAllocator:
SpriteAllocator

Data Fields

std::unique_ptr< uint8_t[]> data
 

Protected Member Functions

void * AllocatePtr (size_t size) override
 Allocate memory for a sprite. More...
 

Additional Inherited Members

- Public Member Functions inherited from SpriteAllocator
template<typename T >
T * Allocate (size_t size)
 Allocate memory for a sprite. More...
 

Detailed Description

SpriteAllocator that allocates memory via a unique_ptr array.

Definition at line 41 of file spritecache.h.

Member Function Documentation

◆ AllocatePtr()

void * UniquePtrSpriteAllocator::AllocatePtr ( size_t  size)
overrideprotectedvirtual

Allocate memory for a sprite.

Parameters
sizeSize of memory to allocate.
Returns
Pointer to allocated memory.

Implements SpriteAllocator.

Definition at line 896 of file spritecache.cpp.


The documentation for this class was generated from the following files: