OpenTTD Source  20241108-master-g80f628063a
SpriteAllocator Class Referenceabstract

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

#include <spriteloader.hpp>

Inheritance diagram for SpriteAllocator:
CacheSpriteAllocator SimpleSpriteAllocator UniquePtrSpriteAllocator

Public Member Functions

template<typename T >
T * Allocate (size_t size)
 Allocate memory for a sprite. More...
 

Protected Member Functions

virtual void * AllocatePtr (size_t size)=0
 Allocate memory for a sprite. More...
 

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
TType to return memory as.
Parameters
sizeSize of memory to allocate in bytes.
Returns
Pointer to allocated memory.

Definition at line 99 of file spriteloader.hpp.

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

◆ AllocatePtr()

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

Allocate memory for a sprite.

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

Implemented in CacheSpriteAllocator, UniquePtrSpriteAllocator, and SimpleSpriteAllocator.


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