OpenTTD Source: SpriteAllocator Class Reference

OpenTTD Source 15.0-beta1

Public Member Functions | Protected Member Functions
SpriteAllocator Class Referenceabstract

Interface for something that can allocate memory for a sprite. More...

`#include <spriteloader.hpp>`

Inheritance diagram for SpriteAllocator:

## Public Member Functions
template<typename T >
T * | Allocate (size_t size)
| Allocate memory for a sprite.

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

## Detailed Description

Interface for something that can allocate memory for a sprite.

Definition at line 88 of file spriteloader.hpp.

## Member Function Documentation

## ◆ Allocate()

template<typename T >

T * SpriteAllocator::Allocate | ( | size_t | size | ) |
| inline

Allocate memory for a sprite.

Template Parameters

  T | Type to return memory as.

Parameters

  size | Size of memory to allocate in bytes.

Returns
  Pointer to allocated memory.

Definition at line 99 of file spriteloader.hpp.

References AllocatePtr().

Referenced by Blitter_32bppSimple::Encode(), Blitter_8bppOptimized::Encode(), Blitter_8bppSimple::Encode(), Blitter_Null::Encode(), OpenGLBackend::Encode(), ReadRecolourSprite(), and ReadSprite().

## ◆ AllocatePtr()

virtual void * SpriteAllocator::AllocatePtr | ( | size_t | size | ) |
| protectedpure virtual

Allocate memory for a sprite.

Parameters

  size | Size of memory to allocate.

Returns
  Pointer to allocated memory.

Implemented in SimpleSpriteAllocator, UniquePtrSpriteAllocator, and CacheSpriteAllocator.

Referenced by Allocate().

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

- src/spriteloader/spriteloader.hpp