OpenTTD Source 20241224-master-gf74b0cf984
CacheSpriteAllocator Class Reference

SpriteAllocator that allocates memory from the sprite cache. More...

#include <spritecache_internal.h>

Inheritance diagram for CacheSpriteAllocator:
SpriteAllocator

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 from the sprite cache.

Definition at line 36 of file spritecache_internal.h.

Member Function Documentation

◆ AllocatePtr()

void * CacheSpriteAllocator::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 855 of file spritecache.cpp.

References Align(), DeleteEntryFromSpriteCache(), and S_FREE_MASK.


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