OpenTTD Source: UniquePtrSpriteAllocator Class Reference

OpenTTD Source 15.0-RC2

Data Fields | Protected Member Functions
UniquePtrSpriteAllocator Class Reference

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

`#include <spritecache.h>`

Inheritance diagram for UniquePtrSpriteAllocator:

## Data Fields
std::unique_ptr< std::byte[]> | data
size_t | size

## Protected Member Functions
void * | AllocatePtr (size_t size) override
| Allocate memory for a sprite.

## Additional Inherited Members
Public Member Functions inherited from SpriteAllocator
template<typename T >
T * | Allocate (size_t size)
| Allocate memory for a sprite.

## Detailed Description

SpriteAllocator that allocates memory via a unique_ptr array.

Definition at line 20 of file spritecache.h.

## Member Function Documentation

## ◆ AllocatePtr()

void * UniquePtrSpriteAllocator::AllocatePtr | ( | size_t | size | ) |
| overrideprotectedvirtual

Allocate memory for a sprite.

Parameters

  size | Size of memory to allocate.

Returns
  Pointer to allocated memory.

Implements SpriteAllocator.

Definition at line 792 of file spritecache.cpp.

## Field Documentation

## ◆ data

std::unique_ptr<std::byte[]> UniquePtrSpriteAllocator::data

Definition at line 22 of file spritecache.h.

## ◆ size

size_t UniquePtrSpriteAllocator::size

Definition at line 23 of file spritecache.h.

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

- src/spritecache.h
- src/spritecache.cpp